979-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch 1.6 KB

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