All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station
@ 2025-04-17  4:57 Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support Sarika Sharma
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Currently, station statistics are filled at deflink for both non-ML and
multi-link(ML) station.

Hence, add support to fill station statistics for the corresponding
link of station.

Depends-On: [wireless-next,v6,00/11] wifi: cfg80211/mac80211: add support
            to handle per link statistics of multi-link station
Link: https://patchwork.kernel.org/project/linux-wireless/cover/20250415042030.1246187-1-quic_sarishar@quicinc.com/

V5:
 - Removed mac80211 patch from this series and included in dependent series.

V4:
 - Removed driver patches.
 - Added branch tree tag.
 
V3:
 - Fix kernel test robot build error

v2:
 - Convert RFC patch to actual PATCH with each patch bisectable.
 - Add new patch to update bw for ofdma packets.
 - Add new patch to fetch tx_retry and tx_failed packets.

Sarika Sharma (6):
  wifi: ath12k: enable wiphy flag for MLO station statistics support
  wifi: ath12k: correctly fetch arsta for MLO
  wifi: ath12k: add link support for multi-link in arsta
  wifi: ath12k: add EHT support for TX rate
  wifi: ath12k: correctly update bw for ofdma packets
  wifi: ath12k: fetch tx_retry and tx_failed from
    htt_ppdu_stats_user_cmpltn_common_tlv

 drivers/net/wireless/ath/ath12k/core.h   |  2 +
 drivers/net/wireless/ath/ath12k/dp.h     |  2 +
 drivers/net/wireless/ath/ath12k/dp_mon.c | 23 ++++++++----
 drivers/net/wireless/ath/ath12k/dp_rx.c  | 48 +++++++++++++++++++-----
 drivers/net/wireless/ath/ath12k/mac.c    | 17 ++++++++-
 drivers/net/wireless/ath/ath12k/peer.h   | 28 +++++++++++++-
 6 files changed, 102 insertions(+), 18 deletions(-)


base-commit: b80c52642c1159c2596776b39b06eb1c2e36baff
-- 
2.34.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support
  2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
@ 2025-04-17  4:57 ` Sarika Sharma
  2025-04-18  5:25   ` kernel test robot
  2025-04-17  4:57 ` [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO Sarika Sharma
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Set the WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS flag during
hw_register() call to inform upper layer that the driver supports
the per-link station statistics.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index f09abe81cc77..10d4a2166915 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -11461,6 +11461,8 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
 	 */
 	wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT;
 
+	wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS;
+
 	/* Copy over MLO related capabilities received from
 	 * WMI_SERVICE_READY_EXT2_EVENT if single_chip_mlo_supp is set.
 	 */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO
  2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support Sarika Sharma
@ 2025-04-17  4:57 ` Sarika Sharma
  2025-04-18  6:09   ` kernel test robot
  2025-04-17  4:57 ` [PATCH ath-next v5 3/6] wifi: ath12k: add link support for multi-link in arsta Sarika Sharma
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Currently in ath12k_mac_op_sta_statistics(), link sinfo structure
is filled from arsta structure and arsta is fetched from ahsta->deflink.
For both non-ML and multi-link operation (MLO), deflink is used. While
this is correct for non-ML, but the corresponding link_id should be
used for MLO.

Therefore, add support for MLO by taking the link_id from the
link_sinfo structure, fetching arsta from ahsta->link[link_id], and
filling the link_sinfo structure if valid_links.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 10d4a2166915..30643f8db487 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -10503,13 +10503,21 @@ static void ath12k_mac_op_link_sta_statistics(struct ieee80211_hw *hw,
 	struct ath12k_sta *ahsta = ath12k_sta_to_ahsta(sta);
 	struct ath12k_fw_stats_req_params params = {};
 	struct ath12k_link_sta *arsta;
+	int link_id = sinfo->link_id;
 	struct ath12k *ar;
 	s8 signal;
 	bool db2dbm;
 
 	lockdep_assert_wiphy(hw->wiphy);
 
-	arsta = &ahsta->deflink;
+	if (link_id < 0)
+		arsta = &ahsta->deflink;
+	else
+		arsta = wiphy_dereference(hw->wiphy, ahsta->link[link_id]);
+
+	if (!arsta)
+		return;
+
 	ar = ath12k_get_ar_by_vif(hw, vif, arsta->link_id);
 	if (!ar)
 		return;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH ath-next v5 3/6] wifi: ath12k: add link support for multi-link in arsta
  2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO Sarika Sharma
