1/* 2 * Copyright (c) 2005 by David E. O'Brien <obrien@FreeBSD.org>. 3 * Copyright (c) 2003,2004 by Quinton Dolan <q@onthenet.com.au>. 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: --- 60 unchanged lines hidden (view full) --- 69 * 70 * Written by Quinton Dolan <q@onthenet.com.au> 71 * Portions based on existing FreeBSD network drivers. 72 * NVIDIA API usage derived from distributed NVIDIA NVNET driver source files. 73 * 74 */ 75 76#include <sys/cdefs.h> |
77__FBSDID("$FreeBSD: head/sys/dev/nve/if_nve.c 148654 2005-08-03 00:18:35Z rwatson $"); |
78 79#include <sys/param.h> 80#include <sys/systm.h> 81#include <sys/sockio.h> 82#include <sys/mbuf.h> 83#include <sys/malloc.h> 84#include <sys/kernel.h> 85#include <sys/socket.h> --- 982 unchanged lines hidden (view full) --- 1068 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) { 1069 /* Accept all packets */ 1070 hwfilter.ulFilterFlags |= ACCEPT_ALL_PACKETS; 1071 sc->hwapi->pfnSetPacketFilter(sc->hwapi->pADCX, &hwfilter); 1072 NVE_UNLOCK(sc); 1073 return; 1074 } 1075 /* Setup multicast filter */ |
1076 IF_ADDR_LOCK(ifp); |
1077 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 1078 u_char *addrp; 1079 1080 if (ifma->ifma_addr->sa_family != AF_LINK) 1081 continue; 1082 1083 addrp = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); 1084 for (i = 0; i < 6; i++) { 1085 u_int8_t mcaddr = addrp[i]; 1086 andaddr[i] &= mcaddr; 1087 oraddr[i] |= mcaddr; 1088 } 1089 } |
1090 IF_ADDR_UNLOCK(ifp); |
1091 for (i = 0; i < 6; i++) { 1092 hwfilter.acMulticastAddress[i] = andaddr[i] & oraddr[i]; 1093 hwfilter.acMulticastMask[i] = andaddr[i] | (~oraddr[i]); 1094 } 1095 1096 /* Send filter to NVIDIA API */ 1097 sc->hwapi->pfnSetPacketFilter(sc->hwapi->pADCX, &hwfilter); 1098 --- 627 unchanged lines hidden --- |