Current implementation of NL80211_CMD_GET_STATION does not work for multi-link operation(MLO) since in case of MLO only deflink (or one of the links) is considered and not all links. Hence, add the link_sinfo structure to provide infrastructure for link-level station statistics for multi-link operation(MLO). Additionally, accumulated stats for MLO are included in a concise manner to provide a comprehensive overview of the ML stations. V7: - Redesign the approach according to provided comments( mentioned the current implemented approach below in "Purposed Flow"). V6: - Fix compilation failure. - Add expected_throughput, beacon_loss_count, rx_dropped_misc at MLO level. - Removed is_per_link_stats_support boolean from sinfo structure. - Used ether_addr_copy() instead of memcpy(). V5: - Rebased the patches. V4: - Update helper function for link_sta derefrence. - Instead of using unnecessary rssi variable directly use return. - Correct commit tittle and message for some patches. - Corrected cfg80211_sinfo_release_content() unnecessary logic. - Split the patches for cfg80211/mac80211. - Add additional fields at MLO level. - Remove Ath12k patche from this series. - Remove unnecessary if condition check from "add additional MLO statistics". V3: - Convert RFC patch to actual PATCH with each patch bisectable. - Add logic for MLO level signal and rates. V2: - Update cover letter to give more details on structural changes. - Split the patch(1/7) in two patches. - Do the required changes for MLO bringup before as seperate patches. - Remove link_sinfo naming to sinfo for better clarity on changes. - Add accumulated stats logic in cfg80211. - Add flag to indicate driver supports per-link station statistics or not. Current flow: cfg80211: - Structure station_info is used to fill all station information (station level as well link level). - Nl80211_get_station() - locally define sinfo, call -.get_station() ops mac80211: - Sta_set_sinfo() - fill station information and call mac80211 ops - .sta_statistics()(to fill the station_info structure). Purposed Flow: cfg80211: - introduce link_station_info structure for link level statistics structure link_station_info { filled rates ...etc // all link specific fields } - add link_station_info for MAX links in station_info structure structure station_info { filled packets sta_flags ... etc valid_links link_station_info *links[IEEE80211_MLD_MAX_NUM_LINKS] } - Station_info structure is used for non-ML station statistics and update the sinfo_structure for MLO, for accumulated, best, least among all valid links in cfg80211_sta_set_mld_sinfo(). - Allocate and free memory for link_sinfo for all links. - Embed NL message to include link level data, if valid_links are present. mac80211: - Sta_set_sinfo() - fill station specific information as filled before if non-ML: - call mac80211 ops .sta_statistics() to fill station_info structure. if MLO: - call sta_set_link_sinfo(), for all valid links to fill link_station_info in *links[link_id]. - introduce and call mac80211 ops for each link- .link_sta_statistics() to fill link statistics from drivers. - Maintain accumulated data for removed links in sta_info structure and fill in to station_info structure for consistency. Sarika Sharma (10): wifi: mac80211: add support towards MLO handling of station statistics wifi: cfg80211: add link_station_info structure to support MLO statistics wifi: cfg80211: extend to embed link level statistics in NL message wifi: cfg80211: add statistics for providing overview for MLO station wifi: cfg80211: allocate memory for link_station info structure wifi: mac80211: add support to accumulate removed link statistics wifi: cfg80211: reset sinfo->filled for MLO station statistics wifi: mac80211: extend support to fill link level sinfo structure wifi: mac80211: add link_sta_statistics ops to fill link station statistics wifi: mac80211: correct RX stats packet increment for multi-link drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 2 +- include/net/cfg80211.h | 124 ++++++ include/net/mac80211.h | 16 +- net/mac80211/cfg.c | 13 + net/mac80211/driver-ops.h | 19 + net/mac80211/ibss.c | 4 +- net/mac80211/rx.c | 15 +- net/mac80211/sta_info.c | 393 +++++++++++++++-- net/mac80211/sta_info.h | 36 +- net/mac80211/trace.h | 7 + net/mac80211/util.c | 14 +- net/wireless/nl80211.c | 434 ++++++++++++++++++- net/wireless/util.c | 12 + 13 files changed, 1051 insertions(+), 38 deletions(-) base-commit: 63a9a727d373fa5b8ce509eef50dbc45e0f745b9 -- 2.34.1