Commit 2152268f authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy

iwlwifi: op_mode holds its pointer to the config

Instead of using the shared area that we be killed.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 68e8dfda
...@@ -521,7 +521,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv) ...@@ -521,7 +521,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv)
iwl_prepare_legacy_sensitivity_tbl(priv, data, &cmd.enhance_table[0]); iwl_prepare_legacy_sensitivity_tbl(priv, data, &cmd.enhance_table[0]);
if (cfg(priv)->base_params->hd_v2) { if (priv->cfg->base_params->hd_v2) {
cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX] = cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX] =
HD_INA_NON_SQUARE_DET_OFDM_DATA_V2; HD_INA_NON_SQUARE_DET_OFDM_DATA_V2;
cmd.enhance_table[HD_INA_NON_SQUARE_DET_CCK_INDEX] = cmd.enhance_table[HD_INA_NON_SQUARE_DET_CCK_INDEX] =
...@@ -895,7 +895,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv, ...@@ -895,7 +895,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
continue; continue;
} }
delta_g = (cfg(priv)->base_params->chain_noise_scale * delta_g = (priv->cfg->base_params->chain_noise_scale *
((s32)average_noise[default_chain] - ((s32)average_noise[default_chain] -
(s32)average_noise[i])) / 1500; (s32)average_noise[i])) / 1500;
...@@ -1051,8 +1051,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv) ...@@ -1051,8 +1051,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
return; return;
/* Analyze signal for disconnected antenna */ /* Analyze signal for disconnected antenna */
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
/* Disable disconnected antenna algorithm for advanced /* Disable disconnected antenna algorithm for advanced
bt coex, assuming valid antennas are connected */ bt coex, assuming valid antennas are connected */
data->active_chains = priv->hw_params.valid_rx_ant; data->active_chains = priv->hw_params.valid_rx_ant;
......
...@@ -175,7 +175,7 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -175,7 +175,7 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
priv->hw_params.tx_chains_num = priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant); num_of_ant(priv->hw_params.valid_tx_ant);
if (cfg(priv)->rx_with_siso_diversity) if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1; priv->hw_params.rx_chains_num = 1;
else else
priv->hw_params.rx_chains_num = priv->hw_params.rx_chains_num =
...@@ -256,7 +256,7 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -256,7 +256,7 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
priv->hw_params.tx_chains_num = priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant); num_of_ant(priv->hw_params.valid_tx_ant);
if (cfg(priv)->rx_with_siso_diversity) if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1; priv->hw_params.rx_chains_num = 1;
else else
priv->hw_params.rx_chains_num = priv->hw_params.rx_chains_num =
...@@ -573,7 +573,7 @@ static void iwl6000_nic_config(struct iwl_priv *priv) ...@@ -573,7 +573,7 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
{ {
iwl_rf_config(priv); iwl_rf_config(priv);
switch (cfg(priv)->device_family) { switch (priv->cfg->device_family) {
case IWL_DEVICE_FAMILY_6005: case IWL_DEVICE_FAMILY_6005:
case IWL_DEVICE_FAMILY_6030: case IWL_DEVICE_FAMILY_6030:
case IWL_DEVICE_FAMILY_6000: case IWL_DEVICE_FAMILY_6000:
...@@ -633,7 +633,7 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -633,7 +633,7 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
priv->hw_params.tx_chains_num = priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant); num_of_ant(priv->hw_params.valid_tx_ant);
if (cfg(priv)->rx_with_siso_diversity) if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1; priv->hw_params.rx_chains_num = 1;
else else
priv->hw_params.rx_chains_num = priv->hw_params.rx_chains_num =
......
...@@ -312,21 +312,21 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv) ...@@ -312,21 +312,21 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) != BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
sizeof(basic.bt3_lookup_table)); sizeof(basic.bt3_lookup_table));
if (cfg(priv)->bt_params) { if (priv->cfg->bt_params) {
/* /*
* newer generation of devices (2000 series and newer) * newer generation of devices (2000 series and newer)
* use the version 2 of the bt command * use the version 2 of the bt command
* we need to make sure sending the host command * we need to make sure sending the host command
* with correct data structure to avoid uCode assert * with correct data structure to avoid uCode assert
*/ */
if (cfg(priv)->bt_params->bt_session_2) { if (priv->cfg->bt_params->bt_session_2) {
bt_cmd_v2.prio_boost = cpu_to_le32( bt_cmd_v2.prio_boost = cpu_to_le32(
cfg(priv)->bt_params->bt_prio_boost); priv->cfg->bt_params->bt_prio_boost);
bt_cmd_v2.tx_prio_boost = 0; bt_cmd_v2.tx_prio_boost = 0;
bt_cmd_v2.rx_prio_boost = 0; bt_cmd_v2.rx_prio_boost = 0;
} else { } else {
bt_cmd_v1.prio_boost = bt_cmd_v1.prio_boost =
cfg(priv)->bt_params->bt_prio_boost; priv->cfg->bt_params->bt_prio_boost;
bt_cmd_v1.tx_prio_boost = 0; bt_cmd_v1.tx_prio_boost = 0;
bt_cmd_v1.rx_prio_boost = 0; bt_cmd_v1.rx_prio_boost = 0;
} }
...@@ -374,7 +374,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv) ...@@ -374,7 +374,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
priv->bt_full_concurrent ? priv->bt_full_concurrent ?
"full concurrency" : "3-wire"); "full concurrency" : "3-wire");
if (cfg(priv)->bt_params->bt_session_2) { if (priv->cfg->bt_params->bt_session_2) {
memcpy(&bt_cmd_v2.basic, &basic, memcpy(&bt_cmd_v2.basic, &basic,
sizeof(basic)); sizeof(basic));
ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG, ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG,
...@@ -740,8 +740,8 @@ static bool is_single_rx_stream(struct iwl_priv *priv) ...@@ -740,8 +740,8 @@ static bool is_single_rx_stream(struct iwl_priv *priv)
*/ */
static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) static int iwl_get_active_rx_chain_count(struct iwl_priv *priv)
{ {
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist && priv->cfg->bt_params->advanced_bt_coexist &&
(priv->bt_full_concurrent || (priv->bt_full_concurrent ||
priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) { priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) {
/* /*
...@@ -812,8 +812,8 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx) ...@@ -812,8 +812,8 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
else else
active_chains = priv->hw_params.valid_rx_ant; active_chains = priv->hw_params.valid_rx_ant;
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist && priv->cfg->bt_params->advanced_bt_coexist &&
(priv->bt_full_concurrent || (priv->bt_full_concurrent ||
priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) { priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) {
/* /*
......
...@@ -1085,7 +1085,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, ...@@ -1085,7 +1085,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
(priv->tm_fixed_rate != lq_sta->dbg_fixed_rate)) (priv->tm_fixed_rate != lq_sta->dbg_fixed_rate))
rs_program_fix_rate(priv, lq_sta); rs_program_fix_rate(priv, lq_sta);
#endif #endif
if (cfg(priv)->bt_params && cfg(priv)->bt_params->advanced_bt_coexist) if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist)
rs_bt_update_lq(priv, ctx, lq_sta); rs_bt_update_lq(priv, ctx, lq_sta);
} }
...@@ -3063,11 +3063,11 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, ...@@ -3063,11 +3063,11 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
* overwrite if needed, pass aggregation time limit * overwrite if needed, pass aggregation time limit
* to uCode in uSec * to uCode in uSec
*/ */
if (priv && cfg(priv)->bt_params && if (priv && priv->cfg->bt_params &&
cfg(priv)->bt_params->agg_time_limit && priv->cfg->bt_params->agg_time_limit &&
priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH) priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)
lq_cmd->agg_params.agg_time_limit = lq_cmd->agg_params.agg_time_limit =
cpu_to_le16(cfg(priv)->bt_params->agg_time_limit); cpu_to_le16(priv->cfg->bt_params->agg_time_limit);
} }
static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
......
...@@ -1105,7 +1105,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv) ...@@ -1105,7 +1105,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv)
iwl_notification_wait_init(&priv->notif_wait); iwl_notification_wait_init(&priv->notif_wait);
/* Set up BT Rx handlers */ /* Set up BT Rx handlers */
if (cfg(priv)->bt_params) if (priv->cfg->bt_params)
iwlagn_bt_rx_handler_setup(priv); iwlagn_bt_rx_handler_setup(priv);
} }
......
...@@ -531,9 +531,9 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv, ...@@ -531,9 +531,9 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv,
} }
if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION && if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION &&
cfg(priv)->ht_params && cfg(priv)->ht_params->smps_mode) priv->cfg->ht_params && priv->cfg->ht_params->smps_mode)
ieee80211_request_smps(ctx->vif, ieee80211_request_smps(ctx->vif,
cfg(priv)->ht_params->smps_mode); priv->cfg->ht_params->smps_mode);
return 0; return 0;
} }
......
...@@ -632,7 +632,7 @@ void iwl_tt_initialize(struct iwl_priv *priv) ...@@ -632,7 +632,7 @@ void iwl_tt_initialize(struct iwl_priv *priv)
INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter); INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter);
INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit); INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit);
if (cfg(priv)->base_params->adv_thermal_throttle) { if (priv->cfg->base_params->adv_thermal_throttle) {
IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n"); IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n");
tt->restriction = kcalloc(IWL_TI_STATE_MAX, tt->restriction = kcalloc(IWL_TI_STATE_MAX,
sizeof(struct iwl_tt_restriction), sizeof(struct iwl_tt_restriction),
......
...@@ -85,8 +85,8 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv, ...@@ -85,8 +85,8 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv,
else if (ieee80211_is_back_req(fc)) else if (ieee80211_is_back_req(fc))
tx_flags |= TX_CMD_FLG_ACK_MSK | TX_CMD_FLG_IMM_BA_RSP_MASK; tx_flags |= TX_CMD_FLG_ACK_MSK | TX_CMD_FLG_IMM_BA_RSP_MASK;
else if (info->band == IEEE80211_BAND_2GHZ && else if (info->band == IEEE80211_BAND_2GHZ &&
cfg(priv)->bt_params && priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist && priv->cfg->bt_params->advanced_bt_coexist &&
(ieee80211_is_auth(fc) || ieee80211_is_assoc_req(fc) || (ieee80211_is_auth(fc) || ieee80211_is_assoc_req(fc) ||
ieee80211_is_reassoc_req(fc) || ieee80211_is_reassoc_req(fc) ||
skb->protocol == cpu_to_be16(ETH_P_PAE))) skb->protocol == cpu_to_be16(ETH_P_PAE)))
...@@ -203,8 +203,8 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, ...@@ -203,8 +203,8 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
rate_flags |= RATE_MCS_CCK_MSK; rate_flags |= RATE_MCS_CCK_MSK;
/* Set up antennas */ /* Set up antennas */
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist && priv->cfg->bt_params->advanced_bt_coexist &&
priv->bt_full_concurrent) { priv->bt_full_concurrent) {
/* operated as 1x1 in full concurrency mode */ /* operated as 1x1 in full concurrency mode */
priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
...@@ -501,7 +501,7 @@ static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int ac) ...@@ -501,7 +501,7 @@ static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int ac)
int q; int q;
for (q = IWLAGN_FIRST_AMPDU_QUEUE; for (q = IWLAGN_FIRST_AMPDU_QUEUE;
q < cfg(priv)->base_params->num_of_queues; q++) { q < priv->cfg->base_params->num_of_queues; q++) {
if (!test_and_set_bit(q, priv->agg_q_alloc)) { if (!test_and_set_bit(q, priv->agg_q_alloc)) {
priv->queue_to_ac[q] = ac; priv->queue_to_ac[q] = ac;
return q; return q;
...@@ -909,8 +909,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, ...@@ -909,8 +909,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv,
* notification again. * notification again.
*/ */
if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 && if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 &&
cfg(priv)->bt_params && priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
IWL_DEBUG_COEX(priv, "receive reply tx w/ bt_kill\n"); IWL_DEBUG_COEX(priv, "receive reply tx w/ bt_kill\n");
} }
...@@ -1249,7 +1249,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv, ...@@ -1249,7 +1249,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
* (in Tx queue's circular buffer) of first TFD/frame in window */ * (in Tx queue's circular buffer) of first TFD/frame in window */
u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn); u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn);
if (scd_flow >= cfg(priv)->base_params->num_of_queues) { if (scd_flow >= priv->cfg->base_params->num_of_queues) {
IWL_ERR(priv, IWL_ERR(priv,
"BUG_ON scd_flow is bigger than number of queues\n"); "BUG_ON scd_flow is bigger than number of queues\n");
return 0; return 0;
......
...@@ -674,7 +674,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv) ...@@ -674,7 +674,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
priv->thermal_throttle.ct_kill_toggle = false; priv->thermal_throttle.ct_kill_toggle = false;
if (cfg(priv)->base_params->support_ct_kill_exit) { if (priv->cfg->base_params->support_ct_kill_exit) {
adv_cmd.critical_temperature_enter = adv_cmd.critical_temperature_enter =
cpu_to_le32(priv->hw_params.ct_kill_threshold); cpu_to_le32(priv->hw_params.ct_kill_threshold);
adv_cmd.critical_temperature_exit = adv_cmd.critical_temperature_exit =
...@@ -791,10 +791,10 @@ int iwl_alive_start(struct iwl_priv *priv) ...@@ -791,10 +791,10 @@ int iwl_alive_start(struct iwl_priv *priv)
} }
/* download priority table before any calibration request */ /* download priority table before any calibration request */
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
/* Configure Bluetooth device coexistence support */ /* Configure Bluetooth device coexistence support */
if (cfg(priv)->bt_params->bt_sco_disable) if (priv->cfg->bt_params->bt_sco_disable)
priv->bt_enable_pspoll = false; priv->bt_enable_pspoll = false;
else else
priv->bt_enable_pspoll = true; priv->bt_enable_pspoll = true;
...@@ -931,9 +931,9 @@ void iwl_down(struct iwl_priv *priv) ...@@ -931,9 +931,9 @@ void iwl_down(struct iwl_priv *priv)
priv->bt_status = 0; priv->bt_status = 0;
priv->cur_rssi_ctx = NULL; priv->cur_rssi_ctx = NULL;
priv->bt_is_sco = 0; priv->bt_is_sco = 0;
if (cfg(priv)->bt_params) if (priv->cfg->bt_params)
priv->bt_traffic_load = priv->bt_traffic_load =
cfg(priv)->bt_params->bt_init_traffic_load; priv->cfg->bt_params->bt_init_traffic_load;
else else
priv->bt_traffic_load = 0; priv->bt_traffic_load = 0;
priv->bt_full_concurrent = false; priv->bt_full_concurrent = false;
...@@ -1114,7 +1114,7 @@ void iwl_setup_deferred_work(struct iwl_priv *priv) ...@@ -1114,7 +1114,7 @@ void iwl_setup_deferred_work(struct iwl_priv *priv)
iwl_setup_scan_deferred_work(priv); iwl_setup_scan_deferred_work(priv);
if (cfg(priv)->bt_params) if (priv->cfg->bt_params)
iwlagn_bt_setup_deferred_work(priv); iwlagn_bt_setup_deferred_work(priv);
init_timer(&priv->statistics_periodic); init_timer(&priv->statistics_periodic);
...@@ -1128,7 +1128,7 @@ void iwl_setup_deferred_work(struct iwl_priv *priv) ...@@ -1128,7 +1128,7 @@ void iwl_setup_deferred_work(struct iwl_priv *priv)
void iwl_cancel_deferred_work(struct iwl_priv *priv) void iwl_cancel_deferred_work(struct iwl_priv *priv)
{ {
if (cfg(priv)->bt_params) if (priv->cfg->bt_params)
iwlagn_bt_cancel_deferred_work(priv); iwlagn_bt_cancel_deferred_work(priv);
cancel_work_sync(&priv->run_time_calib_work); cancel_work_sync(&priv->run_time_calib_work);
...@@ -1179,8 +1179,8 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv, ...@@ -1179,8 +1179,8 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
ht_info->ht_supported = true; ht_info->ht_supported = true;
if (cfg(priv)->ht_params && if (priv->cfg->ht_params &&
cfg(priv)->ht_params->ht_greenfield_support) priv->cfg->ht_params->ht_greenfield_support)
ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD;
ht_info->cap |= IEEE80211_HT_CAP_SGI_20; ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
max_bit_rate = MAX_BIT_RATE_20_MHZ; max_bit_rate = MAX_BIT_RATE_20_MHZ;
...@@ -1362,7 +1362,7 @@ int iwl_init_drv(struct iwl_priv *priv) ...@@ -1362,7 +1362,7 @@ int iwl_init_drv(struct iwl_priv *priv)
priv->band = IEEE80211_BAND_2GHZ; priv->band = IEEE80211_BAND_2GHZ;
priv->plcp_delta_threshold = priv->plcp_delta_threshold =
cfg(priv)->base_params->plcp_delta_threshold; priv->cfg->base_params->plcp_delta_threshold;
priv->iw_mode = NL80211_IFTYPE_STATION; priv->iw_mode = NL80211_IFTYPE_STATION;
priv->current_ht_config.smps = IEEE80211_SMPS_STATIC; priv->current_ht_config.smps = IEEE80211_SMPS_STATIC;
...@@ -1379,8 +1379,8 @@ int iwl_init_drv(struct iwl_priv *priv) ...@@ -1379,8 +1379,8 @@ int iwl_init_drv(struct iwl_priv *priv)
iwl_init_scan_params(priv); iwl_init_scan_params(priv);
/* init bt coex */ /* init bt coex */
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT; priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT; priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK; priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
...@@ -1425,9 +1425,9 @@ void iwl_uninit_drv(struct iwl_priv *priv) ...@@ -1425,9 +1425,9 @@ void iwl_uninit_drv(struct iwl_priv *priv)
void iwl_set_hw_params(struct iwl_priv *priv) void iwl_set_hw_params(struct iwl_priv *priv)
{ {
if (cfg(priv)->ht_params) if (priv->cfg->ht_params)
priv->hw_params.use_rts_for_aggregation = priv->hw_params.use_rts_for_aggregation =
cfg(priv)->ht_params->use_rts_for_aggregation; priv->cfg->ht_params->use_rts_for_aggregation;
if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL) if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
priv->hw_params.sku &= ~EEPROM_SKU_CAP_11N_ENABLE; priv->hw_params.sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
...@@ -1474,6 +1474,7 @@ void iwl_debug_config(struct iwl_priv *priv) ...@@ -1474,6 +1474,7 @@ void iwl_debug_config(struct iwl_priv *priv)
} }
static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
const struct iwl_cfg *cfg,
const struct iwl_fw *fw) const struct iwl_fw *fw)
{ {
struct iwl_priv *priv; struct iwl_priv *priv;
...@@ -1499,8 +1500,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1499,8 +1500,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
************************/ ************************/
hw = iwl_alloc_all(); hw = iwl_alloc_all();
if (!hw) { if (!hw) {
pr_err("%s: Cannot allocate network device\n", pr_err("%s: Cannot allocate network device\n", cfg->name);
cfg(trans)->name);
goto out; goto out;
} }
...@@ -1509,9 +1509,10 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1509,9 +1509,10 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
priv = IWL_OP_MODE_GET_DVM(op_mode); priv = IWL_OP_MODE_GET_DVM(op_mode);
priv->shrd = trans->shrd; priv->shrd = trans->shrd;
priv->trans = trans; priv->trans = trans;
priv->cfg = cfg;
priv->fw = fw; priv->fw = fw;
switch (cfg(priv)->device_family) { switch (priv->cfg->device_family) {
case IWL_DEVICE_FAMILY_1000: case IWL_DEVICE_FAMILY_1000:
case IWL_DEVICE_FAMILY_100: case IWL_DEVICE_FAMILY_100:
priv->lib = &iwl1000_lib; priv->lib = &iwl1000_lib;
...@@ -1557,7 +1558,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1557,7 +1558,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
trans_cfg.rx_buf_size_8k = iwlagn_mod_params.amsdu_size_8K; trans_cfg.rx_buf_size_8k = iwlagn_mod_params.amsdu_size_8K;
if (!iwlagn_mod_params.wd_disable) if (!iwlagn_mod_params.wd_disable)
trans_cfg.queue_watchdog_timeout = trans_cfg.queue_watchdog_timeout =
cfg(priv)->base_params->wd_timeout; priv->cfg->base_params->wd_timeout;
else else
trans_cfg.queue_watchdog_timeout = IWL_WATCHHDOG_DISABLED; trans_cfg.queue_watchdog_timeout = IWL_WATCHHDOG_DISABLED;
trans_cfg.command_names = iwl_dvm_cmd_strings; trans_cfg.command_names = iwl_dvm_cmd_strings;
...@@ -1622,7 +1623,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1622,7 +1623,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
* 2. Read REV register * 2. Read REV register
***********************/ ***********************/
IWL_INFO(priv, "Detected %s, REV=0x%X\n", IWL_INFO(priv, "Detected %s, REV=0x%X\n",
cfg(priv)->name, priv->trans->hw_rev); priv->cfg->name, priv->trans->hw_rev);
if (iwl_trans_start_hw(priv->trans)) if (iwl_trans_start_hw(priv->trans))
goto out_free_traffic_mem; goto out_free_traffic_mem;
......
...@@ -279,8 +279,8 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena); ...@@ -279,8 +279,8 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena);
static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv) static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv)
{ {
return cfg(priv)->bt_params && return priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist; priv->cfg->bt_params->advanced_bt_coexist;
} }
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
......
...@@ -408,7 +408,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, ...@@ -408,7 +408,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
const u8 *ptr; const u8 *ptr;
char *buf; char *buf;
u16 eeprom_ver; u16 eeprom_ver;
size_t eeprom_len = cfg(priv)->base_params->eeprom_size; size_t eeprom_len = priv->cfg->base_params->eeprom_size;
buf_size = 4 * eeprom_len + 256; buf_size = 4 * eeprom_len + 256;
if (eeprom_len % 16) { if (eeprom_len % 16) {
...@@ -829,7 +829,7 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file, ...@@ -829,7 +829,7 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,
char *buf; char *buf;
int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) + int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) +
(cfg(priv)->base_params->num_of_queues * 32 * 8) + 400; (priv->cfg->base_params->num_of_queues * 32 * 8) + 400;
const u8 *ptr; const u8 *ptr;
ssize_t ret; ssize_t ret;
...@@ -2380,7 +2380,7 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file, ...@@ -2380,7 +2380,7 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file,
char buf[40]; char buf[40];
const size_t bufsz = sizeof(buf); const size_t bufsz = sizeof(buf);
if (cfg(priv)->ht_params) if (priv->cfg->ht_params)
pos += scnprintf(buf + pos, bufsz - pos, pos += scnprintf(buf + pos, bufsz - pos,
"use %s for aggregation\n", "use %s for aggregation\n",
(priv->hw_params.use_rts_for_aggregation) ? (priv->hw_params.use_rts_for_aggregation) ?
...@@ -2400,7 +2400,7 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file, ...@@ -2400,7 +2400,7 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
int buf_size; int buf_size;
int rts; int rts;
if (!cfg(priv)->ht_params) if (!priv->cfg->ht_params)
return -EINVAL; return -EINVAL;
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
......
...@@ -761,6 +761,7 @@ struct iwl_priv { ...@@ -761,6 +761,7 @@ struct iwl_priv {
/*data shared among all the driver's layers */ /*data shared among all the driver's layers */
struct iwl_shared *shrd; struct iwl_shared *shrd;
struct iwl_trans *trans; struct iwl_trans *trans;
const struct iwl_cfg *cfg;
const struct iwl_fw *fw; const struct iwl_fw *fw;
const struct iwl_lib_ops *lib; const struct iwl_lib_ops *lib;
unsigned long status; unsigned long status;
......
...@@ -859,7 +859,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) ...@@ -859,7 +859,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
release_firmware(ucode_raw); release_firmware(ucode_raw);
complete(&drv->request_firmware_complete); complete(&drv->request_firmware_complete);
drv->op_mode = iwl_dvm_ops.start(drv->trans, &drv->fw); drv->op_mode = iwl_dvm_ops.start(drv->trans, cfg, &drv->fw);
if (!drv->op_mode) if (!drv->op_mode)
goto out_unbind; goto out_unbind;
......
...@@ -236,8 +236,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv) ...@@ -236,8 +236,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION); eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
calib_ver = iwl_eeprom_calib_version(priv); calib_ver = iwl_eeprom_calib_version(priv);
if (eeprom_ver < cfg(priv)->eeprom_ver || if (eeprom_ver < priv->cfg->eeprom_ver ||
calib_ver < cfg(priv)->eeprom_calib_ver) calib_ver < priv->cfg->eeprom_calib_ver)
goto err; goto err;
IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n", IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n",
...@@ -247,8 +247,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv) ...@@ -247,8 +247,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
err: err:
IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x " IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x "
"CALIB=0x%x < 0x%x\n", "CALIB=0x%x < 0x%x\n",
eeprom_ver, cfg(priv)->eeprom_ver, eeprom_ver, priv->cfg->eeprom_ver,
calib_ver, cfg(priv)->eeprom_calib_ver); calib_ver, priv->cfg->eeprom_calib_ver);
return -EINVAL; return -EINVAL;
} }
...@@ -259,7 +259,7 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv) ...@@ -259,7 +259,7 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
priv->hw_params.sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP); priv->hw_params.sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP);
if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE && if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE &&
!cfg(priv)->ht_params) { !priv->cfg->ht_params) {
IWL_ERR(priv, "Invalid 11n configuration\n"); IWL_ERR(priv, "Invalid 11n configuration\n");
return -EINVAL; return -EINVAL;
} }
...@@ -277,10 +277,10 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv) ...@@ -277,10 +277,10 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
priv->hw_params.valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); priv->hw_params.valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg);
/* check overrides (some devices have wrong EEPROM) */ /* check overrides (some devices have wrong EEPROM) */
if (cfg(priv)->valid_tx_ant) if (priv->cfg->valid_tx_ant)
priv->hw_params.valid_tx_ant = cfg(priv)->valid_tx_ant; priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
if (cfg(priv)->valid_rx_ant) if (priv->cfg->valid_rx_ant)
priv->hw_params.valid_rx_ant = cfg(priv)->valid_rx_ant; priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
if (!priv->hw_params.valid_tx_ant || !priv->hw_params.valid_rx_ant) { if (!priv->hw_params.valid_tx_ant || !priv->hw_params.valid_rx_ant) {
IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n", IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n",
...@@ -349,7 +349,7 @@ static u32 eeprom_indirect_address(struct iwl_priv *priv, u32 address) ...@@ -349,7 +349,7 @@ static u32 eeprom_indirect_address(struct iwl_priv *priv, u32 address)
const u8 *iwl_eeprom_query_addr(struct iwl_priv *priv, size_t offset) const u8 *iwl_eeprom_query_addr(struct iwl_priv *priv, size_t offset)
{ {
u32 address = eeprom_indirect_address(priv, offset); u32 address = eeprom_indirect_address(priv, offset);
BUG_ON(address >= cfg(priv)->base_params->eeprom_size); BUG_ON(address >= priv->cfg->base_params->eeprom_size);
return &priv->eeprom[address]; return &priv->eeprom[address];
} }
...@@ -693,7 +693,7 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv) ...@@ -693,7 +693,7 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv)
((txp->delta_20_in_40 & 0xf0) >> 4), ((txp->delta_20_in_40 & 0xf0) >> 4),
(txp->delta_20_in_40 & 0x0f)); (txp->delta_20_in_40 & 0x0f));
max_txp_avg = iwl_get_max_txpower_avg(cfg(priv), txp_array, idx, max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx,
&max_txp_avg_halfdbm); &max_txp_avg_halfdbm);
/* /*
...@@ -730,7 +730,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -730,7 +730,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
if (priv->nvm_device_type == -ENOENT) if (priv->nvm_device_type == -ENOENT)
return -ENOENT; return -ENOENT;
/* allocate eeprom */ /* allocate eeprom */
sz = cfg(priv)->base_params->eeprom_size; sz = priv->cfg->base_params->eeprom_size;
IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz);
priv->eeprom = kzalloc(sz, GFP_KERNEL); priv->eeprom = kzalloc(sz, GFP_KERNEL);
if (!priv->eeprom) { if (!priv->eeprom) {
...@@ -770,7 +770,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev) ...@@ -770,7 +770,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK | CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK |
CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK);
/* traversing the linked list if no shadow ram supported */ /* traversing the linked list if no shadow ram supported */
if (!cfg(priv)->base_params->shadow_ram_support) { if (!priv->cfg->base_params->shadow_ram_support) {
if (iwl_find_otp_image(priv->trans, &validblockaddr)) { if (iwl_find_otp_image(priv->trans, &validblockaddr)) {
ret = -ENOENT; ret = -ENOENT;
goto done; goto done;
......
...@@ -138,11 +138,11 @@ static int iwl_led_cmd(struct iwl_priv *priv, ...@@ -138,11 +138,11 @@ static int iwl_led_cmd(struct iwl_priv *priv,
} }
IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n", IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n",
cfg(priv)->base_params->led_compensation); priv->cfg->base_params->led_compensation);
led_cmd.on = iwl_blink_compensation(priv, on, led_cmd.on = iwl_blink_compensation(priv, on,
cfg(priv)->base_params->led_compensation); priv->cfg->base_params->led_compensation);
led_cmd.off = iwl_blink_compensation(priv, off, led_cmd.off = iwl_blink_compensation(priv, off,
cfg(priv)->base_params->led_compensation); priv->cfg->base_params->led_compensation);
ret = iwl_send_led_cmd(priv, &led_cmd); ret = iwl_send_led_cmd(priv, &led_cmd);
if (!ret) { if (!ret) {
...@@ -183,7 +183,7 @@ void iwl_leds_init(struct iwl_priv *priv) ...@@ -183,7 +183,7 @@ void iwl_leds_init(struct iwl_priv *priv)
return; return;
} }
if (mode == IWL_LED_DEFAULT) if (mode == IWL_LED_DEFAULT)
mode = cfg(priv)->led_mode; mode = priv->cfg->led_mode;
priv->led.name = kasprintf(GFP_KERNEL, "%s-led", priv->led.name = kasprintf(GFP_KERNEL, "%s-led",
wiphy_name(priv->hw->wiphy)); wiphy_name(priv->hw->wiphy));
......
...@@ -1130,8 +1130,8 @@ void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw, ...@@ -1130,8 +1130,8 @@ void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw,
IWL_DEBUG_MAC80211(priv, "enter\n"); IWL_DEBUG_MAC80211(priv, "enter\n");
mutex_lock(&priv->mutex); mutex_lock(&priv->mutex);
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
if (rssi_event == RSSI_EVENT_LOW) if (rssi_event == RSSI_EVENT_LOW)
priv->bt_enable_pspoll = true; priv->bt_enable_pspoll = true;
else if (rssi_event == RSSI_EVENT_HIGH) else if (rssi_event == RSSI_EVENT_HIGH)
...@@ -1240,7 +1240,7 @@ int iwl_setup_interface(struct iwl_priv *priv, struct iwl_rxon_context *ctx) ...@@ -1240,7 +1240,7 @@ int iwl_setup_interface(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
return err; return err;
} }
if (cfg(priv)->bt_params && cfg(priv)->bt_params->advanced_bt_coexist && if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist &&
vif->type == NL80211_IFTYPE_ADHOC) { vif->type == NL80211_IFTYPE_ADHOC) {
/* /*
* pretend to have high BT traffic as long as we * pretend to have high BT traffic as long as we
......
...@@ -129,6 +129,7 @@ struct iwl_fw; ...@@ -129,6 +129,7 @@ struct iwl_fw;
*/ */
struct iwl_op_mode_ops { struct iwl_op_mode_ops {
struct iwl_op_mode *(*start)(struct iwl_trans *trans, struct iwl_op_mode *(*start)(struct iwl_trans *trans,
const struct iwl_cfg *cfg,
const struct iwl_fw *fw); const struct iwl_fw *fw);
void (*stop)(struct iwl_op_mode *op_mode); void (*stop)(struct iwl_op_mode *op_mode);
int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb, int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,
......
...@@ -167,7 +167,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, ...@@ -167,7 +167,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
u8 skip; u8 skip;
u32 slp_itrvl; u32 slp_itrvl;
if (cfg(priv)->adv_pm) { if (priv->cfg->adv_pm) {
table = apm_range_2; table = apm_range_2;
if (period <= IWL_DTIM_RANGE_1_MAX) if (period <= IWL_DTIM_RANGE_1_MAX)
table = apm_range_1; table = apm_range_1;
...@@ -215,13 +215,13 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, ...@@ -215,13 +215,13 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
else else
cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK; cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK;
if (cfg(priv)->base_params->shadow_reg_enable) if (priv->cfg->base_params->shadow_reg_enable)
cmd->flags |= IWL_POWER_SHADOW_REG_ENA; cmd->flags |= IWL_POWER_SHADOW_REG_ENA;
else else
cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
if (iwl_advanced_bt_coexist(priv)) { if (iwl_advanced_bt_coexist(priv)) {
if (!cfg(priv)->bt_params->bt_sco_disable) if (!priv->cfg->bt_params->bt_sco_disable)
cmd->flags |= IWL_POWER_BT_SCO_ENA; cmd->flags |= IWL_POWER_BT_SCO_ENA;
else else
cmd->flags &= ~IWL_POWER_BT_SCO_ENA; cmd->flags &= ~IWL_POWER_BT_SCO_ENA;
...@@ -295,7 +295,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, ...@@ -295,7 +295,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
if (priv->wowlan) if (priv->wowlan)
iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper); iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper);
else if (!cfg(priv)->base_params->no_idle_support && else if (!priv->cfg->base_params->no_idle_support &&
priv->hw->conf.flags & IEEE80211_CONF_IDLE) priv->hw->conf.flags & IEEE80211_CONF_IDLE)
iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20);
else if (iwl_tt_is_low_power_state(priv)) { else if (iwl_tt_is_low_power_state(priv)) {
......
...@@ -791,8 +791,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) ...@@ -791,8 +791,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
* Internal scans are passive, so we can indiscriminately set * Internal scans are passive, so we can indiscriminately set
* the BT ignore flag on 2.4 GHz since it applies to TX only. * the BT ignore flag on 2.4 GHz since it applies to TX only.
*/ */
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) priv->cfg->bt_params->advanced_bt_coexist)
scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT; scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT;
break; break;
case IEEE80211_BAND_5GHZ: case IEEE80211_BAND_5GHZ:
...@@ -834,8 +834,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) ...@@ -834,8 +834,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
band = priv->scan_band; band = priv->scan_band;
if (band == IEEE80211_BAND_2GHZ && if (band == IEEE80211_BAND_2GHZ &&
cfg(priv)->bt_params && priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
/* transmit 2.4 GHz probes only on first antenna */ /* transmit 2.4 GHz probes only on first antenna */
scan_tx_antennas = first_antenna(scan_tx_antennas); scan_tx_antennas = first_antenna(scan_tx_antennas);
} }
...@@ -863,8 +863,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) ...@@ -863,8 +863,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
rx_ant = first_antenna(active_chains); rx_ant = first_antenna(active_chains);
} }
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist && priv->cfg->bt_params->advanced_bt_coexist &&
priv->bt_full_concurrent) { priv->bt_full_concurrent) {
/* operated as 1x1 in full concurrency mode */ /* operated as 1x1 in full concurrency mode */
rx_ant = first_antenna(rx_ant); rx_ant = first_antenna(rx_ant);
......
...@@ -473,8 +473,8 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -473,8 +473,8 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
case IWL_TM_CMD_APP2DEV_GET_DEVICENAME: case IWL_TM_CMD_APP2DEV_GET_DEVICENAME:
rsp_data_ptr = (unsigned char *)cfg(priv)->name; rsp_data_ptr = (unsigned char *)priv->cfg->name;
rsp_data_len = strlen(cfg(priv)->name); rsp_data_len = strlen(priv->cfg->name);
skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
rsp_data_len + 20); rsp_data_len + 20);
if (!skb) { if (!skb) {
...@@ -534,7 +534,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -534,7 +534,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
case IWL_TM_CMD_APP2DEV_GET_EEPROM: case IWL_TM_CMD_APP2DEV_GET_EEPROM:
if (priv->eeprom) { if (priv->eeprom) {
skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
cfg(priv)->base_params->eeprom_size + 20); priv->cfg->base_params->eeprom_size + 20);
if (!skb) { if (!skb) {
IWL_ERR(priv, "Memory allocation fail\n"); IWL_ERR(priv, "Memory allocation fail\n");
return -ENOMEM; return -ENOMEM;
...@@ -542,7 +542,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb) ...@@ -542,7 +542,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND,
IWL_TM_CMD_DEV2APP_EEPROM_RSP); IWL_TM_CMD_DEV2APP_EEPROM_RSP);
NLA_PUT(skb, IWL_TM_ATTR_EEPROM, NLA_PUT(skb, IWL_TM_ATTR_EEPROM,
cfg(priv)->base_params->eeprom_size, priv->cfg->base_params->eeprom_size,
priv->eeprom); priv->eeprom);
status = cfg80211_testmode_reply(skb); status = cfg80211_testmode_reply(skb);
if (status < 0) if (status < 0)
......
...@@ -145,8 +145,8 @@ int iwl_init_alive_start(struct iwl_priv *priv) ...@@ -145,8 +145,8 @@ int iwl_init_alive_start(struct iwl_priv *priv)
{ {
int ret; int ret;
if (cfg(priv)->bt_params && if (priv->cfg->bt_params &&
cfg(priv)->bt_params->advanced_bt_coexist) { priv->cfg->bt_params->advanced_bt_coexist) {
/* /*
* Tell uCode we are ready to perform calibration * Tell uCode we are ready to perform calibration
* need to perform this before any calibration * need to perform this before any calibration
...@@ -168,8 +168,8 @@ int iwl_init_alive_start(struct iwl_priv *priv) ...@@ -168,8 +168,8 @@ int iwl_init_alive_start(struct iwl_priv *priv)
* temperature offset calibration is only needed for runtime ucode, * temperature offset calibration is only needed for runtime ucode,
* so prepare the value now. * so prepare the value now.
*/ */
if (cfg(priv)->need_temp_offset_calib) { if (priv->cfg->need_temp_offset_calib) {
if (cfg(priv)->temp_offset_v2) if (priv->cfg->temp_offset_v2)
return iwl_set_temperature_offset_calib_v2(priv); return iwl_set_temperature_offset_calib_v2(priv);
else else
return iwl_set_temperature_offset_calib(priv); return iwl_set_temperature_offset_calib(priv);
...@@ -253,7 +253,7 @@ static int iwl_alive_notify(struct iwl_priv *priv) ...@@ -253,7 +253,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
if (ret) if (ret)
return ret; return ret;
if (!cfg(priv)->no_xtal_calib) { if (!priv->cfg->no_xtal_calib) {
ret = iwl_set_Xtal_calib(priv); ret = iwl_set_Xtal_calib(priv);
if (ret) if (ret)
return ret; return ret;
......
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