summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_ioctl.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-06-04 15:57:38 +0000
committersam <sam@FreeBSD.org>2009-06-04 15:57:38 +0000
commite673d3b5e90d6ec6fe0c6bca82c4b813b1af6e3d (patch)
tree0087ddfa0d20ea5694d61834bf30fbd8cf190b9f /sys/net80211/ieee80211_ioctl.c
parent981682577c61c5ffe81deb34e9b9b1f0658c7fb0 (diff)
downloadFreeBSD-src-e673d3b5e90d6ec6fe0c6bca82c4b813b1af6e3d.zip
FreeBSD-src-e673d3b5e90d6ec6fe0c6bca82c4b813b1af6e3d.tar.gz
o station mode channel switch support
o IEEE80211_IOC_CHANSWITCH fixups: - restrict to hostap vaps - return EOPNOTSUPP instead of EINVAL when applied to !hostap vap or to a vap w/o 11h enabled - interpret count of 0 to mean cancel the current CSA Reviewed by: rpaulo, avatar
Diffstat (limited to 'sys/net80211/ieee80211_ioctl.c')
-rw-r--r--sys/net80211/ieee80211_ioctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 36c6f4c..d88f812 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -2304,8 +2304,10 @@ ieee80211_ioctl_chanswitch(struct ieee80211vap *vap, struct ieee80211req *ireq)
error = copyin(ireq->i_data, &csr, sizeof(csr));
if (error != 0)
return error;
- if ((vap->iv_flags & IEEE80211_F_DOTH) == 0)
- return EINVAL;
+ /* XXX adhoc mode not supported */
+ if (vap->iv_opmode != IEEE80211_M_HOSTAP ||
+ (vap->iv_flags & IEEE80211_F_DOTH) == 0)
+ return EOPNOTSUPP;
c = ieee80211_find_channel(ic,
csr.csa_chan.ic_freq, csr.csa_chan.ic_flags);
if (c == NULL)
@@ -2313,6 +2315,8 @@ ieee80211_ioctl_chanswitch(struct ieee80211vap *vap, struct ieee80211req *ireq)
IEEE80211_LOCK(ic);
if ((ic->ic_flags & IEEE80211_F_CSAPENDING) == 0)
ieee80211_csa_startswitch(ic, c, csr.csa_mode, csr.csa_count);
+ else if (csr.csa_count == 0)
+ ieee80211_csa_cancelswitch(ic);
else
error = EBUSY;
IEEE80211_UNLOCK(ic);
OpenPOWER on IntegriCloud