diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-04-23 20:14:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:17 -0400 |
commit | 8614f360bdc7db8d35609a9c771601f1d45539e5 (patch) | |
tree | 9309ba2f774ea22552bafc9f68585ddb3ebce67d /drivers/net/wireless/iwlwifi/iwl-4965.c | |
parent | b661c8190e91c0baeebf813fec7ff8e99e155a54 (diff) |
iwlwifi: check eeprom version in pci probe time
This patch move eeprom version checking into pci probe stage
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-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index d1ddbf34b7fe..a41a83a5f816 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -494,6 +494,31 @@ int iwl4965_hw_rxq_stop(struct iwl_priv *priv) | |||
494 | return 0; | 494 | return 0; |
495 | } | 495 | } |
496 | 496 | ||
497 | /* | ||
498 | * EEPROM handlers | ||
499 | */ | ||
500 | |||
501 | static int iwl4965_eeprom_check_version(struct iwl_priv *priv) | ||
502 | { | ||
503 | u16 eeprom_ver; | ||
504 | u16 calib_ver; | ||
505 | |||
506 | eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION); | ||
507 | |||
508 | calib_ver = iwl_eeprom_query16(priv, EEPROM_4965_CALIB_VERSION_OFFSET); | ||
509 | |||
510 | if (eeprom_ver < EEPROM_4965_EEPROM_VERSION || | ||
511 | calib_ver < EEPROM_4965_TX_POWER_VERSION) | ||
512 | goto err; | ||
513 | |||
514 | return 0; | ||
515 | err: | ||
516 | IWL_ERROR("Unsuported EEPROM VER=0x%x < 0x%x CALIB=0x%x < 0x%x\n", | ||
517 | eeprom_ver, EEPROM_4965_EEPROM_VERSION, | ||
518 | calib_ver, EEPROM_4965_TX_POWER_VERSION); | ||
519 | return -EINVAL; | ||
520 | |||
521 | } | ||
497 | int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src) | 522 | int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src) |
498 | { | 523 | { |
499 | int ret; | 524 | int ret; |
@@ -763,12 +788,6 @@ int iwl4965_hw_nic_init(struct iwl_priv *priv) | |||
763 | 788 | ||
764 | spin_unlock_irqrestore(&priv->lock, flags); | 789 | spin_unlock_irqrestore(&priv->lock, flags); |
765 | 790 | ||
766 | if (iwl_eeprom_query16(priv, EEPROM_4965_CALIB_VERSION_OFFSET) < | ||
767 | EEPROM_4965_TX_POWER_VERSION) { | ||
768 | IWL_ERROR("Older EEPROM detected! Aborting.\n"); | ||
769 | return -EINVAL; | ||
770 | } | ||
771 | |||
772 | pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link); | 791 | pci_read_config_byte(priv->pci_dev, PCI_LINK_CTRL, &val_link); |
773 | 792 | ||
774 | /* disable L1 entry -- workaround for pre-B1 */ | 793 | /* disable L1 entry -- workaround for pre-B1 */ |
@@ -4354,6 +4373,7 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
4354 | .verify_signature = iwlcore_eeprom_verify_signature, | 4373 | .verify_signature = iwlcore_eeprom_verify_signature, |
4355 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, | 4374 | .acquire_semaphore = iwlcore_eeprom_acquire_semaphore, |
4356 | .release_semaphore = iwlcore_eeprom_release_semaphore, | 4375 | .release_semaphore = iwlcore_eeprom_release_semaphore, |
4376 | .check_version = iwl4965_eeprom_check_version, | ||
4357 | .query_addr = iwlcore_eeprom_query_addr, | 4377 | .query_addr = iwlcore_eeprom_query_addr, |
4358 | }, | 4378 | }, |
4359 | .radio_kill_sw = iwl4965_radio_kill_sw, | 4379 | .radio_kill_sw = iwl4965_radio_kill_sw, |