diff options
author | Zhu, Yi <yi.zhu@intel.com> | 2008-12-05 10:58:40 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-12 13:48:21 -0500 |
commit | 73d7b5acc461bdc99e0135779d15e1874c6e00a6 (patch) | |
tree | 30c62a728e57cc83f938a2a69a0188d624c42793 /drivers/net/wireless/iwlwifi/iwl-3945.c | |
parent | 42802d71dd14dd0e435a8da59d817d0c6f8a2866 (diff) |
iwlwifi: iwl_poll_{direct_}bit cleanup
The patch merges implementation of iwl_poll_bit() and
iwl_poll_direct_bit() by letting the latter be a special case of
the former.
Signed-off-by: Zhu Yi <yi.zhu@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-3945.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 4e9e592b1cab..1c35fa857be6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -1103,9 +1103,8 @@ int iwl3945_hw_nic_init(struct iwl3945_priv *priv) | |||
1103 | CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); | 1103 | CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); |
1104 | 1104 | ||
1105 | iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 1105 | iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
1106 | rc = iwl3945_poll_bit(priv, CSR_GP_CNTRL, | 1106 | rc = iwl3945_poll_direct_bit(priv, CSR_GP_CNTRL, |
1107 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 1107 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); |
1108 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | ||
1109 | if (rc < 0) { | 1108 | if (rc < 0) { |
1110 | spin_unlock_irqrestore(&priv->lock, flags); | 1109 | spin_unlock_irqrestore(&priv->lock, flags); |
1111 | IWL_DEBUG_INFO("Failed to init the card\n"); | 1110 | IWL_DEBUG_INFO("Failed to init the card\n"); |
@@ -1286,8 +1285,7 @@ int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv) | |||
1286 | IWL_DEBUG_INFO("Card in power save, master is already " | 1285 | IWL_DEBUG_INFO("Card in power save, master is already " |
1287 | "stopped\n"); | 1286 | "stopped\n"); |
1288 | else { | 1287 | else { |
1289 | rc = iwl3945_poll_bit(priv, CSR_RESET, | 1288 | rc = iwl3945_poll_direct_bit(priv, CSR_RESET, |
1290 | CSR_RESET_REG_FLAG_MASTER_DISABLED, | ||
1291 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); | 1289 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); |
1292 | if (rc < 0) { | 1290 | if (rc < 0) { |
1293 | spin_unlock_irqrestore(&priv->lock, flags); | 1291 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -1312,9 +1310,8 @@ int iwl3945_hw_nic_reset(struct iwl3945_priv *priv) | |||
1312 | 1310 | ||
1313 | iwl3945_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | 1311 | iwl3945_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); |
1314 | 1312 | ||
1315 | rc = iwl3945_poll_bit(priv, CSR_GP_CNTRL, | 1313 | iwl3945_poll_direct_bit(priv, CSR_GP_CNTRL, |
1316 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 1314 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); |
1317 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | ||
1318 | 1315 | ||
1319 | rc = iwl3945_grab_nic_access(priv); | 1316 | rc = iwl3945_grab_nic_access(priv); |
1320 | if (!rc) { | 1317 | if (!rc) { |
@@ -2311,7 +2308,8 @@ int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv) | |||
2311 | } | 2308 | } |
2312 | 2309 | ||
2313 | iwl3945_write_direct32(priv, FH_RCSR_CONFIG(0), 0); | 2310 | iwl3945_write_direct32(priv, FH_RCSR_CONFIG(0), 0); |
2314 | rc = iwl3945_poll_direct_bit(priv, FH_RSSR_STATUS, (1 << 24), 1000); | 2311 | rc = iwl3945_poll_direct_bit(priv, FH_RSSR_STATUS, |
2312 | FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000); | ||
2315 | if (rc < 0) | 2313 | if (rc < 0) |
2316 | IWL_ERROR("Can't stop Rx DMA.\n"); | 2314 | IWL_ERROR("Can't stop Rx DMA.\n"); |
2317 | 2315 | ||