Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci No functional change. This change reduces diff a...



details:   https://anonhg.NetBSD.org/src/rev/9cc16a43dce7
branches:  trunk
changeset: 997980:9cc16a43dce7
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Apr 04 12:38:27 2019 +0000

description:
No functional change. This change reduces diff against DragonFly:
- Fix BNX_PCI_GRC_WINDOW_ADDR_VALUE's name. Note that this macro is not used.
- Whitespace change.
- Sort some lines.

diffstat:

 sys/dev/pci/if_bnxreg.h |  5913 +++++++++++++++++++++++-----------------------
 1 files changed, 2954 insertions(+), 2959 deletions(-)

diffs (truncated from 7015 to 300 lines):

diff -r 0d59821810dc -r 9cc16a43dce7 sys/dev/pci/if_bnxreg.h
--- a/sys/dev/pci/if_bnxreg.h   Thu Apr 04 12:34:31 2019 +0000
+++ b/sys/dev/pci/if_bnxreg.h   Thu Apr 04 12:38:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bnxreg.h,v 1.22 2019/03/29 08:54:35 msaitoh Exp $   */
+/*     $NetBSD: if_bnxreg.h,v 1.23 2019/04/04 12:38:27 msaitoh Exp $   */
 /*     $OpenBSD: if_bnxreg.h,v 1.33 2009/09/05 16:02:28 claudio Exp $  */
 
 /*-
@@ -33,126 +33,126 @@
  */
 
 /* General controller flags -- bnx_flags element in bnx_softc */
-#define BNX_PCIX_FLAG                   0x01
-#define BNX_PCI_32BIT_FLAG              0x02
-#define BNX_ONE_TDMA_FLAG               0x04            /* Deprecated */
-#define BNX_NO_WOL_FLAG                 0x08
-#define BNX_USING_DAC_FLAG              0x10
-#define BNX_USING_MSI_FLAG              0x20
-#define BNX_MFW_ENABLE_FLAG             0x40
-#define BNX_ACTIVE_FLAG                 0x80
-#define BNX_ALLOC_PKTS_FLAG             0x100
-#define BNX_PCIE_FLAG                  0x200
+#define BNX_PCIX_FLAG                  0x01
+#define BNX_PCI_32BIT_FLAG             0x02
+#define BNX_ONE_TDMA_FLAG              0x04            /* Deprecated */
+#define BNX_NO_WOL_FLAG                        0x08
+#define BNX_USING_DAC_FLAG             0x10
+#define BNX_USING_MSI_FLAG             0x20
+#define BNX_MFW_ENABLE_FLAG            0x40
+#define BNX_ACTIVE_FLAG                        0x80
+#define BNX_ALLOC_PKTS_FLAG            0x100
+#define BNX_PCIE_FLAG                  0x200
 
 /* PHY specific flags -- bnx_phy_flags element in bnx_softc */
-#define BNX_PHY_SERDES_FLAG                     0x001
-#define BNX_PHY_CRC_FIX_FLAG                    0x002
-#define BNX_PHY_PARALLEL_DETECT_FLAG            0x004
-#define BNX_PHY_2_5G_CAPABLE_FLAG               0x008
-#define BNX_PHY_INT_MODE_MASK_FLAG              0x300
-#define BNX_PHY_INT_MODE_AUTO_POLLING_FLAG      0x100
-#define BNX_PHY_INT_MODE_LINK_READY_FLAG        0x200
-#define BNX_PHY_IEEE_CLAUSE_45_FLAG             0x400
+#define BNX_PHY_SERDES_FLAG                    0x001
+#define BNX_PHY_CRC_FIX_FLAG                   0x002
+#define BNX_PHY_PARALLEL_DETECT_FLAG           0x004
+#define BNX_PHY_2_5G_CAPABLE_FLAG              0x008
+#define BNX_PHY_INT_MODE_MASK_FLAG             0x300
+#define BNX_PHY_INT_MODE_AUTO_POLLING_FLAG     0x100
+#define BNX_PHY_INT_MODE_LINK_READY_FLAG       0x200
+#define BNX_PHY_IEEE_CLAUSE_45_FLAG            0x400
 
 /****************************************************************************/
