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-4965.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-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 8717946de011..dd10c426ecc4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -396,45 +396,11 @@ static void iwl4965_nic_config(struct iwl_priv *priv) | |||
396 | spin_unlock_irqrestore(&priv->lock, flags); | 396 | spin_unlock_irqrestore(&priv->lock, flags); |
397 | } | 397 | } |
398 | 398 | ||
399 | static int iwl4965_apm_stop_master(struct iwl_priv *priv) | ||
400 | { | ||
401 | unsigned long flags; | ||
402 | |||
403 | spin_lock_irqsave(&priv->lock, flags); | ||
404 | |||
405 | /* set stop master bit */ | ||
406 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER); | ||
407 | |||
408 | iwl_poll_direct_bit(priv, CSR_RESET, | ||
409 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); | ||
410 | |||
411 | spin_unlock_irqrestore(&priv->lock, flags); | ||
412 | IWL_DEBUG_INFO(priv, "stop master\n"); | ||
413 | |||
414 | return 0; | ||
415 | } | ||
416 | |||
417 | static void iwl4965_apm_stop(struct iwl_priv *priv) | ||
418 | { | ||
419 | unsigned long flags; | ||
420 | |||
421 | iwl4965_apm_stop_master(priv); | ||
422 | |||
423 | spin_lock_irqsave(&priv->lock, flags); | ||
424 | |||
425 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | ||
426 | |||
427 | udelay(10); | ||
428 | /* clear "init complete" move adapter D0A* --> D0U state */ | ||
429 | iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | ||
430 | spin_unlock_irqrestore(&priv->lock, flags); | ||
431 | } | ||
432 | |||
433 | static int iwl4965_apm_reset(struct iwl_priv *priv) | 399 | static int iwl4965_apm_reset(struct iwl_priv *priv) |
434 | { | 400 | { |
435 | int ret = 0; | 401 | int ret = 0; |
436 | 402 | ||
437 | iwl4965_apm_stop_master(priv); | 403 | iwl_apm_stop_master(priv); |
438 | 404 | ||
439 | 405 | ||
440 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | 406 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); |
@@ -2306,7 +2272,7 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
2306 | .apm_ops = { | 2272 | .apm_ops = { |
2307 | .init = iwl4965_apm_init, | 2273 | .init = iwl4965_apm_init, |
2308 | .reset = iwl4965_apm_reset, | 2274 | .reset = iwl4965_apm_reset, |
2309 | .stop = iwl4965_apm_stop, | 2275 | .stop = iwl_apm_stop, |
2310 | .config = iwl4965_nic_config, | 2276 | .config = iwl4965_nic_config, |
2311 | .set_pwr_src = iwl_set_pwr_src, | 2277 | .set_pwr_src = iwl_set_pwr_src, |
2312 | }, | 2278 | }, |