OSDN Git Service

mac80211: add pre-RCU-sync sta removal driver operation
authorJohannes Berg <johannes.berg@intel.com>
Wed, 4 Dec 2013 21:39:17 +0000 (22:39 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 16 Dec 2013 10:29:44 +0000 (11:29 +0100)
commit6a9d1b91f34df1935bc0ad98114801a44db0f98c
treeecf4637a32c57786a6ac468be5bc392bb28e779d
parentc4de673b775e4db48cd2db6277e0c6714332ca0c
mac80211: add pre-RCU-sync sta removal driver operation

Currently, mac80211 allows drivers to keep RCU-protected station
references that are cleared when the station is removed from the
driver and consequently needs to synchronize twice, once before
removing the station from the driver (so it can guarantee that
the station is no longer used in TX towards the driver) and once
after the station is removed from the driver.

Add a new pre-RCU-synchronisation station removal operation to
the API to allow drivers to clear/invalidate their RCU-protected
station pointers before the RCU synchronisation.

This will allow removing the second synchronisation by changing
the driver API so that the driver may no longer assume a valid
RCU-protected pointer after sta_remove/sta_state returns.

The alternative to this would be to synchronize_rcu() in all the
drivers that currently rely on this behaviour (only iwlmvm) but
that would defeat the purpose.

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