ieee80211.c (190391) | ieee80211.c (190526) |
---|---|
1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 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: --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 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: --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 190391 2009-03-24 20:39:08Z sam $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 190526 2009-03-29 17:59:14Z sam $"); |
29 30/* 31 * IEEE 802.11 generic handler 32 */ 33#include "opt_wlan.h" 34 35#include <sys/param.h> 36#include <sys/systm.h> --- 197 unchanged lines hidden (view full) --- 234 m_freem(m); 235} 236 237/* 238 * Attach/setup the common net80211 state. Called by 239 * the driver on attach to prior to creating any vap's. 240 */ 241void | 29 30/* 31 * IEEE 802.11 generic handler 32 */ 33#include "opt_wlan.h" 34 35#include <sys/param.h> 36#include <sys/systm.h> --- 197 unchanged lines hidden (view full) --- 234 m_freem(m); 235} 236 237/* 238 * Attach/setup the common net80211 state. Called by 239 * the driver on attach to prior to creating any vap's. 240 */ 241void |
242ieee80211_ifattach(struct ieee80211com *ic) | 242ieee80211_ifattach(struct ieee80211com *ic, 243 const uint8_t macaddr[IEEE80211_ADDR_LEN]) |
243{ 244 struct ifnet *ifp = ic->ic_ifp; 245 struct sockaddr_dl *sdl; 246 struct ifaddr *ifa; 247 248 KASSERT(ifp->if_type == IFT_IEEE80211, ("if_type %d", ifp->if_type)); 249 250 IEEE80211_LOCK_INIT(ic, ifp->if_xname); --- 34 unchanged lines hidden (view full) --- 285 ifp->if_input = null_input; /* just in case */ 286 ifp->if_resolvemulti = NULL; /* NB: callers check */ 287 288 ifa = ifaddr_byindex(ifp->if_index); 289 KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); 290 sdl = (struct sockaddr_dl *)ifa->ifa_addr; 291 sdl->sdl_type = IFT_ETHER; /* XXX IFT_IEEE80211? */ 292 sdl->sdl_alen = IEEE80211_ADDR_LEN; | 244{ 245 struct ifnet *ifp = ic->ic_ifp; 246 struct sockaddr_dl *sdl; 247 struct ifaddr *ifa; 248 249 KASSERT(ifp->if_type == IFT_IEEE80211, ("if_type %d", ifp->if_type)); 250 251 IEEE80211_LOCK_INIT(ic, ifp->if_xname); --- 34 unchanged lines hidden (view full) --- 286 ifp->if_input = null_input; /* just in case */ 287 ifp->if_resolvemulti = NULL; /* NB: callers check */ 288 289 ifa = ifaddr_byindex(ifp->if_index); 290 KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__)); 291 sdl = (struct sockaddr_dl *)ifa->ifa_addr; 292 sdl->sdl_type = IFT_ETHER; /* XXX IFT_IEEE80211? */ 293 sdl->sdl_alen = IEEE80211_ADDR_LEN; |
293 IEEE80211_ADDR_COPY(LLADDR(sdl), ic->ic_myaddr); | 294 IEEE80211_ADDR_COPY(LLADDR(sdl), macaddr); |
294} 295 296/* 297 * Detach net80211 state on device detach. Tear down 298 * all vap's and reclaim all common state prior to the 299 * device state going away. Note we may call back into 300 * driver; it must be prepared for this. 301 */ --- 1220 unchanged lines hidden --- | 295} 296 297/* 298 * Detach net80211 state on device detach. Tear down 299 * all vap's and reclaim all common state prior to the 300 * device state going away. Note we may call back into 301 * driver; it must be prepared for this. 302 */ --- 1220 unchanged lines hidden --- |