iwlwifi: mvm: remove users of nvm_data->valid_tx_ant
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 3 Apr 2013 17:10:06 +0000 (20:10 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 8 Apr 2013 11:31:08 +0000 (13:31 +0200)
In commit 332235427a566d8be04b9676a7ac380c8853aa9b
"iwlwifi: mvm: take the valid_{rx,tx}_ant from the TLV"

I replaced the access to nvm_data->valid_tx_ant to an inline
cheking the TLV flags but forgot a few occurences. Fix that.

Change-Id: I92daac735b46738d97fe2dbd5934bb177fd0751b
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-on: https://gerrit.rds.intel.com/12308
Tested-by: IWL Jenkins
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/mvm/rs.c
drivers/net/wireless/iwlwifi/mvm/tx.c

index a01a661..55334d5 100644 (file)
@@ -793,7 +793,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
 
                if (num_of_ant(tbl->ant_type) > 1)
                        tbl->ant_type =
-                           first_antenna(mvm->nvm_data->valid_tx_ant);
+                           first_antenna(iwl_fw_valid_tx_ant(mvm->fw));
 
                tbl->is_ht40 = 0;
                tbl->is_SGI = 0;
@@ -1235,7 +1235,7 @@ static int rs_switch_to_mimo2(struct iwl_mvm *mvm,
                return -1;
 
        /* Need both Tx chains/antennas to support MIMO */
-       if (num_of_ant(mvm->nvm_data->valid_tx_ant) < 2)
+       if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) < 2)
                return -1;
 
        IWL_DEBUG_RATE(mvm, "LQ: try to switch to MIMO2\n");
@@ -1287,7 +1287,7 @@ static int rs_switch_to_mimo3(struct iwl_mvm *mvm,
                return -1;
 
        /* Need both Tx chains/antennas to support MIMO */
-       if (num_of_ant(mvm->nvm_data->valid_tx_ant) < 3)
+       if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) < 3)
                return -1;
 
        IWL_DEBUG_RATE(mvm, "LQ: try to switch to MIMO3\n");
@@ -1381,7 +1381,7 @@ static int rs_move_legacy_other(struct iwl_mvm *mvm,
        u32 sz = (sizeof(struct iwl_scale_tbl_info) -
                  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
        u8 start_action;
-       u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+       u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
        u8 tx_chains_num = num_of_ant(valid_tx_ant);
        int ret;
        u8 update_search_tbl_counter = 0;
@@ -1514,7 +1514,7 @@ static int rs_move_siso_to_other(struct iwl_mvm *mvm,
        u32 sz = (sizeof(struct iwl_scale_tbl_info) -
                  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
        u8 start_action;
-       u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+       u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
        u8 tx_chains_num = num_of_ant(valid_tx_ant);
        u8 update_search_tbl_counter = 0;
        int ret;
@@ -1649,7 +1649,7 @@ static int rs_move_mimo2_to_other(struct iwl_mvm *mvm,
        u32 sz = (sizeof(struct iwl_scale_tbl_info) -
                  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
        u8 start_action;
-       u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+       u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
        u8 tx_chains_num = num_of_ant(valid_tx_ant);
        u8 update_search_tbl_counter = 0;
        int ret;
@@ -1786,7 +1786,7 @@ static int rs_move_mimo3_to_other(struct iwl_mvm *mvm,
        u32 sz = (sizeof(struct iwl_scale_tbl_info) -
                  (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
        u8 start_action;
-       u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+       u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
        u8 tx_chains_num = num_of_ant(valid_tx_ant);
        int ret;
        u8 update_search_tbl_counter = 0;
@@ -2449,7 +2449,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
 
        i = lq_sta->last_txrate_idx;
 
-       valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+       valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
 
        if (!lq_sta->search_better_tbl)
                active_tbl = lq_sta->active_tbl;
@@ -2639,15 +2639,15 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 
        /* These values will be overridden later */
        lq_sta->lq.single_stream_ant_msk =
-               first_antenna(mvm->nvm_data->valid_tx_ant);
+               first_antenna(iwl_fw_valid_tx_ant(mvm->fw));
        lq_sta->lq.dual_stream_ant_msk =
-               mvm->nvm_data->valid_tx_ant &
-               ~first_antenna(mvm->nvm_data->valid_tx_ant);
+               iwl_fw_valid_tx_ant(mvm->fw) &
+               ~first_antenna(iwl_fw_valid_tx_ant(mvm->fw));
        if (!lq_sta->lq.dual_stream_ant_msk) {
                lq_sta->lq.dual_stream_ant_msk = ANT_AB;
-       } else if (num_of_ant(mvm->nvm_data->valid_tx_ant) == 2) {
+       } else if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) == 2) {
                lq_sta->lq.dual_stream_ant_msk =
-                       mvm->nvm_data->valid_tx_ant;
+                       iwl_fw_valid_tx_ant(mvm->fw);
        }
 
        /* as default allow aggregation for all tids */
@@ -2708,7 +2708,7 @@ static void rs_fill_link_cmd(struct iwl_mvm *mvm,
        index++;
        repeat_rate--;
        if (mvm)
-               valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+               valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
 
        /* Fill rest of rate table */
        while (index < LINK_QUAL_MAX_RETRY_NUM) {
@@ -2813,7 +2813,7 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
        u8 ant_sel_tx;
 
        mvm = lq_sta->drv;
-       valid_tx_ant = mvm->nvm_data->valid_tx_ant;
+       valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
        if (lq_sta->dbg_fixed_rate) {
                ant_sel_tx =
                  ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK)
@@ -2884,9 +2884,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
        desc += sprintf(buff+desc, "fixed rate 0x%X\n",
                        lq_sta->dbg_fixed_rate);
        desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n",
-           (mvm->nvm_data->valid_tx_ant & ANT_A) ? "ANT_A," : "",
-           (mvm->nvm_data->valid_tx_ant & ANT_B) ? "ANT_B," : "",
-           (mvm->nvm_data->valid_tx_ant & ANT_C) ? "ANT_C" : "");
+           (iwl_fw_valid_tx_ant(mvm->fw) & ANT_A) ? "ANT_A," : "",
+           (iwl_fw_valid_tx_ant(mvm->fw) & ANT_B) ? "ANT_B," : "",
+           (iwl_fw_valid_tx_ant(mvm->fw) & ANT_C) ? "ANT_C" : "");
        desc += sprintf(buff+desc, "lq type %s\n",
           (is_legacy(tbl->lq_type)) ? "legacy" : "HT");
        if (is_Ht(tbl->lq_type)) {
index 3fed01e..4790743 100644 (file)
@@ -205,7 +205,7 @@ static void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm,
        rate_plcp = iwl_mvm_mac80211_idx_to_hwrate(rate_idx);
 
        mvm->mgmt_last_antenna_idx =
-               iwl_mvm_next_antenna(mvm, mvm->nvm_data->valid_tx_ant,
+               iwl_mvm_next_antenna(mvm, iwl_fw_valid_tx_ant(mvm->fw),
                                     mvm->mgmt_last_antenna_idx);
        rate_flags = BIT(mvm->mgmt_last_antenna_idx) << RATE_MCS_ANT_POS;