Commit 4ed735e7 authored by Johannes Berg's avatar Johannes Berg Committed by Emmanuel Grumbach

iwlwifi: remove iwl_fw_valid_(tx|rx)_ant inlines

These inlines are pretty pointless now as they just return a
fixed struct value, remove them - the code even gets shorter.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Reviewed-by: default avatarEran Harary <eran.harary@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 77db0a3c
...@@ -296,14 +296,4 @@ struct iwl_fw { ...@@ -296,14 +296,4 @@ struct iwl_fw {
struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS]; 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__ */ #endif /* __iwl_fw_h__ */
...@@ -591,7 +591,7 @@ iwl_dbgfs_scan_ant_rxchain_write(struct iwl_mvm *mvm, char *buf, ...@@ -591,7 +591,7 @@ iwl_dbgfs_scan_ant_rxchain_write(struct iwl_mvm *mvm, char *buf,
return -EINVAL; return -EINVAL;
if (scan_rx_ant > ANT_ABC) if (scan_rx_ant > ANT_ABC)
return -EINVAL; return -EINVAL;
if (scan_rx_ant & ~iwl_fw_valid_rx_ant(mvm->fw)) if (scan_rx_ant & ~mvm->fw->valid_rx_ant)
return -EINVAL; return -EINVAL;
mvm->scan_rx_ant = scan_rx_ant; mvm->scan_rx_ant = scan_rx_ant;
......
...@@ -320,7 +320,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) ...@@ -320,7 +320,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
} }
/* Send TX valid antennas before triggering calibrations */ /* 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) if (ret)
goto error; goto error;
...@@ -422,7 +422,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ...@@ -422,7 +422,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
if (ret) if (ret)
IWL_ERR(mvm, "Failed to initialize Smart Fifo\n"); 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) if (ret)
goto error; goto error;
...@@ -507,7 +507,7 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm) ...@@ -507,7 +507,7 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm)
goto error; 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) if (ret)
goto error; goto error;
......
...@@ -952,7 +952,7 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm, ...@@ -952,7 +952,7 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,
TX_CMD_FLG_TSF); TX_CMD_FLG_TSF);
mvm->mgmt_last_antenna_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); mvm->mgmt_last_antenna_idx);
beacon_cmd.tx.rate_n_flags = beacon_cmd.tx.rate_n_flags =
......
...@@ -259,8 +259,8 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm) ...@@ -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, return iwl_parse_nvm_data(mvm->trans->dev, mvm->cfg, hw, sw, calib,
regulatory, mac_override, regulatory, mac_override,
iwl_fw_valid_tx_ant(mvm->fw), mvm->fw->valid_tx_ant,
iwl_fw_valid_rx_ant(mvm->fw)); mvm->fw->valid_rx_ant);
} }
#define MAX_NVM_FILE_LEN 16384 #define MAX_NVM_FILE_LEN 16384
......
...@@ -156,13 +156,13 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm, ...@@ -156,13 +156,13 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
idle_cnt = chains_static; idle_cnt = chains_static;
active_cnt = chains_dynamic; 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); PHY_RX_CHAIN_VALID_POS);
cmd->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS); cmd->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS);
cmd->rxchain_info |= cpu_to_le32(active_cnt << cmd->rxchain_info |= cpu_to_le32(active_cnt <<
PHY_RX_CHAIN_MIMO_CNT_POS); 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);
} }
/* /*
......
...@@ -166,7 +166,7 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, ...@@ -166,7 +166,7 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
if (sta->smps_mode == IEEE80211_SMPS_STATIC) if (sta->smps_mode == IEEE80211_SMPS_STATIC)
return false; 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; return false;
if (!iwl_mvm_bt_coex_is_mimo_allowed(mvm, sta)) 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, ...@@ -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) 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 */ /* Relevant in both switching to SISO or Legacy */
rate->sgi = false; rate->sgi = false;
...@@ -1477,7 +1477,7 @@ static enum rs_column rs_get_next_column(struct iwl_mvm *mvm, ...@@ -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 *curr_col = &rs_tx_columns[tbl->column];
const struct rs_tx_column *next_col; const struct rs_tx_column *next_col;
allow_column_func_t allow_func; 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; const u16 *expected_tpt_tbl;
s32 tpt, max_expected_tpt; s32 tpt, max_expected_tpt;
...@@ -2089,7 +2089,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, ...@@ -2089,7 +2089,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm,
i = lq_sta->last_txrate_idx; 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) if (!lq_sta->search_better_tbl)
active_tbl = lq_sta->active_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, ...@@ -2319,7 +2319,7 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
/* These values will be overridden later */ /* These values will be overridden later */
lq_sta->lq.single_stream_ant_msk = 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; lq_sta->lq.dual_stream_ant_msk = ANT_AB;
/* as default allow aggregation for all tids */ /* as default allow aggregation for all tids */
...@@ -2445,7 +2445,7 @@ static void rs_build_rates_table(struct iwl_mvm *mvm, ...@@ -2445,7 +2445,7 @@ static void rs_build_rates_table(struct iwl_mvm *mvm,
memcpy(&rate, initial_rate, sizeof(rate)); 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)) { if (is_siso(&rate)) {
num_rates = RS_INITIAL_SISO_NUM_RATES; num_rates = RS_INITIAL_SISO_NUM_RATES;
...@@ -2676,9 +2676,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, ...@@ -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", desc += sprintf(buff+desc, "fixed rate 0x%X\n",
lq_sta->dbg_fixed_rate); lq_sta->dbg_fixed_rate);
desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n",
(iwl_fw_valid_tx_ant(mvm->fw) & ANT_A) ? "ANT_A," : "", (mvm->fw->valid_tx_ant & ANT_A) ? "ANT_A," : "",
(iwl_fw_valid_tx_ant(mvm->fw) & ANT_B) ? "ANT_B," : "", (mvm->fw->valid_tx_ant & ANT_B) ? "ANT_B," : "",
(iwl_fw_valid_tx_ant(mvm->fw) & ANT_C) ? "ANT_C" : ""); (mvm->fw->valid_tx_ant & ANT_C) ? "ANT_C" : "");
desc += sprintf(buff+desc, "lq type %s\n", desc += sprintf(buff+desc, "lq type %s\n",
(is_legacy(rate)) ? "legacy" : (is_legacy(rate)) ? "legacy" :
is_vht(rate) ? "VHT" : "HT"); is_vht(rate) ? "VHT" : "HT");
......
...@@ -82,7 +82,7 @@ static inline __le16 iwl_mvm_scan_rx_chain(struct iwl_mvm *mvm) ...@@ -82,7 +82,7 @@ static inline __le16 iwl_mvm_scan_rx_chain(struct iwl_mvm *mvm)
if (mvm->scan_rx_ant != ANT_NONE) if (mvm->scan_rx_ant != ANT_NONE)
rx_ant = mvm->scan_rx_ant; rx_ant = mvm->scan_rx_ant;
else 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_VALID_POS;
rx_chain |= rx_ant << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS; rx_chain |= rx_ant << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS;
rx_chain |= rx_ant << PHY_RX_CHAIN_FORCE_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, ...@@ -124,7 +124,7 @@ iwl_mvm_scan_rate_n_flags(struct iwl_mvm *mvm, enum ieee80211_band band,
u32 tx_ant; u32 tx_ant;
mvm->scan_last_antenna_idx = 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); mvm->scan_last_antenna_idx);
tx_ant = BIT(mvm->scan_last_antenna_idx) << RATE_MCS_ANT_POS; tx_ant = BIT(mvm->scan_last_antenna_idx) << RATE_MCS_ANT_POS;
......
...@@ -207,7 +207,7 @@ static void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, ...@@ -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); rate_plcp = iwl_mvm_mac80211_idx_to_hwrate(rate_idx);
mvm->mgmt_last_antenna_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); mvm->mgmt_last_antenna_idx);
rate_flags = BIT(mvm->mgmt_last_antenna_idx) << RATE_MCS_ANT_POS; rate_flags = BIT(mvm->mgmt_last_antenna_idx) << RATE_MCS_ANT_POS;
......
...@@ -587,7 +587,7 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -587,7 +587,7 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
/* SMPS is irrelevant for NICs that don't have at least 2 RX antenna */ /* 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; return;
if (vif->type == NL80211_IFTYPE_AP) if (vif->type == NL80211_IFTYPE_AP)
......
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