@@ -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;
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(-)