Message ID | 20250310223528.3528897-1-muna.sinada@oss.qualcomm.com |
---|---|
Headers | show |
Series | wifi: mac80211: MLO handling for Dynamic VLAN | expand |
On Mon, 2025-03-10 at 15:35 -0700, Muna Sinada wrote: > > /* no need to tell driver, but set carrier and chanctx */ > if (sdata->bss->active) { > - ieee80211_link_vlan_copy_chanctx(&sdata->deflink); > + struct ieee80211_link_data *link; > + unsigned long valid_links = sdata->vif.valid_links; > + > + if (valid_links) { > + for_each_set_bit(link_id, &valid_links, > + IEEE80211_MLD_MAX_NUM_LINKS) { > + link = sdata_dereference(sdata->link[link_id], > + sdata); > + ieee80211_link_vlan_copy_chanctx(link); > + } > + } else { > + ieee80211_link_vlan_copy_chanctx(&sdata->deflink); > + } > + Can this not use for_each_valid_link()? I think for_each_valid_link(&sdata->vif, link_id) should work? If not some new macro? I don't like open-coding this "if (valid_links)" etc. everywhere. johannes
On 3/11/2025 3:29 AM, Johannes Berg wrote: > > Can this not use for_each_valid_link()? I think > for_each_valid_link(&sdata->vif, link_id) should work? If not some new > macro? I don't like open-coding this "if (valid_links)" etc. everywhere. > > johannes for_each_valid_link() is a cfg80211 macro that utilizes wdev to access valid_links and links array. Using this macro with &sdata->vif will not work since, links array located in sdata and is named "link" and valid_links is located inside vif. Should I will go ahead and define a new macro that is similar but utilizes sdata or should I stick to using for_each_valid_link() and pass in &sdata->wdev.