-/* Debugging macros and definitions.                                        */
+/* Debugging macros and definitions.                                       */
 /****************************************************************************/
-#define BNX_CP_LOAD                    0x00000001
-#define BNX_CP_SEND                            0x00000002
-#define BNX_CP_RECV                            0x00000004
-#define BNX_CP_INTR                            0x00000008
-#define BNX_CP_UNLOAD                  0x00000010
-#define BNX_CP_RESET                   0x00000020
-#define BNX_CP_PHY                     0x00000040
-#define BNX_CP_ALL                             0x00FFFFFF
-
-#define BNX_CP_MASK                            0x00FFFFFF
-
-#define BNX_LEVEL_FATAL                        0x00000000
-#define BNX_LEVEL_WARN                 0x01000000
-#define BNX_LEVEL_INFO                 0x02000000
-#define BNX_LEVEL_VERBOSE              0x03000000
-#define BNX_LEVEL_EXCESSIVE            0x04000000
-
-#define BNX_LEVEL_MASK                 0xFF000000
-
-#define BNX_WARN_LOAD                  (BNX_CP_LOAD | BNX_LEVEL_WARN)
-#define BNX_INFO_LOAD                  (BNX_CP_LOAD | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_LOAD               (BNX_CP_LOAD | BNX_LEVEL_VERBOSE)
-#define BNX_EXCESSIVE_LOAD             (BNX_CP_LOAD | BNX_LEVEL_EXCESSIVE)
-
-#define BNX_WARN_SEND                  (BNX_CP_SEND | BNX_LEVEL_WARN)
-#define BNX_INFO_SEND                  (BNX_CP_SEND | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_SEND               (BNX_CP_SEND | BNX_LEVEL_VERBOSE)
-#define BNX_EXCESSIVE_SEND             (BNX_CP_SEND | BNX_LEVEL_EXCESSIVE)
-
-#define BNX_WARN_RECV                  (BNX_CP_RECV | BNX_LEVEL_WARN)
-#define BNX_INFO_RECV                  (BNX_CP_RECV | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_RECV               (BNX_CP_RECV | BNX_LEVEL_VERBOSE)
-#define BNX_EXCESSIVE_RECV             (BNX_CP_RECV | BNX_LEVEL_EXCESSIVE)
-
-#define BNX_WARN_INTR                  (BNX_CP_INTR | BNX_LEVEL_WARN)
-#define BNX_INFO_INTR                  (BNX_CP_INTR | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_INTR               (BNX_CP_INTR | BNX_LEVEL_VERBOSE)
-#define BNX_EXCESSIVE_INTR             (BNX_CP_INTR | BNX_LEVEL_EXCESSIVE)
-
-#define BNX_WARN_UNLOAD                        (BNX_CP_UNLOAD | BNX_LEVEL_WARN)
-#define BNX_INFO_UNLOAD                        (BNX_CP_UNLOAD | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_UNLOAD             (BNX_CP_UNLOAD | BNX_LEVEL_VERBOSE)
+#define BNX_CP_LOAD            0x00000001
+#define BNX_CP_SEND            0x00000002
+#define BNX_CP_RECV            0x00000004
+#define BNX_CP_INTR            0x00000008
+#define BNX_CP_UNLOAD          0x00000010
+#define BNX_CP_RESET           0x00000020
+#define BNX_CP_PHY             0x00000040
+#define BNX_CP_ALL             0x00FFFFFF
+
+#define BNX_CP_MASK            0x00FFFFFF
+
+#define BNX_LEVEL_FATAL                0x00000000
+#define BNX_LEVEL_WARN         0x01000000
+#define BNX_LEVEL_INFO         0x02000000
+#define BNX_LEVEL_VERBOSE      0x03000000
+#define BNX_LEVEL_EXCESSIVE    0x04000000
+
+#define BNX_LEVEL_MASK         0xFF000000
+
+#define BNX_WARN_LOAD          (BNX_CP_LOAD | BNX_LEVEL_WARN)
+#define BNX_INFO_LOAD          (BNX_CP_LOAD | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_LOAD       (BNX_CP_LOAD | BNX_LEVEL_VERBOSE)
+#define BNX_EXCESSIVE_LOAD     (BNX_CP_LOAD | BNX_LEVEL_EXCESSIVE)
+
+#define BNX_WARN_SEND          (BNX_CP_SEND | BNX_LEVEL_WARN)
+#define BNX_INFO_SEND          (BNX_CP_SEND | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_SEND       (BNX_CP_SEND | BNX_LEVEL_VERBOSE)
+#define BNX_EXCESSIVE_SEND     (BNX_CP_SEND | BNX_LEVEL_EXCESSIVE)
+
+#define BNX_WARN_RECV          (BNX_CP_RECV | BNX_LEVEL_WARN)
+#define BNX_INFO_RECV          (BNX_CP_RECV | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_RECV       (BNX_CP_RECV | BNX_LEVEL_VERBOSE)
+#define BNX_EXCESSIVE_RECV     (BNX_CP_RECV | BNX_LEVEL_EXCESSIVE)
+
+#define BNX_WARN_INTR          (BNX_CP_INTR | BNX_LEVEL_WARN)
+#define BNX_INFO_INTR          (BNX_CP_INTR | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_INTR       (BNX_CP_INTR | BNX_LEVEL_VERBOSE)
+#define BNX_EXCESSIVE_INTR     (BNX_CP_INTR | BNX_LEVEL_EXCESSIVE)
+
+#define BNX_WARN_UNLOAD                (BNX_CP_UNLOAD | BNX_LEVEL_WARN)
+#define BNX_INFO_UNLOAD                (BNX_CP_UNLOAD | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_UNLOAD     (BNX_CP_UNLOAD | BNX_LEVEL_VERBOSE)
 #define BNX_EXCESSIVE_UNLOAD   (BNX_CP_UNLOAD | BNX_LEVEL_EXCESSIVE)
 
