Commit 9e680946 authored by Eyal Shapira's avatar Eyal Shapira Committed by Emmanuel Grumbach

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: default avatarEyal Shapira <eyal@wizery.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 1a61b347
...@@ -750,8 +750,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -750,8 +750,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
#endif /* CONFIG_IWLWIFI_DEBUGFS */ #endif /* CONFIG_IWLWIFI_DEBUGFS */
/* rate scaling */ /* rate scaling */
int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init);
u8 flags, bool init);
/* power managment */ /* power managment */
static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm,
......
...@@ -298,7 +298,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm, ...@@ -298,7 +298,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm,
if (lq_sta->dbg_fixed_rate) { if (lq_sta->dbg_fixed_rate) {
rs_fill_link_cmd(NULL, NULL, lq_sta, lq_sta->dbg_fixed_rate); rs_fill_link_cmd(NULL, NULL, lq_sta, lq_sta->dbg_fixed_rate);
iwl_mvm_send_lq_cmd(lq_sta->drv, &lq_sta->lq, CMD_ASYNC, false); iwl_mvm_send_lq_cmd(lq_sta->drv, &lq_sta->lq, false);
} }
} }
#endif #endif
...@@ -855,7 +855,7 @@ static void rs_tx_status(void *mvm_r, struct ieee80211_supported_band *sband, ...@@ -855,7 +855,7 @@ static void rs_tx_status(void *mvm_r, struct ieee80211_supported_band *sband,
lq_sta->missed_rate_counter++; lq_sta->missed_rate_counter++;
if (lq_sta->missed_rate_counter > IWL_MISSED_RATE_MAX) { if (lq_sta->missed_rate_counter > IWL_MISSED_RATE_MAX) {
lq_sta->missed_rate_counter = 0; lq_sta->missed_rate_counter = 0;
iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_ASYNC, false); iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);
} }
/* Regardless, ignore this status info for outdated rate */ /* Regardless, ignore this status info for outdated rate */
return; return;
...@@ -1667,7 +1667,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm, ...@@ -1667,7 +1667,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm,
/* Update uCode's rate table. */ /* Update uCode's rate table. */
rate = rate_n_flags_from_tbl(mvm, tbl, index); rate = rate_n_flags_from_tbl(mvm, tbl, index);
rs_fill_link_cmd(mvm, sta, lq_sta, rate); rs_fill_link_cmd(mvm, sta, lq_sta, rate);
iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_ASYNC, false); iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);
} }
static u8 rs_get_tid(struct iwl_lq_sta *lq_data, static u8 rs_get_tid(struct iwl_lq_sta *lq_data,
...@@ -2064,7 +2064,7 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm, ...@@ -2064,7 +2064,7 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm,
"Switch current mcs: %X index: %d\n", "Switch current mcs: %X index: %d\n",
tbl->current_rate, index); tbl->current_rate, index);
rs_fill_link_cmd(mvm, sta, lq_sta, tbl->current_rate); rs_fill_link_cmd(mvm, sta, lq_sta, tbl->current_rate);
iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_ASYNC, false); iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, false);
} else { } else {
done_search = 1; done_search = 1;
} }
...@@ -2168,7 +2168,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, ...@@ -2168,7 +2168,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
rs_set_expected_tpt_table(lq_sta, tbl); rs_set_expected_tpt_table(lq_sta, tbl);
rs_fill_link_cmd(NULL, NULL, lq_sta, rate); rs_fill_link_cmd(NULL, NULL, lq_sta, rate);
/* TODO restore station should remember the lq cmd */ /* TODO restore station should remember the lq cmd */
iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, CMD_SYNC, true); iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq, true);
} }
static void rs_get_rate(void *mvm_r, struct ieee80211_sta *sta, void *mvm_sta, 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,5 +2841,5 @@ int iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
lq->flags &= ~LQ_FLAG_SET_STA_TLC_RTS_MSK; lq->flags &= ~LQ_FLAG_SET_STA_TLC_RTS_MSK;
} }
return iwl_mvm_send_lq_cmd(mvm, lq, CMD_ASYNC, false); return iwl_mvm_send_lq_cmd(mvm, lq, false);
} }
...@@ -945,7 +945,7 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -945,7 +945,7 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
*/ */
} }
return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.lq, CMD_ASYNC, false); return iwl_mvm_send_lq_cmd(mvm, &mvmsta->lq_sta.lq, false);
} }
int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif, int iwl_mvm_sta_tx_agg_stop(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
......
...@@ -486,22 +486,18 @@ void iwl_mvm_dump_sram(struct iwl_mvm *mvm) ...@@ -486,22 +486,18 @@ void iwl_mvm_dump_sram(struct iwl_mvm *mvm)
* this case to clear the state indicating that station creation is in * this case to clear the state indicating that station creation is in
* progress. * progress.
*/ */
int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init)
u8 flags, bool init)
{ {
struct iwl_host_cmd cmd = { struct iwl_host_cmd cmd = {
.id = LQ_CMD, .id = LQ_CMD,
.len = { sizeof(struct iwl_lq_cmd), }, .len = { sizeof(struct iwl_lq_cmd), },
.flags = flags, .flags = init ? CMD_SYNC : CMD_ASYNC,
.data = { lq, }, .data = { lq, },
}; };
if (WARN_ON(lq->sta_id == IWL_MVM_STATION_COUNT)) if (WARN_ON(lq->sta_id == IWL_MVM_STATION_COUNT))
return -EINVAL; return -EINVAL;
if (WARN_ON(init && (cmd.flags & CMD_ASYNC)))
return -EINVAL;
return iwl_mvm_send_cmd(mvm, &cmd); return iwl_mvm_send_cmd(mvm, &cmd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment