From dfabbaa0e030669f8ccddb4d52e85e96e8fcf39c Mon Sep 17 00:00:00 2001 From: Andriy Voskoboinyk Date: Fri, 3 Mar 2017 01:06:27 +0000 Subject: 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 --- sys/net80211/ieee80211_var.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/net80211/ieee80211_var.h') diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 7c972944a76b..175d95fc6444 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -175,6 +175,7 @@ struct ieee80211com { uint16_t ic_holdover; /* PM hold over duration */ uint16_t ic_txpowlimit; /* global tx power limit */ struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX]; + struct ieee80211_htrateset ic_sup_htrates; /* * Channel state: @@ -692,6 +693,8 @@ int ieee80211_vap_attach(struct ieee80211vap *, void ieee80211_vap_detach(struct ieee80211vap *); const struct ieee80211_rateset *ieee80211_get_suprates(struct ieee80211com *ic, const struct ieee80211_channel *); +const struct ieee80211_htrateset *ieee80211_get_suphtrates( + struct ieee80211com *, const struct ieee80211_channel *); void ieee80211_announce(struct ieee80211com *); void ieee80211_announce_channels(struct ieee80211com *); void ieee80211_drain(struct ieee80211com *); -- cgit v1.2.3