Skip to content

Commit

Permalink
iwlwifi: Check HW ready before prepare card.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mohamed Abbas authored and John W. Linville committed Jul 10, 2009
1 parent 7d5ca3b commit 3354a0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,13 +1812,19 @@ static int iwl_prepare_card_hw(struct iwl_priv *priv)

IWL_DEBUG_INFO(priv, "iwl_prepare_card_hw enter \n");

ret = iwl_set_hw_ready(priv);
if (priv->hw_ready)
return ret;

/* If HW is not ready, prepare the conditions to check again */
iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_PREPARE);

ret = iwl_poll_bit(priv, CSR_HW_IF_CONFIG_REG,
~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE,
CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000);

/* HW should be ready by now, check again. */
if (ret != -ETIMEDOUT)
iwl_set_hw_ready(priv);

Expand Down

0 comments on commit 3354a0f

Please sign in to comment.