Commit c2c52e8b authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville

iwlagn: add an API for RX stop

Rx stop moves to transport layer.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1359ca4f
...@@ -905,17 +905,6 @@ void iwlagn_rx_replenish_now(struct iwl_priv *priv) ...@@ -905,17 +905,6 @@ void iwlagn_rx_replenish_now(struct iwl_priv *priv)
iwlagn_rx_queue_restock(priv); iwlagn_rx_queue_restock(priv);
} }
int iwlagn_rxq_stop(struct iwl_priv *priv)
{
/* stop Rx DMA */
iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
iwl_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
return 0;
}
int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band) int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band)
{ {
int idx = 0; int idx = 0;
...@@ -2322,10 +2311,11 @@ void iwlagn_stop_device(struct iwl_priv *priv) ...@@ -2322,10 +2311,11 @@ void iwlagn_stop_device(struct iwl_priv *priv)
*/ */
if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) { if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) {
iwlagn_txq_ctx_stop(priv); iwlagn_txq_ctx_stop(priv);
iwlagn_rxq_stop(priv); priv->trans.ops->rx_stop(priv);
/* Power-down device's busmaster DMA clocks */ /* Power-down device's busmaster DMA clocks */
iwl_write_prph(priv, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT); iwl_write_prph(priv, APMG_CLK_DIS_REG,
APMG_CLK_VAL_DMA_CLK_RQT);
udelay(5); udelay(5);
} }
......
...@@ -193,7 +193,6 @@ void iwlagn_rx_queue_restock(struct iwl_priv *priv); ...@@ -193,7 +193,6 @@ void iwlagn_rx_queue_restock(struct iwl_priv *priv);
void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority); void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority);
void iwlagn_rx_replenish(struct iwl_priv *priv); void iwlagn_rx_replenish(struct iwl_priv *priv);
void iwlagn_rx_replenish_now(struct iwl_priv *priv); void iwlagn_rx_replenish_now(struct iwl_priv *priv);
int iwlagn_rxq_stop(struct iwl_priv *priv);
int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band); int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band);
void iwl_setup_rx_handlers(struct iwl_priv *priv); void iwl_setup_rx_handlers(struct iwl_priv *priv);
......
...@@ -1231,12 +1231,14 @@ struct iwl_trans; ...@@ -1231,12 +1231,14 @@ struct iwl_trans;
* struct iwl_trans_ops - transport specific operations * struct iwl_trans_ops - transport specific operations
* @rx_init: inits the rx memory, allocate it if needed * @rx_init: inits the rx memory, allocate it if needed
* @rx_stop: stop the rx
* @rx_free: frees the rx memory * @rx_free: frees the rx memory
* @tx_init:inits the tx memory, allocate if needed * @tx_init:inits the tx memory, allocate if needed
* @tx_free: frees the tx memory * @tx_free: frees the tx memory
*/ */
struct iwl_trans_ops { struct iwl_trans_ops {
int (*rx_init)(struct iwl_priv *priv); int (*rx_init)(struct iwl_priv *priv);
int (*rx_stop)(struct iwl_priv *priv);
void (*rx_free)(struct iwl_priv *priv); void (*rx_free)(struct iwl_priv *priv);
int (*tx_init)(struct iwl_priv *priv); int (*tx_init)(struct iwl_priv *priv);
......
...@@ -188,6 +188,15 @@ static void iwl_trans_rx_free(struct iwl_priv *priv) ...@@ -188,6 +188,15 @@ static void iwl_trans_rx_free(struct iwl_priv *priv)
rxq->rb_stts = NULL; rxq->rb_stts = NULL;
} }
static int iwl_trans_rx_stop(struct iwl_priv *priv)
{
/* stop Rx DMA */
iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
return iwl_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
}
/* TODO:remove this code duplication */ /* TODO:remove this code duplication */
static inline int iwlagn_alloc_dma_ptr(struct iwl_priv *priv, static inline int iwlagn_alloc_dma_ptr(struct iwl_priv *priv,
struct iwl_dma_ptr *ptr, size_t size) struct iwl_dma_ptr *ptr, size_t size)
...@@ -490,6 +499,7 @@ static int iwl_trans_tx_init(struct iwl_priv *priv) ...@@ -490,6 +499,7 @@ static int iwl_trans_tx_init(struct iwl_priv *priv)
static const struct iwl_trans_ops trans_ops = { static const struct iwl_trans_ops trans_ops = {
.rx_init = iwl_trans_rx_init, .rx_init = iwl_trans_rx_init,
.rx_stop = iwl_trans_rx_stop,
.rx_free = iwl_trans_rx_free, .rx_free = iwl_trans_rx_free,
.tx_init = iwl_trans_tx_init, .tx_init = iwl_trans_tx_init,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment