if_nxge.c (173139) | if_nxge.c (195049) |
---|---|
1/*- 2 * Copyright (c) 2002-2007 Neterion, Inc. 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2002-2007 Neterion, Inc. 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/dev/nxge/if_nxge.c 173139 2007-10-29 14:19:32Z rwatson $ | 26 * $FreeBSD: head/sys/dev/nxge/if_nxge.c 195049 2009-06-26 11:45:06Z rwatson $ |
27 */ 28 29#include <dev/nxge/if_nxge.h> 30#include <dev/nxge/xge-osdep.h> 31#include <net/if_arp.h> 32#include <sys/types.h> 33#include <net/if.h> 34#include <net/if_vlan_var.h> --- 2198 unchanged lines hidden (view full) --- 2233 } 2234 2235 if(status != XGE_HAL_OK) { 2236 xge_trace(XGE_ERR, "Enabling/disabling multicast failed"); 2237 goto _exit; 2238 } 2239 2240 /* Updating address list */ | 27 */ 28 29#include <dev/nxge/if_nxge.h> 30#include <dev/nxge/xge-osdep.h> 31#include <net/if_arp.h> 32#include <sys/types.h> 33#include <net/if.h> 34#include <net/if_vlan_var.h> --- 2198 unchanged lines hidden (view full) --- 2233 } 2234 2235 if(status != XGE_HAL_OK) { 2236 xge_trace(XGE_ERR, "Enabling/disabling multicast failed"); 2237 goto _exit; 2238 } 2239 2240 /* Updating address list */ |
2241 IF_ADDR_LOCK(ifnetp); | 2241 if_maddr_rlock(ifnetp); |
2242 index = 0; 2243 TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { 2244 if(ifma->ifma_addr->sa_family != AF_LINK) { 2245 continue; 2246 } 2247 lladdr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); 2248 index += 1; 2249 } | 2242 index = 0; 2243 TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { 2244 if(ifma->ifma_addr->sa_family != AF_LINK) { 2245 continue; 2246 } 2247 lladdr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); 2248 index += 1; 2249 } |
2250 IF_ADDR_UNLOCK(ifnetp); | 2250 if_maddr_runlock(ifnetp); |
2251 2252 if((!lldev->all_multicast) && (index)) { 2253 lldev->macaddr_count = (index + 1); 2254 if(lldev->macaddr_count > table_size) { 2255 goto _exit; 2256 } 2257 2258 /* Clear old addresses */ 2259 for(index = 0; index < 48; index++) { 2260 xge_hal_device_macaddr_set(hldev, (offset + index), 2261 initial_addr); 2262 } 2263 } 2264 2265 /* Add new addresses */ | 2251 2252 if((!lldev->all_multicast) && (index)) { 2253 lldev->macaddr_count = (index + 1); 2254 if(lldev->macaddr_count > table_size) { 2255 goto _exit; 2256 } 2257 2258 /* Clear old addresses */ 2259 for(index = 0; index < 48; index++) { 2260 xge_hal_device_macaddr_set(hldev, (offset + index), 2261 initial_addr); 2262 } 2263 } 2264 2265 /* Add new addresses */ |
2266 IF_ADDR_LOCK(ifnetp); | 2266 if_maddr_rlock(ifnetp); |
2267 index = 0; 2268 TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { 2269 if(ifma->ifma_addr->sa_family != AF_LINK) { 2270 continue; 2271 } 2272 lladdr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); 2273 xge_hal_device_macaddr_set(hldev, (offset + index), lladdr); 2274 index += 1; 2275 } | 2267 index = 0; 2268 TAILQ_FOREACH(ifma, &ifnetp->if_multiaddrs, ifma_link) { 2269 if(ifma->ifma_addr->sa_family != AF_LINK) { 2270 continue; 2271 } 2272 lladdr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); 2273 xge_hal_device_macaddr_set(hldev, (offset + index), lladdr); 2274 index += 1; 2275 } |
2276 IF_ADDR_UNLOCK(ifnetp); | 2276 if_maddr_runlock(ifnetp); |
2277 2278_exit: 2279 return; 2280} 2281 2282/** 2283 * xge_enable_promisc 2284 * Enable Promiscuous Mode --- 1242 unchanged lines hidden --- | 2277 2278_exit: 2279 return; 2280} 2281 2282/** 2283 * xge_enable_promisc 2284 * Enable Promiscuous Mode --- 1242 unchanged lines hidden --- |