Search Linux Wireless

[PATCH 3.12 3/3] mac80211: sanity check WMM/QoS parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

Check for invalid WMM parameters (AIFSN < 2 or CWmax < CWmin)
and try to set them to usable values in this case.

Notably the Sitecom WL-153 v1 with firmware 1.45 is sending
AIFSN, ECWmin and ECWmax as all zero.

Reported-and-tested-by: Antonio Quartulli <antonio@xxxxxxxxxxxxxx>
Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 net/mac80211/mlme.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 86e4ad5..058ae1c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1598,6 +1598,7 @@ static bool ieee80211_sta_wmm_params(struct ieee80211_local *local,
 	int count;
 	const u8 *pos;
 	u8 uapsd_queues = 0;
+	static const u8 default_aifs[] = { 2, 2, 3, 7 };
 
 	if (!local->ops->conf_tx)
 		return false;
@@ -1664,8 +1665,12 @@ static bool ieee80211_sta_wmm_params(struct ieee80211_local *local,
 		}
 
 		params.aifs = pos[0] & 0x0f;
+		if (params.aifs < 2)
+			params.aifs = default_aifs[queue];
 		params.cw_max = ecw2cw((pos[1] & 0xf0) >> 4);
 		params.cw_min = ecw2cw(pos[1] & 0x0f);
+		if (params.cw_max < params.cw_min)
+			params.cw_max = params.cw_min;
 		params.txop = get_unaligned_le16(pos + 2);
 		params.acm = acm;
 		params.uapsd = uapsd;
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux