diff options
author | yongari <yongari@FreeBSD.org> | 2007-12-08 00:14:09 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2007-12-08 00:14:09 +0000 |
commit | c60450024ed994361d0144d8be795b6f6fba957e (patch) | |
tree | 1f9ef19cf236a5bf56409683d26b1ce3231e75a6 /sys/dev/re | |
parent | 6bd01c70a2bb4cf2034458a808cc2a2a03bae798 (diff) | |
download | FreeBSD-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/dev/re')
-rw-r--r-- | sys/dev/re/if_re.c | 16 |
1 files changed, 13 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; |