ath11k: support TXOP duration based RTS threshold
authorPradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Tue, 20 Oct 2020 18:31:10 +0000 (11:31 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 9 Dec 2020 07:04:42 +0000 (09:04 +0200)
HE operation IE in beacons is constructed based on userspace params,
which firmware might not be aware of. This causes firmware not to
configure TXOP duration based RTS threshold which could cause mismatch
in behaviour with respect to what is being advertised in beacons. This
patch sends HE operation IE fetched from beacon to firmware using
WMI interface for configuration.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201020183111.25458-4-pradeepc@codeaurora.org
drivers/net/wireless/ath/ath11k/mac.c

index 12cc160..e8b0b66 100644 (file)
@@ -1969,9 +1969,25 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
        if (changed & BSS_CHANGED_BSSID && !is_zero_ether_addr(info->bssid))
                ether_addr_copy(arvif->bssid, info->bssid);
 
-       if (changed & BSS_CHANGED_BEACON_ENABLED)
+       if (changed & BSS_CHANGED_BEACON_ENABLED) {
                ath11k_control_beaconing(arvif, info);
 
+               if (arvif->is_up && vif->bss_conf.he_support &&
+                   vif->bss_conf.he_oper.params) {
+                       param_id = WMI_VDEV_PARAM_HEOPS_0_31;
+                       param_value = vif->bss_conf.he_oper.params;
+                       ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
+                                                           param_id, param_value);
+                       ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
+                                  "he oper param: %x set for VDEV: %d\n",
+                                  param_value, arvif->vdev_id);
+
+                       if (ret)
+                               ath11k_warn(ar->ab, "Failed to set he oper params %x for VDEV %d: %i\n",
+                                           param_value, arvif->vdev_id, ret);
+               }
+       }
+
        if (changed & BSS_CHANGED_ERP_CTS_PROT) {
                u32 cts_prot;