Date: Sat, 6 Dec 2008 21:19:27 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r185719 - head/sys/dev/usb Message-ID: <200812062119.mB6LJRT9005366@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: thompsa Date: Sat Dec 6 21:19:26 2008 New Revision: 185719 URL: http://svn.freebsd.org/changeset/base/185719 Log: 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. Modified: head/sys/dev/usb/if_ural.c Modified: head/sys/dev/usb/if_ural.c ============================================================================== --- head/sys/dev/usb/if_ural.c Sat Dec 6 20:49:08 2008 (r185718) +++ head/sys/dev/usb/if_ural.c Sat Dec 6 21:19:26 2008 (r185719) @@ -1544,11 +1544,11 @@ ural_ioctl(struct ifnet *ifp, u_long cmd 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 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 error = ether_ioctl(ifp, cmd, data); break; } - RAL_UNLOCK(sc); - - if (startall) - ieee80211_start_all(ic); return error; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812062119.mB6LJRT9005366>