ath5k: channel change fix
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 322-mac80211-add-more-missing-checks-for-VHT-tx-rates.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Fri, 21 Nov 2014 23:27:33 +0100
3 Subject: [PATCH] mac80211: add more missing checks for VHT tx rates
4
5 Fixes a crash on attempting to calculate the frame duration for a VHT
6 packet (which needs to be handled by hw/driver instead).
7
8 Reported-by: Jouni Malinen <j@w1.fi>
9 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
10 ---
11
12 --- a/net/mac80211/rate.c
13 +++ b/net/mac80211/rate.c
14 @@ -446,7 +446,8 @@ static void rate_fixup_ratelist(struct i
15 *
16 * XXX: Should this check all retry rates?
17 */
18 - if (!(rates[0].flags & IEEE80211_TX_RC_MCS)) {
19 + if (!(rates[0].flags &
20 + (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))) {
21 u32 basic_rates = vif->bss_conf.basic_rates;
22 s8 baserate = basic_rates ? ffs(basic_rates) - 1 : 0;
23
24 --- a/net/mac80211/tx.c
25 +++ b/net/mac80211/tx.c
26 @@ -60,7 +60,7 @@ static __le16 ieee80211_duration(struct
27 rcu_read_unlock();
28
29 /* assume HW handles this */
30 - if (tx->rate.flags & IEEE80211_TX_RC_MCS)
31 + if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS))
32 return 0;
33
34 /* uh huh? */