summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
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/ath/if_ath.c
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/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 8caed20..b104c50 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -6277,9 +6277,9 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ifreq *ifr = (struct ifreq *)data;
int error = 0;
- ATH_LOCK(sc);
switch (cmd) {
case SIOCSIFFLAGS:
+ ATH_LOCK(sc);
if (IS_RUNNING(ifp)) {
/*
* To avoid rescanning another access point,
@@ -6301,6 +6301,7 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
ath_init(sc); /* XXX lose error */
} else
ath_stop_locked(ifp);
+ ATH_UNLOCK(sc);
break;
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
@@ -6315,27 +6316,20 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
&sc->sc_stats.ast_rx_noise);
#endif
sc->sc_stats.ast_tx_rate = sc->sc_hwmap[sc->sc_txrate].ieeerate;
- ATH_UNLOCK(sc);
- /*
- * NB: Drop the softc lock in case of a page fault;
- * we'll accept any potential inconsisentcy in the
- * statistics. The alternative is to copy the data
- * to a local structure.
- */
return copyout(&sc->sc_stats,
- ifr->ifr_data, sizeof (sc->sc_stats));
+ ifr->ifr_data, sizeof (sc->sc_stats));
#ifdef ATH_DIAGAPI
case SIOCGATHDIAG:
- ATH_UNLOCK(sc);
error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
- ATH_LOCK(sc);
break;
#endif
- default:
+ case SIOCGIFADDR:
error = ether_ioctl(ifp, cmd, data);
break;
+ default:
+ error = EINVAL;
+ break;
}
- ATH_UNLOCK(sc);
return error;
#undef IS_RUNNING
}
OpenPOWER on IntegriCloud