@ 2025-04-17  4:57 ` Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 4/6] wifi: ath12k: add EHT support for TX rate Sarika Sharma
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Currently, statistics in arsta are updated at deflink for both non-ML
and multi-link(ML) station. Link statistics are not updated for
multi-link operation(MLO).

Hence, add support to correctly obtain the link ID if the peer is ML,
fetch the arsta from the appropriate link ID, and update the
statistics in the corresponding arsta.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp_mon.c | 23 +++++++++++++------
 drivers/net/wireless/ath/ath12k/dp_rx.c  | 11 +++++-----
 drivers/net/wireless/ath/ath12k/peer.h   | 28 +++++++++++++++++++++++-
 3 files changed, 49 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 210fda4af5d0..3cc63ba872b5 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -3362,7 +3362,6 @@ ath12k_dp_mon_rx_update_user_stats(struct ath12k *ar,
 				   struct hal_rx_mon_ppdu_info *ppdu_info,
 				   u32 uid)
 {
-	struct ath12k_sta *ahsta;
 	struct ath12k_link_sta *arsta;
 	struct ath12k_rx_peer_stats *rx_stats = NULL;
 	struct hal_rx_user_status *user_stats = &ppdu_info->userstats[uid];
@@ -3380,10 +3379,14 @@ ath12k_dp_mon_rx_update_user_stats(struct ath12k *ar,
 		return;
 	}
 
-	ahsta = ath12k_sta_to_ahsta(peer->sta);
-	arsta = &ahsta->deflink;
-	rx_stats = arsta->rx_stats;
+	arsta = ath12k_peer_get_link_sta(ar->ab, peer);
+	if (!arsta) {
+		ath12k_warn(ar->ab, "link sta not found on peer %pM id %d\n",
+			    peer->addr, peer->peer_id);
+		return;
+	}
 
+	rx_stats = arsta->rx_stats;
 	if (!rx_stats)
 		return;
 
@@ -3496,7 +3499,6 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int *budget,
 	struct dp_srng *mon_dst_ring;
 	struct hal_srng *srng;
 	struct dp_rxdma_mon_ring *buf_ring;
-	struct ath12k_sta *ahsta = NULL;
 	struct ath12k_link_sta *arsta;
 	struct ath12k_peer *peer;
 	struct sk_buff_head skb_list;
@@ -3623,8 +3625,15 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int *budget,
 		}
 
 		if (ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_SU) {
-			ahsta = ath12k_sta_to_ahsta(peer->sta);
-			arsta = &ahsta->deflink;
+			arsta = ath12k_peer_get_link_sta(ar->ab, peer);
+			if (!arsta) {
+				ath12k_warn(ar->ab, "link sta not found on peer %pM id %d\n",
+					    peer->addr, peer->peer_id);
+				spin_unlock_bh(&ab->base_lock);
+				rcu_read_unlock();
+				dev_kfree_skb_any(skb);
+				continue;
+			}
 			ath12k_dp_mon_rx_update_peer_su_stats(ar, arsta,
 							      ppdu_info);
 		} else if ((ppdu_info->fc_valid) &&
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index f746ba3d9571..c2568d02c42e 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -1356,8 +1356,6 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 {
 	struct ath12k_base *ab = ar->ab;
 	struct ath12k_peer *peer;
-	struct ieee80211_sta *sta;
-	struct ath12k_sta *ahsta;
 	struct ath12k_link_sta *arsta;
 	struct htt_ppdu_stats_user_rate *user_rate;
 	struct ath12k_per_peer_tx_stats *peer_stats = &ar->peer_tx_stats;
@@ -1438,9 +1436,12 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 		return;
 	}
 
-	sta = peer->sta;
-	ahsta = ath12k_sta_to_ahsta(sta);
-	arsta = &ahsta->deflink;
+	arsta = ath12k_peer_get_link_sta(ab, peer);
+	if (!arsta) {
+		spin_unlock_bh(&ab->base_lock);
+		rcu_read_unlock();
+		return;
+	}
 
 	memset(&arsta->txrate, 0, sizeof(arsta->txrate));
 
diff --git a/drivers/net/wireless/ath/ath12k/peer.h b/drivers/net/wireless/ath/ath12k/peer.h
index 5870ee11a8c7..3f3e0e025be9 100644
--- a/drivers/net/wireless/ath/ath12k/peer.h
+++ b/drivers/net/wireless/ath/ath12k/peer.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef ATH12K_PEER_H
@@ -90,5 +90,31 @@ struct ath12k_peer *ath12k_peer_find_by_ast(struct ath12k_base *ab, int ast_hash
 int ath12k_peer_ml_create(struct ath12k_hw *ah, struct ieee80211_sta *sta);
 int ath12k_peer_ml_delete(struct ath12k_hw *ah, struct ieee80211_sta *sta);
 int ath12k_peer_mlo_link_peers_delete(struct ath12k_vif *ahvif, struct ath12k_sta *ahsta);
+static inline
+struct ath12k_link_sta *ath12k_peer_get_link_sta(struct ath12k_base *ab,
+						 struct ath12k_peer *peer)
+{
+	struct ath12k_sta *ahsta;
+	struct ath12k_link_sta *arsta;
+
+	if (!peer->sta)
+		return NULL;
+
+	ahsta = ath12k_sta_to_ahsta(peer->sta);
+	if (peer->ml_id & ATH12K_PEER_ML_ID_VALID) {
+		if (!(ahsta->links_map & BIT(peer->link_id))) {
+			ath12k_warn(ab, "peer %pM id %d link_id %d can't found in STA link_map 0x%x\n",
+				    peer->addr, peer->peer_id, peer->link_id,
+				    ahsta->links_map);
+			return NULL;
+		}
+		arsta = rcu_dereference(ahsta->link[peer->link_id]);
+		if (!arsta)
+			return NULL;
+	} else {
+		arsta =  &ahsta->deflink;
+	}
+	return arsta;
+}
 
 #endif /* _PEER_H_ */
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH ath-next v5 4/6] wifi: ath12k: add EHT support for TX rate
  2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
                   ` (2 preceding siblings ...)
  2025-04-17  4:57 ` [PATCH ath-next v5 3/6] wifi: ath12k: add link support for multi-link in arsta Sarika Sharma
@ 2025-04-17  4:57 ` Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 5/6] wifi: ath12k: correctly update bw for ofdma packets Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 6/6] wifi: ath12k: fetch tx_retry and tx_failed from htt_ppdu_stats_user_cmpltn_common_tlv Sarika Sharma
  5 siblings, 0 replies; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Currently, TX rates are not supported for EHT. Hence, add EHT
