diff mbox series

wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID

Message ID 20240131021832.17298-1-quic_bqiang@quicinc.com (mailing list archive)
State Accepted
Commit 413e20e82ee78f142cb5194fd317db514f012602
Delegated to: Kalle Valo
Headers show
Series wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID | expand

Commit Message

Baochen Qiang Jan. 31, 2024, 2:18 a.m. UTC
From: Wen Gong <quic_wgong@quicinc.com>

Currently when connecting to an AP with 11AX-HE phy mode, host sends
WMI_VDEV_PARAM_SET_HEMU_MODE parameter to firmware after
WMI_PEER_ASSOC_CMDID command. This results in TXBF not working, because
firmware calculates TXBF values while handling WMI_PEER_ASSOC_CMDID,
however at that time WMI_VDEV_PARAM_SET_HEMU_MODE has not been sent yet.
See below log:

AP sends "VHT/HE/EHT NDP Announcement" to station, and station sends
"Action no Ack" of category code HE to AP, the "Nc Index" and
"Codebook Information" are wrong:

Issued action:
IEEE 802.11 Action No Ack, Flags: ........
IEEE 802.11 wireless LAN
    Fixed parameters
        Category code: HE (30)
        HE Action: HE Compressed Beamforming And CQI (0)
            Total length: 152
            HE MIMO Control: 0x0004008018
                .... .... .... .... .... .... .... .... .... .000 = Nc Index: 1 Column (0)
                .... .... .... .... .... .... .... ..0. .... .... = Codebook Information: 0

Change to send WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID,
then firmware will calculate the TXBF values with valid parameters
instead of empty values. TXBF works well and throughput performance is
improved from 80 Mbps to 130 Mbps with this patch.

Good action after this patch:
IEEE 802.11 Action No Ack, Flags: ........
IEEE 802.11 wireless LAN
    Fixed parameters
        Category code: HE (30)
        HE Action: HE Compressed Beamforming And CQI (0)
            Total length: 409
            HE MIMO Control: 0x0004008219
                .... .... .... .... .... .... .... .... .... .001 = Nc Index: 2 Columns (1)
                .... .... .... .... .... .... .... ..1. .... .... = Codebook Information: 1

This change applies to all chipsets.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23

Fixes: 38dfe775d0ab ("wifi: ath11k: push MU-MIMO params from hostapd to hardware")
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)


base-commit: 17f4b952f067b1f87d14e6df4c8c216fe7a245d1

Comments

Jeff Johnson Jan. 31, 2024, 5:22 p.m. UTC | #1
On 1/30/2024 6:18 PM, Baochen Qiang wrote:
> From: Wen Gong <quic_wgong@quicinc.com>
> 
> Currently when connecting to an AP with 11AX-HE phy mode, host sends
> WMI_VDEV_PARAM_SET_HEMU_MODE parameter to firmware after
> WMI_PEER_ASSOC_CMDID command. This results in TXBF not working, because
> firmware calculates TXBF values while handling WMI_PEER_ASSOC_CMDID,
> however at that time WMI_VDEV_PARAM_SET_HEMU_MODE has not been sent yet.
> See below log:
> 
> AP sends "VHT/HE/EHT NDP Announcement" to station, and station sends
> "Action no Ack" of category code HE to AP, the "Nc Index" and
> "Codebook Information" are wrong:
> 
> Issued action:
> IEEE 802.11 Action No Ack, Flags: ........
> IEEE 802.11 wireless LAN
>     Fixed parameters
>         Category code: HE (30)
>         HE Action: HE Compressed Beamforming And CQI (0)
>             Total length: 152
>             HE MIMO Control: 0x0004008018
>                 .... .... .... .... .... .... .... .... .... .000 = Nc Index: 1 Column (0)
>                 .... .... .... .... .... .... .... ..0. .... .... = Codebook Information: 0
> 
> Change to send WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID,
> then firmware will calculate the TXBF values with valid parameters
> instead of empty values. TXBF works well and throughput performance is
> improved from 80 Mbps to 130 Mbps with this patch.
> 
> Good action after this patch:
> IEEE 802.11 Action No Ack, Flags: ........
> IEEE 802.11 wireless LAN
>     Fixed parameters
>         Category code: HE (30)
>         HE Action: HE Compressed Beamforming And CQI (0)
>             Total length: 409
>             HE MIMO Control: 0x0004008219
>                 .... .... .... .... .... .... .... .... .... .001 = Nc Index: 2 Columns (1)
>                 .... .... .... .... .... .... .... ..1. .... .... = Codebook Information: 1
> 
> This change applies to all chipsets.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Fixes: 38dfe775d0ab ("wifi: ath11k: push MU-MIMO params from hostapd to hardware")
> Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Kalle Valo Feb. 2, 2024, 11:41 a.m. UTC | #2
Baochen Qiang <quic_bqiang@quicinc.com> wrote:

