OSDN Git Service

iwlwifi: mvm: simplify iwl_mvm_send_lq_cmd
authorEyal Shapira <eyal@wizery.com>
Fri, 8 Nov 2013 22:16:16 +0000 (00:16 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 9 Dec 2013 20:29:02 +0000 (22:29 +0200)
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>
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/rs.c
drivers/net/wireless/iwlwifi/mvm/sta.c
drivers/net/wireless/iwlwifi/mvm/utils.c

index fed21ef..7992baa 100644 (file)
@@ -750,8 +750,7 @@ iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 #endif /* CONFIG_IWLWIFI_DEBUGFS */
 
 /* rate scaling */
-int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq,
-                       u8 flags, bool init);
+int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init);
 
 /* power managment */
 static inline int iwl_mvm_power_update_mode(struct iwl_mvm *mvm,
index f7ac485..0a64089 100644 (file)
@@ -298,7 +298,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm,
 
        if (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
@@ -855,7 +855,7 @@ static void rs_tx_status(void *mvm_r, struct ieee80211_supported_band *sband,
                lq_sta->missed_rate_counter++;
                if (lq_sta->missed_rate_counter > IWL_MISSED_RATE_MAX) {
                        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 */
                return;
@@ -1667,7 +1667,7 @@ static void rs_update_rate_tbl(struct iwl_mvm *mvm,
        /* Update uCode's rate table. */
        rate = rate_n_flags_from_tbl(mvm, tbl, index);
        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,
@@ -2064,7 +2064,7 @@ lq_update:
                                       "Switch current  mcs: %X index: %d\n",
                                       tbl->current_rate, index);
                        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 {
                        done_search = 1;
                }
@@ -2168,7 +2168,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
        rs_set_expected_tpt_table(lq_sta, tbl);
        rs_fill_link_cmd(NULL, NULL, lq_sta, rate);
        /* 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,
@@ -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;
        }
 
-       return iwl_mvm_send_lq_cmd(mvm, lq, CMD_ASYNC, false);
+       return iwl_mvm_send_lq_cmd(mvm, lq, false);
 }
index 3299523..c89232c 100644 (file)
@@ -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,
index ed69e9b..56cf819 100644 (file)
@@ -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
  * progress.
  */
-int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq,
-                       u8 flags, bool init)
+int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq, bool init)
 {
        struct iwl_host_cmd cmd = {
                .id = LQ_CMD,
                .len = { sizeof(struct iwl_lq_cmd), },
-               .flags = flags,
+               .flags = init ? CMD_SYNC : CMD_ASYNC,
                .data = { lq, },
        };
 
        if (WARN_ON(lq->sta_id == IWL_MVM_STATION_COUNT))
                return -EINVAL;
 
-       if (WARN_ON(init && (cmd.flags & CMD_ASYNC)))
-               return -EINVAL;
-
        return iwl_mvm_send_cmd(mvm, &cmd);
 }