diff options
author | Sara Sharon <sara.sharon@intel.com> | 2016-04-10 08:51:54 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-05-10 15:34:04 -0400 |
commit | 13303c0fb1481e40377d072a29570e005e7bd032 (patch) | |
tree | 500e217b7348e158f05a1319d9a38bbfe069de10 /drivers/net/wireless/intel/iwlwifi/mvm/tt.c | |
parent | ce1f27787d493bc28d2f523a3b4c9f72aa9cee7d (diff) |
iwlwifi: mvm: use helpers to get iwl_mvm_sta
Getting the mvm station out of station id requires dereferencing
the station id to get ieee80211_sta, then checking for pointer
validity and only then extract mvm station out.
Given that there are helpers to do it - use them instead of
duplicating the code whenever we need only mvm station.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tt.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c index eb3f460ce1b6..58fc7b3c711c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c | |||
@@ -359,16 +359,14 @@ static void iwl_mvm_tt_smps_iterator(void *_data, u8 *mac, | |||
359 | 359 | ||
360 | static void iwl_mvm_tt_tx_protection(struct iwl_mvm *mvm, bool enable) | 360 | static void iwl_mvm_tt_tx_protection(struct iwl_mvm *mvm, bool enable) |
361 | { | 361 | { |
362 | struct ieee80211_sta *sta; | ||
363 | struct iwl_mvm_sta *mvmsta; | 362 | struct iwl_mvm_sta *mvmsta; |
364 | int i, err; | 363 | int i, err; |
365 | 364 | ||
366 | for (i = 0; i < IWL_MVM_STATION_COUNT; i++) { | 365 | for (i = 0; i < IWL_MVM_STATION_COUNT; i++) { |
367 | sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], | 366 | mvmsta = iwl_mvm_sta_from_staid_protected(mvm, i); |
368 | lockdep_is_held(&mvm->mutex)); | 367 | if (!mvmsta) |
369 | if (IS_ERR_OR_NULL(sta)) | ||
370 | continue; | 368 | continue; |
371 | mvmsta = iwl_mvm_sta_from_mac80211(sta); | 369 | |
372 | if (enable == mvmsta->tt_tx_protection) | 370 | if (enable == mvmsta->tt_tx_protection) |
373 | continue; | 371 | continue; |
374 | err = iwl_mvm_tx_protection(mvm, mvmsta, enable); | 372 | err = iwl_mvm_tx_protection(mvm, mvmsta, enable); |