if_rue.c (194677) | if_rue.c (195049) |
---|---|
1/*- 2 * Copyright (c) 2001-2003, Shunsuke Akiyama <akiyama@FreeBSD.org>. 3 * Copyright (c) 1997, 1998, 1999, 2000 Bill Paul <wpaul@ee.columbia.edu>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 43 unchanged lines hidden (view full) --- 52 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 53 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 54 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 55 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 56 * THE POSSIBILITY OF SUCH DAMAGE. 57 */ 58 59#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2003, Shunsuke Akiyama <akiyama@FreeBSD.org>. 3 * Copyright (c) 1997, 1998, 1999, 2000 Bill Paul <wpaul@ee.columbia.edu>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 43 unchanged lines hidden (view full) --- 52 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 53 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 54 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 55 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 56 * THE POSSIBILITY OF SUCH DAMAGE. 57 */ 58 59#include <sys/cdefs.h> |
60__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_rue.c 194677 2009-06-23 02:19:59Z thompsa $"); | 60__FBSDID("$FreeBSD: head/sys/dev/usb/net/if_rue.c 195049 2009-06-26 11:45:06Z rwatson $"); |
61 62/* 63 * RealTek RTL8150 USB to fast ethernet controller driver. 64 * Datasheet is available from 65 * ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/. 66 */ 67 68#include <sys/stdint.h> --- 420 unchanged lines hidden (view full) --- 489 return; 490 } 491 492 /* first, zot all the existing hash bits */ 493 rue_csr_write_4(sc, RUE_MAR0, 0); 494 rue_csr_write_4(sc, RUE_MAR4, 0); 495 496 /* now program new ones */ | 61 62/* 63 * RealTek RTL8150 USB to fast ethernet controller driver. 64 * Datasheet is available from 65 * ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/. 66 */ 67 68#include <sys/stdint.h> --- 420 unchanged lines hidden (view full) --- 489 return; 490 } 491 492 /* first, zot all the existing hash bits */ 493 rue_csr_write_4(sc, RUE_MAR0, 0); 494 rue_csr_write_4(sc, RUE_MAR4, 0); 495 496 /* now program new ones */ |
497 IF_ADDR_LOCK(ifp); | 497 if_maddr_rlock(ifp); |
498 TAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link) 499 { 500 if (ifma->ifma_addr->sa_family != AF_LINK) 501 continue; 502 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 503 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 504 if (h < 32) 505 hashes[0] |= (1 << h); 506 else 507 hashes[1] |= (1 << (h - 32)); 508 mcnt++; 509 } | 498 TAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link) 499 { 500 if (ifma->ifma_addr->sa_family != AF_LINK) 501 continue; 502 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 503 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; 504 if (h < 32) 505 hashes[0] |= (1 << h); 506 else 507 hashes[1] |= (1 << (h - 32)); 508 mcnt++; 509 } |
510 IF_ADDR_UNLOCK(ifp); | 510 if_maddr_runlock(ifp); |
511 512 if (mcnt) 513 rxcfg |= RUE_RCR_AM; 514 else 515 rxcfg &= ~RUE_RCR_AM; 516 517 rxcfg &= ~(RUE_RCR_AAM | RUE_RCR_AAP); 518 --- 403 unchanged lines hidden --- | 511 512 if (mcnt) 513 rxcfg |= RUE_RCR_AM; 514 else 515 rxcfg &= ~RUE_RCR_AM; 516 517 rxcfg &= ~(RUE_RCR_AAM | RUE_RCR_AAP); 518 --- 403 unchanged lines hidden --- |