ieee80211_ioctl.c (295126) | ieee80211_ioctl.c (296169) |
---|---|
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_ioctl.c 295126 2016-02-01 17:41:21Z glebius $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ioctl.c 296169 2016-02-28 23:35:03Z avos $"); |
29 30/* 31 * IEEE 802.11 ioctl support (FreeBSD-specific) 32 */ 33 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 3247 unchanged lines hidden (view full) --- 3284 return error; 3285} 3286 3287int 3288ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) 3289{ 3290 struct ieee80211vap *vap = ifp->if_softc; 3291 struct ieee80211com *ic = vap->iv_ic; | 29 30/* 31 * IEEE 802.11 ioctl support (FreeBSD-specific) 32 */ 33 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 3247 unchanged lines hidden (view full) --- 3284 return error; 3285} 3286 3287int 3288ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) 3289{ 3290 struct ieee80211vap *vap = ifp->if_softc; 3291 struct ieee80211com *ic = vap->iv_ic; |
3292 int error = 0; | 3292 int error = 0, wait = 0; |
3293 struct ifreq *ifr; 3294 struct ifaddr *ifa; /* XXX */ 3295 3296 switch (cmd) { 3297 case SIOCSIFFLAGS: 3298 IEEE80211_LOCK(ic); 3299 if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_PROMISC) 3300 ieee80211_promisc(vap, ifp->if_flags & IFF_PROMISC); 3301 if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_ALLMULTI) 3302 ieee80211_allmulti(vap, ifp->if_flags & IFF_ALLMULTI); 3303 vap->iv_ifflags = ifp->if_flags; 3304 if (ifp->if_flags & IFF_UP) { 3305 /* 3306 * Bring ourself up unless we're already operational. 3307 * If we're the first vap and the parent is not up 3308 * then it will automatically be brought up as a 3309 * side-effect of bringing ourself up. 3310 */ | 3293 struct ifreq *ifr; 3294 struct ifaddr *ifa; /* XXX */ 3295 3296 switch (cmd) { 3297 case SIOCSIFFLAGS: 3298 IEEE80211_LOCK(ic); 3299 if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_PROMISC) 3300 ieee80211_promisc(vap, ifp->if_flags & IFF_PROMISC); 3301 if ((ifp->if_flags ^ vap->iv_ifflags) & IFF_ALLMULTI) 3302 ieee80211_allmulti(vap, ifp->if_flags & IFF_ALLMULTI); 3303 vap->iv_ifflags = ifp->if_flags; 3304 if (ifp->if_flags & IFF_UP) { 3305 /* 3306 * Bring ourself up unless we're already operational. 3307 * If we're the first vap and the parent is not up 3308 * then it will automatically be brought up as a 3309 * side-effect of bringing ourself up. 3310 */ |
3311 if (vap->iv_state == IEEE80211_S_INIT) | 3311 if (vap->iv_state == IEEE80211_S_INIT) { 3312 if (ic->ic_nrunning == 0) 3313 wait = 1; |
3312 ieee80211_start_locked(vap); | 3314 ieee80211_start_locked(vap); |
3315 } |
|
3313 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { 3314 /* 3315 * Stop ourself. If we are the last vap to be 3316 * marked down the parent will also be taken down. 3317 */ | 3316 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { 3317 /* 3318 * Stop ourself. If we are the last vap to be 3319 * marked down the parent will also be taken down. 3320 */ |
3321 if (ic->ic_nrunning == 1) 3322 wait = 1; |
|
3318 ieee80211_stop_locked(vap); 3319 } 3320 IEEE80211_UNLOCK(ic); 3321 /* Wait for parent ioctl handler if it was queued */ | 3323 ieee80211_stop_locked(vap); 3324 } 3325 IEEE80211_UNLOCK(ic); 3326 /* Wait for parent ioctl handler if it was queued */ |
3322 ieee80211_waitfor_parent(ic); | 3327 if (wait) 3328 ieee80211_waitfor_parent(ic); |
3323 break; 3324 case SIOCADDMULTI: 3325 case SIOCDELMULTI: 3326 ieee80211_runtask(ic, &ic->ic_mcast_task); 3327 break; 3328 case SIOCSIFMEDIA: 3329 case SIOCGIFMEDIA: 3330 ifr = (struct ifreq *)data; --- 64 unchanged lines hidden --- | 3329 break; 3330 case SIOCADDMULTI: 3331 case SIOCDELMULTI: 3332 ieee80211_runtask(ic, &ic->ic_mcast_task); 3333 break; 3334 case SIOCSIFMEDIA: 3335 case SIOCGIFMEDIA: 3336 ifr = (struct ifreq *)data; --- 64 unchanged lines hidden --- |