summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/if_re/if_re.c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2009-02-20 19:28:31 +0000
committerTill Straumann <strauman@slac.stanford.edu>2009-02-20 19:28:31 +0000
commit1df069bd92994a9392169b3e47cf211e0b36e690 (patch)
tree6c3fcc3293bd3ab106a0d1819c609a34048f6447 /bsd_eth_drivers/if_re/if_re.c
parent - added mdio callbacks and rtems specific code to poll the phy. (diff)
downloadlibbsdport-1df069bd92994a9392169b3e47cf211e0b36e690.tar.bz2
- compute hashes for multicast filtering (UNTESTED)
Diffstat (limited to 'bsd_eth_drivers/if_re/if_re.c')
-rw-r--r--bsd_eth_drivers/if_re/if_re.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/bsd_eth_drivers/if_re/if_re.c b/bsd_eth_drivers/if_re/if_re.c
index 81cfd0d..8db06b0 100644
--- a/bsd_eth_drivers/if_re/if_re.c
+++ b/bsd_eth_drivers/if_re/if_re.c
@@ -710,8 +710,8 @@ re_setmulti(sc)
struct rl_softc *sc;
{
struct ifnet *ifp;
-#ifndef __rtems__
int h = 0;
+#ifndef __rtems__
struct ifmultiaddr *ifma;
#endif
u_int32_t hashes[2] = { 0, 0 };
@@ -760,6 +760,21 @@ re_setmulti(sc)
mcnt++;
}
IF_ADDR_UNLOCK(ifp);
+#else
+ {
+ /* UNTESTED */
+ struct ether_multi *enm;
+ struct ether_multistep step;
+ ETHER_FIRST_MULTI(step, (struct arpcom*)ifp, enm);
+ while ( enm != NULL ) {
+ h = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) >> 26;
+ if (h < 32)
+ hashes[0] |= (1 << h);
+ else
+ hashes[1] |= (1 << (h - 32));
+ mcnt++;
+ }
+ }
#endif
if (mcnt)