summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-10-05 23:03:48 +0000
committeryongari <yongari@FreeBSD.org>2010-10-05 23:03:48 +0000
commit992be25328661f9de7bfc0cb133996e5fd0a7235 (patch)
tree4d81d30535bb9c4bb8e85f58b6eddc1f61ca48b8 /sys/dev/bge
parent44073c254fc202b864d423a9af6ebd317cf22a0f (diff)
downloadFreeBSD-src-992be25328661f9de7bfc0cb133996e5fd0a7235.zip
FreeBSD-src-992be25328661f9de7bfc0cb133996e5fd0a7235.tar.gz
Separate common flags into controller specific and PHY related
flags. There should be no functional changes. This change will make it easy to add more quirk/flags in future. Reviewed by: davidch
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c22
-rw-r--r--sys/dev/bge/if_bgereg.h35
2 files changed, 29 insertions, 28 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 317bcd2..d7cba4b 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -2510,7 +2510,7 @@ bge_attach(device_t dev)
sc->bge_asicrev != BGE_ASICREV_BCM5906 &&
sc->bge_chipid != BGE_CHIPID_BCM5705_A0 &&
sc->bge_chipid != BGE_CHIPID_BCM5705_A1)
- sc->bge_flags |= BGE_FLAG_WIRESPEED;
+ sc->bge_phy_flags |= BGE_PHY_WIRESPEED;
if (bge_has_eaddr(sc))
sc->bge_flags |= BGE_FLAG_EADDR;
@@ -2547,30 +2547,30 @@ bge_attach(device_t dev)
break;
}
- /* Set various bug flags. */
+ /* Set various PHY bug flags. */
if (sc->bge_chipid == BGE_CHIPID_BCM5701_A0 ||
sc->bge_chipid == BGE_CHIPID_BCM5701_B0)
- sc->bge_flags |= BGE_FLAG_CRC_BUG;
+ sc->bge_phy_flags |= BGE_PHY_CRC_BUG;
if (sc->bge_chiprev == BGE_CHIPREV_5703_AX ||
sc->bge_chiprev == BGE_CHIPREV_5704_AX)
- sc->bge_flags |= BGE_FLAG_ADC_BUG;
+ sc->bge_phy_flags |= BGE_PHY_ADC_BUG;
if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0)
- sc->bge_flags |= BGE_FLAG_5704_A0_BUG;
+ sc->bge_phy_flags |= BGE_PHY_5704_A0_BUG;
if (pci_get_subvendor(dev) == DELL_VENDORID)
- sc->bge_flags |= BGE_FLAG_NO_3LED;
+ sc->bge_phy_flags |= BGE_PHY_NO_3LED;
if (pci_get_device(dev) == BCOM_DEVICEID_BCM5755M)
- sc->bge_flags |= BGE_FLAG_ADJUST_TRIM;
+ sc->bge_phy_flags |= BGE_PHY_ADJUST_TRIM;
if (BGE_IS_5705_PLUS(sc) &&
- !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) {
+ !(sc->bge_phy_flags & BGE_PHY_ADJUST_TRIM)) {
if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
sc->bge_asicrev == BGE_ASICREV_BCM5787) {
if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 &&
pci_get_device(dev) != BCOM_DEVICEID_BCM5756)
- sc->bge_flags |= BGE_FLAG_JITTER_BUG;
+ sc->bge_phy_flags |= BGE_PHY_JITTER_BUG;
} else if (sc->bge_asicrev != BGE_ASICREV_BCM5906)
- sc->bge_flags |= BGE_FLAG_BER_BUG;
+ sc->bge_phy_flags |= BGE_PHY_BER_BUG;
}
/*
@@ -5353,7 +5353,7 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARGS)
printf(" - PCI-X Bus\n");
if (sc->bge_flags & BGE_FLAG_PCIE)
printf(" - PCI Express Bus\n");
- if (sc->bge_flags & BGE_FLAG_NO_3LED)
+ if (sc->bge_phy_flags & BGE_FLAG_NO_3LED)
printf(" - No 3 LEDs\n");
if (sc->bge_flags & BGE_FLAG_RX_ALIGNBUG)
printf(" - RX Alignment Bug\n");
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index 87abca8..b17ff5a 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -2663,29 +2663,30 @@ struct bge_softc {
uint32_t bge_flags;
#define BGE_FLAG_TBI 0x00000001
#define BGE_FLAG_JUMBO 0x00000002
-#define BGE_FLAG_WIRESPEED 0x00000004
#define BGE_FLAG_EADDR 0x00000008
#define BGE_FLAG_MII_SERDES 0x00000010
#define BGE_FLAG_MSI 0x00000100
#define BGE_FLAG_PCIX 0x00000200
#define BGE_FLAG_PCIE 0x00000400
#define BGE_FLAG_TSO 0x00000800
-#define BGE_FLAG_5700_FAMILY 0x00001000
-#define BGE_FLAG_5705_PLUS 0x00002000
-#define BGE_FLAG_5714_FAMILY 0x00004000
-#define BGE_FLAG_575X_PLUS 0x00008000
-#define BGE_FLAG_5755_PLUS 0x00010000
-#define BGE_FLAG_40BIT_BUG 0x00020000
-#define BGE_FLAG_4G_BNDRY_BUG 0x00040000
-#define BGE_FLAG_RX_ALIGNBUG 0x00100000
-#define BGE_FLAG_NO_3LED 0x00200000
-#define BGE_FLAG_ADC_BUG 0x00400000
-#define BGE_FLAG_5704_A0_BUG 0x00800000
-#define BGE_FLAG_JITTER_BUG 0x01000000
-#define BGE_FLAG_BER_BUG 0x02000000
-#define BGE_FLAG_ADJUST_TRIM 0x04000000
-#define BGE_FLAG_CRC_BUG 0x08000000
-#define BGE_FLAG_5788 0x20000000
+#define BGE_FLAG_5700_FAMILY 0x00010000
+#define BGE_FLAG_5705_PLUS 0x00020000
+#define BGE_FLAG_5714_FAMILY 0x00040000
+#define BGE_FLAG_575X_PLUS 0x00080000
+#define BGE_FLAG_5755_PLUS 0x00100000
+#define BGE_FLAG_5788 0x00200000
+#define BGE_FLAG_40BIT_BUG 0x01000000
+#define BGE_FLAG_4G_BNDRY_BUG 0x02000000
+#define BGE_FLAG_RX_ALIGNBUG 0x04000000
+ uint32_t bge_phy_flags;
+#define BGE_PHY_WIRESPEED 0x00000001
+#define BGE_PHY_ADC_BUG 0x00000002
+#define BGE_PHY_5704_A0_BUG 0x00000004
+#define BGE_PHY_JITTER_BUG 0x00000008
+#define BGE_PHY_BER_BUG 0x00000010
+#define BGE_PHY_ADJUST_TRIM 0x00000020
+#define BGE_PHY_CRC_BUG 0x00000040
+#define BGE_PHY_NO_3LED 0x00000080
uint32_t bge_chipid;
uint32_t bge_asicrev;
uint32_t bge_chiprev;
OpenPOWER on IntegriCloud