aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-6000.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-07-31 17:28:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-04 16:44:22 -0400
commit65b7998a9be418482493e9448bb83ff2914ed050 (patch)
tree47af0592b112089e54feb7925420013bf1f7f981 /drivers/net/wireless/iwlwifi/iwl-6000.c
parent8ce73f3abd064081706cc337c771378fc4431ef3 (diff)
iwlwifi: Distinguish power amplifier for 6000 series
For 6x00 2x2 NIC, two types of Power Amplifier are available. In order for uCode to apply correct tx power, driver needs to program the CSR_GP_DRIVER_REG register and let uCode know the type of PA. If driver do not program CSR_GP_DRIVER_REG register (default to 0), then it is uCode's decision for tx power 2x2 Hybrid card: use both internal and external PA 2x2 IPA(Internal Power Amplifier) card: internal PA only Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-6000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 59ff73536f3a..052a704f2364 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -68,6 +68,24 @@ static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
68 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD; 68 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
69} 69}
70 70
71/* NIC configuration for 6000 series */
72static void iwl6000_nic_config(struct iwl_priv *priv)
73{
74 iwl5000_nic_config(priv);
75
76 /* no locking required for register write */
77 if (priv->cfg->pa_type == IWL_PA_HYBRID) {
78 /* 2x2 hybrid phy type */
79 iwl_write32(priv, CSR_GP_DRIVER_REG,
80 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_HYB);
81 } else if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
82 /* 2x2 IPA phy type */
83 iwl_write32(priv, CSR_GP_DRIVER_REG,
84 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
85 }
86 /* else do nothing, uCode configured */
87}
88
71static struct iwl_lib_ops iwl6000_lib = { 89static struct iwl_lib_ops iwl6000_lib = {
72 .set_hw_params = iwl5000_hw_set_hw_params, 90 .set_hw_params = iwl5000_hw_set_hw_params,
73 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, 91 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
@@ -90,7 +108,7 @@ static struct iwl_lib_ops iwl6000_lib = {
90 .init = iwl5000_apm_init, 108 .init = iwl5000_apm_init,
91 .reset = iwl5000_apm_reset, 109 .reset = iwl5000_apm_reset,
92 .stop = iwl5000_apm_stop, 110 .stop = iwl5000_apm_stop,
93 .config = iwl5000_nic_config, 111 .config = iwl6000_nic_config,
94 .set_pwr_src = iwl_set_pwr_src, 112 .set_pwr_src = iwl_set_pwr_src,
95 }, 113 },
96 .eeprom_ops = { 114 .eeprom_ops = {
@@ -146,9 +164,13 @@ struct iwl_cfg iwl6000_2ag_cfg = {
146 .valid_tx_ant = ANT_BC, 164 .valid_tx_ant = ANT_BC,
147 .valid_rx_ant = ANT_BC, 165 .valid_rx_ant = ANT_BC,
148 .need_pll_cfg = false, 166 .need_pll_cfg = false,
167 .pa_type = IWL_PA_SYSTEM,
149}; 168};
150 169
151struct iwl_cfg iwl6000_2agn_cfg = { 170/*
171 * "h": Hybrid configuration, use both internal and external Power Amplifier
172 */
173struct iwl_cfg iwl6000h_2agn_cfg = {
152 .name = "6000 Series 2x2 AGN", 174 .name = "6000 Series 2x2 AGN",
153 .fw_name_pre = IWL6000_FW_PRE, 175 .fw_name_pre = IWL6000_FW_PRE,
154 .ucode_api_max = IWL6000_UCODE_API_MAX, 176 .ucode_api_max = IWL6000_UCODE_API_MAX,
@@ -162,6 +184,27 @@ struct iwl_cfg iwl6000_2agn_cfg = {
162 .valid_tx_ant = ANT_AB, 184 .valid_tx_ant = ANT_AB,
163 .valid_rx_ant = ANT_AB, 185 .valid_rx_ant = ANT_AB,
164 .need_pll_cfg = false, 186 .need_pll_cfg = false,
187 .pa_type = IWL_PA_HYBRID,
188};
189
190/*
191 * "i": Internal configuration, use internal Power Amplifier
192 */
193struct iwl_cfg iwl6000i_2agn_cfg = {
194 .name = "6000 Series 2x2 AGN",
195 .fw_name_pre = IWL6000_FW_PRE,
196 .ucode_api_max = IWL6000_UCODE_API_MAX,
197 .ucode_api_min = IWL6000_UCODE_API_MIN,
198 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
199 .ops = &iwl6000_ops,
200 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
201 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
202 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
203 .mod_params = &iwl50_mod_params,
204 .valid_tx_ant = ANT_BC,
205 .valid_rx_ant = ANT_BC,
206 .need_pll_cfg = false,
207 .pa_type = IWL_PA_INTERNAL,
165}; 208};
166 209
167struct iwl_cfg iwl6050_2agn_cfg = { 210struct iwl_cfg iwl6050_2agn_cfg = {
@@ -178,6 +221,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
178 .valid_tx_ant = ANT_AB, 221 .valid_tx_ant = ANT_AB,
179 .valid_rx_ant = ANT_AB, 222 .valid_rx_ant = ANT_AB,
180 .need_pll_cfg = false, 223 .need_pll_cfg = false,
224 .pa_type = IWL_PA_SYSTEM,
181}; 225};
182 226
183struct iwl_cfg iwl6000_3agn_cfg = { 227struct iwl_cfg iwl6000_3agn_cfg = {
@@ -194,6 +238,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
194 .valid_tx_ant = ANT_ABC, 238 .valid_tx_ant = ANT_ABC,
195 .valid_rx_ant = ANT_ABC, 239 .valid_rx_ant = ANT_ABC,
196 .need_pll_cfg = false, 240 .need_pll_cfg = false,
241 .pa_type = IWL_PA_SYSTEM,
197}; 242};
198 243
199struct iwl_cfg iwl6050_3agn_cfg = { 244struct iwl_cfg iwl6050_3agn_cfg = {
@@ -210,6 +255,7 @@ struct iwl_cfg iwl6050_3agn_cfg = {
210 .valid_tx_ant = ANT_ABC, 255 .valid_tx_ant = ANT_ABC,
211 .valid_rx_ant = ANT_ABC, 256 .valid_rx_ant = ANT_ABC,
212 .need_pll_cfg = false, 257 .need_pll_cfg = false,
258 .pa_type = IWL_PA_SYSTEM,
213}; 259};
214 260
215MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); 261MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));