diff options
author | Andriy Voskoboinyk <avos@FreeBSD.org> | 2017-03-03 01:06:27 +0000 |
---|---|---|
committer | Andriy Voskoboinyk <avos@FreeBSD.org> | 2017-03-03 01:06:27 +0000 |
commit | dfabbaa0e030669f8ccddb4d52e85e96e8fcf39c (patch) | |
tree | 65068da874772f9a391680aaaf06aa2ce6fcfc40 /sys/net80211/ieee80211.c | |
parent | 0132c9cd4ac9a4cf86ff858e22cab39fc446ba93 (diff) | |
download | src-dfabbaa0e030669f8ccddb4d52e85e96e8fcf39c.tar.gz src-dfabbaa0e030669f8ccddb4d52e85e96e8fcf39c.zip |
net80211: fix ieee80211_htrateset setup, return EINVAL for an unsupported
ucast/mcast/mgmt HT rate.
- Init global ieee80211_htrateset only once; neither ic_htcaps nor
ic_txstream is changed when device is attached;
- Move global ieee80211_htrateset structure to ieee80211com;
there was a possible data race when more than 1 wireless device is
used simultaneously;
- Discard unsupported rates in ieee80211_ioctl_settxparams(); otherwise,
an unsupported value may break connectivity (actually,
'ifconfig wlan0 ucastrate 8' for RTL8188EU results in immediate
disconnect + infinite 'device timeout's after it).
Tested with:
- Intel 6205, STA mode.
- RTL8821AU, STA mode.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9871
Notes
Notes:
svn path=/head/; revision=314575
Diffstat (limited to 'sys/net80211/ieee80211.c')
-rw-r--r-- | sys/net80211/ieee80211.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 77b5513f3902..05939f100fc1 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -242,6 +242,8 @@ ieee80211_chan_init(struct ieee80211com *ic) if (ic->ic_txstream == 0) ic->ic_txstream = 2; + ieee80211_init_suphtrates(ic); + /* * Set auto mode to reset active channel state and any desired channel. */ @@ -1905,6 +1907,14 @@ ieee80211_get_suprates(struct ieee80211com *ic, const struct ieee80211_channel * return &ic->ic_sup_rates[ieee80211_chan2mode(c)]; } +/* XXX inline or eliminate? */ +const struct ieee80211_htrateset * +ieee80211_get_suphtrates(struct ieee80211com *ic, + const struct ieee80211_channel *c) +{ + return &ic->ic_sup_htrates; +} + void ieee80211_announce(struct ieee80211com *ic) { |