iwlwifi: remove iwl_fw_valid_(tx|rx)_ant inlines
authorJohannes Berg <johannes.berg@intel.com>
Wed, 12 Feb 2014 20:47:44 +0000 (21:47 +0100)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 13 Feb 2014 11:49:44 +0000 (13:49 +0200)
These inlines are pretty pointless now as they just return a
fixed struct value, remove them - the code even gets shorter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-fw.h
drivers/net/wireless/iwlwifi/mvm/debugfs.c
drivers/net/wireless/iwlwifi/mvm/fw.c
drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/iwlwifi/mvm/nvm.c
drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
drivers/net/wireless/iwlwifi/mvm/rs.c
drivers/net/wireless/iwlwifi/mvm/scan.c
drivers/net/wireless/iwlwifi/mvm/tx.c
drivers/net/wireless/iwlwifi/mvm/utils.c

index 73671072d0f6bfa96e62f1121bbd0933258062c1..af6b4528d499ff997512f0147ba4cd50464cfa28 100644 (file)
@@ -296,14 +296,4 @@ struct iwl_fw {
        struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS];
 };
 
-static inline u8 iwl_fw_valid_tx_ant(const struct iwl_fw *fw)
-{
-       return fw->valid_tx_ant;
-}
-
-static inline u8 iwl_fw_valid_rx_ant(const struct iwl_fw *fw)
-{
-       return fw->valid_rx_ant;
-}
-
 #endif  /* __iwl_fw_h__ */
index 9b9833720a245a086d53fba783befd9f2a81e140..3278b4890823a50ca13ea3ed625eefff7aac049b 100644 (file)
@@ -591,7 +591,7 @@ iwl_dbgfs_scan_ant_rxchain_write(struct iwl_mvm *mvm, char *buf,
                return -EINVAL;
        if (scan_rx_ant > ANT_ABC)
                return -EINVAL;
-       if (scan_rx_ant & ~iwl_fw_valid_rx_ant(mvm->fw))
+       if (scan_rx_ant & ~mvm->fw->valid_rx_ant)
                return -EINVAL;
 
        mvm->scan_rx_ant = scan_rx_ant;
index bae75b308fc0332bb08fbd30d3b21ec9fec56ee5..4f398e63f44a31c3e8bdb24fe251c5dea8c99ae1 100644 (file)
@@ -320,7 +320,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
        }
 
        /* Send TX valid antennas before triggering calibrations */
-       ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw));
+       ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant);
        if (ret)
                goto error;
 
@@ -422,7 +422,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
        if (ret)
                IWL_ERR(mvm, "Failed to initialize Smart Fifo\n");
 
-       ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw));
+       ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant);
        if (ret)
                goto error;
 
@@ -507,7 +507,7 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm)
                goto error;
        }
 
-       ret = iwl_send_tx_ant_cfg(mvm, iwl_fw_valid_tx_ant(mvm->fw));
+       ret = iwl_send_tx_ant_cfg(mvm, mvm->fw->valid_tx_ant);
        if (ret)
                goto error;
 
index 5c21aabb40cbc3b2c59309d26ea53c920bff2c28..9ccec10bba166299cc91cf1706992937127d277a 100644 (file)
@@ -952,7 +952,7 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,
                                             TX_CMD_FLG_TSF);
 
        mvm->mgmt_last_antenna_idx =
-               iwl_mvm_next_antenna(mvm, iwl_fw_valid_tx_ant(mvm->fw),
+               iwl_mvm_next_antenna(mvm, mvm->fw->valid_tx_ant,
                                     mvm->mgmt_last_antenna_idx);
 
        beacon_cmd.tx.rate_n_flags =
index e80e81a3f82837770dc3dca2ea97ad8cdab8e5a8..cf2d09f53782b0227f9a47d9a8761af8b5ea7ffe 100644 (file)
@@ -259,8 +259,8 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
 
        return iwl_parse_nvm_data(mvm->trans->dev, mvm->cfg, hw, sw, calib,
                                  regulatory, mac_override,
-                                 iwl_fw_valid_tx_ant(mvm->fw),
-                                 iwl_fw_valid_rx_ant(mvm->fw));
+                                 mvm->fw->valid_tx_ant,
+                                 mvm->fw->valid_rx_ant);
 }
 
 #define MAX_NVM_FILE_LEN       16384
index b7268c0b33339c975a93eca4450d145bfa27137b..237efe0ac1c44dab52d375ced3cb84912aabe082 100644 (file)
@@ -156,13 +156,13 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
        idle_cnt = chains_static;
        active_cnt = chains_dynamic;
 
-       cmd->rxchain_info = cpu_to_le32(iwl_fw_valid_rx_ant(mvm->fw) <<
+       cmd->rxchain_info = cpu_to_le32(mvm->fw->valid_rx_ant <<
                                        PHY_RX_CHAIN_VALID_POS);
        cmd->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS);
        cmd->rxchain_info |= cpu_to_le32(active_cnt <<
                                         PHY_RX_CHAIN_MIMO_CNT_POS);
 
