]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: ath12k: fix ack signal strength calculation
authorLingbo Kong <quic_lingbok@quicinc.com>
Thu, 16 May 2024 08:30:44 +0000 (11:30 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Fri, 17 May 2024 06:56:54 +0000 (09:56 +0300)
Currently, the calculation of ack signal strength is incorrect.

This is because before calculating the ack signal strength, ath12k need
to determine whether the hardware and firmware support db2dbm. If the
hardware and firmware support db2dbm, do not need to add noise floor,
otherwise, need to add noise floor.

Besides, the value of ack_rssi passed by firmware to ath12k should be a
signed number, so change its type to s8.

This patch affects QCN9274 and WCN7850 because they have the same issue.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240511030917.65811-1-quic_lingbok@quicinc.com
drivers/net/wireless/ath/ath12k/dp_tx.c
drivers/net/wireless/ath/ath12k/dp_tx.h
drivers/net/wireless/ath/ath12k/hal_tx.h

index 32496015cf9a14455456f9f199c04adc2ae4c2d1..f57bc8d69715ede2436740bc46b26e74109f2b7b 100644 (file)
@@ -393,8 +393,12 @@ ath12k_dp_tx_htt_tx_complete_buf(struct ath12k_base *ab,
        if (ts->acked) {
                if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
                        info->flags |= IEEE80211_TX_STAT_ACK;
-                       info->status.ack_signal = ATH12K_DEFAULT_NOISE_FLOOR +
-                                                 ts->ack_rssi;
+                       info->status.ack_signal = ts->ack_rssi;
+
+                       if (!test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
+                                     ab->wmi_ab.svc_map))
+                               info->status.ack_signal += ATH12K_DEFAULT_NOISE_FLOOR;
+
                        info->status.flags = IEEE80211_TX_STATUS_ACK_SIGNAL_VALID;
                } else {
                        info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
@@ -486,8 +490,12 @@ static void ath12k_dp_tx_complete_msdu(struct ath12k *ar,
        case HAL_WBM_TQM_REL_REASON_FRAME_ACKED:
                if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
                        info->flags |= IEEE80211_TX_STAT_ACK;
-                       info->status.ack_signal = ATH12K_DEFAULT_NOISE_FLOOR +
-                                                 ts->ack_rssi;
+                       info->status.ack_signal = ts->ack_rssi;
+
+                       if (!test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
+                                     ab->wmi_ab.svc_map))
+                               info->status.ack_signal += ATH12K_DEFAULT_NOISE_FLOOR;
+
                        info->status.flags = IEEE80211_TX_STATUS_ACK_SIGNAL_VALID;
                }
                break;
index 7faa81faf6a72bf5f7dea496e57c06632cdcd669..55ff8cc721e37f68967142941c11be77c1fc783c 100644 (file)
@@ -12,7 +12,7 @@
 
 struct ath12k_dp_htt_wbm_tx_status {
        bool acked;
-       int ack_rssi;
+       s8 ack_rssi;
 };
 
 int ath12k_dp_tx_htt_h2t_ver_req_msg(struct ath12k_base *ab);
index 7c837094a6f798e00fb628482d65961c61e03582..3cf5973771d78d0663fe300a627fdd2cf4399f70 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef ATH12K_HAL_TX_H
@@ -57,7 +57,7 @@ struct hal_tx_info {
 struct hal_tx_status {
        enum hal_wbm_rel_src_module buf_rel_source;
        enum hal_wbm_tqm_rel_reason status;
-       u8 ack_rssi;
+       s8 ack_rssi;
        u32 flags; /* %HAL_TX_STATUS_FLAGS_ */
        u32 ppdu_id;
        u8 try_cnt;