handling for TX rates and update the EHT-specific fields in arsta
accordingly.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp_rx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index c2568d02c42e..edd3452d659f 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -1474,6 +1474,16 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 		v = ath12k_he_ru_tones_to_nl80211_he_ru_alloc(tones);
 		arsta->txrate.he_ru_alloc = v;
 		break;
+	case WMI_RATE_PREAMBLE_EHT:
+		arsta->txrate.mcs = mcs;
+		arsta->txrate.flags = RATE_INFO_FLAGS_EHT_MCS;
+		arsta->txrate.he_dcm = dcm;
+		arsta->txrate.eht_gi = ath12k_mac_eht_gi_to_nl80211_eht_gi(sgi);
+		tones = le16_to_cpu(user_rate->ru_end) -
+			le16_to_cpu(user_rate->ru_start) + 1;
+		v = ath12k_mac_eht_ru_tones_to_nl80211_eht_ru_alloc(tones);
+		arsta->txrate.eht_ru_alloc = v;
+		break;
 	}
 
 	arsta->txrate.nss = nss;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH ath-next v5 5/6] wifi: ath12k: correctly update bw for ofdma packets
  2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
                   ` (3 preceding siblings ...)
  2025-04-17  4:57 ` [PATCH ath-next v5 4/6] wifi: ath12k: add EHT support for TX rate Sarika Sharma
@ 2025-04-17  4:57 ` Sarika Sharma
  2025-04-17  4:57 ` [PATCH ath-next v5 6/6] wifi: ath12k: fetch tx_retry and tx_failed from htt_ppdu_stats_user_cmpltn_common_tlv Sarika Sharma
  5 siblings, 0 replies; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Currently, arsta->txrate.bw is filled from ath12k_mac_bw_to_mac80211_bw(bw)
during ath12k_update_per_peer_tx_stats(). But in tx_completion path bw
is filled differently if ppdu_type is ofdma for HE/EHT rates.

Hence, update arsta->txrate.bw correctly if packet is ofdma for HE
and EHT rate.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp.h    |  2 ++
 drivers/net/wireless/ath/ath12k/dp_rx.c | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 6ce5f853dcdb..ef6be7245639 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -1524,6 +1524,8 @@ enum HTT_PPDU_STATS_PPDU_TYPE {
 #define HTT_PPDU_STATS_USER_RATE_FLAGS_DCM_M		BIT(28)
 #define HTT_PPDU_STATS_USER_RATE_FLAGS_LDPC_M		BIT(29)
 
+#define HTT_USR_RATE_PPDU_TYPE(_val) \
+		le32_get_bits(_val, HTT_PPDU_STATS_USER_RATE_INFO1_PPDU_TYPE_M)
 #define HTT_USR_RATE_PREAMBLE(_val) \
 		le32_get_bits(_val, HTT_PPDU_STATS_USER_RATE_FLAGS_PREAMBLE_M)
 #define HTT_USR_RATE_BW(_val) \
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index edd3452d659f..54057113b2a3 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -1362,12 +1362,12 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 	struct htt_ppdu_user_stats *usr_stats = &ppdu_stats->user_stats[user];
 	struct htt_ppdu_stats_common *common = &ppdu_stats->common;
 	int ret;
-	u8 flags, mcs, nss, bw, sgi, dcm, rate_idx = 0;
+	u8 flags, mcs, nss, bw, sgi, dcm, ppdu_type, rate_idx = 0;
 	u32 v, succ_bytes = 0;
 	u16 tones, rate = 0, succ_pkts = 0;
 	u32 tx_duration = 0;
 	u8 tid = HTT_PPDU_STATS_NON_QOS_TID;
-	bool is_ampdu = false;
+	bool is_ampdu = false, is_ofdma = false;
 
 	if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE)))
 		return;
@@ -1396,6 +1396,10 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 	sgi = HTT_USR_RATE_GI(user_rate->rate_flags);
 	dcm = HTT_USR_RATE_DCM(user_rate->rate_flags);
 
