if_aue.c (194677) | if_aue.c (195049) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999, 2000 3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. 4 * 5 * Copyright (c) 2006 6 * Alfred Perlstein <alfred@FreeBSD.org>. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 33 * THE POSSIBILITY OF SUCH DAMAGE. 34 */ 35 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998, 1999, 2000 3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. 4 * 5 * Copyright (c) 2006 6 * Alfred Perlstein <alfred@FreeBSD.org>. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 33 * THE POSSIBILITY OF SUCH DAMAGE. 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_aue.c 194677 2009-06-23 02:19:59Z thompsa $"); | 37__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_aue.c 195049 2009-06-26 11:45:06Z rwatson $"); |
38 39/* 40 * ADMtek AN986 Pegasus and AN8511 Pegasus II USB to ethernet driver. 41 * Datasheet is available from http://www.admtek.com.tw. 42 * 43 * Written by Bill Paul <wpaul@ee.columbia.edu> 44 * Electrical Engineering Department 45 * Columbia University, New York City --- 500 unchanged lines hidden (view full) --- 546 if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { 547 AUE_SETBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); 548 return; 549 } 550 551 AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); 552 553 /* now program new ones */ | 38 39/* 40 * ADMtek AN986 Pegasus and AN8511 Pegasus II USB to ethernet driver. 41 * Datasheet is available from http://www.admtek.com.tw. 42 * 43 * Written by Bill Paul <wpaul@ee.columbia.edu> 44 * Electrical Engineering Department 45 * Columbia University, New York City --- 500 unchanged lines hidden (view full) --- 546 if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { 547 AUE_SETBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); 548 return; 549 } 550 551 AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); 552 553 /* now program new ones */ |
554 IF_ADDR_LOCK(ifp); | 554 if_maddr_rlock(ifp); |
555 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 556 if (ifma->ifma_addr->sa_family != AF_LINK) 557 continue; 558 h = ether_crc32_le(LLADDR((struct sockaddr_dl *) 559 ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1); 560 hashtbl[(h >> 3)] |= 1 << (h & 0x7); 561 } | 555 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 556 if (ifma->ifma_addr->sa_family != AF_LINK) 557 continue; 558 h = ether_crc32_le(LLADDR((struct sockaddr_dl *) 559 ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1); 560 hashtbl[(h >> 3)] |= 1 << (h & 0x7); 561 } |
562 IF_ADDR_UNLOCK(ifp); | 562 if_maddr_runlock(ifp); |
563 564 /* write the hashtable */ 565 for (i = 0; i != 8; i++) 566 aue_csr_write_1(sc, AUE_MAR0 + i, hashtbl[i]); 567} 568 569static void 570aue_reset_pegasus_II(struct aue_softc *sc) --- 494 unchanged lines hidden --- | 563 564 /* write the hashtable */ 565 for (i = 0; i != 8; i++) 566 aue_csr_write_1(sc, AUE_MAR0 + i, hashtbl[i]); 567} 568 569static void 570aue_reset_pegasus_II(struct aue_softc *sc) --- 494 unchanged lines hidden --- |