diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-01-14 08:30:32 +0200 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-02-03 22:23:33 +0200 |
commit | f327b04c4240cc6dbce698bea8f8e14db7fc3a8a (patch) | |
tree | 40bf61d0c1d6221c92ff732243dfd5fd1690e140 /drivers/net/wireless/iwlwifi/mvm/debugfs.c | |
parent | 33b2f6845b0c86ade2146ec9f259b857ecebeffc (diff) | |
download | lwn-f327b04c4240cc6dbce698bea8f8e14db7fc3a8a.tar.gz lwn-f327b04c4240cc6dbce698bea8f8e14db7fc3a8a.zip |
iwlwifi: mvm: provide helper to fetch the iwl_mvm_sta from sta_id
We somtimes need to fetch the iwl_mvm_sta structure from a
station index - provide a helper to do that.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index 369d4c90e669..8d3bf25f00d6 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c @@ -90,7 +90,7 @@ static ssize_t iwl_dbgfs_tx_flush_write(struct iwl_mvm *mvm, char *buf, static ssize_t iwl_dbgfs_sta_drain_write(struct iwl_mvm *mvm, char *buf, size_t count, loff_t *ppos) { - struct ieee80211_sta *sta; + struct iwl_mvm_sta *mvmsta; int sta_id, drain, ret; if (!mvm->ucode_loaded || mvm->cur_ucode != IWL_UCODE_REGULAR) @@ -105,13 +105,12 @@ static ssize_t iwl_dbgfs_sta_drain_write(struct iwl_mvm *mvm, char *buf, mutex_lock(&mvm->mutex); - sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], - lockdep_is_held(&mvm->mutex)); - if (IS_ERR_OR_NULL(sta)) + mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); + + if (!mvmsta) ret = -ENOENT; else - ret = iwl_mvm_drain_sta(mvm, (void *)sta->drv_priv, drain) ? : - count; + ret = iwl_mvm_drain_sta(mvm, mvmsta, drain) ? : count; mutex_unlock(&mvm->mutex); |