5ffec9a21cb099e0968f6fdc5a9426682e8f34ba
[openwrt/staging/wigyori.git] / package / kernel / ath10k-ct / patches / 163-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch
1 From: Pradeep kumar Chitrapu <pradeepc@codeaurora.org>
2 Date: Mon, 10 Dec 2018 20:56:11 -0800
3 Subject: ath10k: fix incorrect multicast/broadcast rate setting
4
5 Invalid rate code is sent to firmware when multicast rate value of 0 is
6 sent to driver indicating disabled case, causing broken mesh path.
7 so fix that.
8
9 Tested on QCA9984 with firmware 10.4-3.6.1-00827
10
11 Fixes: cd93b83ad92 ("ath10k: support for multicast rate control")
12 Co-developed-by: Zhi Chen <zhichen@codeaurora.org>
13 Signed-off-by: Zhi Chen <zhichen@codeaurora.org>
14 Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
15
16 Origin: other, https://patchwork.kernel.org/patch/10723033/
17
18 --- a/ath10k-4.19/mac.c
19 +++ b/ath10k-4.19/mac.c
20 @@ -6264,8 +6264,8 @@ static void ath10k_bss_info_changed(stru
21 struct cfg80211_chan_def def;
22 u32 vdev_param, pdev_param, slottime, preamble;
23 u16 bitrate, hw_value;
24 - u8 rate, basic_rate_idx;
25 - int rateidx, ret = 0, hw_rate_code;
26 + u8 rate, basic_rate_idx, rateidx;
27 + int ret = 0, hw_rate_code, mcast_rate;
28 enum nl80211_band band;
29 const struct ieee80211_supported_band *sband;
30
31 @@ -6438,7 +6438,11 @@ static void ath10k_bss_info_changed(stru
32 if (changed & BSS_CHANGED_MCAST_RATE &&
33 !WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
34 band = def.chan->band;
35 - rateidx = vif->bss_conf.mcast_rate[band] - 1;
36 + mcast_rate = vif->bss_conf.mcast_rate[band];
37 + if (mcast_rate > 0)
38 + rateidx = mcast_rate - 1;
39 + else
40 + rateidx = ffs(vif->bss_conf.basic_rates) - 1;
41
42 if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY)
43 rateidx += ATH10K_MAC_FIRST_OFDM_RATE_IDX;