From 5622c31582422e1487b6bd229588d0d90eae9920 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Sat, 6 Dec 2008 21:19:26 +0000 Subject: The startall variable should default to zero, otherwise the vap is restarted everytime an ioctl happens. While I am here, limit the locking scope to SIOCSIFFLAGS. --- sys/dev/usb/if_ural.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index 5415492b3e81..459576197b57 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -1544,11 +1544,11 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ural_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - int error = 0, startall = 1; + int error = 0, startall = 0; - RAL_LOCK(sc); switch (cmd) { case SIOCSIFFLAGS: + RAL_LOCK(sc); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ural_init_locked(sc); @@ -1559,6 +1559,9 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (ifp->if_drv_flags & IFF_DRV_RUNNING) ural_stop(sc); } + RAL_UNLOCK(sc); + if (startall) + ieee80211_start_all(ic); break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: @@ -1568,10 +1571,6 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ether_ioctl(ifp, cmd, data); break; } - RAL_UNLOCK(sc); - - if (startall) - ieee80211_start_all(ic); return error; } -- cgit v1.3