diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2009-02-20 19:28:31 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2009-02-20 19:28:31 +0000 |
commit | 1df069bd92994a9392169b3e47cf211e0b36e690 (patch) | |
tree | 6c3fcc3293bd3ab106a0d1819c609a34048f6447 /bsd_eth_drivers/if_re/if_re.c | |
parent | - added mdio callbacks and rtems specific code to poll the phy. (diff) | |
download | libbsdport-1df069bd92994a9392169b3e47cf211e0b36e690.tar.bz2 |
- compute hashes for multicast filtering (UNTESTED)
Diffstat (limited to '')
-rw-r--r-- | bsd_eth_drivers/if_re/if_re.c | 17 |
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) |