diff options
author | Eyal Shapira <eyal@wizery.com> | 2013-11-08 17:16:16 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-09 15:29:02 -0500 |
commit | 9e680946a48be7f7c074a60d8583b21815526d61 (patch) | |
tree | dcda251a6748584b6c5b9303072778b80def19d2 /drivers/net/wireless | |
parent | 1a61b3477817e1a1473644b87c9c377dc08f74c4 (diff) |
iwlwifi: mvm: simplify iwl_mvm_send_lq_cmd
Remove the flags parameter which should be set to sync or async
according to whether this is called during sta init or not.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/rs.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/utils.c | 8 |
4 files changed, 10 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index fed21ef4162d..7992baabb882 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -750,8 +750,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
750 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ | 750 | #endif /* CONFIG_IWLWIFI_DEBUGFS */ |
751 | 751 | ||
752 | /* rate scaling */ | 752 | /* rate scaling */ |
753 | int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, | 753 | int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init); |
754 | u8 flags, bool init); | ||
755 | 754 | ||
756 | /* power managment */ | 755 | /* power managment */ |
757 | static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, | 756 | static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index f7ac485f85e1..0a640891b460 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c | |||
@@ -298,7 +298,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm, | |||
298 | 298 | ||
299 | if (lq_sta->dbg_fixed_rate) { | 299 | if (lq_sta->dbg_fixed_rate) { |
300 | rs_fill_link_cmd(NULL, NULL, lq_sta, lq_sta->dbg_fixed_rate); | 300 | rs_fill_link_cmd(NULL, NULL, lq_sta, lq_sta->dbg_fixed_rate); |
301 | iwl_mvm_send_lq_cmd(lq_sta->drv, &lq_sta->lq, CMD_ASYNC, false); | 301 | iwl_mvm_send_lq_cmd(lq_sta->drv, &lq_sta->lq, false); |
302 | } | 302 | } |
303 | } | 303 | } |
304 | #endif | 304 | #endif |
@@ -855,7 +855,7 @@ static void rs_tx_status(void *mvm_r, struct ieee80211_supported_band *sband, | |||
855 | lq_sta->missed_rate_counter++; | 855 | lq_sta->missed_rate_counter++; |
856 | if (lq_sta->missed_rate_counter > IWL_MISSED_RATE_MAX) { | 856 | if (lq_sta->missed_rate_counter > IWL_MISSED_RATE_MAX) { |
857 | lq_sta->missed_rate_counter = 0; | 857 | lq_sta->missed_rate_counter = 0; |
858 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_ASYNC, false); | 858 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false); |
859 | } | 859 | } |
860 | /* Regardless, ignore this status info for outdated rate */ | 860 | /* Regardless, ignore this status info for outdated rate */ |
861 | return; | 861 | return; |
@@ -1667,7 +1667,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm, | |||
1667 | /* Update uCode's rate table. */ | 1667 | /* Update uCode's rate table. */ |
1668 | rate = rate_n_flags_from_tbl(mvm, tbl, index); | 1668 | rate = rate_n_flags_from_tbl(mvm, tbl, index); |
1669 | rs_fill_link_cmd(mvm, sta, lq_sta, rate); | 1669 | rs_fill_link_cmd(mvm, sta, lq_sta, rate); |
1670 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_ASYNC, false); | 1670 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false); |
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | static u8 rs_get_tid(struct iwl_lq_sta *lq_data, | 1673 | static u8 rs_get_tid(struct iwl_lq_sta *lq_data, |
@@ -2064,7 +2064,7 @@ lq_update: | |||
2064 | "Switch current mcs: %X index: %d\n", | 2064 | "Switch current mcs: %X index: %d\n", |
2065 | tbl->current_rate, index); | 2065 | tbl->current_rate, index); |
2066 | rs_fill_link_cmd(mvm, sta, lq_sta, tbl->current_rate); | 2066 | rs_fill_link_cmd(mvm, sta, lq_sta, tbl->current_rate); |
2067 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_ASYNC, false); | 2067 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false); |
2068 | } else { | 2068 | } else { |
2069 | done_search = 1; | 2069 | done_search = 1; |
2070 | } | 2070 | } |
@@ -2168,7 +2168,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, | |||
2168 | rs_set_expected_tpt_table(lq_sta, tbl); | 2168 | rs_set_expected_tpt_table(lq_sta, tbl); |
2169 | rs_fill_link_cmd(NULL, NULL, lq_sta, rate); | 2169 | rs_fill_link_cmd(NULL, NULL, lq_sta, rate); |
2170 | /* TODO restore station should remember the lq cmd */ | 2170 | /* TODO restore station should remember the lq cmd */ |
2171 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_SYNC, true); | 2171 | iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, true); |
2172 | } | 2172 | } |
2173 | 2173 | ||
2174 | static void rs_get_rate(void *mvm_r, struct ieee80211_sta *sta, void *mvm_sta, | 2174 | static void rs_get_rate(void *mvm_r, struct ieee80211_sta *sta, void *mvm_sta, |
@@ -2841,5 +2841,5 @@ int iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, | |||
2841 | lq->flags &= ~LQ_FLAG_SET_STA_TLC_RTS_MSK; | 2841 | lq->flags &= ~LQ_FLAG_SET_STA_TLC_RTS_MSK; |
2842 | } | 2842 | } |
2843 | 2843 | ||
2844 | return iwl_mvm_send_lq_cmd(mvm, lq, CMD_ASYNC, false); | 2844 | return iwl_mvm_send_lq_cmd(mvm, lq, false); |
2845 | } | 2845 | } |
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index 329952363a54..c89232c8aa79 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -945,7 +945,7 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
945 | */ | 945 | */ |
946 | } | 946 | } |
947 | 947 | ||
948 | return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.lq, CMD_ASYNC, false); | 948 | return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.lq, false); |
949 | } | 949 | } |
950 | 950 | ||
951 | int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 951 | int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c index ed69e9b78e82..56cf819bc0c7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c | |||
@@ -486,22 +486,18 @@ void iwl_mvm_dump_sram(struct iwl_mvm *mvm) | |||
486 | * this case to clear the state indicating that station creation is in | 486 | * this case to clear the state indicating that station creation is in |
487 | * progress. | 487 | * progress. |
488 | */ | 488 | */ |
489 | int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, | 489 | int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init) |
490 | u8 flags, bool init) | ||
491 | { | 490 | { |
492 | struct iwl_host_cmd cmd = { | 491 | struct iwl_host_cmd cmd = { |
493 | .id = LQ_CMD, | 492 | .id = LQ_CMD, |
494 | .len = { sizeof(struct iwl_lq_cmd), }, | 493 | .len = { sizeof(struct iwl_lq_cmd), }, |
495 | .flags = flags, | 494 | .flags = init ? CMD_SYNC : CMD_ASYNC, |
496 | .data = { lq, }, | 495 | .data = { lq, }, |
497 | }; | 496 | }; |
498 | 497 | ||
499 | if (WARN_ON(lq->sta_id == IWL_MVM_STATION_COUNT)) | 498 | if (WARN_ON(lq->sta_id == IWL_MVM_STATION_COUNT)) |
500 | return -EINVAL; | 499 | return -EINVAL; |
501 | 500 | ||
502 | if (WARN_ON(init && (cmd.flags & CMD_ASYNC))) | ||
503 | return -EINVAL; | ||
504 | |||
505 | return iwl_mvm_send_cmd(mvm, &cmd); | 501 | return iwl_mvm_send_cmd(mvm, &cmd); |
506 | } | 502 | } |
507 | 503 | ||