wifi: mac80211: add and use a link iteration macro
authorJohannes Berg <johannes.berg@intel.com>
Mon, 29 Jan 2024 18:34:41 +0000 (19:34 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Feb 2024 12:07:37 +0000 (13:07 +0100)
commitd1256c1546a0e03f103e2f0381103dc747ea7f81
tree234da38d541ec935d11cd14aa1056749a4a4c19b
parent6092077ad09ce880c61735c314060f0bd79ae4aa
wifi: mac80211: add and use a link iteration macro

In the channel context code we have quite a few instances
of nested loops iterating the interfaces and then links.
Add a new for_each_sdata_link() macro and use it. Also,
since it's easier, convert all the loops and a few other
places away from RCU as we now hold the wiphy mutex
everywhere anyway.

This does cause a little bit more work (such as checking
interface types for each link of an interface rather than
not iterating links in some cases), but that's not a huge
issue and seems like an acceptable trade-off, readability
is important too.

Link: https://msgid.link/20240129194108.7240829bd96d.I5ccbb8dd019cbcb5326c85d76121359225d6541a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/chan.c
net/mac80211/ieee80211_i.h