aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJay Sternberg <jay.e.sternberg@linux.intel.com>2009-02-02 19:21:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-09 15:03:42 -0500
commitc0bac76a22c00d0b4622b2847e0b087befb9ff25 (patch)
treebfb687789459945050b38cba25e8fed3f1c2a379 /drivers
parent2264596d6d0a5c1e569af809625c11f8f2d89435 (diff)
iwlwifi: simplify parameter setting to allow support for 6000 series
by parametrizing the set hw function, in addition to allowing for supporting the 6000 family significantly simplify the addition of new hardware. Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-100.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c76
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
4 files changed, 53 insertions, 37 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-100.c b/drivers/net/wireless/iwlwifi/iwl-100.c
index dbadaf44f570..4c4d16537e3d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-100.c
+++ b/drivers/net/wireless/iwlwifi/iwl-100.c
@@ -66,5 +66,7 @@ struct iwl_cfg iwl100_bgn_cfg = {
66 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 66 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
67 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 67 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
68 .mod_params = &iwl50_mod_params, 68 .mod_params = &iwl50_mod_params,
69 .valid_tx_ant = ANT_A,
70 .valid_rx_ant = ANT_AB,
69}; 71};
70 72
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index c5e9a66e2f88..539fc0e234f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -43,6 +43,7 @@
43#include "iwl-sta.h" 43#include "iwl-sta.h"
44#include "iwl-helpers.h" 44#include "iwl-helpers.h"
45#include "iwl-5000-hw.h" 45#include "iwl-5000-hw.h"
46#include "iwl-6000-hw.h"
46 47
47/* Highest firmware API version supported */ 48/* Highest firmware API version supported */
48#define IWL5000_UCODE_API_MAX 1 49#define IWL5000_UCODE_API_MAX 1
@@ -840,8 +841,18 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
840 priv->hw_params.tfd_size = sizeof(struct iwl_tfd); 841 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
841 priv->hw_params.max_stations = IWL5000_STATION_COUNT; 842 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
842 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; 843 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
843 priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE; 844
844 priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE; 845 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
846 case CSR_HW_REV_TYPE_6x00:
847 case CSR_HW_REV_TYPE_6x50:
848 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
849 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
850 break;
851 default:
852 priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
853 priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE;
854 }
855
845 priv->hw_params.max_bsm_size = 0; 856 priv->hw_params.max_bsm_size = 0;
846 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) | 857 priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) |
847 BIT(IEEE80211_BAND_5GHZ); 858 BIT(IEEE80211_BAND_5GHZ);
@@ -849,61 +860,40 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
849 860
850 priv->hw_params.sens = &iwl5000_sensitivity; 861 priv->hw_params.sens = &iwl5000_sensitivity;
851 862
852 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 863 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
853 case CSR_HW_REV_TYPE_5100: 864 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
854 priv->hw_params.tx_chains_num = 1; 865 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
855 priv->hw_params.rx_chains_num = 2; 866 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
856 priv->hw_params.valid_tx_ant = ANT_B;
857 priv->hw_params.valid_rx_ant = ANT_AB;
858 break;
859 case CSR_HW_REV_TYPE_5150:
860 priv->hw_params.tx_chains_num = 1;
861 priv->hw_params.rx_chains_num = 2;
862 priv->hw_params.valid_tx_ant = ANT_A;
863 priv->hw_params.valid_rx_ant = ANT_AB;
864 break;
865 case CSR_HW_REV_TYPE_5300:
866 case CSR_HW_REV_TYPE_5350:
867 priv->hw_params.tx_chains_num = 3;
868 priv->hw_params.rx_chains_num = 3;
869 priv->hw_params.valid_tx_ant = ANT_ABC;
870 priv->hw_params.valid_rx_ant = ANT_ABC;
871 break;
872 }
873 867
874 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 868 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
875 case CSR_HW_REV_TYPE_5100:
876 case CSR_HW_REV_TYPE_5300:
877 case CSR_HW_REV_TYPE_5350:
878 /* 5X00 and 5350 wants in Celsius */
879 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
880 break;
881 case CSR_HW_REV_TYPE_5150: 869 case CSR_HW_REV_TYPE_5150:
882 /* 5150 wants in Kelvin */ 870 /* 5150 wants in Kelvin */
883 priv->hw_params.ct_kill_threshold = 871 priv->hw_params.ct_kill_threshold =
884 iwl5150_get_ct_threshold(priv); 872 iwl5150_get_ct_threshold(priv);
885 break; 873 break;
874 default:
875 /* all others want Celsius */
876 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
877 break;
886 } 878 }
887 879
888 /* Set initial calibration set */ 880 /* Set initial calibration set */
889 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 881 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
890 case CSR_HW_REV_TYPE_5100: 882 case CSR_HW_REV_TYPE_5150:
891 case CSR_HW_REV_TYPE_5300:
892 case CSR_HW_REV_TYPE_5350:
893 priv->hw_params.calib_init_cfg = 883 priv->hw_params.calib_init_cfg =
894 BIT(IWL_CALIB_XTAL) | 884 BIT(IWL_CALIB_DC) |
895 BIT(IWL_CALIB_LO) | 885 BIT(IWL_CALIB_LO) |
896 BIT(IWL_CALIB_TX_IQ) | 886 BIT(IWL_CALIB_TX_IQ) |
897 BIT(IWL_CALIB_TX_IQ_PERD) |
898 BIT(IWL_CALIB_BASE_BAND); 887 BIT(IWL_CALIB_BASE_BAND);
888
899 break; 889 break;
900 case CSR_HW_REV_TYPE_5150: 890 default:
901 priv->hw_params.calib_init_cfg = 891 priv->hw_params.calib_init_cfg =
902 BIT(IWL_CALIB_DC) | 892 BIT(IWL_CALIB_XTAL) |
903 BIT(IWL_CALIB_LO) | 893 BIT(IWL_CALIB_LO) |
904 BIT(IWL_CALIB_TX_IQ) | 894 BIT(IWL_CALIB_TX_IQ) |
895 BIT(IWL_CALIB_TX_IQ_PERD) |
905 BIT(IWL_CALIB_BASE_BAND); 896 BIT(IWL_CALIB_BASE_BAND);
906
907 break; 897 break;
908 } 898 }
909 899
@@ -1556,6 +1546,8 @@ struct iwl_cfg iwl5300_agn_cfg = {
1556 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 1546 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1557 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 1547 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1558 .mod_params = &iwl50_mod_params, 1548 .mod_params = &iwl50_mod_params,
1549 .valid_tx_ant = ANT_ABC,
1550 .valid_rx_ant = ANT_ABC,
1559}; 1551};
1560 1552
1561struct iwl_cfg iwl5100_bg_cfg = { 1553struct iwl_cfg iwl5100_bg_cfg = {
@@ -1569,6 +1561,8 @@ struct iwl_cfg iwl5100_bg_cfg = {
1569 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 1561 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1570 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 1562 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1571 .mod_params = &iwl50_mod_params, 1563 .mod_params = &iwl50_mod_params,
1564 .valid_tx_ant = ANT_B,
1565 .valid_rx_ant = ANT_AB,
1572}; 1566};
1573 1567
1574struct iwl_cfg iwl5100_abg_cfg = { 1568struct iwl_cfg iwl5100_abg_cfg = {
@@ -1582,6 +1576,8 @@ struct iwl_cfg iwl5100_abg_cfg = {
1582 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 1576 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1583 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 1577 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1584 .mod_params = &iwl50_mod_params, 1578 .mod_params = &iwl50_mod_params,
1579 .valid_tx_ant = ANT_B,
1580 .valid_rx_ant = ANT_AB,
1585}; 1581};
1586 1582
1587struct iwl_cfg iwl5100_agn_cfg = { 1583struct iwl_cfg iwl5100_agn_cfg = {
@@ -1595,6 +1591,8 @@ struct iwl_cfg iwl5100_agn_cfg = {
1595 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 1591 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1596 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 1592 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1597 .mod_params = &iwl50_mod_params, 1593 .mod_params = &iwl50_mod_params,
1594 .valid_tx_ant = ANT_B,
1595 .valid_rx_ant = ANT_AB,
1598}; 1596};
1599 1597
1600struct iwl_cfg iwl5350_agn_cfg = { 1598struct iwl_cfg iwl5350_agn_cfg = {
@@ -1608,6 +1606,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
1608 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, 1606 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
1609 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, 1607 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
1610 .mod_params = &iwl50_mod_params, 1608 .mod_params = &iwl50_mod_params,
1609 .valid_tx_ant = ANT_ABC,
1610 .valid_rx_ant = ANT_ABC,
1611}; 1611};
1612 1612
1613struct iwl_cfg iwl5150_agn_cfg = { 1613struct iwl_cfg iwl5150_agn_cfg = {
@@ -1621,6 +1621,8 @@ struct iwl_cfg iwl5150_agn_cfg = {
1621 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, 1621 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
1622 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, 1622 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
1623 .mod_params = &iwl50_mod_params, 1623 .mod_params = &iwl50_mod_params,
1624 .valid_tx_ant = ANT_A,
1625 .valid_rx_ant = ANT_AB,
1624}; 1626};
1625 1627
1626MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 1628MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 4515a6053dd0..b78d67633c27 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -72,6 +72,8 @@ struct iwl_cfg iwl6000_2ag_cfg = {
72 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 72 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
73 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 73 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
74 .mod_params = &iwl50_mod_params, 74 .mod_params = &iwl50_mod_params,
75 .valid_tx_ant = ANT_BC,
76 .valid_rx_ant = ANT_BC,
75}; 77};
76 78
77struct iwl_cfg iwl6000_2agn_cfg = { 79struct iwl_cfg iwl6000_2agn_cfg = {
@@ -85,6 +87,8 @@ struct iwl_cfg iwl6000_2agn_cfg = {
85 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 87 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
86 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 88 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
87 .mod_params = &iwl50_mod_params, 89 .mod_params = &iwl50_mod_params,
90 .valid_tx_ant = ANT_BC,
91 .valid_rx_ant = ANT_BC,
88}; 92};
89 93
90struct iwl_cfg iwl6050_2agn_cfg = { 94struct iwl_cfg iwl6050_2agn_cfg = {
@@ -98,6 +102,8 @@ struct iwl_cfg iwl6050_2agn_cfg = {
98 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 102 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
99 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 103 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
100 .mod_params = &iwl50_mod_params, 104 .mod_params = &iwl50_mod_params,
105 .valid_tx_ant = ANT_BC,
106 .valid_rx_ant = ANT_BC,
101}; 107};
102 108
103struct iwl_cfg iwl6000_3agn_cfg = { 109struct iwl_cfg iwl6000_3agn_cfg = {
@@ -111,6 +117,8 @@ struct iwl_cfg iwl6000_3agn_cfg = {
111 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 117 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
112 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 118 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
113 .mod_params = &iwl50_mod_params, 119 .mod_params = &iwl50_mod_params,
120 .valid_tx_ant = ANT_ABC,
121 .valid_rx_ant = ANT_ABC,
114}; 122};
115 123
116struct iwl_cfg iwl6050_3agn_cfg = { 124struct iwl_cfg iwl6050_3agn_cfg = {
@@ -124,6 +132,8 @@ struct iwl_cfg iwl6050_3agn_cfg = {
124 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 132 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
125 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 133 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
126 .mod_params = &iwl50_mod_params, 134 .mod_params = &iwl50_mod_params,
135 .valid_tx_ant = ANT_ABC,
136 .valid_rx_ant = ANT_ABC,
127}; 137};
128 138
129MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); 139MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 0a719aeb7349..02e92be75568 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -211,6 +211,8 @@ struct iwl_cfg {
211 u16 eeprom_calib_ver; 211 u16 eeprom_calib_ver;
212 const struct iwl_ops *ops; 212 const struct iwl_ops *ops;
213 const struct iwl_mod_params *mod_params; 213 const struct iwl_mod_params *mod_params;
214 u8 valid_tx_ant;
215 u8 valid_rx_ant;
214}; 216};
215 217
216/*************************** 218/***************************