wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/228-ath11k-fix-rssi-station-dump-not-updated-in-qcn9000.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

156 lines
5.9 KiB
Diff

From 2321888a0f07a22af896313ea93d2470546c12f5 Mon Sep 17 00:00:00 2001
From: P Praneesh <ppranees@codeaurora.org>
Date: Fri, 20 Nov 2020 16:03:47 +0530
Subject: [PATCH] ath11k: fix rssi station dump not updated in qcn9000
In qcn9000, station dump signal values displays default
-95 dbm, Since there is firmware header change for
HAL_RX_MPDU_START between qcn9000 and qca8074 which
cause wrong peer_id fetch from msdu. Fixed this
by update hal_rx_mpdu_info with corresponding
qcn9000 tlv format.
Signed-off-by: P Praneesh <ppranees@codeaurora.org>
---
drivers/net/wireless/ath/ath11k/hal_rx.c | 20 +++++++++++++----
drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++++++-
drivers/net/wireless/ath/ath11k/hw.c | 38 ++++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath11k/hw.h | 3 +++
4 files changed, 73 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
@@ -1540,8 +1540,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
if (peer_id)
ppdu_info->peer_id = peer_id;
- ppdu_info->mpdu_len += FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN,
- __le32_to_cpu(mpdu_info->info1));
+ ppdu_info->mpdu_len += ab->hw_params.hw_ops->rx_desc_get_hal_mpdu_len(tlv_data);
break;
}
case HAL_RXPCU_PPDU_END_INFO: {
--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
@@ -501,6 +501,14 @@ struct hal_rx_mpdu_info_wcn6855 {
__le32 rsvd1[14];
} __packed;
+struct hal_rx_mpdu_info_qcn9074 {
+ __le32 rsvd0[10];
+ __le32 info0;
+ __le32 rsvd1[2];
+ __le32 info1;
+ __le32 rsvd2[9];
+} __packed;
+
#define HAL_RX_PPDU_END_DURATION GENMASK(23, 0)
struct hal_rx_ppdu_end_duration {
__le32 rsvd0[9];
--- a/drivers/net/wireless/ath/ath11k/hw.c
+++ b/drivers/net/wireless/ath/ath11k/hw.c
@@ -883,6 +883,16 @@ static u16 ath11k_hw_ipq8074_mpdu_info_g
return peer_id;
}
+static
+u32 ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len(u8 *tlv_data)
+{
+ struct hal_rx_mpdu_info *mpdu_info =
+ (struct hal_rx_mpdu_info *)tlv_data;
+
+ return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN,
+ __le32_to_cpu(mpdu_info->u.ipq8074.info1));
+}
+
static u16 ath11k_hw_wcn6855_mpdu_info_get_peerid(u8 *tlv_data)
{
u16 peer_id = 0;
@@ -900,6 +910,26 @@ static bool ath11k_hw_wcn6855_rx_desc_ge
__le32_to_cpu(desc->u.wcn6855.msdu_start.info2));
}
+static u16 ath11k_hw_qcn9074_mpdu_info_get_peerid(u8 *tlv_data)
+{
+ struct hal_rx_mpdu_info_qcn9074 *mpdu_info =
+ (struct hal_rx_mpdu_info_qcn9074 *)tlv_data;
+
+ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID,
+ __le32_to_cpu(mpdu_info->u.qcn9074.info0));
+}
+
+static
+u32 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len(u8 *tlv_data)
+{
+ struct hal_rx_mpdu_info_qcn9074 *mpdu_info =
+ (struct hal_rx_mpdu_info_qcn9074 *)tlv_data;
+
+ return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN,
+ __le32_to_cpu(mpdu_info->u.qcn9074.info1));
+}
+
+
static void ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring(struct ath11k_base *ab)
{
u8 frag_dst_ring = HAL_SRNG_RING_ID_REO2SW1;
@@ -1003,6 +1033,7 @@ const struct ath11k_hw_ops ipq8074_ops =
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
.set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
.get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
};
const struct ath11k_hw_ops ipq6018_ops = {
@@ -1044,6 +1075,7 @@ const struct ath11k_hw_ops ipq6018_ops =
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
.set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
.get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
};
const struct ath11k_hw_ops qca6390_ops = {
@@ -1085,6 +1117,7 @@ const struct ath11k_hw_ops qca6390_ops =
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
.set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
.get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
};
const struct ath11k_hw_ops qcn9074_ops = {
@@ -1126,6 +1159,8 @@ const struct ath11k_hw_ops qcn9074_ops =
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
.set_rx_fragmentation_dst_ring = ath11k_hw_ipq8074_set_rx_fragmentation_dst_ring,
.get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
+ .mpdu_info_get_peerid = ath11k_hw_qcn9074_mpdu_info_get_peerid,
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len,
};
const struct ath11k_hw_ops wcn6855_ops = {
@@ -1167,6 +1202,7 @@ const struct ath11k_hw_ops wcn6855_ops =
.rx_desc_mpdu_start_addr2 = ath11k_hw_wcn6855_rx_desc_mpdu_start_addr2,
.set_rx_fragmentation_dst_ring = ath11k_hw_wcn6855_set_rx_fragmentation_dst_ring,
.get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_default,
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
};
const struct ath11k_hw_ops wcn6750_ops = {
@@ -1247,6 +1283,8 @@ const struct ath11k_hw_ops ipq5018_ops =
.reo_setup = ath11k_hw_ipq5018_reo_setup,
.set_rx_fragmentation_dst_ring = ath11k_hw_ipq5018_set_rx_fragmentation_dst_ring,
.get_reo_dest_remap_config = ath11k_get_reo_dest_remap_config_5018,
+ .mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len,
};
#define ATH11K_TX_RING_MASK_0 0x1
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -265,6 +265,7 @@ struct ath11k_hw_ops {
u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc);
void (*set_rx_fragmentation_dst_ring)(struct ath11k_base *ab);
u32 (*get_reo_dest_remap_config)(void);
+ u32 (*rx_desc_get_hal_mpdu_len) (u8 *tlv_data);
};
extern const struct ath11k_hw_ops ipq8074_ops;