svn commit: r280095 - head/sys/dev/wpi

Adrian Chadd adrian at FreeBSD.org
Sun Mar 15 21:06:37 UTC 2015


Author: adrian
Date: Sun Mar 15 21:06:36 2015
New Revision: 280095
URL: https://svnweb.freebsd.org/changeset/base/280095

Log:
  Refactor wpi_ioctl().
  
  PR:		kern/197143
  Submitted by:	Andriy Voskoboinyk <s3erios at gmail.com>

Modified:
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Sun Mar 15 21:05:59 2015	(r280094)
+++ head/sys/dev/wpi/if_wpi.c	Sun Mar 15 21:06:36 2015	(r280095)
@@ -2964,30 +2964,23 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd,
 	struct ieee80211com *ic = ifp->if_l2com;
 	struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
 	struct ifreq *ifr = (struct ifreq *) data;
-	int error = 0, startall = 0, stop = 0;
+	int error = 0;
 
 	switch (cmd) {
 	case SIOCGIFADDR:
 		error = ether_ioctl(ifp, cmd, data);
 		break;
 	case SIOCSIFFLAGS:
-		WPI_LOCK(sc);
 		if (ifp->if_flags & IFF_UP) {
-			if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
-				wpi_init_locked(sc);
-				if (WPI_READ(sc, WPI_GP_CNTRL) &
-				    WPI_GP_CNTRL_RFKILL)
-					startall = 1;
-				else
-					stop = 1;
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+				wpi_init(sc);
+
+				if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 &&
+				    vap != NULL)
+					ieee80211_stop(vap);
 			}
-		} else if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-			wpi_stop_locked(sc);
-		WPI_UNLOCK(sc);
-		if (startall)
-			ieee80211_start_all(ic);
-		else if (vap != NULL && stop)
-			ieee80211_stop(vap);
+		} else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+			wpi_stop(sc);
 		break;
 	case SIOCGIFMEDIA:
 		error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd);


More information about the svn-src-head mailing list