if_sn.c (148144) | if_sn.c (148654) |
---|---|
1/*- 2 * Copyright (c) 1996 Gardner Buchanan <gbuchanan@shl.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1996 Gardner Buchanan <gbuchanan@shl.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/sn/if_sn.c 148144 2005-07-18 23:41:34Z imp $"); | 33__FBSDID("$FreeBSD: head/sys/dev/sn/if_sn.c 148654 2005-08-03 00:18:35Z rwatson $"); |
34 35/* 36 * This is a driver for SMC's 9000 series of Ethernet adapters. 37 * 38 * This FreeBSD driver is derived from the smc9194 Linux driver by 39 * Erik Stahlman and is Copyright (C) 1996 by Erik Stahlman. 40 * This driver also shamelessly borrows from the FreeBSD ep driver 41 * which is Copyright (C) 1994 Herb Peyerl <hpeyerl@novatel.ca> --- 1363 unchanged lines hidden (view full) --- 1405{ 1406 int i; 1407 uint32_t index, index2; 1408 uint8_t *af = mcf; 1409 struct ifmultiaddr *ifma; 1410 1411 bzero(mcf, MCFSZ); 1412 | 34 35/* 36 * This is a driver for SMC's 9000 series of Ethernet adapters. 37 * 38 * This FreeBSD driver is derived from the smc9194 Linux driver by 39 * Erik Stahlman and is Copyright (C) 1996 by Erik Stahlman. 40 * This driver also shamelessly borrows from the FreeBSD ep driver 41 * which is Copyright (C) 1994 Herb Peyerl <hpeyerl@novatel.ca> --- 1363 unchanged lines hidden (view full) --- 1405{ 1406 int i; 1407 uint32_t index, index2; 1408 uint8_t *af = mcf; 1409 struct ifmultiaddr *ifma; 1410 1411 bzero(mcf, MCFSZ); 1412 |
1413 IF_ADDR_LOCK(ifp); |
|
1413 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | 1414 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { |
1414 if (ifma->ifma_addr->sa_family != AF_LINK) | 1415 if (ifma->ifma_addr->sa_family != AF_LINK) { 1416 IF_ADDR_UNLOCK(ifp); |
1415 return 0; | 1417 return 0; |
1418 } |
|
1416 index = ether_crc32_le(LLADDR((struct sockaddr_dl *) 1417 ifma->ifma_addr), ETHER_ADDR_LEN) & 0x3f; 1418 index2 = 0; 1419 for (i = 0; i < 6; i++) { 1420 index2 <<= 1; 1421 index2 |= (index & 0x01); 1422 index >>= 1; 1423 } 1424 af[index2 >> 3] |= 1 << (index2 & 7); 1425 } | 1419 index = ether_crc32_le(LLADDR((struct sockaddr_dl *) 1420 ifma->ifma_addr), ETHER_ADDR_LEN) & 0x3f; 1421 index2 = 0; 1422 for (i = 0; i < 6; i++) { 1423 index2 <<= 1; 1424 index2 |= (index & 0x01); 1425 index >>= 1; 1426 } 1427 af[index2 >> 3] |= 1 << (index2 & 7); 1428 } |
1429 IF_ADDR_UNLOCK(ifp); |
|
1426 return 1; /* use multicast filter */ 1427} | 1430 return 1; /* use multicast filter */ 1431} |