]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: add ieee80211_iterate_active_interfaces_rtnl()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 21 Aug 2013 20:07:20 +0000 (22:07 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 26 Sep 2013 11:21:37 +0000 (13:21 +0200)
commit65fc6970d422a1dc7fae9b4540ba197e39b57eb9
tree183c3557d596a8ae69bf3ae9219e7ef49456052e
parent8d77f31568220a8293f2e30959e7772efe92c198
mac80211: add ieee80211_iterate_active_interfaces_rtnl()

If it is needed to disconnect multiple virtual interfaces after
(WoWLAN-) suspend, the most obvious approach would be to iterate
all interfaces by calling ieee80211_iterate_active_interfaces()
and then call ieee80211_resume_disconnect() for each one. This
is what the iwlmvm driver does.

Unfortunately, this causes a locking dependency from mac80211's
iflist_mtx to the key_mtx. This is problematic as the former is
intentionally never held while calling any driver operation to
allow drivers to iterate with their own locks held. The key_mtx
is held while installing a key into the driver though, so this
new lock dependency means drivers implementing the logic above
can no longer hold their own lock while iterating.

To fix this, add a new ieee80211_iterate_active_interfaces_rtnl()
function that iterates while the RTNL is already held. This is
true during suspend/resume, so that then the locking dependency
isn't introduced.

While at it, also refactor the various interface iterators and
keep only a single implementation called by the various cases.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/util.c