aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-07-08 11:46:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-11 15:02:01 -0400
commitc2c52e8bed1a186d060166ec57228e2a123cab2e (patch)
tree65f8b5f8973f22842d4d8ca27bf36094c77bcd88 /drivers/net/wireless
parent1359ca4f305a1680ea6a1347a43bea76c352097c (diff)
iwlagn: add an API for RX stop
Rx stop moves to transport layer. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.c10
4 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 90d366e15d2f..25a592a656a4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -905,17 +905,6 @@ void iwlagn_rx_replenish_now(struct iwl_priv *priv)
905 iwlagn_rx_queue_restock(priv); 905 iwlagn_rx_queue_restock(priv);
906} 906}
907 907
908int iwlagn_rxq_stop(struct iwl_priv *priv)
909{
910
911 /* stop Rx DMA */
912 iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
913 iwl_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
914 FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
915
916 return 0;
917}
918
919int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band) 908int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band)
920{ 909{
921 int idx = 0; 910 int idx = 0;
@@ -2321,13 +2310,14 @@ void iwlagn_stop_device(struct iwl_priv *priv)
2321 * already dead. 2310 * already dead.
2322 */ 2311 */
2323 if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) { 2312 if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) {
2324 iwlagn_txq_ctx_stop(priv); 2313 iwlagn_txq_ctx_stop(priv);
2325 iwlagn_rxq_stop(priv); 2314 priv->trans.ops->rx_stop(priv);
2326 2315
2327 /* Power-down device's busmaster DMA clocks */ 2316 /* Power-down device's busmaster DMA clocks */
2328 iwl_write_prph(priv, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT); 2317 iwl_write_prph(priv, APMG_CLK_DIS_REG,
2329 udelay(5); 2318 APMG_CLK_VAL_DMA_CLK_RQT);
2330 } 2319 udelay(5);
2320 }
2331 2321
2332 /* Make sure (redundant) we've released our request to stay awake */ 2322 /* Make sure (redundant) we've released our request to stay awake */
2333 iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); 2323 iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index fabab0ff5577..0fa379b4f46b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -193,7 +193,6 @@ void iwlagn_rx_queue_restock(struct iwl_priv *priv);
193void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority); 193void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority);
194void iwlagn_rx_replenish(struct iwl_priv *priv); 194void iwlagn_rx_replenish(struct iwl_priv *priv);
195void iwlagn_rx_replenish_now(struct iwl_priv *priv); 195void iwlagn_rx_replenish_now(struct iwl_priv *priv);
196int iwlagn_rxq_stop(struct iwl_priv *priv);
197int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band); 196int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band);
198void iwl_setup_rx_handlers(struct iwl_priv *priv); 197void iwl_setup_rx_handlers(struct iwl_priv *priv);
199 198
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index a29fdd43a9f3..8611cf0e5556 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1231,12 +1231,14 @@ struct iwl_trans;
1231 * struct iwl_trans_ops - transport specific operations 1231 * struct iwl_trans_ops - transport specific operations
1232 1232
1233 * @rx_init: inits the rx memory, allocate it if needed 1233 * @rx_init: inits the rx memory, allocate it if needed
1234 * @rx_stop: stop the rx
1234 * @rx_free: frees the rx memory 1235 * @rx_free: frees the rx memory
1235 * @tx_init:inits the tx memory, allocate if needed 1236 * @tx_init:inits the tx memory, allocate if needed
1236 * @tx_free: frees the tx memory 1237 * @tx_free: frees the tx memory
1237 */ 1238 */
1238struct iwl_trans_ops { 1239struct iwl_trans_ops {
1239 int (*rx_init)(struct iwl_priv *priv); 1240 int (*rx_init)(struct iwl_priv *priv);
1241 int (*rx_stop)(struct iwl_priv *priv);
1240 void (*rx_free)(struct iwl_priv *priv); 1242 void (*rx_free)(struct iwl_priv *priv);
1241 1243
1242 int (*tx_init)(struct iwl_priv *priv); 1244 int (*tx_init)(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index 38b43e41d561..c4cd363d81f2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.c
@@ -188,6 +188,15 @@ static void iwl_trans_rx_free(struct iwl_priv *priv)
188 rxq->rb_stts = NULL; 188 rxq->rb_stts = NULL;
189} 189}
190 190
191static int iwl_trans_rx_stop(struct iwl_priv *priv)
192{
193
194 /* stop Rx DMA */
195 iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
196 return iwl_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
197 FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
198}
199
191/* TODO:remove this code duplication */ 200/* TODO:remove this code duplication */
192static inline int iwlagn_alloc_dma_ptr(struct iwl_priv *priv, 201static inline int iwlagn_alloc_dma_ptr(struct iwl_priv *priv,
193 struct iwl_dma_ptr *ptr, size_t size) 202 struct iwl_dma_ptr *ptr, size_t size)
@@ -490,6 +499,7 @@ error:
490 499
491static const struct iwl_trans_ops trans_ops = { 500static const struct iwl_trans_ops trans_ops = {
492 .rx_init = iwl_trans_rx_init, 501 .rx_init = iwl_trans_rx_init,
502 .rx_stop = iwl_trans_rx_stop,
493 .rx_free = iwl_trans_rx_free, 503 .rx_free = iwl_trans_rx_free,
494 504
495 .tx_init = iwl_trans_tx_init, 505 .tx_init = iwl_trans_tx_init,