From: Johannes Berg Date: Fri, 29 May 2026 08:25:03 +0000 (+0200) Subject: wifi: mac80211: explain ieee80211_determine_chan_mode() parsing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5cbf19456f6f17503e1a7d8e23bcb4fb107133e;p=thirdparty%2Flinux.git wifi: mac80211: explain ieee80211_determine_chan_mode() parsing Looking through element parsing behaviour for multi-BSSID and multi-link, this one seemed odd. Add a comment that explains why it's written this way. Link: https://patch.msgid.link/20260529102644.25f75c4df338.I1f1f17cc0ae8e413659654d4bbaa34260ef68e2c@changeid Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2b7bb371efee1..3553e39a7db4d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1077,6 +1077,14 @@ ieee80211_determine_chan_mode(struct ieee80211_sub_if_data *sdata, const struct cfg80211_bss_ies *ies = rcu_dereference(cbss->ies); struct ieee80211_bss *bss = (void *)cbss->priv; struct ieee80211_channel *channel = cbss->channel; + /* + * This is for parsing a beacon or probe response here, but it's + * using the *BSS* elements which are synthetic for multi-BSSID, + * created by cfg80211 based on multi-BSSID inheritance etc. As + * a result, this sets neither .bss (since multi-BSSID is parsed + * already) nor a valid .link_id (since it doesn't want to see + * the data from another link.) + */ struct ieee80211_elems_parse_params parse_params = { .link_id = -1, .from_ap = true,