if_dc.c (71962) | if_dc.c (72084) |
---|---|
1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ee.columbia.edu>. 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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ee.columbia.edu>. 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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/dev/dc/if_dc.c 71962 2001-02-03 16:29:10Z phk $ | 32 * $FreeBSD: head/sys/dev/dc/if_dc.c 72084 2001-02-06 10:12:15Z phk $ |
33 */ 34 35/* 36 * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143 37 * series chips and several workalikes including the following: 38 * 39 * Macronix 98713/98715/98725/98727/98732 PMAC (www.macronix.com) 40 * Macronix/Lite-On 82c115 PNIC II (www.macronix.com) --- 87 unchanged lines hidden (view full) --- 128 129MODULE_DEPEND(dc, miibus, 1, 1, 1); 130 131/* "controller miibus0" required. See GENERIC if you get errors here. */ 132#include "miibus_if.h" 133 134#ifndef lint 135static const char rcsid[] = | 33 */ 34 35/* 36 * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143 37 * series chips and several workalikes including the following: 38 * 39 * Macronix 98713/98715/98725/98727/98732 PMAC (www.macronix.com) 40 * Macronix/Lite-On 82c115 PNIC II (www.macronix.com) --- 87 unchanged lines hidden (view full) --- 128 129MODULE_DEPEND(dc, miibus, 1, 1, 1); 130 131/* "controller miibus0" required. See GENERIC if you get errors here. */ 132#include "miibus_if.h" 133 134#ifndef lint 135static const char rcsid[] = |
136 "$FreeBSD: head/sys/dev/dc/if_dc.c 71962 2001-02-03 16:29:10Z phk $"; | 136 "$FreeBSD: head/sys/dev/dc/if_dc.c 72084 2001-02-06 10:12:15Z phk $"; |
137#endif 138 139/* 140 * Various supported device vendors/types and their names. 141 */ 142static struct dc_type dc_devs[] = { 143 { DC_VENDORID_DEC, DC_DEVICEID_21143, 144 "Intel 21143 10/100BaseTX" }, --- 901 unchanged lines hidden (view full) --- 1046 else 1047 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC); 1048 1049 if (ifp->if_flags & IFF_ALLMULTI) 1050 DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1051 else 1052 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1053 | 137#endif 138 139/* 140 * Various supported device vendors/types and their names. 141 */ 142static struct dc_type dc_devs[] = { 143 { DC_VENDORID_DEC, DC_DEVICEID_21143, 144 "Intel 21143 10/100BaseTX" }, --- 901 unchanged lines hidden (view full) --- 1046 else 1047 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC); 1048 1049 if (ifp->if_flags & IFF_ALLMULTI) 1050 DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1051 else 1052 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1053 |
1054 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | 1054 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { |
1055 if (ifma->ifma_addr->sa_family != AF_LINK) 1056 continue; 1057 h = dc_crc_le(sc, 1058 LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1059 sp[h >> 4] |= 1 << (h & 0xF); 1060 } 1061 1062 if (ifp->if_flags & IFF_BROADCAST) { --- 54 unchanged lines hidden (view full) --- 1117 /* 1118 * If we're already in promisc or allmulti mode, we 1119 * don't have to bother programming the multicast filter. 1120 */ 1121 if (ifp->if_flags & (IFF_PROMISC|IFF_ALLMULTI)) 1122 return; 1123 1124 /* now program new ones */ | 1055 if (ifma->ifma_addr->sa_family != AF_LINK) 1056 continue; 1057 h = dc_crc_le(sc, 1058 LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1059 sp[h >> 4] |= 1 << (h & 0xF); 1060 } 1061 1062 if (ifp->if_flags & IFF_BROADCAST) { --- 54 unchanged lines hidden (view full) --- 1117 /* 1118 * If we're already in promisc or allmulti mode, we 1119 * don't have to bother programming the multicast filter. 1120 */ 1121 if (ifp->if_flags & (IFF_PROMISC|IFF_ALLMULTI)) 1122 return; 1123 1124 /* now program new ones */ |
1125 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | 1125 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { |
1126 if (ifma->ifma_addr->sa_family != AF_LINK) 1127 continue; 1128 h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1129 if (h < 32) 1130 hashes[0] |= (1 << h); 1131 else 1132 hashes[1] |= (1 << (h - 32)); 1133 } --- 51 unchanged lines hidden (view full) --- 1185 /* 1186 * If we're already in promisc or allmulti mode, we 1187 * don't have to bother programming the multicast filter. 1188 */ 1189 if (ifp->if_flags & (IFF_PROMISC|IFF_ALLMULTI)) 1190 return; 1191 1192 /* now program new ones */ | 1126 if (ifma->ifma_addr->sa_family != AF_LINK) 1127 continue; 1128 h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1129 if (h < 32) 1130 hashes[0] |= (1 << h); 1131 else 1132 hashes[1] |= (1 << (h - 32)); 1133 } --- 51 unchanged lines hidden (view full) --- 1185 /* 1186 * If we're already in promisc or allmulti mode, we 1187 * don't have to bother programming the multicast filter. 1188 */ 1189 if (ifp->if_flags & (IFF_PROMISC|IFF_ALLMULTI)) 1190 return; 1191 1192 /* now program new ones */ |
1193 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | 1193 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { |
1194 if (ifma->ifma_addr->sa_family != AF_LINK) 1195 continue; 1196 h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1197 if (h < 32) 1198 hashes[0] |= (1 << h); 1199 else 1200 hashes[1] |= (1 << (h - 32)); 1201 } --- 37 unchanged lines hidden (view full) --- 1239 else 1240 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC); 1241 1242 if (ifp->if_flags & IFF_ALLMULTI) 1243 DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1244 else 1245 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1246 | 1194 if (ifma->ifma_addr->sa_family != AF_LINK) 1195 continue; 1196 h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1197 if (h < 32) 1198 hashes[0] |= (1 << h); 1199 else 1200 hashes[1] |= (1 << (h - 32)); 1201 } --- 37 unchanged lines hidden (view full) --- 1239 else 1240 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC); 1241 1242 if (ifp->if_flags & IFF_ALLMULTI) 1243 DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1244 else 1245 DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); 1246 |
1247 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | 1247 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { |
1248 if (ifma->ifma_addr->sa_family != AF_LINK) 1249 continue; 1250 h = dc_crc_le(sc, 1251 LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1252 sp[h >> 4] |= 1 << (h & 0xF); 1253 } 1254 1255 if (ifp->if_flags & IFF_BROADCAST) { --- 2112 unchanged lines hidden --- | 1248 if (ifma->ifma_addr->sa_family != AF_LINK) 1249 continue; 1250 h = dc_crc_le(sc, 1251 LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); 1252 sp[h >> 4] |= 1 << (h & 0xF); 1253 } 1254 1255 if (ifp->if_flags & IFF_BROADCAST) { --- 2112 unchanged lines hidden --- |