diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-11-10 12:56:50 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:26:59 -0500 |
commit | f81c1f48384d398dbe8f6c5b10377c7158086791 (patch) | |
tree | f5a813c7e3b66a024adb7db8359c920fb878a4db /drivers/net/wireless/iwlwifi/iwl-rx.c | |
parent | 6fe8efb2211fe61caa7b0e1c36c521670b8a10a9 (diff) |
iwlagn: enable shadow register
For 6000 series devices and up, enable automatic update MAC's register
for better power usage in PSP mode
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index baca4cc0073b..87a6fd84d4d2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -134,28 +134,37 @@ void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q | |||
134 | if (q->need_update == 0) | 134 | if (q->need_update == 0) |
135 | goto exit_unlock; | 135 | goto exit_unlock; |
136 | 136 | ||
137 | /* If power-saving is in use, make sure device is awake */ | 137 | if (priv->cfg->base_params->shadow_reg_enable) { |
138 | if (test_bit(STATUS_POWER_PMI, &priv->status)) { | 138 | /* shadow register enabled */ |
139 | reg = iwl_read32(priv, CSR_UCODE_DRV_GP1); | ||
140 | |||
141 | if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { | ||
142 | IWL_DEBUG_INFO(priv, "Rx queue requesting wakeup, GP1 = 0x%x\n", | ||
143 | reg); | ||
144 | iwl_set_bit(priv, CSR_GP_CNTRL, | ||
145 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | ||
146 | goto exit_unlock; | ||
147 | } | ||
148 | |||
149 | q->write_actual = (q->write & ~0x7); | ||
150 | iwl_write_direct32(priv, rx_wrt_ptr_reg, q->write_actual); | ||
151 | |||
152 | /* Else device is assumed to be awake */ | ||
153 | } else { | ||
154 | /* Device expects a multiple of 8 */ | 139 | /* Device expects a multiple of 8 */ |
155 | q->write_actual = (q->write & ~0x7); | 140 | q->write_actual = (q->write & ~0x7); |
156 | iwl_write32(priv, rx_wrt_ptr_reg, q->write_actual); | 141 | iwl_write32(priv, rx_wrt_ptr_reg, q->write_actual); |
157 | } | 142 | } else { |
143 | /* If power-saving is in use, make sure device is awake */ | ||
144 | if (test_bit(STATUS_POWER_PMI, &priv->status)) { | ||
145 | reg = iwl_read32(priv, CSR_UCODE_DRV_GP1); | ||
146 | |||
147 | if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { | ||
148 | IWL_DEBUG_INFO(priv, | ||
149 | "Rx queue requesting wakeup," | ||
150 | " GP1 = 0x%x\n", reg); | ||
151 | iwl_set_bit(priv, CSR_GP_CNTRL, | ||
152 | CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); | ||
153 | goto exit_unlock; | ||
154 | } | ||
158 | 155 | ||
156 | q->write_actual = (q->write & ~0x7); | ||
157 | iwl_write_direct32(priv, rx_wrt_ptr_reg, | ||
158 | q->write_actual); | ||
159 | |||
160 | /* Else device is assumed to be awake */ | ||
161 | } else { | ||
162 | /* Device expects a multiple of 8 */ | ||
163 | q->write_actual = (q->write & ~0x7); | ||
164 | iwl_write_direct32(priv, rx_wrt_ptr_reg, | ||
165 | q->write_actual); | ||
166 | } | ||
167 | } | ||
159 | q->need_update = 0; | 168 | q->need_update = 0; |
160 | 169 | ||
161 | exit_unlock: | 170 | exit_unlock: |