aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-11-15 16:43:07 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-11-24 19:57:55 -0500
commitdbbf1755b09eef8ff6dd21c8dafe1606f051ce12 (patch)
treebf0b1c6786b879255e991be1052a37991d634eb7 /drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
parent4b7384f936817489a4172b9c5d946f63f479ca15 (diff)
iwlwifi: use antenna information in EEPROM
The valid tx/rx antenna information is part of EEPROM, so use it to configure the device. For few cases, the EEPROM did not reflect the correct antenna, but it is too late to modify the EEPROM, so overwrite with .cfg parameters Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
index 8a4d3acb9b79..dbada761624d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
@@ -251,6 +251,7 @@ err:
251int iwl_eeprom_check_sku(struct iwl_priv *priv) 251int iwl_eeprom_check_sku(struct iwl_priv *priv)
252{ 252{
253 u16 eeprom_sku; 253 u16 eeprom_sku;
254 u16 radio_cfg;
254 255
255 eeprom_sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP); 256 eeprom_sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP);
256 257
@@ -266,6 +267,25 @@ int iwl_eeprom_check_sku(struct iwl_priv *priv)
266 267
267 IWL_INFO(priv, "Device SKU: 0X%x\n", priv->cfg->sku); 268 IWL_INFO(priv, "Device SKU: 0X%x\n", priv->cfg->sku);
268 269
270 if (!priv->cfg->valid_tx_ant && !priv->cfg->valid_rx_ant) {
271 /* not using .cfg overwrite */
272 radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
273 priv->cfg->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
274 priv->cfg->valid_rx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
275 if (!priv->cfg->valid_tx_ant || !priv->cfg->valid_rx_ant) {
276 IWL_ERR(priv, "Invalid chain (0X%x, 0X%x)\n",
277 priv->cfg->valid_tx_ant,
278 priv->cfg->valid_rx_ant);
279 return -EINVAL;
280 }
281 IWL_INFO(priv, "Valid Tx ant: 0X%x, Valid Rx ant: 0X%x\n",
282 priv->cfg->valid_tx_ant, priv->cfg->valid_rx_ant);
283 }
284 /*
285 * for some special cases,
286 * EEPROM did not reflect the correct antenna setting
287 * so overwrite the valid tx/rx antenna from .cfg
288 */
269 return 0; 289 return 0;
270} 290}
271 291