• Johannes Berg's avatar
    cfg80211: change netdev registration/unregistration semantics · 2fe8ef10
    Johannes Berg authored
    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@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    2fe8ef10
core.c 21.1 KB