> Currently when connecting to an AP with 11AX-HE phy mode, host sends
> WMI_VDEV_PARAM_SET_HEMU_MODE parameter to firmware after
> WMI_PEER_ASSOC_CMDID command. This results in TXBF not working, because
> firmware calculates TXBF values while handling WMI_PEER_ASSOC_CMDID,
> however at that time WMI_VDEV_PARAM_SET_HEMU_MODE has not been sent yet.
> See below log:
> 
> AP sends "VHT/HE/EHT NDP Announcement" to station, and station sends
> "Action no Ack" of category code HE to AP, the "Nc Index" and
> "Codebook Information" are wrong:
> 
> Issued action:
> IEEE 802.11 Action No Ack, Flags: ........
> IEEE 802.11 wireless LAN
>     Fixed parameters
>         Category code: HE (30)
>         HE Action: HE Compressed Beamforming And CQI (0)
>             Total length: 152
>             HE MIMO Control: 0x0004008018
>                 .... .... .... .... .... .... .... .... .... .000 = Nc Index: 1 Column (0)
>                 .... .... .... .... .... .... .... ..0. .... .... = Codebook Information: 0
> 
> Change to send WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID,
> then firmware will calculate the TXBF values with valid parameters
> instead of empty values. TXBF works well and throughput performance is
> improved from 80 Mbps to 130 Mbps with this patch.
> 
> Good action after this patch:
> IEEE 802.11 Action No Ack, Flags: ........
> IEEE 802.11 wireless LAN
>     Fixed parameters
>         Category code: HE (30)
>         HE Action: HE Compressed Beamforming And CQI (0)
>             Total length: 409
>             HE MIMO Control: 0x0004008219
>                 .... .... .... .... .... .... .... .... .... .001 = Nc Index: 2 Columns (1)
>                 .... .... .... .... .... .... .... ..1. .... .... = Codebook Information: 1
> 
> This change applies to all chipsets.
> 
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Fixes: 38dfe775d0ab ("wifi: ath11k: push MU-MIMO params from hostapd to hardware")
> Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

413e20e82ee7 wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index bbf4d1f4d310..df1b1ee71881 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3023,7 +3023,14 @@  static void ath11k_bss_assoc(struct ieee80211_hw *hw,
 
 	rcu_read_unlock();
 
+	if (!ath11k_mac_vif_recalc_sta_he_txbf(ar, vif, &he_cap)) {
+		ath11k_warn(ar->ab, "failed to recalc he txbf for vdev %i on bss %pM\n",
+			    arvif->vdev_id, bss_conf->bssid);
+		return;
+	}
+
 	peer_arg.is_assoc = true;
+
 	ret = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n",
@@ -3046,12 +3053,6 @@  static void ath11k_bss_assoc(struct ieee80211_hw *hw,
 		return;
 	}
 
-	if (!ath11k_mac_vif_recalc_sta_he_txbf(ar, vif, &he_cap)) {
-		ath11k_warn(ar->ab, "failed to recalc he txbf for vdev %i on bss %pM\n",
-			    arvif->vdev_id, bss_conf->bssid);
-		return;
-	}
-
 	WARN_ON(arvif->is_up);
 
 	arvif->aid = vif->cfg.aid;