diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-10-06 11:10:00 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-10-06 11:10:00 -0400 |
commit | 7cb1b0887fcc61918e3d64827fbef968bb67a57a (patch) | |
tree | fa9103423af207c68be604523b3a362e1a6c3e14 /drivers/net/wireless/iwlwifi/iwl-1000.c | |
parent | 72645eff4b2ad6cf2b016b54f9d6817cca0a621d (diff) |
iwlagn: reduce redundant parameter definitions
move paramater definitions to a device paramater structure only
leaving the device name, which antennas are used and what firmware
file to use in the iwl_cfg structure. this will not completely
remove the redundancies but greatly reduce them for devices that
only vary by name or antennas. the parameters that are more
likely to change within a given device family are left in iwl_cfg.
also separate bt param structure added to help reduce more.
Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-1000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-1000.c | 121 |
1 files changed, 38 insertions, 83 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 19dbef06d52c..134f54541330 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -126,13 +126,13 @@ static int iwl1000_hw_set_hw_params(struct iwl_priv *priv) | |||
126 | { | 126 | { |
127 | if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES && | 127 | if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES && |
128 | priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES) | 128 | priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES) |
129 | priv->cfg->num_of_queues = | 129 | priv->cfg->base_params->num_of_queues = |
130 | priv->cfg->mod_params->num_of_queues; | 130 | priv->cfg->mod_params->num_of_queues; |
131 | 131 | ||
132 | priv->hw_params.max_txq_num = priv->cfg->num_of_queues; | 132 | priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues; |
133 | priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM; | 133 | priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM; |
134 | priv->hw_params.scd_bc_tbls_size = | 134 | priv->hw_params.scd_bc_tbls_size = |
135 | priv->cfg->num_of_queues * | 135 | priv->cfg->base_params->num_of_queues * |
136 | sizeof(struct iwlagn_scd_bc_tbl); | 136 | sizeof(struct iwlagn_scd_bc_tbl); |
137 | priv->hw_params.tfd_size = sizeof(struct iwl_tfd); | 137 | priv->hw_params.tfd_size = sizeof(struct iwl_tfd); |
138 | priv->hw_params.max_stations = IWLAGN_STATION_COUNT; | 138 | priv->hw_params.max_stations = IWLAGN_STATION_COUNT; |
@@ -250,29 +250,16 @@ static const struct iwl_ops iwl1000_ops = { | |||
250 | .led = &iwlagn_led_ops, | 250 | .led = &iwlagn_led_ops, |
251 | }; | 251 | }; |
252 | 252 | ||
253 | struct iwl_cfg iwl1000_bgn_cfg = { | 253 | static struct iwl_base_params iwl1000_base_params = { |
254 | .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN", | ||
255 | .fw_name_pre = IWL1000_FW_PRE, | ||
256 | .ucode_api_max = IWL1000_UCODE_API_MAX, | ||
257 | .ucode_api_min = IWL1000_UCODE_API_MIN, | ||
258 | .sku = IWL_SKU_G|IWL_SKU_N, | ||
259 | .ops = &iwl1000_ops, | ||
260 | .eeprom_size = OTP_LOW_IMAGE_SIZE, | ||
261 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, | ||
262 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, | ||
263 | .num_of_queues = IWLAGN_NUM_QUEUES, | 254 | .num_of_queues = IWLAGN_NUM_QUEUES, |
264 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 255 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
265 | .mod_params = &iwlagn_mod_params, | 256 | .eeprom_size = OTP_LOW_IMAGE_SIZE, |
266 | .valid_tx_ant = ANT_A, | ||
267 | .valid_rx_ant = ANT_AB, | ||
268 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, | 257 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, |
269 | .set_l0s = true, | 258 | .set_l0s = true, |
270 | .use_bsm = false, | 259 | .use_bsm = false, |
271 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | 260 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, |
272 | .shadow_ram_support = false, | 261 | .shadow_ram_support = false, |
273 | .ht_greenfield_support = true, | ||
274 | .led_compensation = 51, | 262 | .led_compensation = 51, |
275 | .use_rts_for_aggregation = true, /* use rts/cts protection */ | ||
276 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | 263 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, |
277 | .support_ct_kill_exit = true, | 264 | .support_ct_kill_exit = true, |
278 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | 265 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, |
@@ -283,6 +270,26 @@ struct iwl_cfg iwl1000_bgn_cfg = { | |||
283 | .sensitivity_calib_by_driver = true, | 270 | .sensitivity_calib_by_driver = true, |
284 | .chain_noise_calib_by_driver = true, | 271 | .chain_noise_calib_by_driver = true, |
285 | }; | 272 | }; |
273 | static struct iwl_ht_params iwl1000_ht_params = { | ||
274 | .ht_greenfield_support = true, | ||
275 | .use_rts_for_aggregation = true, /* use rts/cts protection */ | ||
276 | }; | ||
277 | |||
278 | struct iwl_cfg iwl1000_bgn_cfg = { | ||
279 | .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN", | ||
280 | .fw_name_pre = IWL1000_FW_PRE, | ||
281 | .ucode_api_max = IWL1000_UCODE_API_MAX, | ||
282 | .ucode_api_min = IWL1000_UCODE_API_MIN, | ||
283 | .sku = IWL_SKU_G|IWL_SKU_N, | ||
284 | .valid_tx_ant = ANT_A, | ||
285 | .valid_rx_ant = ANT_AB, | ||
286 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, | ||
287 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, | ||
288 | .ops = &iwl1000_ops, | ||
289 | .mod_params = &iwlagn_mod_params, | ||
290 | .base_params = &iwl1000_base_params, | ||
291 | .ht_params = &iwl1000_ht_params, | ||
292 | }; | ||
286 | 293 | ||
287 | struct iwl_cfg iwl1000_bg_cfg = { | 294 | struct iwl_cfg iwl1000_bg_cfg = { |
288 | .name = "Intel(R) Centrino(R) Wireless-N 1000 BG", | 295 | .name = "Intel(R) Centrino(R) Wireless-N 1000 BG", |
@@ -290,30 +297,13 @@ struct iwl_cfg iwl1000_bg_cfg = { | |||
290 | .ucode_api_max = IWL1000_UCODE_API_MAX, | 297 | .ucode_api_max = IWL1000_UCODE_API_MAX, |
291 | .ucode_api_min = IWL1000_UCODE_API_MIN, | 298 | .ucode_api_min = IWL1000_UCODE_API_MIN, |
292 | .sku = IWL_SKU_G, | 299 | .sku = IWL_SKU_G, |
293 | .ops = &iwl1000_ops, | 300 | .valid_tx_ant = ANT_A, |
294 | .eeprom_size = OTP_LOW_IMAGE_SIZE, | 301 | .valid_rx_ant = ANT_AB, |
295 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, | 302 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, |
296 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, | 303 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, |
297 | .num_of_queues = IWLAGN_NUM_QUEUES, | 304 | .ops = &iwl1000_ops, |
298 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | ||
299 | .mod_params = &iwlagn_mod_params, | 305 | .mod_params = &iwlagn_mod_params, |
300 | .valid_tx_ant = ANT_A, | 306 | .base_params = &iwl1000_base_params, |
301 | .valid_rx_ant = ANT_AB, | ||
302 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, | ||
303 | .set_l0s = true, | ||
304 | .use_bsm = false, | ||
305 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | ||
306 | .shadow_ram_support = false, | ||
307 | .led_compensation = 51, | ||
308 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | ||
309 | .support_ct_kill_exit = true, | ||
310 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | ||
311 | .chain_noise_scale = 1000, | ||
312 | .monitor_recover_period = IWL_DEF_MONITORING_PERIOD, | ||
313 | .max_event_log_size = 128, | ||
314 | .ucode_tracing = true, | ||
315 | .sensitivity_calib_by_driver = true, | ||
316 | .chain_noise_calib_by_driver = true, | ||
317 | }; | 307 | }; |
318 | 308 | ||
319 | struct iwl_cfg iwl100_bgn_cfg = { | 309 | struct iwl_cfg iwl100_bgn_cfg = { |
@@ -322,32 +312,14 @@ struct iwl_cfg iwl100_bgn_cfg = { | |||
322 | .ucode_api_max = IWL100_UCODE_API_MAX, | 312 | .ucode_api_max = IWL100_UCODE_API_MAX, |
323 | .ucode_api_min = IWL100_UCODE_API_MIN, | 313 | .ucode_api_min = IWL100_UCODE_API_MIN, |
324 | .sku = IWL_SKU_G|IWL_SKU_N, | 314 | .sku = IWL_SKU_G|IWL_SKU_N, |
325 | .ops = &iwl1000_ops, | 315 | .valid_tx_ant = ANT_A, |
326 | .eeprom_size = OTP_LOW_IMAGE_SIZE, | 316 | .valid_rx_ant = ANT_A, |
327 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, | 317 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, |
328 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, | 318 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, |
329 | .num_of_queues = IWLAGN_NUM_QUEUES, | 319 | .ops = &iwl1000_ops, |
330 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | ||
331 | .mod_params = &iwlagn_mod_params, | 320 | .mod_params = &iwlagn_mod_params, |
332 | .valid_tx_ant = ANT_A, | 321 | .base_params = &iwl1000_base_params, |
333 | .valid_rx_ant = ANT_A, | 322 | .ht_params = &iwl1000_ht_params, |
334 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, | ||
335 | .set_l0s = true, | ||
336 | .use_bsm = false, | ||
337 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | ||
338 | .shadow_ram_support = false, | ||
339 | .ht_greenfield_support = true, | ||
340 | .led_compensation = 51, | ||
341 | .use_rts_for_aggregation = true, /* use rts/cts protection */ | ||
342 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | ||
343 | .support_ct_kill_exit = true, | ||
344 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | ||
345 | .chain_noise_scale = 1000, | ||
346 | .monitor_recover_period = IWL_DEF_MONITORING_PERIOD, | ||
347 | .max_event_log_size = 128, | ||
348 | .ucode_tracing = true, | ||
349 | .sensitivity_calib_by_driver = true, | ||
350 | .chain_noise_calib_by_driver = true, | ||
351 | }; | 323 | }; |
352 | 324 | ||
353 | struct iwl_cfg iwl100_bg_cfg = { | 325 | struct iwl_cfg iwl100_bg_cfg = { |
@@ -356,30 +328,13 @@ struct iwl_cfg iwl100_bg_cfg = { | |||
356 | .ucode_api_max = IWL100_UCODE_API_MAX, | 328 | .ucode_api_max = IWL100_UCODE_API_MAX, |
357 | .ucode_api_min = IWL100_UCODE_API_MIN, | 329 | .ucode_api_min = IWL100_UCODE_API_MIN, |
358 | .sku = IWL_SKU_G, | 330 | .sku = IWL_SKU_G, |
359 | .ops = &iwl1000_ops, | 331 | .valid_tx_ant = ANT_A, |
360 | .eeprom_size = OTP_LOW_IMAGE_SIZE, | 332 | .valid_rx_ant = ANT_A, |
361 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, | 333 | .eeprom_ver = EEPROM_1000_EEPROM_VERSION, |
362 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, | 334 | .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, |
363 | .num_of_queues = IWLAGN_NUM_QUEUES, | 335 | .ops = &iwl1000_ops, |
364 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | ||
365 | .mod_params = &iwlagn_mod_params, | 336 | .mod_params = &iwlagn_mod_params, |
366 | .valid_tx_ant = ANT_A, | 337 | .base_params = &iwl1000_base_params, |
367 | .valid_rx_ant = ANT_A, | ||
368 | .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, | ||
369 | .set_l0s = true, | ||
370 | .use_bsm = false, | ||
371 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | ||
372 | .shadow_ram_support = false, | ||
373 | .led_compensation = 51, | ||
374 | .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, | ||
375 | .support_ct_kill_exit = true, | ||
376 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, | ||
377 | .chain_noise_scale = 1000, | ||
378 | .monitor_recover_period = IWL_DEF_MONITORING_PERIOD, | ||
379 | .max_event_log_size = 128, | ||
380 | .ucode_tracing = true, | ||
381 | .sensitivity_calib_by_driver = true, | ||
382 | .chain_noise_calib_by_driver = true, | ||
383 | }; | 338 | }; |
384 | 339 | ||
385 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); | 340 | MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); |