From: Johannes Berg Just like for interfaces, the change_sta_links() method really changes the active links of a station, not (just) valid ones. It's possible that both change, of course, but in many cases (such as link switching) only the active ones really change. Clarify the documentation and add a note in the mac80211 code about why ieee80211_sta_set_link_valid() can call the driver wrapper directly without any check. Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- include/net/mac80211.h | 10 ++++++---- net/mac80211/sta_info.c | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 76ff86ff9974..f07a4d262314 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -4741,11 +4741,13 @@ struct ieee80211_prep_tx_info { * Note that removal of link should always succeed, so the return value * will be ignored in a removal only case. * This callback can sleep. - * @change_sta_links: Change the valid links of a station, similar to + * @change_sta_links: Change the active links of a station, similar to * @change_vif_links. This callback can sleep. - * Note that a sta can also be inserted or removed with valid links, - * i.e. passed to @sta_add/@sta_state with sta->valid_links not zero. - * In fact, cannot change from having valid_links and not having them. + * Note that a sta can also be inserted or removed with active links, + * i.e. passed to @sta_add/@sta_state with sta->valid_links not zero + * (note vif->active_links needs to be considered with sta->valid_links). + * It cannot, in fact, change between having valid_links and not having + * any, since it either represents an MLD or not. * @set_hw_timestamp: Enable/disable HW timestamping of TM/FTM frames. This is * not restored at HW reset by mac80211 so drivers need to take care of * that. diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 572455549c63..61aadc3c695d 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -3507,6 +3507,10 @@ int ieee80211_sta_set_link_valid(struct sta_info *sta, unsigned int link_id) */ ieee80211_sta_recalc_aggregates(&sta->sta); + /* + * Note: this is a no-op when new links are added that + * aren't actually active in the vif. + */ ret = drv_change_sta_links(sdata->local, sdata, &sta->sta, old_links, new_links); if (ret) { -- 2.56.0