Commit 0d8877a1 authored by Johannes Berg's avatar Johannes Berg

iwlwifi: move some configuration parameters into DVM

There are a number of parameters that aren't really hardware
specific but rather define how the DVM firmware is used.
Move these into the DVM configuration.
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ee4d5471
...@@ -78,10 +78,13 @@ ...@@ -78,10 +78,13 @@
/* device operations */ /* device operations */
extern struct iwl_dvm_cfg iwl_dvm_1000_cfg; extern struct iwl_dvm_cfg iwl_dvm_1000_cfg;
extern struct iwl_dvm_cfg iwl_dvm_2000_cfg; extern struct iwl_dvm_cfg iwl_dvm_2000_cfg;
extern struct iwl_dvm_cfg iwl_dvm_105_cfg;
extern struct iwl_dvm_cfg iwl_dvm_2030_cfg; extern struct iwl_dvm_cfg iwl_dvm_2030_cfg;
extern struct iwl_dvm_cfg iwl_dvm_5000_cfg; extern struct iwl_dvm_cfg iwl_dvm_5000_cfg;
extern struct iwl_dvm_cfg iwl_dvm_5150_cfg; extern struct iwl_dvm_cfg iwl_dvm_5150_cfg;
extern struct iwl_dvm_cfg iwl_dvm_6000_cfg; extern struct iwl_dvm_cfg iwl_dvm_6000_cfg;
extern struct iwl_dvm_cfg iwl_dvm_6005_cfg;
extern struct iwl_dvm_cfg iwl_dvm_6050_cfg;
extern struct iwl_dvm_cfg iwl_dvm_6030_cfg; extern struct iwl_dvm_cfg iwl_dvm_6030_cfg;
...@@ -291,8 +294,8 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena); ...@@ -291,8 +294,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 priv->cfg->bt_params && return priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist; priv->lib->bt_params->advanced_bt_coexist;
} }
#ifdef CONFIG_IWLWIFI_DEBUG #ifdef CONFIG_IWLWIFI_DEBUG
......
...@@ -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 (priv->cfg->base_params->hd_v2) { if (priv->lib->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 = (priv->cfg->base_params->chain_noise_scale * delta_g = (priv->lib->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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->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->nvm_data->valid_rx_ant; data->active_chains = priv->nvm_data->valid_rx_ant;
......
...@@ -568,16 +568,61 @@ struct iwl_hw_params { ...@@ -568,16 +568,61 @@ struct iwl_hw_params {
const struct iwl_sensitivity_ranges *sens; const struct iwl_sensitivity_ranges *sens;
}; };
/**
* struct iwl_dvm_bt_params - DVM specific BT (coex) parameters
* @advanced_bt_coexist: support advanced bt coexist
* @bt_init_traffic_load: specify initial bt traffic load
* @bt_prio_boost: default bt priority boost value
* @agg_time_limit: maximum number of uSec in aggregation
* @bt_sco_disable: uCode should not response to BT in SCO/ESCO mode
*/
struct iwl_dvm_bt_params {
bool advanced_bt_coexist;
u8 bt_init_traffic_load;
u32 bt_prio_boost;
u16 agg_time_limit;
bool bt_sco_disable;
bool bt_session_2;
};
/**
* struct iwl_dvm_cfg - DVM firmware specific device configuration
* @set_hw_params: set hardware parameters
* @set_channel_switch: send channel switch command
* @nic_config: apply device specific configuration
* @temperature: read temperature
* @adv_thermal_throttle: support advance thermal throttle
* @support_ct_kill_exit: support ct kill exit condition
* @plcp_delta_threshold: plcp error rate threshold used to trigger
* radio tuning when there is a high receiving plcp error rate
* @chain_noise_scale: default chain noise scale used for gain computation
* @hd_v2: v2 of enhanced sensitivity value, used for 2000 series and up
* @no_idle_support: do not support idle mode
* @bt_params: pointer to BT parameters
* @need_temp_offset_calib: need to perform temperature offset calibration
* @no_xtal_calib: some devices do not need crystal calibration data,
* don't send it to those
* @temp_offset_v2: support v2 of temperature offset calibration
* @adv_pm: advanced power management
*/
struct iwl_dvm_cfg { struct iwl_dvm_cfg {
/* set hw dependent parameters */
void (*set_hw_params)(struct iwl_priv *priv); void (*set_hw_params)(struct iwl_priv *priv);
int (*set_channel_switch)(struct iwl_priv *priv, int (*set_channel_switch)(struct iwl_priv *priv,
struct ieee80211_channel_switch *ch_switch); struct ieee80211_channel_switch *ch_switch);
/* device specific configuration */
void (*nic_config)(struct iwl_priv *priv); void (*nic_config)(struct iwl_priv *priv);
/* temperature */
void (*temperature)(struct iwl_priv *priv); void (*temperature)(struct iwl_priv *priv);
const struct iwl_dvm_bt_params *bt_params;
s32 chain_noise_scale;
u8 plcp_delta_threshold;
bool adv_thermal_throttle;
bool support_ct_kill_exit;
bool hd_v2;
bool no_idle_support;
bool need_temp_offset_calib;
bool no_xtal_calib;
bool temp_offset_v2;
bool adv_pm;
}; };
struct iwl_wipan_noa_data { struct iwl_wipan_noa_data {
......
...@@ -178,6 +178,9 @@ struct iwl_dvm_cfg iwl_dvm_1000_cfg = { ...@@ -178,6 +178,9 @@ struct iwl_dvm_cfg iwl_dvm_1000_cfg = {
.set_hw_params = iwl1000_hw_set_hw_params, .set_hw_params = iwl1000_hw_set_hw_params,
.nic_config = iwl1000_nic_config, .nic_config = iwl1000_nic_config,
.temperature = iwlagn_temperature, .temperature = iwlagn_temperature,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
}; };
...@@ -236,12 +239,52 @@ struct iwl_dvm_cfg iwl_dvm_2000_cfg = { ...@@ -236,12 +239,52 @@ struct iwl_dvm_cfg iwl_dvm_2000_cfg = {
.set_hw_params = iwl2000_hw_set_hw_params, .set_hw_params = iwl2000_hw_set_hw_params,
.nic_config = iwl2000_nic_config, .nic_config = iwl2000_nic_config,
.temperature = iwlagn_temperature, .temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.hd_v2 = true,
.need_temp_offset_calib = true,
.temp_offset_v2 = true,
};
struct iwl_dvm_cfg iwl_dvm_105_cfg = {
.set_hw_params = iwl2000_hw_set_hw_params,
.nic_config = iwl2000_nic_config,
.temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.hd_v2 = true,
.need_temp_offset_calib = true,
.temp_offset_v2 = true,
.adv_pm = true,
};
static const struct iwl_dvm_bt_params iwl2030_bt_params = {
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.advanced_bt_coexist = true,
.agg_time_limit = BT_AGG_THRESHOLD_DEF,
.bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
.bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT32,
.bt_sco_disable = true,
.bt_session_2 = true,
}; };
struct iwl_dvm_cfg iwl_dvm_2030_cfg = { struct iwl_dvm_cfg iwl_dvm_2030_cfg = {
.set_hw_params = iwl2000_hw_set_hw_params, .set_hw_params = iwl2000_hw_set_hw_params,
.nic_config = iwl2000_nic_config, .nic_config = iwl2000_nic_config,
.temperature = iwlagn_temperature, .temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.hd_v2 = true,
.bt_params = &iwl2030_bt_params,
.need_temp_offset_calib = true,
.temp_offset_v2 = true,
.adv_pm = true,
}; };
/* /*
...@@ -424,12 +467,19 @@ struct iwl_dvm_cfg iwl_dvm_5000_cfg = { ...@@ -424,12 +467,19 @@ struct iwl_dvm_cfg iwl_dvm_5000_cfg = {
.set_hw_params = iwl5000_hw_set_hw_params, .set_hw_params = iwl5000_hw_set_hw_params,
.set_channel_switch = iwl5000_hw_channel_switch, .set_channel_switch = iwl5000_hw_channel_switch,
.temperature = iwlagn_temperature, .temperature = iwlagn_temperature,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.no_idle_support = true,
}; };
struct iwl_dvm_cfg iwl_dvm_5150_cfg = { struct iwl_dvm_cfg iwl_dvm_5150_cfg = {
.set_hw_params = iwl5150_hw_set_hw_params, .set_hw_params = iwl5150_hw_set_hw_params,
.set_channel_switch = iwl5000_hw_channel_switch, .set_channel_switch = iwl5000_hw_channel_switch,
.temperature = iwl5150_temperature, .temperature = iwl5150_temperature,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.no_idle_support = true,
.no_xtal_calib = true,
}; };
...@@ -589,6 +639,42 @@ struct iwl_dvm_cfg iwl_dvm_6000_cfg = { ...@@ -589,6 +639,42 @@ struct iwl_dvm_cfg iwl_dvm_6000_cfg = {
.set_channel_switch = iwl6000_hw_channel_switch, .set_channel_switch = iwl6000_hw_channel_switch,
.nic_config = iwl6000_nic_config, .nic_config = iwl6000_nic_config,
.temperature = iwlagn_temperature, .temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
};
const struct iwl_dvm_cfg iwl_dvm_6005_cfg = {
.set_hw_params = iwl6000_hw_set_hw_params,
.set_channel_switch = iwl6000_hw_channel_switch,
.nic_config = iwl6000_nic_config,
.temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.need_temp_offset_calib = true,
};
struct iwl_dvm_cfg iwl_dvm_6050_cfg = {
.set_hw_params = iwl6000_hw_set_hw_params,
.set_channel_switch = iwl6000_hw_channel_switch,
.nic_config = iwl6000_nic_config,
.temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1500,
};
static const struct iwl_dvm_bt_params iwl6000_bt_params = {
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.advanced_bt_coexist = true,
.agg_time_limit = BT_AGG_THRESHOLD_DEF,
.bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
.bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
.bt_sco_disable = true,
}; };
struct iwl_dvm_cfg iwl_dvm_6030_cfg = { struct iwl_dvm_cfg iwl_dvm_6030_cfg = {
...@@ -596,4 +682,11 @@ struct iwl_dvm_cfg iwl_dvm_6030_cfg = { ...@@ -596,4 +682,11 @@ struct iwl_dvm_cfg iwl_dvm_6030_cfg = {
.set_channel_switch = iwl6000_hw_channel_switch, .set_channel_switch = iwl6000_hw_channel_switch,
.nic_config = iwl6000_nic_config, .nic_config = iwl6000_nic_config,
.temperature = iwlagn_temperature, .temperature = iwlagn_temperature,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.bt_params = &iwl6000_bt_params,
.need_temp_offset_calib = true,
.adv_pm = true,
}; };
...@@ -254,23 +254,23 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv) ...@@ -254,23 +254,23 @@ 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 (priv->cfg->bt_params) { if (priv->lib->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 (priv->cfg->bt_params->bt_session_2) { if (priv->lib->bt_params->bt_session_2) {
bt_cmd_v2.prio_boost = cpu_to_le32( bt_cmd_v2.prio_boost = cpu_to_le32(
priv->cfg->bt_params->bt_prio_boost); priv->lib->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 {
/* older version only has 8 bits */ /* older version only has 8 bits */
WARN_ON(priv->cfg->bt_params->bt_prio_boost & ~0xFF); WARN_ON(priv->lib->bt_params->bt_prio_boost & ~0xFF);
bt_cmd_v1.prio_boost = bt_cmd_v1.prio_boost =
priv->cfg->bt_params->bt_prio_boost; priv->lib->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;
} }
...@@ -330,7 +330,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv) ...@@ -330,7 +330,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 (priv->cfg->bt_params->bt_session_2) { if (priv->lib->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,
...@@ -758,8 +758,8 @@ static bool is_single_rx_stream(struct iwl_priv *priv) ...@@ -758,8 +758,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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist && priv->lib->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)) {
/* /*
...@@ -830,8 +830,8 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx) ...@@ -830,8 +830,8 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
else else
active_chains = priv->nvm_data->valid_rx_ant; active_chains = priv->nvm_data->valid_rx_ant;
if (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist && priv->lib->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)) {
/* /*
......
...@@ -1284,8 +1284,8 @@ static void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw, ...@@ -1284,8 +1284,8 @@ static 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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->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)
...@@ -1395,7 +1395,7 @@ static int iwl_setup_interface(struct iwl_priv *priv, ...@@ -1395,7 +1395,7 @@ static int iwl_setup_interface(struct iwl_priv *priv,
return err; return err;
} }
if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist && if (priv->lib->bt_params && priv->lib->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
......
...@@ -615,7 +615,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv) ...@@ -615,7 +615,7 @@ static 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 (priv->cfg->base_params->support_ct_kill_exit) { if (priv->lib->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 =
...@@ -732,10 +732,10 @@ int iwl_alive_start(struct iwl_priv *priv) ...@@ -732,10 +732,10 @@ int iwl_alive_start(struct iwl_priv *priv)
} }
/* download priority table before any calibration request */ /* download priority table before any calibration request */
if (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->bt_params->advanced_bt_coexist) {
/* Configure Bluetooth device coexistence support */ /* Configure Bluetooth device coexistence support */
if (priv->cfg->bt_params->bt_sco_disable) if (priv->lib->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;
...@@ -873,9 +873,9 @@ void iwl_down(struct iwl_priv *priv) ...@@ -873,9 +873,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 (priv->cfg->bt_params) if (priv->lib->bt_params)
priv->bt_traffic_load = priv->bt_traffic_load =
priv->cfg->bt_params->bt_init_traffic_load; priv->lib->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;
...@@ -1058,7 +1058,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv) ...@@ -1058,7 +1058,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
iwl_setup_scan_deferred_work(priv); iwl_setup_scan_deferred_work(priv);
if (priv->cfg->bt_params) if (priv->lib->bt_params)
iwlagn_bt_setup_deferred_work(priv); iwlagn_bt_setup_deferred_work(priv);
init_timer(&priv->statistics_periodic); init_timer(&priv->statistics_periodic);
...@@ -1072,7 +1072,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv) ...@@ -1072,7 +1072,7 @@ static 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 (priv->cfg->bt_params) if (priv->lib->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);
...@@ -1098,8 +1098,7 @@ static int iwl_init_drv(struct iwl_priv *priv) ...@@ -1098,8 +1098,7 @@ static 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 = priv->lib->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;
...@@ -1116,8 +1115,8 @@ static int iwl_init_drv(struct iwl_priv *priv) ...@@ -1116,8 +1115,8 @@ static 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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->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;
...@@ -1267,9 +1266,11 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1267,9 +1266,11 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
priv->lib = &iwl_dvm_1000_cfg; priv->lib = &iwl_dvm_1000_cfg;
break; break;
case IWL_DEVICE_FAMILY_2000: case IWL_DEVICE_FAMILY_2000:
case IWL_DEVICE_FAMILY_105:
priv->lib = &iwl_dvm_2000_cfg; priv->lib = &iwl_dvm_2000_cfg;
break; break;
case IWL_DEVICE_FAMILY_105:
priv->lib = &iwl_dvm_105_cfg;
break;
case IWL_DEVICE_FAMILY_2030: case IWL_DEVICE_FAMILY_2030:
case IWL_DEVICE_FAMILY_135: case IWL_DEVICE_FAMILY_135:
priv->lib = &iwl_dvm_2030_cfg; priv->lib = &iwl_dvm_2030_cfg;
...@@ -1281,11 +1282,15 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, ...@@ -1281,11 +1282,15 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
priv->lib = &iwl_dvm_5150_cfg; priv->lib = &iwl_dvm_5150_cfg;
break; break;
case IWL_DEVICE_FAMILY_6000: case IWL_DEVICE_FAMILY_6000:
case IWL_DEVICE_FAMILY_6005:
case IWL_DEVICE_FAMILY_6000i: case IWL_DEVICE_FAMILY_6000i:
priv->lib = &iwl_dvm_6000_cfg;
break;
case IWL_DEVICE_FAMILY_6005:
priv->lib = &iwl_dvm_6005_cfg;
break;
case IWL_DEVICE_FAMILY_6050: case IWL_DEVICE_FAMILY_6050:
case IWL_DEVICE_FAMILY_6150: case IWL_DEVICE_FAMILY_6150:
priv->lib = &iwl_dvm_6000_cfg; priv->lib = &iwl_dvm_6050_cfg;
break; break;
case IWL_DEVICE_FAMILY_6030: case IWL_DEVICE_FAMILY_6030:
priv->lib = &iwl_dvm_6030_cfg; priv->lib = &iwl_dvm_6030_cfg;
......
...@@ -163,7 +163,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, ...@@ -163,7 +163,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
u8 skip; u8 skip;
u32 slp_itrvl; u32 slp_itrvl;
if (priv->cfg->adv_pm) { if (priv->lib->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;
...@@ -217,7 +217,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, ...@@ -217,7 +217,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
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 (!priv->cfg->bt_params->bt_sco_disable) if (!priv->lib->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;
...@@ -293,7 +293,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, ...@@ -293,7 +293,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 (!priv->cfg->base_params->no_idle_support && else if (!priv->lib->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)) {
......
...@@ -1088,7 +1088,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, ...@@ -1088,7 +1088,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 (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) if (priv->lib->bt_params && priv->lib->bt_params->advanced_bt_coexist)
rs_bt_update_lq(priv, ctx, lq_sta); rs_bt_update_lq(priv, ctx, lq_sta);
} }
...@@ -3064,11 +3064,11 @@ static void rs_fill_link_cmd(struct iwl_priv *priv, ...@@ -3064,11 +3064,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 && priv->cfg->bt_params && if (priv && priv->lib->bt_params &&
priv->cfg->bt_params->agg_time_limit && priv->lib->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(priv->cfg->bt_params->agg_time_limit); cpu_to_le16(priv->lib->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)
......
...@@ -1102,7 +1102,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv) ...@@ -1102,7 +1102,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 (priv->cfg->bt_params) if (priv->lib->bt_params)
iwlagn_bt_rx_handler_setup(priv); iwlagn_bt_rx_handler_setup(priv);
} }
......
...@@ -801,8 +801,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) ...@@ -801,8 +801,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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) priv->lib->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:
...@@ -844,8 +844,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) ...@@ -844,8 +844,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 &&
priv->cfg->bt_params && priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->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);
} }
...@@ -873,8 +873,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) ...@@ -873,8 +873,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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist && priv->lib->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);
......
...@@ -627,7 +627,7 @@ void iwl_tt_initialize(struct iwl_priv *priv) ...@@ -627,7 +627,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 (priv->cfg->base_params->adv_thermal_throttle) { if (priv->lib->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),
......
...@@ -83,8 +83,8 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv, ...@@ -83,8 +83,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 &&
priv->cfg->bt_params && priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist && priv->lib->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)))
...@@ -202,8 +202,8 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, ...@@ -202,8 +202,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 (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist && priv->lib->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,
...@@ -986,8 +986,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, ...@@ -986,8 +986,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 &&
priv->cfg->bt_params && priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->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");
} }
......
...@@ -132,8 +132,8 @@ int iwl_init_alive_start(struct iwl_priv *priv) ...@@ -132,8 +132,8 @@ int iwl_init_alive_start(struct iwl_priv *priv)
{ {
int ret; int ret;
if (priv->cfg->bt_params && if (priv->lib->bt_params &&
priv->cfg->bt_params->advanced_bt_coexist) { priv->lib->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
...@@ -155,8 +155,8 @@ int iwl_init_alive_start(struct iwl_priv *priv) ...@@ -155,8 +155,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 (priv->cfg->need_temp_offset_calib) { if (priv->lib->need_temp_offset_calib) {
if (priv->cfg->temp_offset_v2) if (priv->lib->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);
...@@ -277,7 +277,7 @@ static int iwl_alive_notify(struct iwl_priv *priv) ...@@ -277,7 +277,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
if (ret) if (ret)
return ret; return ret;
if (!priv->cfg->no_xtal_calib) { if (!priv->lib->no_xtal_calib) {
ret = iwl_set_Xtal_calib(priv); ret = iwl_set_Xtal_calib(priv);
if (ret) if (ret)
return ret; return ret;
......
...@@ -60,9 +60,6 @@ static const struct iwl_base_params iwl1000_base_params = { ...@@ -60,9 +60,6 @@ static const struct iwl_base_params iwl1000_base_params = {
.max_ll_items = OTP_MAX_LL_ITEMS_1000, .max_ll_items = OTP_MAX_LL_ITEMS_1000,
.shadow_ram_support = false, .shadow_ram_support = false,
.led_compensation = 51, .led_compensation = 51,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_WATCHDOG_DISABLED, .wd_timeout = IWL_WATCHDOG_DISABLED,
.max_event_log_size = 128, .max_event_log_size = 128,
}; };
......
...@@ -72,14 +72,9 @@ static const struct iwl_base_params iwl2000_base_params = { ...@@ -72,14 +72,9 @@ static const struct iwl_base_params iwl2000_base_params = {
.max_ll_items = OTP_MAX_LL_ITEMS_2x00, .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
.shadow_ram_support = true, .shadow_ram_support = true,
.led_compensation = 51, .led_compensation = 51,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_DEF_WD_TIMEOUT, .wd_timeout = IWL_DEF_WD_TIMEOUT,
.max_event_log_size = 512, .max_event_log_size = 512,
.shadow_reg_enable = false, /* TODO: fix bugs using this feature */ .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
.hd_v2 = true,
}; };
...@@ -90,14 +85,9 @@ static const struct iwl_base_params iwl2030_base_params = { ...@@ -90,14 +85,9 @@ static const struct iwl_base_params iwl2030_base_params = {
.max_ll_items = OTP_MAX_LL_ITEMS_2x00, .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
.shadow_ram_support = true, .shadow_ram_support = true,
.led_compensation = 57, .led_compensation = 57,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_LONG_WD_TIMEOUT, .wd_timeout = IWL_LONG_WD_TIMEOUT,
.max_event_log_size = 512, .max_event_log_size = 512,
.shadow_reg_enable = false, /* TODO: fix bugs using this feature */ .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
.hd_v2 = true,
}; };
static const struct iwl_ht_params iwl2000_ht_params = { static const struct iwl_ht_params iwl2000_ht_params = {
...@@ -106,16 +96,6 @@ static const struct iwl_ht_params iwl2000_ht_params = { ...@@ -106,16 +96,6 @@ static const struct iwl_ht_params iwl2000_ht_params = {
.ht40_bands = BIT(IEEE80211_BAND_2GHZ), .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
}; };
static const struct iwl_bt_params iwl2030_bt_params = {
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.advanced_bt_coexist = true,
.agg_time_limit = BT_AGG_THRESHOLD_DEF,
.bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
.bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT32,
.bt_sco_disable = true,
.bt_session_2 = true,
};
static const struct iwl_eeprom_params iwl20x0_eeprom_params = { static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
.regulatory_bands = { .regulatory_bands = {
EEPROM_REG_BAND_1_CHANNELS, EEPROM_REG_BAND_1_CHANNELS,
...@@ -141,8 +121,6 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = { ...@@ -141,8 +121,6 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
.base_params = &iwl2000_base_params, \ .base_params = &iwl2000_base_params, \
.eeprom_params = &iwl20x0_eeprom_params, \ .eeprom_params = &iwl20x0_eeprom_params, \
.need_temp_offset_calib = true, \
.temp_offset_v2 = true, \
.led_mode = IWL_LED_RF_STATE .led_mode = IWL_LED_RF_STATE
const struct iwl_cfg iwl2000_2bgn_cfg = { const struct iwl_cfg iwl2000_2bgn_cfg = {
...@@ -168,12 +146,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = { ...@@ -168,12 +146,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = {
.nvm_ver = EEPROM_2000_EEPROM_VERSION, \ .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
.base_params = &iwl2030_base_params, \ .base_params = &iwl2030_base_params, \
.bt_params = &iwl2030_bt_params, \
.eeprom_params = &iwl20x0_eeprom_params, \ .eeprom_params = &iwl20x0_eeprom_params, \
.need_temp_offset_calib = true, \ .led_mode = IWL_LED_RF_STATE
.temp_offset_v2 = true, \
.led_mode = IWL_LED_RF_STATE, \
.adv_pm = true
const struct iwl_cfg iwl2030_2bgn_cfg = { const struct iwl_cfg iwl2030_2bgn_cfg = {
.name = "Intel(R) Centrino(R) Wireless-N 2230 BGN", .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
...@@ -193,10 +167,7 @@ const struct iwl_cfg iwl2030_2bgn_cfg = { ...@@ -193,10 +167,7 @@ const struct iwl_cfg iwl2030_2bgn_cfg = {
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
.base_params = &iwl2000_base_params, \ .base_params = &iwl2000_base_params, \
.eeprom_params = &iwl20x0_eeprom_params, \ .eeprom_params = &iwl20x0_eeprom_params, \
.need_temp_offset_calib = true, \
.temp_offset_v2 = true, \
.led_mode = IWL_LED_RF_STATE, \ .led_mode = IWL_LED_RF_STATE, \
.adv_pm = true, \
.rx_with_siso_diversity = true .rx_with_siso_diversity = true
const struct iwl_cfg iwl105_bgn_cfg = { const struct iwl_cfg iwl105_bgn_cfg = {
...@@ -222,12 +193,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = { ...@@ -222,12 +193,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = {
.nvm_ver = EEPROM_2000_EEPROM_VERSION, \ .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
.nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
.base_params = &iwl2030_base_params, \ .base_params = &iwl2030_base_params, \
.bt_params = &iwl2030_bt_params, \
.eeprom_params = &iwl20x0_eeprom_params, \ .eeprom_params = &iwl20x0_eeprom_params, \
.need_temp_offset_calib = true, \
.temp_offset_v2 = true, \
.led_mode = IWL_LED_RF_STATE, \ .led_mode = IWL_LED_RF_STATE, \
.adv_pm = true, \
.rx_with_siso_diversity = true .rx_with_siso_diversity = true
const struct iwl_cfg iwl135_bgn_cfg = { const struct iwl_cfg iwl135_bgn_cfg = {
......
...@@ -59,11 +59,8 @@ static const struct iwl_base_params iwl5000_base_params = { ...@@ -59,11 +59,8 @@ static const struct iwl_base_params iwl5000_base_params = {
.num_of_queues = IWLAGN_NUM_QUEUES, .num_of_queues = IWLAGN_NUM_QUEUES,
.pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
.led_compensation = 51, .led_compensation = 51,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_WATCHDOG_DISABLED, .wd_timeout = IWL_WATCHDOG_DISABLED,
.max_event_log_size = 512, .max_event_log_size = 512,
.no_idle_support = true,
}; };
static const struct iwl_ht_params iwl5000_ht_params = { static const struct iwl_ht_params iwl5000_ht_params = {
...@@ -159,7 +156,6 @@ const struct iwl_cfg iwl5350_agn_cfg = { ...@@ -159,7 +156,6 @@ const struct iwl_cfg iwl5350_agn_cfg = {
.nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
.base_params = &iwl5000_base_params, \ .base_params = &iwl5000_base_params, \
.eeprom_params = &iwl5000_eeprom_params, \ .eeprom_params = &iwl5000_eeprom_params, \
.no_xtal_calib = true, \
.led_mode = IWL_LED_BLINK, \ .led_mode = IWL_LED_BLINK, \
.internal_wimax_coex = true .internal_wimax_coex = true
......
...@@ -82,10 +82,6 @@ static const struct iwl_base_params iwl6000_base_params = { ...@@ -82,10 +82,6 @@ static const struct iwl_base_params iwl6000_base_params = {
.max_ll_items = OTP_MAX_LL_ITEMS_6x00, .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
.shadow_ram_support = true, .shadow_ram_support = true,
.led_compensation = 51, .led_compensation = 51,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_DEF_WD_TIMEOUT, .wd_timeout = IWL_DEF_WD_TIMEOUT,
.max_event_log_size = 512, .max_event_log_size = 512,
.shadow_reg_enable = false, /* TODO: fix bugs using this feature */ .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
...@@ -98,10 +94,6 @@ static const struct iwl_base_params iwl6050_base_params = { ...@@ -98,10 +94,6 @@ static const struct iwl_base_params iwl6050_base_params = {
.max_ll_items = OTP_MAX_LL_ITEMS_6x50, .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
.shadow_ram_support = true, .shadow_ram_support = true,
.led_compensation = 51, .led_compensation = 51,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1500,
.wd_timeout = IWL_DEF_WD_TIMEOUT, .wd_timeout = IWL_DEF_WD_TIMEOUT,
.max_event_log_size = 1024, .max_event_log_size = 1024,
.shadow_reg_enable = false, /* TODO: fix bugs using this feature */ .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
...@@ -114,10 +106,6 @@ static const struct iwl_base_params iwl6000_g2_base_params = { ...@@ -114,10 +106,6 @@ static const struct iwl_base_params iwl6000_g2_base_params = {
.max_ll_items = OTP_MAX_LL_ITEMS_6x00, .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
.shadow_ram_support = true, .shadow_ram_support = true,
.led_compensation = 57, .led_compensation = 57,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_LONG_WD_TIMEOUT, .wd_timeout = IWL_LONG_WD_TIMEOUT,
.max_event_log_size = 512, .max_event_log_size = 512,
.shadow_reg_enable = false, /* TODO: fix bugs using this feature */ .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
...@@ -129,15 +117,6 @@ static const struct iwl_ht_params iwl6000_ht_params = { ...@@ -129,15 +117,6 @@ static const struct iwl_ht_params iwl6000_ht_params = {
.ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ), .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
}; };
static const struct iwl_bt_params iwl6000_bt_params = {
/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
.advanced_bt_coexist = true,
.agg_time_limit = BT_AGG_THRESHOLD_DEF,
.bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
.bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
.bt_sco_disable = true,
};
static const struct iwl_eeprom_params iwl6000_eeprom_params = { static const struct iwl_eeprom_params iwl6000_eeprom_params = {
.regulatory_bands = { .regulatory_bands = {
EEPROM_REG_BAND_1_CHANNELS, EEPROM_REG_BAND_1_CHANNELS,
...@@ -163,7 +142,6 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = { ...@@ -163,7 +142,6 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = {
.nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
.base_params = &iwl6000_g2_base_params, \ .base_params = &iwl6000_g2_base_params, \
.eeprom_params = &iwl6000_eeprom_params, \ .eeprom_params = &iwl6000_eeprom_params, \
.need_temp_offset_calib = true, \
.led_mode = IWL_LED_RF_STATE .led_mode = IWL_LED_RF_STATE
const struct iwl_cfg iwl6005_2agn_cfg = { const struct iwl_cfg iwl6005_2agn_cfg = {
...@@ -217,11 +195,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = { ...@@ -217,11 +195,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
.nvm_ver = EEPROM_6030_EEPROM_VERSION, \ .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
.base_params = &iwl6000_g2_base_params, \ .base_params = &iwl6000_g2_base_params, \
.bt_params = &iwl6000_bt_params, \
.eeprom_params = &iwl6000_eeprom_params, \ .eeprom_params = &iwl6000_eeprom_params, \
.need_temp_offset_calib = true, \ .led_mode = IWL_LED_RF_STATE
.led_mode = IWL_LED_RF_STATE, \
.adv_pm = true \
const struct iwl_cfg iwl6030_2agn_cfg = { const struct iwl_cfg iwl6030_2agn_cfg = {
.name = "Intel(R) Centrino(R) Advanced-N 6230 AGN", .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
...@@ -256,11 +231,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = { ...@@ -256,11 +231,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = {
.nvm_ver = EEPROM_6030_EEPROM_VERSION, \ .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
.nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
.base_params = &iwl6000_g2_base_params, \ .base_params = &iwl6000_g2_base_params, \
.bt_params = &iwl6000_bt_params, \
.eeprom_params = &iwl6000_eeprom_params, \ .eeprom_params = &iwl6000_eeprom_params, \
.need_temp_offset_calib = true, \ .led_mode = IWL_LED_RF_STATE
.led_mode = IWL_LED_RF_STATE, \
.adv_pm = true
const struct iwl_cfg iwl6035_2agn_cfg = { const struct iwl_cfg iwl6035_2agn_cfg = {
.name = "Intel(R) Centrino(R) Advanced-N 6235 AGN", .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
......
...@@ -96,10 +96,6 @@ static const struct iwl_base_params iwl7000_base_params = { ...@@ -96,10 +96,6 @@ static const struct iwl_base_params iwl7000_base_params = {
.pll_cfg_val = 0, .pll_cfg_val = 0,
.shadow_ram_support = true, .shadow_ram_support = true,
.led_compensation = 57, .led_compensation = 57,
.adv_thermal_throttle = true,
.support_ct_kill_exit = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000,
.wd_timeout = IWL_LONG_WD_TIMEOUT, .wd_timeout = IWL_LONG_WD_TIMEOUT,
.max_event_log_size = 512, .max_event_log_size = 512,
.shadow_reg_enable = true, .shadow_reg_enable = true,
...@@ -118,10 +114,7 @@ static const struct iwl_ht_params iwl7000_ht_params = { ...@@ -118,10 +114,7 @@ static const struct iwl_ht_params iwl7000_ht_params = {
.max_inst_size = IWL60_RTC_INST_SIZE, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
.max_data_size = IWL60_RTC_DATA_SIZE, \ .max_data_size = IWL60_RTC_DATA_SIZE, \
.base_params = &iwl7000_base_params, \ .base_params = &iwl7000_base_params, \
/* TODO: .bt_params? */ \ .led_mode = IWL_LED_RF_STATE
.need_temp_offset_calib = true, \
.led_mode = IWL_LED_RF_STATE, \
.adv_pm = true \
const struct iwl_cfg iwl7260_2ac_cfg = { const struct iwl_cfg iwl7260_2ac_cfg = {
......
...@@ -136,17 +136,9 @@ enum iwl_led_mode { ...@@ -136,17 +136,9 @@ enum iwl_led_mode {
* @led_compensation: compensate on the led on/off time per HW according * @led_compensation: compensate on the led on/off time per HW according
* to the deviation to achieve the desired led frequency. * to the deviation to achieve the desired led frequency.
* The detail algorithm is described in iwl-led.c * The detail algorithm is described in iwl-led.c
* @chain_noise_num_beacons: number of beacons used to compute chain noise
* @adv_thermal_throttle: support advance thermal throttle
* @support_ct_kill_exit: support ct kill exit condition
* @plcp_delta_threshold: plcp error rate threshold used to trigger
* radio tuning when there is a high receiving plcp error rate
* @chain_noise_scale: default chain noise scale used for gain computation
* @wd_timeout: TX queues watchdog timeout * @wd_timeout: TX queues watchdog timeout
* @max_event_log_size: size of event log buffer size for ucode event logging * @max_event_log_size: size of event log buffer size for ucode event logging
* @shadow_reg_enable: HW shadow register support * @shadow_reg_enable: HW shadow register support
* @hd_v2: v2 of enhanced sensitivity value, used for 2000 series and up
* @no_idle_support: do not support idle mode
*/ */
struct iwl_base_params { struct iwl_base_params {
int eeprom_size; int eeprom_size;
...@@ -157,31 +149,9 @@ struct iwl_base_params { ...@@ -157,31 +149,9 @@ struct iwl_base_params {
const u16 max_ll_items; const u16 max_ll_items;
const bool shadow_ram_support; const bool shadow_ram_support;
u16 led_compensation; u16 led_compensation;
bool adv_thermal_throttle;
bool support_ct_kill_exit;
u8 plcp_delta_threshold;
s32 chain_noise_scale;
unsigned int wd_timeout; unsigned int wd_timeout;
u32 max_event_log_size; u32 max_event_log_size;
const bool shadow_reg_enable; const bool shadow_reg_enable;
const bool hd_v2;
const bool no_idle_support;
};
/*
* @advanced_bt_coexist: support advanced bt coexist
* @bt_init_traffic_load: specify initial bt traffic load
* @bt_prio_boost: default bt priority boost value
* @agg_time_limit: maximum number of uSec in aggregation
* @bt_sco_disable: uCode should not response to BT in SCO/ESCO mode
*/
struct iwl_bt_params {
bool advanced_bt_coexist;
u8 bt_init_traffic_load;
u32 bt_prio_boost;
u16 agg_time_limit;
bool bt_sco_disable;
bool bt_session_2;
}; };
/* /*
...@@ -231,16 +201,10 @@ struct iwl_eeprom_params { ...@@ -231,16 +201,10 @@ struct iwl_eeprom_params {
* @nvm_calib_ver: NVM calibration version * @nvm_calib_ver: NVM calibration version
* @lib: pointer to the lib ops * @lib: pointer to the lib ops
* @base_params: pointer to basic parameters * @base_params: pointer to basic parameters
* @ht_params: point to ht patameters * @ht_params: point to ht parameters
* @bt_params: pointer to bt parameters
* @need_temp_offset_calib: need to perform temperature offset calibration
* @no_xtal_calib: some devices do not need crystal calibration data,
* don't send it to those
* @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off) * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off)
* @adv_pm: advance power management
* @rx_with_siso_diversity: 1x1 device with rx antenna diversity * @rx_with_siso_diversity: 1x1 device with rx antenna diversity
* @internal_wimax_coex: internal wifi/wimax combo device * @internal_wimax_coex: internal wifi/wimax combo device
* @temp_offset_v2: support v2 of temperature offset calibration
* *
* We enable the driver to be backward compatible wrt. hardware features. * We enable the driver to be backward compatible wrt. hardware features.
* API differences in uCode shouldn't be handled here but through TLVs * API differences in uCode shouldn't be handled here but through TLVs
...@@ -264,15 +228,10 @@ struct iwl_cfg { ...@@ -264,15 +228,10 @@ struct iwl_cfg {
const struct iwl_base_params *base_params; const struct iwl_base_params *base_params;
/* params likely to change within a device family */ /* params likely to change within a device family */
const struct iwl_ht_params *ht_params; const struct iwl_ht_params *ht_params;
const struct iwl_bt_params *bt_params;
const struct iwl_eeprom_params *eeprom_params; const struct iwl_eeprom_params *eeprom_params;
const bool need_temp_offset_calib; /* if used set to true */
const bool no_xtal_calib;
enum iwl_led_mode led_mode; enum iwl_led_mode led_mode;
const bool adv_pm;
const bool rx_with_siso_diversity; const bool rx_with_siso_diversity;
const bool internal_wimax_coex; const bool internal_wimax_coex;
const bool temp_offset_v2;
}; };
/* /*
......
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