-#define BNX_WARN_RESET                 (BNX_CP_RESET | BNX_LEVEL_WARN)
-#define BNX_INFO_RESET                 (BNX_CP_RESET | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_RESET              (BNX_CP_RESET | BNX_LEVEL_VERBOSE)
-#define BNX_EXCESSIVE_RESET            (BNX_CP_RESET | BNX_LEVEL_EXCESSIVE)
-
-#define BNX_WARN_PHY                   (BNX_CP_PHY | BNX_LEVEL_WARN)
-#define BNX_INFO_PHY                   (BNX_CP_PHY | BNX_LEVEL_INFO)
-#define BNX_VERBOSE_PHY                        (BNX_CP_PHY | BNX_LEVEL_VERBOSE)
-#define BNX_EXTREME_PHY                        (BNX_CP_PHY | BNX_LEVEL_EXTREME)
-#define BNX_INSANE_PHY                 (BNX_CP_PHY | BNX_LEVEL_INSANE)
-
-#define BNX_FATAL                              (BNX_CP_ALL | BNX_LEVEL_FATAL)
-#define BNX_WARN                               (BNX_CP_ALL | BNX_LEVEL_WARN)
-#define BNX_INFO                               (BNX_CP_ALL | BNX_LEVEL_INFO)
-#define BNX_VERBOSE                            (BNX_CP_ALL | BNX_LEVEL_VERBOSE)
-#define BNX_EXCESSIVE                  (BNX_CP_ALL | BNX_LEVEL_EXCESSIVE)
-
-#define BNX_CODE_PATH(cp)              ((cp & BNX_CP_MASK) & bnx_debug)
+#define BNX_WARN_RESET         (BNX_CP_RESET | BNX_LEVEL_WARN)
+#define BNX_INFO_RESET         (BNX_CP_RESET | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_RESET      (BNX_CP_RESET | BNX_LEVEL_VERBOSE)
+#define BNX_EXCESSIVE_RESET    (BNX_CP_RESET | BNX_LEVEL_EXCESSIVE)
+
+#define BNX_WARN_PHY           (BNX_CP_PHY | BNX_LEVEL_WARN)
+#define BNX_INFO_PHY           (BNX_CP_PHY | BNX_LEVEL_INFO)
+#define BNX_VERBOSE_PHY                (BNX_CP_PHY | BNX_LEVEL_VERBOSE)
+#define BNX_EXTREME_PHY                (BNX_CP_PHY | BNX_LEVEL_EXTREME)
+#define BNX_INSANE_PHY         (BNX_CP_PHY | BNX_LEVEL_INSANE)
+
+#define BNX_FATAL              (BNX_CP_ALL | BNX_LEVEL_FATAL)
+#define BNX_WARN               (BNX_CP_ALL | BNX_LEVEL_WARN)
+#define BNX_INFO               (BNX_CP_ALL | BNX_LEVEL_INFO)
+#define BNX_VERBOSE            (BNX_CP_ALL | BNX_LEVEL_VERBOSE)
+#define BNX_EXCESSIVE          (BNX_CP_ALL | BNX_LEVEL_EXCESSIVE)
+
+#define BNX_CODE_PATH(cp)      ((cp & BNX_CP_MASK) & bnx_debug)
 #define BNX_MSG_LEVEL(lv)      \
     ((lv & BNX_LEVEL_MASK) <= (bnx_debug & BNX_LEVEL_MASK))
