Commit 1023f3bc authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville

iwlegacy: remove set_hw_params callback

We do not need that callback, settings parameters can be done locally.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 00ea99e1
...@@ -6079,7 +6079,34 @@ il4965_hw_detect(struct il_priv *il) ...@@ -6079,7 +6079,34 @@ il4965_hw_detect(struct il_priv *il)
D_INFO("HW Revision ID = 0x%X\n", il->rev_id); D_INFO("HW Revision ID = 0x%X\n", il->rev_id);
} }
static int static struct il_sensitivity_ranges il4965_sensitivity = {
.min_nrg_cck = 97,
.max_nrg_cck = 0, /* not used, set to 0 */
.auto_corr_min_ofdm = 85,
.auto_corr_min_ofdm_mrc = 170,
.auto_corr_min_ofdm_x1 = 105,
.auto_corr_min_ofdm_mrc_x1 = 220,
.auto_corr_max_ofdm = 120,
.auto_corr_max_ofdm_mrc = 210,
.auto_corr_max_ofdm_x1 = 140,
.auto_corr_max_ofdm_mrc_x1 = 270,
.auto_corr_min_cck = 125,
.auto_corr_max_cck = 200,
.auto_corr_min_cck_mrc = 200,
.auto_corr_max_cck_mrc = 400,
.nrg_th_cck = 100,
.nrg_th_ofdm = 100,
.barker_corr_th_min = 190,
.barker_corr_th_min_mrc = 390,
.nrg_th_cca = 62,
};
static void
il4965_set_hw_params(struct il_priv *il) il4965_set_hw_params(struct il_priv *il)
{ {
il->hw_params.bcast_id = IL4965_BROADCAST_ID; il->hw_params.bcast_id = IL4965_BROADCAST_ID;
...@@ -6095,8 +6122,36 @@ il4965_set_hw_params(struct il_priv *il) ...@@ -6095,8 +6122,36 @@ il4965_set_hw_params(struct il_priv *il)
if (il->cfg->mod_params->disable_11n) if (il->cfg->mod_params->disable_11n)
il->cfg->sku &= ~IL_SKU_N; il->cfg->sku &= ~IL_SKU_N;
/* Device-specific setup */ if (il->cfg->mod_params->num_of_queues >= IL_MIN_NUM_QUEUES &&
return il->ops->lib->set_hw_params(il); il->cfg->mod_params->num_of_queues <= IL49_NUM_QUEUES)
il->cfg->num_of_queues =
il->cfg->mod_params->num_of_queues;
il->hw_params.max_txq_num = il->cfg->num_of_queues;
il->hw_params.dma_chnl_num = FH49_TCSR_CHNL_NUM;
il->hw_params.scd_bc_tbls_size =
il->cfg->num_of_queues *
sizeof(struct il4965_scd_bc_tbl);
il->hw_params.tfd_size = sizeof(struct il_tfd);
il->hw_params.max_stations = IL4965_STATION_COUNT;
il->hw_params.max_data_size = IL49_RTC_DATA_SIZE;
il->hw_params.max_inst_size = IL49_RTC_INST_SIZE;
il->hw_params.max_bsm_size = BSM_SRAM_SIZE;
il->hw_params.ht40_channel = BIT(IEEE80211_BAND_5GHZ);
il->hw_params.rx_wrt_ptr_reg = FH49_RSCSR_CHNL0_WPTR;
il->hw_params.tx_chains_num = il4965_num_of_ant(il->cfg->valid_tx_ant);
il->hw_params.rx_chains_num = il4965_num_of_ant(il->cfg->valid_rx_ant);
il->hw_params.valid_tx_ant = il->cfg->valid_tx_ant;
il->hw_params.valid_rx_ant = il->cfg->valid_rx_ant;
il->hw_params.ct_kill_threshold =
CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY);
il->hw_params.sens = &il4965_sensitivity;
il->hw_params.beacon_time_tsf_bits = IL4965_EXT_BEACON_TIME_POS;
} }
static int static int
...@@ -6230,10 +6285,7 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -6230,10 +6285,7 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/************************ /************************
* 5. Setup HW constants * 5. Setup HW constants
************************/ ************************/
if (il4965_set_hw_params(il)) { il4965_set_hw_params(il);
IL_ERR("failed to set hw parameters\n");
goto out_free_eeprom;
}
/******************* /*******************
* 6. Setup il * 6. Setup il
......
...@@ -569,81 +569,6 @@ il4965_chain_noise_reset(struct il_priv *il) ...@@ -569,81 +569,6 @@ il4965_chain_noise_reset(struct il_priv *il)
} }
} }
static struct il_sensitivity_ranges il4965_sensitivity = {
.min_nrg_cck = 97,
.max_nrg_cck = 0, /* not used, set to 0 */
.auto_corr_min_ofdm = 85,
.auto_corr_min_ofdm_mrc = 170,
.auto_corr_min_ofdm_x1 = 105,
.auto_corr_min_ofdm_mrc_x1 = 220,
.auto_corr_max_ofdm = 120,
.auto_corr_max_ofdm_mrc = 210,
.auto_corr_max_ofdm_x1 = 140,
.auto_corr_max_ofdm_mrc_x1 = 270,
.auto_corr_min_cck = 125,
.auto_corr_max_cck = 200,
.auto_corr_min_cck_mrc = 200,
.auto_corr_max_cck_mrc = 400,
.nrg_th_cck = 100,
.nrg_th_ofdm = 100,
.barker_corr_th_min = 190,
.barker_corr_th_min_mrc = 390,
.nrg_th_cca = 62,
};
static void
il4965_set_ct_threshold(struct il_priv *il)
{
/* want Kelvin */
il->hw_params.ct_kill_threshold =
CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY);
}
/**
* il4965_hw_set_hw_params
*
* Called when initializing driver
*/
static int
il4965_hw_set_hw_params(struct il_priv *il)
{
if (il->cfg->mod_params->num_of_queues >= IL_MIN_NUM_QUEUES &&
il->cfg->mod_params->num_of_queues <= IL49_NUM_QUEUES)
il->cfg->num_of_queues =
il->cfg->mod_params->num_of_queues;
il->hw_params.max_txq_num = il->cfg->num_of_queues;
il->hw_params.dma_chnl_num = FH49_TCSR_CHNL_NUM;
il->hw_params.scd_bc_tbls_size =
il->cfg->num_of_queues *
sizeof(struct il4965_scd_bc_tbl);
il->hw_params.tfd_size = sizeof(struct il_tfd);
il->hw_params.max_stations = IL4965_STATION_COUNT;
il->hw_params.max_data_size = IL49_RTC_DATA_SIZE;
il->hw_params.max_inst_size = IL49_RTC_INST_SIZE;
il->hw_params.max_bsm_size = BSM_SRAM_SIZE;
il->hw_params.ht40_channel = BIT(IEEE80211_BAND_5GHZ);
il->hw_params.rx_wrt_ptr_reg = FH49_RSCSR_CHNL0_WPTR;
il->hw_params.tx_chains_num = il4965_num_of_ant(il->cfg->valid_tx_ant);
il->hw_params.rx_chains_num = il4965_num_of_ant(il->cfg->valid_rx_ant);
il->hw_params.valid_tx_ant = il->cfg->valid_tx_ant;
il->hw_params.valid_rx_ant = il->cfg->valid_rx_ant;
il4965_set_ct_threshold(il);
il->hw_params.sens = &il4965_sensitivity;
il->hw_params.beacon_time_tsf_bits = IL4965_EXT_BEACON_TIME_POS;
return 0;
}
static s32 static s32
il4965_math_div_round(s32 num, s32 denom, s32 * res) il4965_math_div_round(s32 num, s32 denom, s32 * res)
{ {
...@@ -2276,7 +2201,6 @@ static struct il_hcmd_utils_ops il4965_hcmd_utils = { ...@@ -2276,7 +2201,6 @@ static struct il_hcmd_utils_ops il4965_hcmd_utils = {
}; };
static struct il_lib_ops il4965_lib = { static struct il_lib_ops il4965_lib = {
.set_hw_params = il4965_hw_set_hw_params,
.txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl, .txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl,
.txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd, .txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd,
.txq_free_tfd = il4965_hw_txq_free_tfd, .txq_free_tfd = il4965_hw_txq_free_tfd,
......
...@@ -1592,8 +1592,6 @@ struct il_temp_ops { ...@@ -1592,8 +1592,6 @@ struct il_temp_ops {
}; };
struct il_lib_ops { struct il_lib_ops {
/* set hw dependent parameters */
int (*set_hw_params) (struct il_priv *il);
/* Handling TX */ /* Handling TX */
void (*txq_update_byte_cnt_tbl) (struct il_priv *il, void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
struct il_tx_queue *txq, struct il_tx_queue *txq,
......
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