diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-12-04 22:39:17 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-12-16 11:29:44 +0100 |
commit | 1ddbbb0c83de82599b1baf14bf6bb69a774d4fc7 (patch) | |
tree | f40e872724a1d8a4de63f75e2e7d357adacc99a8 /drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | |
parent | 6a9d1b91f34df1935bc0ad98114801a44db0f98c (diff) | |
download | talos-obmc-linux-1ddbbb0c83de82599b1baf14bf6bb69a774d4fc7.tar.gz talos-obmc-linux-1ddbbb0c83de82599b1baf14bf6bb69a774d4fc7.zip |
iwlwifi: mvm: use pre-RCU-sync sta removal operation
iwlmvm relies on the current mac80211 behaviour of allowing
station pointers to be valid for an RCU grace period after
returning from the sta_state() callback. To optimise these
cases, this behaviour is going away, so make the driver use
the new sta_pre_rcu_remove() method to clear the pointer in
the fw_id_to_mac_id[] array.
Since this may happen while the station is still present in
the firmware, don't set the pointer to NULL but to -ENOENT
to mark this particular case. In client mode, the station
is kept even longer (until marking the MAC as unassociated)
so the drain flow must take this new behavior into account.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c index 67f6a2071653..27f140ceaac5 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c @@ -98,14 +98,17 @@ static ssize_t iwl_dbgfs_mac_params_read(struct file *file, if (vif->type == NL80211_IFTYPE_STATION && ap_sta_id != IWL_MVM_STATION_COUNT) { struct ieee80211_sta *sta; - struct iwl_mvm_sta *mvm_sta; sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[ap_sta_id], lockdep_is_held(&mvm->mutex)); - mvm_sta = (void *)sta->drv_priv; - pos += scnprintf(buf+pos, bufsz-pos, - "ap_sta_id %d - reduced Tx power %d\n", - ap_sta_id, mvm_sta->bt_reduced_txpower); + if (!IS_ERR_OR_NULL(sta)) { + struct iwl_mvm_sta *mvm_sta = (void *)sta->drv_priv; + + pos += scnprintf(buf+pos, bufsz-pos, + "ap_sta_id %d - reduced Tx power %d\n", + ap_sta_id, + mvm_sta->bt_reduced_txpower); + } } rcu_read_lock(); |