aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-12-08 10:51:50 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-12-13 18:53:54 -0500
commit65af8dea26aa89ae4a810bdaa05545a8e670b636 (patch)
tree48684a81f4b877f9ddf8cab0c5c284b61ba08b3f /drivers/net/wireless/iwlwifi/iwl-5000.c
parentf21dd005df95e0fc6a578342c61b5333ce2abc2b (diff)
iwlagn: code clean up to remove duplicate code
Multiple devices use almost the same .cfg with minor differences. Use macro and remove the duplication. By doing this, reduce the chance for mistake while modify .cfg parameters Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c89
1 files changed, 31 insertions, 58 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 34af9e0cfa43..79ab0a6b1386 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -520,65 +520,44 @@ static struct iwl_ht_params iwl5000_ht_params = {
520 .use_rts_for_aggregation = true, /* use rts/cts protection */ 520 .use_rts_for_aggregation = true, /* use rts/cts protection */
521}; 521};
522 522
523#define IWL_DEVICE_5000 \
524 .fw_name_pre = IWL5000_FW_PRE, \
525 .ucode_api_max = IWL5000_UCODE_API_MAX, \
526 .ucode_api_min = IWL5000_UCODE_API_MIN, \
527 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
528 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
529 .ops = &iwl5000_ops, \
530 .mod_params = &iwlagn_mod_params, \
531 .base_params = &iwl5000_base_params, \
532 .led_mode = IWL_LED_BLINK
533
523struct iwl_cfg iwl5300_agn_cfg = { 534struct iwl_cfg iwl5300_agn_cfg = {
524 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", 535 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
525 .fw_name_pre = IWL5000_FW_PRE, 536 IWL_DEVICE_5000,
526 .ucode_api_max = IWL5000_UCODE_API_MAX,
527 .ucode_api_min = IWL5000_UCODE_API_MIN,
528 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
529 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
530 .ops = &iwl5000_ops,
531 .mod_params = &iwlagn_mod_params,
532 .base_params = &iwl5000_base_params,
533 .ht_params = &iwl5000_ht_params, 537 .ht_params = &iwl5000_ht_params,
534 .led_mode = IWL_LED_BLINK,
535}; 538};
536 539
537struct iwl_cfg iwl5100_bgn_cfg = { 540struct iwl_cfg iwl5100_bgn_cfg = {
538 .name = "Intel(R) WiFi Link 5100 BGN", 541 .name = "Intel(R) WiFi Link 5100 BGN",
539 .fw_name_pre = IWL5000_FW_PRE, 542 IWL_DEVICE_5000,
540 .ucode_api_max = IWL5000_UCODE_API_MAX,
541 .ucode_api_min = IWL5000_UCODE_API_MIN,
542 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 543 .valid_tx_ant = ANT_B, /* .cfg overwrite */
543 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 544 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
544 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
545 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
546 .ops = &iwl5000_ops,
547 .mod_params = &iwlagn_mod_params,
548 .base_params = &iwl5000_base_params,
549 .ht_params = &iwl5000_ht_params, 545 .ht_params = &iwl5000_ht_params,
550 .led_mode = IWL_LED_BLINK,
551}; 546};
552 547
553struct iwl_cfg iwl5100_abg_cfg = { 548struct iwl_cfg iwl5100_abg_cfg = {
554 .name = "Intel(R) WiFi Link 5100 ABG", 549 .name = "Intel(R) WiFi Link 5100 ABG",
555 .fw_name_pre = IWL5000_FW_PRE, 550 IWL_DEVICE_5000,
556 .ucode_api_max = IWL5000_UCODE_API_MAX,
557 .ucode_api_min = IWL5000_UCODE_API_MIN,
558 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 551 .valid_tx_ant = ANT_B, /* .cfg overwrite */
559 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 552 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
560 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
561 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
562 .ops = &iwl5000_ops,
563 .mod_params = &iwlagn_mod_params,
564 .base_params = &iwl5000_base_params,
565 .led_mode = IWL_LED_BLINK,
566}; 553};
567 554
568struct iwl_cfg iwl5100_agn_cfg = { 555struct iwl_cfg iwl5100_agn_cfg = {
569 .name = "Intel(R) WiFi Link 5100 AGN", 556 .name = "Intel(R) WiFi Link 5100 AGN",
570 .fw_name_pre = IWL5000_FW_PRE, 557 IWL_DEVICE_5000,
571 .ucode_api_max = IWL5000_UCODE_API_MAX,
572 .ucode_api_min = IWL5000_UCODE_API_MIN,
573 .valid_tx_ant = ANT_B, /* .cfg overwrite */ 558 .valid_tx_ant = ANT_B, /* .cfg overwrite */
574 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ 559 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
575 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
576 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
577 .ops = &iwl5000_ops,
578 .mod_params = &iwlagn_mod_params,
579 .base_params = &iwl5000_base_params,
580 .ht_params = &iwl5000_ht_params, 560 .ht_params = &iwl5000_ht_params,
581 .led_mode = IWL_LED_BLINK,
582}; 561};
583 562
584struct iwl_cfg iwl5350_agn_cfg = { 563struct iwl_cfg iwl5350_agn_cfg = {
@@ -596,35 +575,29 @@ struct iwl_cfg iwl5350_agn_cfg = {
596 .internal_wimax_coex = true, 575 .internal_wimax_coex = true,
597}; 576};
598 577
578#define IWL_DEVICE_5150 \
579 .fw_name_pre = IWL5150_FW_PRE, \
580 .ucode_api_max = IWL5150_UCODE_API_MAX, \
581 .ucode_api_min = IWL5150_UCODE_API_MIN, \
582 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
583 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
584 .ops = &iwl5150_ops, \
585 .mod_params = &iwlagn_mod_params, \
586 .base_params = &iwl5000_base_params, \
587 .need_dc_calib = true, \
588 .led_mode = IWL_LED_BLINK, \
589 .internal_wimax_coex = true
590
599struct iwl_cfg iwl5150_agn_cfg = { 591struct iwl_cfg iwl5150_agn_cfg = {
600 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", 592 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
601 .fw_name_pre = IWL5150_FW_PRE, 593 IWL_DEVICE_5150,
602 .ucode_api_max = IWL5150_UCODE_API_MAX,
603 .ucode_api_min = IWL5150_UCODE_API_MIN,
604 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
605 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
606 .ops = &iwl5150_ops,
607 .mod_params = &iwlagn_mod_params,
608 .base_params = &iwl5000_base_params,
609 .ht_params = &iwl5000_ht_params, 594 .ht_params = &iwl5000_ht_params,
610 .need_dc_calib = true, 595
611 .led_mode = IWL_LED_BLINK,
612 .internal_wimax_coex = true,
613}; 596};
614 597
615struct iwl_cfg iwl5150_abg_cfg = { 598struct iwl_cfg iwl5150_abg_cfg = {
616 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG", 599 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
617 .fw_name_pre = IWL5150_FW_PRE, 600 IWL_DEVICE_5150,
618 .ucode_api_max = IWL5150_UCODE_API_MAX,
619 .ucode_api_min = IWL5150_UCODE_API_MIN,
620 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
621 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
622 .ops = &iwl5150_ops,
623 .mod_params = &iwlagn_mod_params,
624 .base_params = &iwl5000_base_params,
625 .need_dc_calib = true,
626 .led_mode = IWL_LED_BLINK,
627 .internal_wimax_coex = true,
628}; 601};
629 602
630MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 603MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));