summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2006-07-05 00:49:26 +0000
committerthompsa <thompsa@FreeBSD.org>2006-07-05 00:49:26 +0000
commit7ae1ec85dc1edc399a954a13e04d4800fbe0c335 (patch)
tree80ccc79371a959dd00888a05a321d5eddf8dae7d
parent8d4c5177f7288279f1f1266cfbe479dd76a34484 (diff)
downloadFreeBSD-src-7ae1ec85dc1edc399a954a13e04d4800fbe0c335.zip
FreeBSD-src-7ae1ec85dc1edc399a954a13e04d4800fbe0c335.tar.gz
Change the multicast calculation to be the same as the other usb drivers and
avoid calling into the usb code with the lock held. This doenst fix the fundamental usb sleeping problem but at least the adapter can be used.
-rw-r--r--sys/dev/usb/if_aue.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 4443583..7f76b9f 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -524,6 +524,7 @@ aue_setmulti(struct aue_softc *sc)
struct ifnet *ifp;
struct ifmultiaddr *ifma;
u_int32_t h = 0, i;
+ u_int8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
ifp = sc->aue_ifp;
@@ -534,10 +535,6 @@ aue_setmulti(struct aue_softc *sc)
AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI);
- /* first, zot all the existing hash bits */
- for (i = 0; i < 8; i++)
- aue_csr_write_1(sc, AUE_MAR0 + i, 0);
-
/* now program new ones */
IF_ADDR_LOCK(ifp);
#if __FreeBSD_version >= 500000
@@ -550,10 +547,14 @@ aue_setmulti(struct aue_softc *sc)
continue;
h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1);
- AUE_SETBIT(sc, AUE_MAR + (h >> 3), 1 << (h & 0x7));
+ hashtbl[(h >> 3)] |= 1 << (h & 0x7);
}
IF_ADDR_UNLOCK(ifp);
+ /* write the hashtable */
+ for (i = 0; i < 8; i++)
+ aue_csr_write_1(sc, AUE_MAR0 + i, hashtbl[i]);
+
return;
}
OpenPOWER on IntegriCloud