diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-10-02 16:44:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:45 -0400 |
commit | d68b603cf01a6e7d8c85c5a86db751ed3960c0c7 (patch) | |
tree | feb661659e80684e3edaa918f650bcc7e70d0625 /drivers/net/wireless/iwlwifi/iwl-3945.c | |
parent | e932a609e9759cc75db0c234f465a5fd6e20d362 (diff) |
iwlwifi/iwl3945 : unify apm stop operation
Unify the usage of apm_stop_master and apm_stop
across all hardwares.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@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 | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index f0ce5c45ca05..c5d1d57b4e0b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -1167,48 +1167,9 @@ void iwl3945_hw_txq_ctx_stop(struct iwl_priv *priv) | |||
1167 | iwl3945_hw_txq_ctx_free(priv); | 1167 | iwl3945_hw_txq_ctx_free(priv); |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | static int iwl3945_apm_stop_master(struct iwl_priv *priv) | ||
1171 | { | ||
1172 | int ret = 0; | ||
1173 | unsigned long flags; | ||
1174 | |||
1175 | spin_lock_irqsave(&priv->lock, flags); | ||
1176 | |||
1177 | /* set stop master bit */ | ||
1178 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER); | ||
1179 | |||
1180 | iwl_poll_direct_bit(priv, CSR_RESET, | ||
1181 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); | ||
1182 | |||
1183 | if (ret < 0) | ||
1184 | goto out; | ||
1185 | |||
1186 | out: | ||
1187 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1188 | IWL_DEBUG_INFO(priv, "stop master\n"); | ||
1189 | |||
1190 | return ret; | ||
1191 | } | ||
1192 | |||
1193 | static void iwl3945_apm_stop(struct iwl_priv *priv) | ||
1194 | { | ||
1195 | unsigned long flags; | ||
1196 | |||
1197 | iwl3945_apm_stop_master(priv); | ||
1198 | |||
1199 | spin_lock_irqsave(&priv->lock, flags); | ||
1200 | |||
1201 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | ||
1202 | |||
1203 | udelay(10); | ||
1204 | /* clear "init complete" move adapter D0A* --> D0U state */ | ||
1205 | iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | ||
1206 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1207 | } | ||
1208 | |||
1209 | static int iwl3945_apm_reset(struct iwl_priv *priv) | 1170 | static int iwl3945_apm_reset(struct iwl_priv *priv) |
1210 | { | 1171 | { |
1211 | iwl3945_apm_stop_master(priv); | 1172 | iwl_apm_stop_master(priv); |
1212 | 1173 | ||
1213 | 1174 | ||
1214 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | 1175 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); |
@@ -2841,7 +2802,7 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
2841 | .apm_ops = { | 2802 | .apm_ops = { |
2842 | .init = iwl3945_apm_init, | 2803 | .init = iwl3945_apm_init, |
2843 | .reset = iwl3945_apm_reset, | 2804 | .reset = iwl3945_apm_reset, |
2844 | .stop = iwl3945_apm_stop, | 2805 | .stop = iwl_apm_stop, |
2845 | .config = iwl3945_nic_config, | 2806 | .config = iwl3945_nic_config, |
2846 | .set_pwr_src = iwl3945_set_pwr_src, | 2807 | .set_pwr_src = iwl3945_set_pwr_src, |
2847 | }, | 2808 | }, |