aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-10-24 02:48:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:02:24 -0400
commit0ef2ca67b19e2286eed8eeb7ef7a35ce57d6d629 (patch)
treec19702e83267fe503a790b164290fd2fec1eb6b9 /drivers/net/wireless/iwlwifi/iwl-5000.c
parented7fafec5e566a30fb21586c98cbef76c306d209 (diff)
iwlwifi: parametrize eeprom versions
This patch uses new parameters eeprom_ver and eeprom_calib_ver to support additional HW. Signed-off-by: Tomas Winkler <tomas.winkler@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-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index a8c8c858e209..f3316d488240 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -293,30 +293,17 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
293 return (address & ADDRESS_MSK) + (offset << 1); 293 return (address & ADDRESS_MSK) + (offset << 1);
294} 294}
295 295
296static int iwl5000_eeprom_check_version(struct iwl_priv *priv) 296static u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv)
297{ 297{
298 u16 eeprom_ver;
299 struct iwl_eeprom_calib_hdr { 298 struct iwl_eeprom_calib_hdr {
300 u8 version; 299 u8 version;
301 u8 pa_type; 300 u8 pa_type;
302 u16 voltage; 301 u16 voltage;
303 } *hdr; 302 } *hdr;
304 303
305 eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
306
307 hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(priv, 304 hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(priv,
308 EEPROM_5000_CALIB_ALL); 305 EEPROM_5000_CALIB_ALL);
309 306 return hdr->version;
310 if (eeprom_ver < EEPROM_5000_EEPROM_VERSION ||
311 hdr->version < EEPROM_5000_TX_POWER_VERSION)
312 goto err;
313
314 return 0;
315err:
316 IWL_ERROR("Unsuported EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n",
317 eeprom_ver, EEPROM_5000_EEPROM_VERSION,
318 hdr->version, EEPROM_5000_TX_POWER_VERSION);
319 return -EINVAL;
320 307
321} 308}
322 309
@@ -1510,7 +1497,7 @@ static struct iwl_lib_ops iwl5000_lib = {
1510 .verify_signature = iwlcore_eeprom_verify_signature, 1497 .verify_signature = iwlcore_eeprom_verify_signature,
1511 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, 1498 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
1512 .release_semaphore = iwlcore_eeprom_release_semaphore, 1499 .release_semaphore = iwlcore_eeprom_release_semaphore,
1513 .check_version = iwl5000_eeprom_check_version, 1500 .calib_version = iwl5000_eeprom_calib_version,
1514 .query_addr = iwl5000_eeprom_query_addr, 1501 .query_addr = iwl5000_eeprom_query_addr,
1515 }, 1502 },
1516}; 1503};
@@ -1537,6 +1524,8 @@ struct iwl_cfg iwl5300_agn_cfg = {
1537 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 1524 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
1538 .ops = &iwl5000_ops, 1525 .ops = &iwl5000_ops,
1539 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, 1526 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
1527 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1528 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1540 .mod_params = &iwl50_mod_params, 1529 .mod_params = &iwl50_mod_params,
1541}; 1530};
1542 1531
@@ -1546,6 +1535,8 @@ struct iwl_cfg iwl5100_bg_cfg = {
1546 .sku = IWL_SKU_G, 1535 .sku = IWL_SKU_G,
1547 .ops = &iwl5000_ops, 1536 .ops = &iwl5000_ops,
1548 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, 1537 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
1538 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1539 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1549 .mod_params = &iwl50_mod_params, 1540 .mod_params = &iwl50_mod_params,
1550}; 1541};
1551 1542
@@ -1555,6 +1546,8 @@ struct iwl_cfg iwl5100_abg_cfg = {
1555 .sku = IWL_SKU_A|IWL_SKU_G, 1546 .sku = IWL_SKU_A|IWL_SKU_G,
1556 .ops = &iwl5000_ops, 1547 .ops = &iwl5000_ops,
1557 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, 1548 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
1549 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1550 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1558 .mod_params = &iwl50_mod_params, 1551 .mod_params = &iwl50_mod_params,
1559}; 1552};
1560 1553
@@ -1564,6 +1557,8 @@ struct iwl_cfg iwl5100_agn_cfg = {
1564 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 1557 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
1565 .ops = &iwl5000_ops, 1558 .ops = &iwl5000_ops,
1566 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, 1559 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
1560 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
1561 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
1567 .mod_params = &iwl50_mod_params, 1562 .mod_params = &iwl50_mod_params,
1568}; 1563};
1569 1564
@@ -1573,6 +1568,8 @@ struct iwl_cfg iwl5350_agn_cfg = {
1573 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 1568 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
1574 .ops = &iwl5000_ops, 1569 .ops = &iwl5000_ops,
1575 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, 1570 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
1571 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
1572 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
1576 .mod_params = &iwl50_mod_params, 1573 .mod_params = &iwl50_mod_params,
1577}; 1574};
1578 1575