mirror of
https://github.com/optim-enterprises-bv/openwrt-ipq.git
synced 2025-10-30 17:58:28 +00:00
ath11k_nss: revert AMPDU in radiotap header
Causes issues with rate stats on IPQ9074 Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
@@ -1,279 +0,0 @@
|
||||
From 3f962ed9a4079964c48e321fd928a2719038d881 Mon Sep 17 00:00:00 2001
|
||||
From: P Praneesh <ppranees@codeaurora.org>
|
||||
Date: Fri, 28 May 2021 23:53:57 +0530
|
||||
Subject: [PATCH] ath11k: add ampdu id in 802.11 radiotap header
|
||||
|
||||
AMPDU aggregate reference number is generated by
|
||||
driver internally which is same across each
|
||||
subframe of an ampdu.
|
||||
|
||||
For fetching AMPDU-ID, we need to concatenate
|
||||
ppdu_id from mpdu_info and tlv_usr from tlv heder.
|
||||
while parsing monitor TLV data with HAL_RX_MPDU_START
|
||||
TLV tag, ampdu id is fetched from mpdu_info and
|
||||
updated to corresponding mac80211 structure during
|
||||
ath11k_update_radiotap.
|
||||
|
||||
Signed-off-by: P Praneesh <ppranees@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.c | 6 ++++++
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.c | 13 ++++++++++++
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.h | 16 ++++++++------
|
||||
drivers/net/wireless/ath/ath11k/hw.c | 36 +++++++++++++++++++++++++-------
|
||||
drivers/net/wireless/ath/ath11k/hw.h | 1 +
|
||||
5 files changed, 58 insertions(+), 14 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -5995,6 +5995,7 @@ static void ath11k_update_radiotap(struc
|
||||
{
|
||||
struct ieee80211_supported_band *sband;
|
||||
u8 *ptr = NULL;
|
||||
+ u16 ampdu_id = ppduinfo->ampdu_id[ppduinfo->userid];
|
||||
|
||||
rxs->flag |= RX_FLAG_MACTIME_START;
|
||||
rxs->signal = ppduinfo->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR;
|
||||
@@ -6002,6 +6003,11 @@ static void ath11k_update_radiotap(struc
|
||||
if (ppduinfo->nss)
|
||||
rxs->nss = ppduinfo->nss;
|
||||
|
||||
+ if (ampdu_id) {
|
||||
+ rxs->flag |= RX_FLAG_AMPDU_DETAILS;
|
||||
+ rxs->ampdu_reference = ampdu_id;
|
||||
+ }
|
||||
+
|
||||
if (ppduinfo->he_mu_flags) {
|
||||
rxs->flag |= RX_FLAG_RADIOTAP_HE_MU;
|
||||
rxs->encoding = RX_ENC_HE;
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
|
||||
@@ -873,6 +873,13 @@ static u16 ath11k_hal_rx_mpduinfo_get_pe
|
||||
return ab->hw_params.hw_ops->mpdu_info_get_peerid(mpdu_info);
|
||||
}
|
||||
|
||||
+static
|
||||
+u16 ath11k_hal_rxdesc_get_hal_mpdu_ppdu_id(struct ath11k_base *ab,
|
||||
+ struct hal_rx_mpdu_info *mpdu_info)
|
||||
+{
|
||||
+ return ab->hw_params.hw_ops->rx_desc_get_hal_ppdu_id(mpdu_info);
|
||||
+}
|
||||
+
|
||||
static enum hal_rx_mon_status
|
||||
ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info,
|
||||
@@ -1546,6 +1553,12 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
|
||||
|
||||
ppdu_info->mpdu_len += ab->hw_params.hw_ops->rx_desc_get_hal_mpdu_len(mpdu_info);
|
||||
|
||||
+ if (userid < HAL_MAX_UL_MU_USERS) {
|
||||
+ ppdu_info->userid = userid;
|
||||
+ ppdu_info->ampdu_id[userid] =
|
||||
+ ath11k_hal_rxdesc_get_hal_mpdu_ppdu_id(ab, mpdu_info);
|
||||
+ }
|
||||
+
|
||||
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
|
||||
@@ -221,6 +221,8 @@ struct hal_rx_mon_ppdu_info {
|
||||
u32 num_users;
|
||||
u32 mpdu_fcs_ok_bitmap[HAL_RX_NUM_WORDS_PER_PPDU_BITMAP];
|
||||
struct hal_rx_user_status userstats[HAL_MAX_UL_MU_USERS];
|
||||
+ u8 userid;
|
||||
+ u16 ampdu_id[HAL_MAX_UL_MU_USERS];
|
||||
bool ppdu_continuation;
|
||||
};
|
||||
|
||||
@@ -460,20 +462,22 @@ struct hal_rx_phyrx_rssi_legacy_info {
|
||||
#define HAL_RX_MPDU_INFO_INFO0_PEERID GENMASK(31, 16)
|
||||
#define HAL_RX_MPDU_INFO_INFO0_PEERID_WCN6855 GENMASK(15, 0)
|
||||
#define HAL_RX_MPDU_INFO_INFO1_MPDU_LEN GENMASK(13, 0)
|
||||
+#define HAL_RX_MPDU_INFO_INFO0_PPDU_ID GENMASK(31, 16)
|
||||
|
||||
struct hal_rx_mpdu_info_ipq8074 {
|
||||
- __le32 rsvd0;
|
||||
__le32 info0;
|
||||
- __le32 rsvd1[11];
|
||||
__le32 info1;
|
||||
+ __le32 rsvd1[11];
|
||||
+ __le32 info2;
|
||||
__le32 rsvd2[9];
|
||||
} __packed;
|
||||
|
||||
struct hal_rx_mpdu_info_qcn9074 {
|
||||
- __le32 rsvd0[10];
|
||||
+ __le32 rsvd0[9];
|
||||
__le32 info0;
|
||||
- __le32 rsvd1[2];
|
||||
__le32 info1;
|
||||
+ __le32 rsvd1[2];
|
||||
+ __le32 info2;
|
||||
__le32 rsvd2[9];
|
||||
} __packed;
|
||||
|
||||
@@ -493,9 +497,11 @@ struct hal_rx_mpdu_info {
|
||||
|
||||
#define HAL_RX_PPDU_END_DURATION GENMASK(23, 0)
|
||||
struct hal_rx_ppdu_end_duration {
|
||||
- __le32 rsvd0[9];
|
||||
+ __le32 rsvd0[2];
|
||||
__le32 info0;
|
||||
- __le32 rsvd1[4];
|
||||
+ __le32 rsvd1[6];
|
||||
+ __le32 info1;
|
||||
+ __le32 rsvd2[4];
|
||||
} __packed;
|
||||
|
||||
struct hal_rx_rxpcu_classification_overview {
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -307,6 +307,7 @@ struct ath11k_hw_ops {
|
||||
void (*rx_desc_get_crypto_header)(struct hal_rx_desc *desc,
|
||||
u8 *crypto_hdr,
|
||||
enum hal_encrypt_type enctype);
|
||||
+ u16 (*rx_desc_get_hal_ppdu_id) (struct hal_rx_mpdu_info *mpdu_info);
|
||||
};
|
||||
|
||||
extern const struct ath11k_hw_ops ipq8074_ops;
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.c
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "hif.h"
|
||||
#include "hal.h"
|
||||
#include "hw.h"
|
||||
+#include "hal_rx.h"
|
||||
|
||||
/* Map from pdev index to hw mac index */
|
||||
static u8 ath11k_hw_ipq8074_mac_from_pdev_id(int pdev_idx)
|
||||
@@ -717,17 +718,6 @@ static u8 *ath11k_hw_qcn9074_rx_desc_get
|
||||
return &desc->u.qcn9074.msdu_payload[0];
|
||||
}
|
||||
|
||||
-static bool ath11k_hw_ipq9074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc)
|
||||
-{
|
||||
- return __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) &
|
||||
- RX_MPDU_START_INFO11_MAC_ADDR2_VALID;
|
||||
-}
|
||||
-
|
||||
-static u8 *ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc)
|
||||
-{
|
||||
- return desc->u.qcn9074.mpdu_start.addr2;
|
||||
-}
|
||||
-
|
||||
static bool ath11k_hw_wcn6855_rx_desc_get_first_msdu(struct hal_rx_desc *desc)
|
||||
{
|
||||
return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU_WCN6855,
|
||||
@@ -1085,12 +1075,27 @@ static void ath11k_hw_ipq5018_reo_setup(
|
||||
}
|
||||
|
||||
static u16
|
||||
+ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id(struct hal_rx_mpdu_info *mpdu_info)
|
||||
+{
|
||||
+
|
||||
+ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PPDU_ID,
|
||||
+ __le32_to_cpu(mpdu_info->u.ipq8074.info0));
|
||||
+}
|
||||
+
|
||||
+static
|
||||
+u16 ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id(struct hal_rx_mpdu_info *mpdu_info)
|
||||
+{
|
||||
+
|
||||
+ return FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PPDU_ID,
|
||||
+ __le32_to_cpu(mpdu_info->u.qcn9074.info0));
|
||||
+}
|
||||
+
|
||||
+static u16
|
||||
ath11k_hw_ipq8074_mpdu_info_get_peerid(struct hal_rx_mpdu_info *mpdu_info)
|
||||
{
|
||||
u16 peer_id = 0;
|
||||
-
|
||||
peer_id = FIELD_GET(HAL_RX_MPDU_INFO_INFO0_PEERID,
|
||||
- __le32_to_cpu(mpdu_info->u.ipq8074.info0));
|
||||
+ __le32_to_cpu(mpdu_info->u.ipq8074.info1));
|
||||
|
||||
return peer_id;
|
||||
}
|
||||
@@ -1196,6 +1201,7 @@ const struct ath11k_hw_ops ipq8074_ops =
|
||||
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
.rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M
|
||||
.rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset,
|
||||
#endif
|
||||
@@ -1219,6 +1225,7 @@ const struct ath11k_hw_ops ipq6018_ops =
|
||||
.rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type,
|
||||
.rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type,
|
||||
.rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl,
|
||||
+ .rx_desc_get_ip_valid = ath11k_hw_ipq8074_rx_desc_get_ip_valid,
|
||||
.rx_desc_get_ldpc_support = ath11k_hw_ipq8074_rx_desc_get_ldpc_support,
|
||||
.rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld,
|
||||
.rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid,
|
||||
@@ -1251,6 +1258,7 @@ const struct ath11k_hw_ops ipq6018_ops =
|
||||
.rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid,
|
||||
.rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr,
|
||||
.rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops qca6390_ops = {
|
||||
@@ -1300,6 +1308,7 @@ const struct ath11k_hw_ops qca6390_ops =
|
||||
.rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid,
|
||||
.rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr,
|
||||
.rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops qcn9074_ops = {
|
||||
@@ -1341,6 +1350,7 @@ const struct ath11k_hw_ops qcn9074_ops =
|
||||
.rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
.rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M
|
||||
.rx_desc_get_offset = ath11k_hw_qcn9074_rx_desc_get_offset,
|
||||
#endif
|
||||
@@ -1389,6 +1399,7 @@ const struct ath11k_hw_ops wcn6855_ops =
|
||||
.rx_desc_mpdu_start_addr2 = ath11k_hw_wcn6855_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
.rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops wcn6750_ops = {
|
||||
@@ -1405,6 +1416,7 @@ const struct ath11k_hw_ops wcn6750_ops =
|
||||
.rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type,
|
||||
.rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type,
|
||||
.rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl,
|
||||
+ .rx_desc_get_ip_valid = ath11k_hw_qcn9074_rx_desc_get_ip_valid,
|
||||
.rx_desc_get_ldpc_support = ath11k_hw_qcn9074_rx_desc_get_ldpc_support,
|
||||
.rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld,
|
||||
.rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid,
|
||||
@@ -1426,9 +1438,10 @@ const struct ath11k_hw_ops wcn6750_ops =
|
||||
.rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
|
||||
.reo_setup = ath11k_hw_wcn6855_reo_setup,
|
||||
.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
|
||||
- .rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
|
||||
- .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
|
||||
+ .rx_desc_mac_addr2_valid = ath11k_hw_qcn9074_rx_desc_mac_addr2_valid,
|
||||
+ .rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_wcn6750_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
};
|
||||
|
||||
/* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */
|
||||
@@ -1468,10 +1481,11 @@ const struct ath11k_hw_ops ipq5018_ops =
|
||||
.reo_setup = ath11k_hw_ipq5018_reo_setup,
|
||||
.rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
|
||||
.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
|
||||
- .rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
|
||||
- .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
|
||||
+ .rx_desc_mac_addr2_valid = ath11k_hw_qcn9074_rx_desc_mac_addr2_valid,
|
||||
+ .rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
.rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len,
|
||||
+ .rx_desc_get_hal_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_ppdu_id,
|
||||
};
|
||||
|
||||
#define ATH11K_TX_RING_MASK_0 BIT(0)
|
||||
Reference in New Issue
Block a user