On Tue, 2025-03-11 at 16:50 -0700, Muna Sinada wrote: > > 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. We probably discussed this before, sorry ... > 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. So valid_links would be fine, but we have links/link naming differences? That's unfortunate. But now that I think about it, also it's array of pointers in vif and array of structs in wdev? Anyway ... > 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. > We already have for_each_vif_active_link() so maybe add for_each_vif_valid_link()? Though honestly in this case you could as well just use for_each_vif_active_link(), it's basically the same in AP? johannes