summaryrefslogtreecommitdiffstats
path: root/sys/dev/wpi
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-05-01 04:55:00 +0000
committerthompsa <thompsa@FreeBSD.org>2008-05-01 04:55:00 +0000
commita96561521e584f7ce37efdbc079f9f3d125f8f39 (patch)
treeb983721c7e7ac121297fd8475a3fd70e7cdc0166 /sys/dev/wpi
parentbaf49360e8bbe44e4ec849b9c8e2374de1cb3f12 (diff)
downloadFreeBSD-src-a96561521e584f7ce37efdbc079f9f3d125f8f39.zip
FreeBSD-src-a96561521e584f7ce37efdbc079f9f3d125f8f39.tar.gz
Unify all the wifi *_ioctl routines
- Limit grabbing the lock to SIOCSIFFLAGS. - Move ieee80211_start_all() to SIOCSIFFLAGS. - Remove SIOCSIFMEDIA as it is not useful. - Limit ether_ioctl to only SIOCGIFADDR. SIOCSIFADDR and SIOCSIFMTU have no affect as there is no input/output path in the vap parent. The vap code will handle the reinit of the mac address changes. - Split off ndis_ioctl_80211 as it was getting too different to wired devices. This fixes a copyout while locked and a lock recursion. Reviewed by: sam
Diffstat (limited to 'sys/dev/wpi')
-rw-r--r--sys/dev/wpi/if_wpi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index f801493..5ac37a7 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -2083,9 +2083,9 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ifreq *ifr = (struct ifreq *) data;
int error = 0, startall = 0;
- WPI_LOCK(sc);
switch (cmd) {
case SIOCSIFFLAGS:
+ WPI_LOCK(sc);
if ((ifp->if_flags & IFF_UP)) {
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
wpi_init_locked(sc, 0);
@@ -2094,19 +2094,20 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
} else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) ||
(sc->flags & WPI_FLAG_HW_RADIO_OFF))
wpi_stop_locked(sc);
+ WPI_UNLOCK(sc);
+ if (startall)
+ ieee80211_start_all(ic);
break;
case SIOCGIFMEDIA:
- case SIOCSIFMEDIA:
error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd);
break;
- default:
+ case SIOCGIFADDR:
error = ether_ioctl(ifp, cmd, data);
break;
+ default:
+ error = EINVAL;
+ break;
}
- WPI_UNLOCK(sc);
-
- if (startall)
- ieee80211_start_all(ic);
return error;
}
OpenPOWER on IntegriCloud