diff options
author | Mohamed Abbas <mohamed.abbas@intel.com> | 2009-06-19 16:52:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:55 -0400 |
commit | 3354a0f6a3ced6957dfb9f689ad075cfa8fd272f (patch) | |
tree | af6bf64de6f9544ec82d0bd253976efe79f46a8c /drivers | |
parent | 7d5ca3b8b2b38ab676d0adc268a3c6a82e7a7588 (diff) |
iwlwifi: Check HW ready before prepare card.
Hardware may be ready for us to manage it without us trying to prepare
it first. Check if this is the case.
Signed-off-by: Mohamed Abbas <mohamed.abbas@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-agn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 6d1519e1f011..63cba8c0ad4d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1812,6 +1812,11 @@ static int iwl_prepare_card_hw(struct iwl_priv *priv) | |||
1812 | 1812 | ||
1813 | IWL_DEBUG_INFO(priv, "iwl_prepare_card_hw enter \n"); | 1813 | IWL_DEBUG_INFO(priv, "iwl_prepare_card_hw enter \n"); |
1814 | 1814 | ||
1815 | ret = iwl_set_hw_ready(priv); | ||
1816 | if (priv->hw_ready) | ||
1817 | return ret; | ||
1818 | |||
1819 | /* If HW is not ready, prepare the conditions to check again */ | ||
1815 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, | 1820 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, |
1816 | CSR_HW_IF_CONFIG_REG_PREPARE); | 1821 | CSR_HW_IF_CONFIG_REG_PREPARE); |
1817 | 1822 | ||
@@ -1819,6 +1824,7 @@ static int iwl_prepare_card_hw(struct iwl_priv *priv) | |||
1819 | ~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, | 1824 | ~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, |
1820 | CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000); | 1825 | CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000); |
1821 | 1826 | ||
1827 | /* HW should be ready by now, check again. */ | ||
1822 | if (ret != -ETIMEDOUT) | 1828 | if (ret != -ETIMEDOUT) |
1823 | iwl_set_hw_ready(priv); | 1829 | iwl_set_hw_ready(priv); |
1824 | 1830 | ||