Date: Sun, 15 Mar 2015 21:06:36 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280095 - head/sys/dev/wpi Message-ID: <201503152106.t2FL6a0P080193@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503152106.t2FL6a0P080193>