svn commit: r185719 - head/sys/dev/usb

Andrew Thompson thompsa at FreeBSD.org
Sat Dec 6 13:19:27 PST 2008


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;
 }
 


More information about the svn-src-all mailing list