aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-29 04:34:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-03 15:00:20 -0400
commitf118a91d16127e461cc8c17c529306910f13a8b1 (patch)
tree96f31c93ef9f044f8b77077b1f16f499944e9c5a /drivers/net/wireless
parent7f066108d15d06ec3534434333f0274c868fe798 (diff)
iwlwifi: implement apm stop function
This patch adds apm stop function for 4965 and 5000. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c19
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
3 files changed, 39 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 646c589b8282..080fc54db151 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -642,6 +642,22 @@ void iwl4965_hw_txq_ctx_stop(struct iwl_priv *priv)
642 iwl_hw_txq_ctx_free(priv); 642 iwl_hw_txq_ctx_free(priv);
643} 643}
644 644
645static void iwl4965_apm_stop(struct iwl_priv *priv)
646{
647 unsigned long flags;
648
649 iwl4965_hw_nic_stop_master(priv);
650
651 spin_lock_irqsave(&priv->lock, flags);
652
653 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
654
655 udelay(10);
656
657 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
658 spin_unlock_irqrestore(&priv->lock, flags);
659}
660
645static int iwl4965_apm_reset(struct iwl_priv *priv) 661static int iwl4965_apm_reset(struct iwl_priv *priv)
646{ 662{
647 int ret = 0; 663 int ret = 0;
@@ -658,6 +674,7 @@ static int iwl4965_apm_reset(struct iwl_priv *priv)
658 /* FIXME: put here L1A -L0S w/a */ 674 /* FIXME: put here L1A -L0S w/a */
659 675
660 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 676 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
677
661 ret = iwl_poll_bit(priv, CSR_RESET, 678 ret = iwl_poll_bit(priv, CSR_RESET,
662 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 679 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
663 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25); 680 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25);
@@ -689,7 +706,6 @@ out:
689 spin_unlock_irqrestore(&priv->lock, flags); 706 spin_unlock_irqrestore(&priv->lock, flags);
690 707
691 return ret; 708 return ret;
692
693} 709}
694 710
695#define REG_RECALIB_PERIOD (60) 711#define REG_RECALIB_PERIOD (60)
@@ -3625,6 +3641,7 @@ static struct iwl_lib_ops iwl4965_lib = {
3625 .apm_ops = { 3641 .apm_ops = {
3626 .init = iwl4965_apm_init, 3642 .init = iwl4965_apm_init,
3627 .reset = iwl4965_apm_reset, 3643 .reset = iwl4965_apm_reset,
3644 .stop = iwl4965_apm_stop,
3628 .config = iwl4965_nic_config, 3645 .config = iwl4965_nic_config,
3629 .set_pwr_src = iwl4965_set_pwr_src, 3646 .set_pwr_src = iwl4965_set_pwr_src,
3630 }, 3647 },
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 10054bdf3e4c..27cfe3c9a58d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -100,6 +100,25 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
100 return ret; 100 return ret;
101} 101}
102 102
103/* FIXME: this is indentical to 4965 */
104static void iwl5000_apm_stop(struct iwl_priv *priv)
105{
106 unsigned long flags;
107
108 iwl4965_hw_nic_stop_master(priv);
109
110 spin_lock_irqsave(&priv->lock, flags);
111
112 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
113
114 udelay(10);
115
116 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
117
118 spin_unlock_irqrestore(&priv->lock, flags);
119}
120
121
103static int iwl5000_apm_reset(struct iwl_priv *priv) 122static int iwl5000_apm_reset(struct iwl_priv *priv)
104{ 123{
105 int ret = 0; 124 int ret = 0;
@@ -859,6 +878,7 @@ static struct iwl_lib_ops iwl5000_lib = {
859 .apm_ops = { 878 .apm_ops = {
860 .init = iwl5000_apm_init, 879 .init = iwl5000_apm_init,
861 .reset = iwl5000_apm_reset, 880 .reset = iwl5000_apm_reset,
881 .stop = iwl5000_apm_stop,
862 .config = iwl5000_nic_config, 882 .config = iwl5000_nic_config,
863 .set_pwr_src = iwl4965_set_pwr_src, 883 .set_pwr_src = iwl4965_set_pwr_src,
864 }, 884 },
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index d82660c88a38..d6e6985181cf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -125,6 +125,7 @@ struct iwl_lib_ops {
125 struct { 125 struct {
126 int (*init)(struct iwl_priv *priv); 126 int (*init)(struct iwl_priv *priv);
127 int (*reset)(struct iwl_priv *priv); 127 int (*reset)(struct iwl_priv *priv);
128 void (*stop)(struct iwl_priv *priv);
128 void (*config)(struct iwl_priv *priv); 129 void (*config)(struct iwl_priv *priv);
129 int (*set_pwr_src)(struct iwl_priv *priv, enum iwl_pwr_src src); 130 int (*set_pwr_src)(struct iwl_priv *priv, enum iwl_pwr_src src);
130 } apm_ops; 131 } apm_ops;