]> git.baikalelectronics.ru Git - kernel.git/commit
cfg80211: change netdev registration/unregistration semantics
authorJohannes Berg <johannes.berg@intel.com>
Fri, 22 Jan 2021 15:19:42 +0000 (16:19 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 22 Jan 2021 15:28:39 +0000 (16:28 +0100)
commit354ea93ef91fd528046b3c46f70b4de2b8288879
treecd0531c336c1c5de84ba8e21bc51921a6e08936f
parent375b6e1b43cab2f40d77548fc66c7c515d77d68a
cfg80211: change netdev registration/unregistration semantics

We used to not require anything in terms of registering netdevs
with cfg80211, using a netdev notifier instead. However, in the
next patch reducing RTNL locking, this causes big problems, and
the simplest way is to just require drivers to do things better.

Change the registration/unregistration semantics to require the
drivers to call cfg80211_(un)register_netdevice() when this is
happening due to a cfg80211 request, i.e. add_virtual_intf() or
del_virtual_intf() (or if it somehow has to happen in any other
cfg80211 callback).

Otherwise, in other contexts, drivers may continue to use the
normal netdev (un)registration functions as usual.

Internally, we still use the netdev notifier and track (by the
new wdev->registered bool) if the wdev had already been added
to cfg80211 or not.

Link: https://lore.kernel.org/r/20210122161942.cf2f4b65e4e9.Ida8234e50da13eb675b557bac52a713ad4eddf71@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 files changed:
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/wil6210/netdev.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
drivers/net/wireless/marvell/mwifiex/cfg80211.c
drivers/net/wireless/microchip/wilc1000/cfg80211.c
drivers/net/wireless/microchip/wilc1000/mon.c
drivers/net/wireless/microchip/wilc1000/netdev.c
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
drivers/net/wireless/quantenna/qtnfmac/core.c
include/net/cfg80211.h
net/mac80211/iface.c
net/wireless/core.c