aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>2007-01-11 20:31:35 +0000
committerBill Paul <wpaul@FreeBSD.org>2007-01-11 20:31:35 +0000
commitbb7dfefb45a7d7505173291429ad36be6bfa904b (patch)
tree1bbf536ba52e5a4b4adaa4397fba319d2aee3875
parent6137b0bdf97237459bf2d368eed42360f5b7451b (diff)
Notes
-rw-r--r--sys/dev/re/if_re.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 2ea024d1e238..6eae2ac5b3ca 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -620,6 +620,7 @@ re_setmulti(sc)
struct ifmultiaddr *ifma;
u_int32_t rxfilt;
int mcnt = 0;
+ u_int32_t hwrev;
RL_LOCK_ASSERT(sc);
@@ -660,8 +661,24 @@ re_setmulti(sc)
rxfilt &= ~RL_RXCFG_RX_MULTI;
CSR_WRITE_4(sc, RL_RXCFG, rxfilt);
- CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
- CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
+
+ /*
+ * For some unfathomable reason, RealTek decided to reverse
+ * the order of the multicast hash registers in the PCI Express
+ * parts. This means we have to write the hash pattern in reverse
+ * order for those devices.
+ */
+
+ 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) {
+ CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1]));
+ CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0]));
+ } else {
+ CSR_WRITE_4(sc, RL_MAR0, hashes[0]);
+ CSR_WRITE_4(sc, RL_MAR4, hashes[1]);
+ }
}
static void