+	ppdu_type = HTT_USR_RATE_PPDU_TYPE(user_rate->info1);
+	is_ofdma = (ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA) ||
+		   (ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA);
+
 	/* Note: If host configured fixed rates and in some other special
 	 * cases, the broadcast/management frames are sent in different rates.
 	 * Firmware rate's control to be skipped for this?
@@ -1445,6 +1449,8 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 
 	memset(&arsta->txrate, 0, sizeof(arsta->txrate));
 
+	arsta->txrate.bw = ath12k_mac_bw_to_mac80211_bw(bw);
+
 	switch (flags) {
 	case WMI_RATE_PREAMBLE_OFDM:
 		arsta->txrate.legacy = rate;
@@ -1473,6 +1479,8 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 			le16_to_cpu(user_rate->ru_start) + 1;
 		v = ath12k_he_ru_tones_to_nl80211_he_ru_alloc(tones);
 		arsta->txrate.he_ru_alloc = v;
+		if (is_ofdma)
+			arsta->txrate.bw = RATE_INFO_BW_HE_RU;
 		break;
 	case WMI_RATE_PREAMBLE_EHT:
 		arsta->txrate.mcs = mcs;
@@ -1483,11 +1491,12 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 			le16_to_cpu(user_rate->ru_start) + 1;
 		v = ath12k_mac_eht_ru_tones_to_nl80211_eht_ru_alloc(tones);
 		arsta->txrate.eht_ru_alloc = v;
+		if (is_ofdma)
+			arsta->txrate.bw = RATE_INFO_BW_EHT_RU;
 		break;
 	}
 
 	arsta->txrate.nss = nss;
-	arsta->txrate.bw = ath12k_mac_bw_to_mac80211_bw(bw);
 	arsta->tx_duration += tx_duration;
 	memcpy(&arsta->last_txrate, &arsta->txrate, sizeof(struct rate_info));
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH ath-next v5 6/6] wifi: ath12k: fetch tx_retry and tx_failed from htt_ppdu_stats_user_cmpltn_common_tlv
  2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
                   ` (4 preceding siblings ...)
  2025-04-17  4:57 ` [PATCH ath-next v5 5/6] wifi: ath12k: correctly update bw for ofdma packets Sarika Sharma
@ 2025-04-17  4:57 ` Sarika Sharma
  5 siblings, 0 replies; 9+ messages in thread
From: Sarika Sharma @ 2025-04-17  4:57 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Sarika Sharma

Currently, tx_retries and tx_failed are updated only in mac80211 during
tx_completion path for sta->deflink. This works fine for non-ML
station but for multi-link (ML) station, these values should be updated
for sta->link[link_id] as per tx link_id. However, in tx_completion path
there is no way to determine the link_id for which packet is retried or
failed.

Therefore, update the tx_retries and tx_failed in arsta structure from
htt_ppdu_stats_user_cmpltn_common_tlv during
ath12k_update_per_peer_tx_stats() call to utilize the values from arsta.
Also, during 'iw dev xxxx station dump' populate the tx_retries and
tx_failed in station_info structure to ensure values are correctly
reflected.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/core.h  |  2 ++
 drivers/net/wireless/ath/ath12k/dp_rx.c | 12 +++++++++++-
 drivers/net/wireless/ath/ath12k/mac.c   |  5 +++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 44e02ebb1071..092ee17ee07c 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -530,6 +530,8 @@ struct ath12k_link_sta {
 
 	 /* for firmware use only */
 	u8 link_idx;
+	u32 tx_retry_failed;
+	u32 tx_retry_count;
 };
 
 struct ath12k_sta {
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index 54057113b2a3..d4b29248423b 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -1368,13 +1368,21 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 	u32 tx_duration = 0;
 	u8 tid = HTT_PPDU_STATS_NON_QOS_TID;
 	bool is_ampdu = false, is_ofdma = false;
+	u16 tx_retry_failed = 0, tx_retry_count = 0;
 
 	if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE)))
 		return;
 
-	if (usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON))
+	if (usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON)) {
 		is_ampdu =
 			HTT_USR_CMPLTN_IS_AMPDU(usr_stats->cmpltn_cmn.flags);
+		tx_retry_failed =
+			__le16_to_cpu(usr_stats->cmpltn_cmn.mpdu_tried) -
+			__le16_to_cpu(usr_stats->cmpltn_cmn.mpdu_success);
+		tx_retry_count =
+			HTT_USR_CMPLTN_LONG_RETRY(usr_stats->cmpltn_cmn.flags) +
+			HTT_USR_CMPLTN_SHORT_RETRY(usr_stats->cmpltn_cmn.flags);
+	}
 
 	if (usr_stats->tlv_flags &
 	    BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_ACK_BA_STATUS)) {
@@ -1496,6 +1504,8 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
 		break;
 	}
 