-       cmd->txchain_info = cpu_to_le32(iwl_fw_valid_tx_ant(mvm->fw));
+       cmd->txchain_info = cpu_to_le32(mvm->fw->valid_tx_ant);
 }
 
 /*
index a6d0ab129c6b8b0693e7361e8607f8f71d9b8398..77c6e36c71cd470d55aebbeff457bf605a1ce598 100644 (file)
@@ -166,7 +166,7 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
        if (sta->smps_mode == IEEE80211_SMPS_STATIC)
                return false;
 
-       if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) < 2)
+       if (num_of_ant(mvm->fw->valid_tx_ant) < 2)
                return false;
 
        if (!iwl_mvm_bt_coex_is_mimo_allowed(mvm, sta))
@@ -917,7 +917,7 @@ static void rs_get_lower_rate_down_column(struct iwl_lq_sta *lq_sta,
 
 
        if (num_of_ant(rate->ant) > 1)
-               rate->ant = first_antenna(iwl_fw_valid_tx_ant(mvm->fw));
+               rate->ant = first_antenna(mvm->fw->valid_tx_ant);
 
        /* Relevant in both switching to SISO or Legacy */
        rate->sgi = false;
@@ -1477,7 +1477,7 @@ static enum rs_column rs_get_next_column(struct iwl_mvm *mvm,
        const struct rs_tx_column *curr_col = &rs_tx_columns[tbl->column];
        const struct rs_tx_column *next_col;
        allow_column_func_t allow_func;
-       u8 valid_ants = iwl_fw_valid_tx_ant(mvm->fw);
+       u8 valid_ants = mvm->fw->valid_tx_ant;
        const u16 *expected_tpt_tbl;
        s32 tpt, max_expected_tpt;
 
@@ -2089,7 +2089,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
 
        i = lq_sta->last_txrate_idx;
 
-       valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
+       valid_tx_ant = mvm->fw->valid_tx_ant;
 
        if (!lq_sta->search_better_tbl)
                active_tbl = lq_sta->active_tbl;
@@ -2319,7 +2319,7 @@ 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(iwl_fw_valid_tx_ant(mvm->fw));
+               first_antenna(mvm->fw->valid_tx_ant);
        lq_sta->lq.dual_stream_ant_msk = ANT_AB;
 
        /* as default allow aggregation for all tids */
@@ -2445,7 +2445,7 @@ static void rs_build_rates_table(struct iwl_mvm *mvm,
 
        memcpy(&rate, initial_rate, sizeof(rate));
 
-       valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);
+       valid_tx_ant = mvm->fw->valid_tx_ant;
 
        if (is_siso(&rate)) {
                num_rates = RS_INITIAL_SISO_NUM_RATES;
@@ -2676,9 +2676,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",
-           (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" : "");
+           (mvm->fw->valid_tx_ant & ANT_A) ? "ANT_A," : "",
+           (mvm->fw->valid_tx_ant & ANT_B) ? "ANT_B," : "",
+           (mvm->fw->valid_tx_ant & ANT_C) ? "ANT_C" : "");
        desc += sprintf(buff+desc, "lq type %s\n",
                        (is_legacy(rate)) ? "legacy" :
                        is_vht(rate) ? "VHT" : "HT");
index bf4e773c6f468d6d51ab1f332295d4a265287d8a..cea935b9afa634d61e03175e0b2451f9b2a6173b 100644 (file)
@@ -82,7 +82,7 @@ static inline __le16 iwl_mvm_scan_rx_chain(struct iwl_mvm *mvm)
        if (mvm->scan_rx_ant != ANT_NONE)
                rx_ant = mvm->scan_rx_ant;
        else
-               rx_ant = iwl_fw_valid_rx_ant(mvm->fw);
+               rx_ant = mvm->fw->valid_rx_ant;
        rx_chain = rx_ant << PHY_RX_CHAIN_VALID_POS;
        rx_chain |= rx_ant << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS;
        rx_chain |= rx_ant << PHY_RX_CHAIN_FORCE_SEL_POS;
@@ -124,7 +124,7 @@ iwl_mvm_scan_rate_n_flags(struct iwl_mvm *mvm, enum ieee80211_band band,
        u32 tx_ant;
 
        mvm->scan_last_antenna_idx =
-               iwl_mvm_next_antenna(mvm, iwl_fw_valid_tx_ant(mvm->fw),
+               iwl_mvm_next_antenna(mvm, mvm->fw->valid_tx_ant,
                                     mvm->scan_last_antenna_idx);
        tx_ant = BIT(mvm->scan_last_antenna_idx) << RATE_MCS_ANT_POS;
 
index 852d9d87a14c1da9cffeeb81f6c9c405c8afb185..b83ef6ad1242d9a304f3458d9d9a2e69c785d9c9 100644 (file)
@@ -207,7 +207,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, iwl_fw_valid_tx_ant(mvm->fw),
+               iwl_mvm_next_antenna(mvm, mvm->fw->valid_tx_ant,
                                     mvm->mgmt_last_antenna_idx);
        rate_flags = BIT(mvm->mgmt_last_antenna_idx) << RATE_MCS_ANT_POS;
 
index 2021b57189bc20fc5fc61c40b0514fbfae32ce59..c81a7fb6276c8ab672eff7cbde0f6d60dcc5ca48 100644 (file)
@@ -587,7 +587,7 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        lockdep_assert_held(&mvm->mutex);
 
        /* SMPS is irrelevant for NICs that don't have at least 2 RX antenna */
-       if (num_of_ant(iwl_fw_valid_rx_ant(mvm->fw)) == 1)
+       if (num_of_ant(mvm->fw->valid_rx_ant) == 1)
                return;
 
        if (vif->type == NL80211_IFTYPE_AP)