-#define BNX_LOG_MSG(m)                 (BNX_CODE_PATH(m) && BNX_MSG_LEVEL(m))
+#define BNX_LOG_MSG(m)         (BNX_CODE_PATH(m) && BNX_MSG_LEVEL(m))
 
 #ifdef BNX_DEBUG
 
 /* Print a message based on the logging level and code path. */
-#define DBPRINT(sc, level, format, args...)                            \
-       if (BNX_LOG_MSG(level)) {                                       \
-               aprint_debug_dev(sc->bnx_dev, format, ## args);         \
+#define DBPRINT(sc, level, format, args...)                    \
+       if (BNX_LOG_MSG(level)) {                               \
+               aprint_debug_dev(sc->bnx_dev, format, ## args); \
        }
 
 /* Runs a particular command based on the logging level and code path. */
-#define DBRUN(m, args...) \
-       if (BNX_LOG_MSG(m)) { \
-               args; \
+#define DBRUN(m, args...)                                      \
+       if (BNX_LOG_MSG(m)) {                                   \
+               args;                                           \
        }
 
 /* Runs a particular command based on the logging level. */
-#define DBRUNLV(level, args...) \
-       if (BNX_MSG_LEVEL(level)) { \
-               args; \
+#define DBRUNLV(level, args...)                                        \
+       if (BNX_MSG_LEVEL(level)) {                             \
+               args;                                           \
        }
 
 /* Runs a particular command based on the code path. */
-#define DBRUNCP(cp, args...) \
-       if (BNX_CODE_PATH(cp)) { \
-               args; \
+#define DBRUNCP(cp, args...)                                   \
+       if (BNX_CODE_PATH(cp)) {                                \
+               args;                                           \
        }
 
 /* Runs a particular command based on a condition. */
-#define DBRUNIF(cond, args...) \
-       if (cond) { \
-               args; \
+#define DBRUNIF(cond, args...)                                 \
+       if (cond) {                                             \
+               args;                                           \
        }
 #if 0
 /* Needed for random() function which is only used in debugging. */
@@ -160,12 +160,12 @@
 #endif
 
 /* Returns FALSE in "defects" per 2^31 - 1 calls, otherwise returns TRUE. */
-#define DB_RANDOMFALSE(defects)        (random() > defects)
+#define DB_RANDOMFALSE(defects)               (random() > defects)
 #define DB_OR_RANDOMFALSE(defects)  || (random() > defects)
 #define DB_AND_RANDOMFALSE(defects) && (random() > defects)
 
 /* Returns TRUE in "defects" per 2^31 - 1 calls, otherwise returns FALSE. */
-#define DB_RANDOMTRUE(defects)         (random() < defects)
+#define DB_RANDOMTRUE(defects)        (random() < defects)
 #define DB_OR_RANDOMTRUE(defects)   || (random() < defects)
 #define DB_AND_RANDOMTRUE(defects)  && (random() < defects)
 
@@ -187,59 +187,59 @@
 
 
 /****************************************************************************/
-/* Device identification definitions.                                       */
+/* Device identification definitions.                                      */
 /****************************************************************************/
-#define BRCM_VENDORID                          0x14E4
+#define BRCM_VENDORID                  0x14E4
 #define BRCM_DEVICEID_BCM5706          0x164A
 #define BRCM_DEVICEID_BCM5706S         0x16AA
 #define BRCM_DEVICEID_BCM5708          0x164C
 #define BRCM_DEVICEID_BCM5708S         0x16AC
 
-#define HP_VENDORID                                    0x103C
-
-#define PCI_ANY_ID                                     (uint16_t) (~0U)
+#define HP_VENDORID                    0x103C
+
+#define PCI_ANY_ID                     (uint16_t) (~0U)
 
 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
 
-#define _BNX_CHIP_NUM(chipid)                  ((chipid) & 0xffff0000)
-#define BNX_CHIP_NUM(sc)                       _BNX_CHIP_NUM((sc)->bnx_chipid)
-#define BNX_CHIP_NUM_5706                      0x57060000
-#define BNX_CHIP_NUM_5708                      0x57080000
-#define BNX_CHIP_NUM_5709                      0x57090000
-#define BNX_CHIP_NUM_5716                      0x57160000
-
-#define _BNX_CHIP_REV(chipid)                  ((chipid) & 0x0000f000)
-#define BNX_CHIP_REV(sc)                       _BNX_CHIP_REV((sc)->bnx_chipid)
-#define BNX_CHIP_REV_Ax                                0x00000000
-#define BNX_CHIP_REV_Bx                                0x00001000
-#define BNX_CHIP_REV_Cx                                0x00002000
-
-#define BNX_CHIP_METAL(sc)                     (((sc)->bnx_chipid) & 0x00000ff0)
-#define BNX_CHIP_BOND(bp)                      (((sc)->bnx_chipid) & 0x0000000f)
-
-#define _BNX_CHIP_ID(chipid)                   ((chipid) & 0xfffffff0)
-#define BNX_CHIP_ID(sc)                                _BNX_CHIP_ID((sc)->bnx_chipid)
-
-#define BNX_CHIP_ID_5706_A0                    0x57060000
-#define BNX_CHIP_ID_5706_A1                    0x57060010
-#define BNX_CHIP_ID_5706_A2                    0x57060020
-#define BNX_CHIP_ID_5706_A3                    0x57060030
-#define BNX_CHIP_ID_5708_A0                    0x57080000
-#define BNX_CHIP_ID_5708_B0                    0x57081000
-#define BNX_CHIP_ID_5708_B1                    0x57081010
-#define BNX_CHIP_ID_5708_B2                    0x57081020
-#define BNX_CHIP_ID_5709_A0                    0x57090000
-#define BNX_CHIP_ID_5709_A1                    0x57090010
-#define BNX_CHIP_ID_5709_B0                    0x57091000
-#define BNX_CHIP_ID_5709_B1                    0x57091010



Home | Main Index | Thread Index | Old Index