+	arsta->tx_retry_failed += tx_retry_failed;
+	arsta->tx_retry_count += tx_retry_count;
 	arsta->txrate.nss = nss;
 	arsta->tx_duration += tx_duration;
 	memcpy(&arsta->last_txrate, &arsta->txrate, sizeof(struct rate_info));
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 30643f8db487..ede4b75440a2 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -10571,6 +10571,11 @@ static void ath12k_mac_op_link_sta_statistics(struct ieee80211_hw *hw,
 		sinfo->signal_avg += ATH12K_DEFAULT_NOISE_FLOOR;
 
 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
+
+	sinfo->tx_retries = arsta->tx_retry_count;
+	sinfo->tx_failed = arsta->tx_retry_failed;
+	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_RETRIES);
+	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED);
 }
 
 static int ath12k_mac_op_cancel_remain_on_channel(struct ieee80211_hw *hw,
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support
  2025-04-17  4:57 ` [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support Sarika Sharma
@ 2025-04-18  5:25   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2025-04-18  5:25 UTC (permalink / raw)
  To: Sarika Sharma; +Cc: oe-kbuild-all

Hi Sarika,

kernel test robot noticed the following build errors:

[auto build test ERROR on b80c52642c1159c2596776b39b06eb1c2e36baff]

url:    https://github.com/intel-lab-lkp/linux/commits/Sarika-Sharma/wifi-ath12k-enable-wiphy-flag-for-MLO-station-statistics-support/20250417-130053
base:   b80c52642c1159c2596776b39b06eb1c2e36baff
patch link:    https://lore.kernel.org/r/20250417045709.770219-2-quic_sarishar%40quicinc.com
patch subject: [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support
config: arm-randconfig-001-20250418 (https://download.01.org/0day-ci/archive/20250418/202504181305.OWdonKFO-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250418/202504181305.OWdonKFO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504181305.OWdonKFO-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_hw_register':
>> drivers/net/wireless/ath/ath12k/mac.c:11464:18: error: 'WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS' undeclared (first use in this function); did you mean 'WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY'?
     wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS;
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY
   drivers/net/wireless/ath/ath12k/mac.c:11464:18: note: each undeclared identifier is reported only once for each function it appears in


vim +11464 drivers/net/wireless/ath/ath12k/mac.c

 11315	
 11316	static int ath12k_mac_hw_register(struct ath12k_hw *ah)
 11317	{
 11318		struct ieee80211_hw *hw = ah->hw;
 11319		struct wiphy *wiphy = hw->wiphy;
 11320		struct ath12k *ar = ath12k_ah_to_ar(ah, 0);
 11321		struct ath12k_base *ab = ar->ab;
 11322		struct ath12k_pdev *pdev;
 11323		struct ath12k_pdev_cap *cap;
 11324		static const u32 cipher_suites[] = {
 11325			WLAN_CIPHER_SUITE_TKIP,
 11326			WLAN_CIPHER_SUITE_CCMP,
 11327			WLAN_CIPHER_SUITE_AES_CMAC,
 11328			WLAN_CIPHER_SUITE_BIP_CMAC_256,
 11329			WLAN_CIPHER_SUITE_BIP_GMAC_128,
 11330			WLAN_CIPHER_SUITE_BIP_GMAC_256,
 11331			WLAN_CIPHER_SUITE_GCMP,
 11332			WLAN_CIPHER_SUITE_GCMP_256,
 11333			WLAN_CIPHER_SUITE_CCMP_256,
 11334		};
 11335		int ret, i, j;
 11336		u32 ht_cap = U32_MAX, antennas_rx = 0, antennas_tx = 0;
 11337		bool is_6ghz = false, is_raw_mode = false, is_monitor_disable = false;
 11338		u8 *mac_addr = NULL;
 11339		u8 mbssid_max_interfaces = 0;
 11340	
 11341		wiphy->max_ap_assoc_sta = 0;
 11342	
 11343		for_each_ar(ah, ar, i) {
 11344			u32 ht_cap_info = 0;
 11345	
 11346			pdev = ar->pdev;
 11347			if (ar->ab->pdevs_macaddr_valid) {
 11348				ether_addr_copy(ar->mac_addr, pdev->mac_addr);
 11349			} else {
 11350				ether_addr_copy(ar->mac_addr, ar->ab->mac_addr);
 11351				ar->mac_addr[4] += ar->pdev_idx;
 11352			}
 11353	
 11354			ret = ath12k_mac_setup_register(ar, &ht_cap_info, hw->wiphy->bands);
 11355			if (ret)
 11356				goto err_cleanup_unregister;
 11357	
 11358			/* 6 GHz does not support HT Cap, hence do not consider it */
 11359			if (!ar->supports_6ghz)
 11360				ht_cap &= ht_cap_info;
 11361	
 11362			wiphy->max_ap_assoc_sta += ar->max_num_stations;
 11363	
 11364			/* Advertise the max antenna support of all radios, driver can handle
 11365			 * per pdev specific antenna setting based on pdev cap when antenna
 11366			 * changes are made
 11367			 */
 11368			cap = &pdev->cap;
 11369	
 11370			antennas_rx = max_t(u32, antennas_rx, cap->rx_chain_mask);
 11371			antennas_tx = max_t(u32, antennas_tx, cap->tx_chain_mask);
 11372	
 11373			if (ar->supports_6ghz)
 11374				is_6ghz = true;
 11375	
 11376			if (test_bit(ATH12K_FLAG_RAW_MODE, &ar->ab->dev_flags))
 11377				is_raw_mode = true;
 11378	
 11379			if (!ar->ab->hw_params->supports_monitor)
 11380				is_monitor_disable = true;
 11381	
 11382			if (i == 0)
 11383				mac_addr = ar->mac_addr;
 11384			else
 11385				mac_addr = ab->mac_addr;
 11386	
 11387			mbssid_max_interfaces += TARGET_NUM_VDEVS;
 11388		}
 11389	
 11390		wiphy->available_antennas_rx = antennas_rx;
 11391		wiphy->available_antennas_tx = antennas_tx;
 11392	
 11393		SET_IEEE80211_PERM_ADDR(hw, mac_addr);
 11394		SET_IEEE80211_DEV(hw, ab->dev);
 11395	
 11396		ret = ath12k_mac_setup_iface_combinations(ah);
 11397		if (ret) {
 11398			ath12k_err(ab, "failed to setup interface combinations: %d\n", ret);
 11399			goto err_complete_cleanup_unregister;
 11400		}
 11401	
 11402		wiphy->interface_modes = ath12k_mac_get_ifmodes(ah);
 11403	
 11404		if (ah->num_radio == 1 &&
 11405		    wiphy->bands[NL80211_BAND_2GHZ] &&
 11406		    wiphy->bands[NL80211_BAND_5GHZ] &&
 11407		    wiphy->bands[NL80211_BAND_6GHZ])
 11408			ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
 11409	
 11410		ieee80211_hw_set(hw, SIGNAL_DBM);
 11411		ieee80211_hw_set(hw, SUPPORTS_PS);
 11412		ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
 11413		ieee80211_hw_set(hw, MFP_CAPABLE);
 11414		ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS);
 11415		ieee80211_hw_set(hw, HAS_RATE_CONTROL);
 11416		ieee80211_hw_set(hw, AP_LINK_PS);
 11417		ieee80211_hw_set(hw, SPECTRUM_MGMT);
 11418		ieee80211_hw_set(hw, CONNECTION_MONITOR);
 11419		ieee80211_hw_set(hw, SUPPORTS_PER_STA_GTK);
 11420		ieee80211_hw_set(hw, CHANCTX_STA_CSA);
 11421		ieee80211_hw_set(hw, QUEUE_CONTROL);
 11422		ieee80211_hw_set(hw, SUPPORTS_TX_FRAG);
 11423		ieee80211_hw_set(hw, REPORTS_LOW_ACK);
 11424		ieee80211_hw_set(hw, NO_VIRTUAL_MONITOR);
 11425	
 11426		if ((ht_cap & WMI_HT_CAP_ENABLED) || is_6ghz) {
 11427			ieee80211_hw_set(hw, AMPDU_AGGREGATION);
 11428			ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);
 11429			ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER);
 11430			ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU);
 11431			ieee80211_hw_set(hw, USES_RSS);
 11432		}
 11433	
 11434		wiphy->features |= NL80211_FEATURE_STATIC_SMPS;
 11435		wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
 11436	
 11437		/* TODO: Check if HT capability advertised from firmware is different
 11438		 * for each band for a dual band capable radio. It will be tricky to
 11439		 * handle it when the ht capability different for each band.
 11440		 */
 11441		if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS ||
 11442		    (is_6ghz && ab->hw_params->supports_dynamic_smps_6ghz))
 11443			wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
 11444	
 11445		wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
 11446		wiphy->max_scan_ie_len = WLAN_SCAN_PARAMS_MAX_IE_LEN;
 11447	
 11448		hw->max_listen_interval = ATH12K_MAX_HW_LISTEN_INTERVAL;
 11449	
 11450		wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 11451		wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
 11452		wiphy->max_remain_on_channel_duration = 5000;
 11453	
 11454		wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
 11455		wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |
 11456					   NL80211_FEATURE_AP_SCAN;
 11457	
 11458		/* MLO is not yet supported so disable Wireless Extensions for now
 11459		 * to make sure ath12k users don't use it. This flag can be removed
 11460		 * once WIPHY_FLAG_SUPPORTS_MLO is enabled.
 11461		 */
 11462		wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT;
 11463	
 11464		wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS;
 11465	
 11466		/* Copy over MLO related capabilities received from
 11467		 * WMI_SERVICE_READY_EXT2_EVENT if single_chip_mlo_supp is set.
 11468		 */
 11469		if (ab->ag->mlo_capable) {
 11470			ath12k_iftypes_ext_capa[2].eml_capabilities = cap->eml_cap;
 11471			ath12k_iftypes_ext_capa[2].mld_capa_and_ops = cap->mld_cap;
 11472			wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
 11473	
 11474			ieee80211_hw_set(hw, MLO_MCAST_MULTI_LINK_TX);
 11475		}
 11476	
 11477		hw->queues = ATH12K_HW_MAX_QUEUES;
 11478		wiphy->tx_queue_len = ATH12K_QUEUE_LEN;
 11479		hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1;
 11480		hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_EHT;
 11481	
 11482		hw->vif_data_size = sizeof(struct ath12k_vif);
 11483		hw->sta_data_size = sizeof(struct ath12k_sta);
 11484		hw->extra_tx_headroom = ab->hw_params->iova_mask;
 11485	
 11486		wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
 11487		wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_STA_TX_PWR);
 11488	
 11489		wiphy->cipher_suites = cipher_suites;
 11490		wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
 11491	
 11492		wiphy->iftype_ext_capab = ath12k_iftypes_ext_capa;
 11493		wiphy->num_iftype_ext_capab = ARRAY_SIZE(ath12k_iftypes_ext_capa);
 11494	
 11495		wiphy->mbssid_max_interfaces = mbssid_max_interfaces;
 11496		wiphy->ema_max_profile_periodicity = TARGET_EMA_MAX_PROFILE_PERIOD;
 11497	
 11498		if (is_6ghz) {
 11499			wiphy_ext_feature_set(wiphy,
 11500					      NL80211_EXT_FEATURE_FILS_DISCOVERY);
 11501			wiphy_ext_feature_set(wiphy,
 11502					      NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP);
 11503		}
 11504	
 11505		wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_PUNCT);
 11506	
 11507		ath12k_reg_init(hw);
 11508	
 11509		if (!is_raw_mode) {
 11510			hw->netdev_features = NETIF_F_HW_CSUM;
 11511			ieee80211_hw_set(hw, SW_CRYPTO_CONTROL);
 11512			ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
 11513		}
 11514	
 11515		if (test_bit(WMI_TLV_SERVICE_NLO, ar->wmi->wmi_ab->svc_map)) {
 11516			wiphy->max_sched_scan_ssids = WMI_PNO_MAX_SUPP_NETWORKS;
 11517			wiphy->max_match_sets = WMI_PNO_MAX_SUPP_NETWORKS;
 11518			wiphy->max_sched_scan_ie_len = WMI_PNO_MAX_IE_LENGTH;
 11519			wiphy->max_sched_scan_plans = WMI_PNO_MAX_SCHED_SCAN_PLANS;
 11520			wiphy->max_sched_scan_plan_interval =
 11521						WMI_PNO_MAX_SCHED_SCAN_PLAN_INT;
 11522			wiphy->max_sched_scan_plan_iterations =
 11523						WMI_PNO_MAX_SCHED_SCAN_PLAN_ITRNS;
 11524			wiphy->features |= NL80211_FEATURE_ND_RANDOM_MAC_ADDR;
 11525		}
 11526	
 11527		ret = ath12k_wow_init(ar);
 11528		if (ret) {
 11529			ath12k_warn(ar->ab, "failed to init wow: %d\n", ret);
 11530			goto err_cleanup_if_combs;
 11531		}
 11532	
 11533		ret = ieee80211_register_hw(hw);
 11534		if (ret) {
 11535			ath12k_err(ab, "ieee80211 registration failed: %d\n", ret);
 11536			goto err_cleanup_if_combs;
 11537		}
 11538	
 11539		if (is_monitor_disable)
 11540			/* There's a race between calling ieee80211_register_hw()
 11541			 * and here where the monitor mode is enabled for a little
 11542			 * while. But that time is so short and in practise it make
 11543			 * a difference in real life.
 11544			 */
 11545			wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MONITOR);
 11546	
 11547		for_each_ar(ah, ar, i) {
 11548			/* Apply the regd received during initialization */
 11549			ret = ath12k_regd_update(ar, true);
 11550			if (ret) {
 11551				ath12k_err(ar->ab, "ath12k regd update failed: %d\n", ret);
 11552				goto err_unregister_hw;
 11553			}
 11554	
 11555			ath12k_fw_stats_init(ar);
 11556			ath12k_debugfs_register(ar);
 11557		}
 11558	
 11559		return 0;
 11560	
 11561	err_unregister_hw:
 11562		for_each_ar(ah, ar, i)
 11563			ath12k_debugfs_unregister(ar);
 11564	
 11565		ieee80211_unregister_hw(hw);
 11566	
 11567	err_cleanup_if_combs:
 11568		ath12k_mac_cleanup_iface_combinations(ah);
 11569	
 11570	err_complete_cleanup_unregister:
 11571		i = ah->num_radio;
 11572	
 11573	err_cleanup_unregister:
 11574		for (j = 0; j < i; j++) {
 11575			ar = ath12k_ah_to_ar(ah, j);
 11576			ath12k_mac_cleanup_unregister(ar);
 11577		}
 11578	
 11579		SET_IEEE80211_DEV(hw, NULL);
 11580	
 11581		return ret;
 11582	}
 11583	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO
  2025-04-17  4:57 ` [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO Sarika Sharma
@ 2025-04-18  6:09   ` kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2025-04-18  6:09 UTC (permalink / raw)
  To: Sarika Sharma; +Cc: oe-kbuild-all

Hi Sarika,

kernel test robot noticed the following build errors:

[auto build test ERROR on b80c52642c1159c2596776b39b06eb1c2e36baff]

url:    https://github.com/intel-lab-lkp/linux/commits/Sarika-Sharma/wifi-ath12k-enable-wiphy-flag-for-MLO-station-statistics-support/20250417-130053
base:   b80c52642c1159c2596776b39b06eb1c2e36baff
patch link:    https://lore.kernel.org/r/20250417045709.770219-3-quic_sarishar%40quicinc.com
patch subject: [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO
config: arm-randconfig-001-20250418 (https://download.01.org/0day-ci/archive/20250418/202504181412.uGSvIIlb-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250418/202504181412.uGSvIIlb-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504181412.uGSvIIlb-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_op_sta_statistics':
>> drivers/net/wireless/ath/ath12k/mac.c:10506:21: error: 'struct station_info' has no member named 'link_id'
     int link_id = sinfo->link_id;
                        ^~
   drivers/net/wireless/ath/ath12k/mac.c: In function 'ath12k_mac_hw_register':
   drivers/net/wireless/ath/ath12k/mac.c:11472:18: error: 'WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS' undeclared (first use in this function); did you mean 'WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY'?
     wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO_STA_PER_LINK_STATS;
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY
   drivers/net/wireless/ath/ath12k/mac.c:11472:18: note: each undeclared identifier is reported only once for each function it appears in


vim +10506 drivers/net/wireless/ath/ath12k/mac.c

 10497	
 10498	static void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw,
 10499						 struct ieee80211_vif *vif,
 10500						 struct ieee80211_sta *sta,
 10501						 struct station_info *sinfo)
 10502	{
 10503		struct ath12k_sta *ahsta = ath12k_sta_to_ahsta(sta);
 10504		struct ath12k_fw_stats_req_params params = {};
 10505		struct ath12k_link_sta *arsta;
 10506		int link_id = sinfo->link_id;
 10507		struct ath12k *ar;
 10508		s8 signal;
 10509		bool db2dbm;
 10510	
 10511		lockdep_assert_wiphy(hw->wiphy);
 10512	
 10513		if (link_id < 0)
 10514			arsta = &ahsta->deflink;
 10515		else
 10516			arsta = wiphy_dereference(hw->wiphy, ahsta->link[link_id]);
 10517	
 10518		if (!arsta)
 10519			return;
 10520	
 10521		ar = ath12k_get_ar_by_vif(hw, vif, arsta->link_id);
 10522		if (!ar)
 10523			return;
 10524	
 10525		db2dbm = test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
 10526				  ar->ab->wmi_ab.svc_map);
 10527	
 10528		sinfo->rx_duration = arsta->rx_duration;
 10529		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION);
 10530	
 10531		sinfo->tx_duration = arsta->tx_duration;
 10532		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_DURATION);
 10533	
 10534		if (arsta->txrate.legacy || arsta->txrate.nss) {
 10535			if (arsta->txrate.legacy) {
 10536				sinfo->txrate.legacy = arsta->txrate.legacy;
 10537			} else {
 10538				sinfo->txrate.mcs = arsta->txrate.mcs;
 10539				sinfo->txrate.nss = arsta->txrate.nss;
 10540				sinfo->txrate.bw = arsta->txrate.bw;
 10541				sinfo->txrate.he_gi = arsta->txrate.he_gi;
 10542				sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
 10543				sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
 10544				sinfo->txrate.eht_gi = arsta->txrate.eht_gi;
 10545				sinfo->txrate.eht_ru_alloc = arsta->txrate.eht_ru_alloc;
 10546			}
 10547			sinfo->txrate.flags = arsta->txrate.flags;
 10548			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
 10549		}
 10550	
 10551		/* TODO: Use real NF instead of default one. */
 10552		signal = arsta->rssi_comb;
 10553	
 10554		params.pdev_id = ar->pdev->pdev_id;
 10555		params.vdev_id = 0;
 10556		params.stats_id = WMI_REQUEST_VDEV_STAT;
 10557	
 10558		if (!signal &&
 10559		    ahsta->ahvif->vdev_type == WMI_VDEV_TYPE_STA &&
 10560		    !(ath12k_mac_get_fw_stats(ar, &params)))
 10561			signal = arsta->rssi_beacon;
 10562	
 10563		if (signal) {
 10564			sinfo->signal = db2dbm ? signal : signal + ATH12K_DEFAULT_NOISE_FLOOR;
 10565			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
 10566		}
 10567	
 10568		sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi);
 10569	
 10570		if (!db2dbm)
 10571			sinfo->signal_avg += ATH12K_DEFAULT_NOISE_FLOOR;
 10572	
 10573		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
 10574	}
 10575	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-04-18  6:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17  4:57 [PATCH ath-next v5 0/6] ath12k: add support to fill link statistics of multi-link station Sarika Sharma
2025-04-17  4:57 ` [PATCH ath-next v5 1/6] wifi: ath12k: enable wiphy flag for MLO station statistics support Sarika Sharma
2025-04-18  5:25   ` kernel test robot
2025-04-17  4:57 ` [PATCH ath-next v5 2/6] wifi: ath12k: correctly fetch arsta for MLO Sarika Sharma
2025-04-18  6:09   ` kernel test robot
2025-04-17  4:57 ` [PATCH ath-next v5 3/6] wifi: ath12k: add link support for multi-link in arsta Sarika Sharma
2025-04-17  4:57 ` [PATCH ath-next v5 4/6] wifi: ath12k: add EHT support for TX rate Sarika Sharma
2025-04-17  4:57 ` [PATCH ath-next v5 5/6] wifi: ath12k: correctly update bw for ofdma packets Sarika Sharma
2025-04-17  4:57 ` [PATCH ath-next v5 6/6] wifi: ath12k: fetch tx_retry and tx_failed from htt_ppdu_stats_user_cmpltn_common_tlv Sarika Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.