summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2007-12-08 00:14:09 +0000
committeryongari <yongari@FreeBSD.org>2007-12-08 00:14:09 +0000
commitc60450024ed994361d0144d8be795b6f6fba957e (patch)
tree1f9ef19cf236a5bf56409683d26b1ce3231e75a6 /sys
parent6bd01c70a2bb4cf2034458a808cc2a2a03bae798 (diff)
downloadFreeBSD-src-c60450024ed994361d0144d8be795b6f6fba957e.zip
FreeBSD-src-c60450024ed994361d0144d8be795b6f6fba957e.tar.gz
Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabit
Ethernet Controller. Multicast filtering wasn't tested and needs more expore. While I'm here change complex if statements with switch statement which would improve readability. Reported by: Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca > Tested by: Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/re/if_re.c16
-rw-r--r--sys/pci/if_rlreg.h1
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index ae91bd4..2734069 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -182,6 +182,8 @@ static struct rl_type re_devs[] = {
"RealTek 8168/8111B PCIe Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN2,
"RealTek 8168/8111B PCIe Gigabit Ethernet" },
+ { RT_VENDORID, RT_DEVICEID_8168, RL_HWREV_8168_SPIN3,
+ "RealTek 8168/8111B PCIe Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169,
"RealTek 8169 Gigabit Ethernet" },
{ RT_VENDORID, RT_DEVICEID_8169, RL_HWREV_8169S,
@@ -223,6 +225,7 @@ static struct rl_hwrev re_hwrevs[] = {
{ RL_HWREV_8100E, RL_8169, "8100E"},
{ RL_HWREV_8101E, RL_8169, "8101E"},
{ RL_HWREV_8168_SPIN2, RL_8169, "8168"},
+ { RL_HWREV_8168_SPIN3, RL_8169, "8168"},
{ 0, 0, NULL }
};
@@ -683,13 +686,19 @@ re_setmulti(sc)
hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV;
- if (hwrev == RL_HWREV_8100E || hwrev == RL_HWREV_8101E ||
- hwrev == RL_HWREV_8168_SPIN1 || hwrev == RL_HWREV_8168_SPIN2) {
+ switch (hwrev) {
+ case RL_HWREV_8100E:
+ case RL_HWREV_8101E:
+ case RL_HWREV_8168_SPIN1:
+ case RL_HWREV_8168_SPIN2:
+ case RL_HWREV_8168_SPIN3:
CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1]));
CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0]));
- } else {
+ break;
+ default:
CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
+ break;
}
}
@@ -1320,6 +1329,7 @@ re_attach(dev)
case RL_HWREV_8169_8110SB:
case RL_HWREV_8169_8110SC:
case RL_HWREV_8168_SPIN2:
+ case RL_HWREV_8168_SPIN3:
re_gmii_writereg(dev, 1, 0x1f, 0);
re_gmii_writereg(dev, 1, 0x0e, 0);
break;
diff --git a/sys/pci/if_rlreg.h b/sys/pci/if_rlreg.h
index 3ab38be..fbfb65b 100644
--- a/sys/pci/if_rlreg.h
+++ b/sys/pci/if_rlreg.h
@@ -156,6 +156,7 @@
#define RL_HWREV_8100E 0x30800000
#define RL_HWREV_8101E 0x34000000
#define RL_HWREV_8168_SPIN2 0x38000000
+#define RL_HWREV_8168_SPIN3 0x38400000
#define RL_HWREV_8139 0x60000000
#define RL_HWREV_8139A 0x70000000
#define RL_HWREV_8139AG 0x70800000
OpenPOWER on IntegriCloud