@@ -9902,11 +9902,18 @@ static void ath12k_mac_op_link_sta_statistics(struct ieee80211_hw *hw,
struct link_station_info *link_sinfo)
{
struct ath12k_sta *ahsta = ath12k_sta_to_ahsta(sta);
+ int link_id = link_sinfo->link_id;
struct ath12k_link_sta *arsta;
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;
link_sinfo->rx_duration = arsta->rx_duration;
link_sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_DURATION);
Currently in ath12k_mac_op_link_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. NOTE: - Currently ath12k changes are only included as an reference to other drivers. Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com> --- drivers/net/wireless/ath/ath12k/mac.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)