Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c170b867 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlagn: add an API for TX stop



Tx 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 c2c52e8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2310,7 +2310,7 @@ void iwlagn_stop_device(struct iwl_priv *priv)
	 * already dead.
	 */
	if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) {
		iwlagn_txq_ctx_stop(priv);
		priv->trans.ops->tx_stop(priv);
		priv->trans.ops->rx_stop(priv);

		/* Power-down device's busmaster DMA clocks */
+0 −33
Original line number Diff line number Diff line
@@ -851,39 +851,6 @@ static inline void iwlagn_free_dma_ptr(struct iwl_priv *priv,
	memset(ptr, 0, sizeof(*ptr));
}

/**
 * iwlagn_txq_ctx_stop - Stop all Tx DMA channels
 */
void iwlagn_txq_ctx_stop(struct iwl_priv *priv)
{
	int ch, txq_id;
	unsigned long flags;

	/* Turn off all Tx DMA fifos */
	spin_lock_irqsave(&priv->lock, flags);

	iwlagn_txq_set_sched(priv, 0);

	/* Stop each Tx DMA channel, and wait for it to be idle */
	for (ch = 0; ch < priv->hw_params.dma_chnl_num; ch++) {
		iwl_write_direct32(priv, FH_TCSR_CHNL_TX_CONFIG_REG(ch), 0x0);
		if (iwl_poll_direct_bit(priv, FH_TSSR_TX_STATUS_REG,
				    FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch),
				    1000))
			IWL_ERR(priv, "Failing on timeout while stopping"
			    " DMA channel %d [0x%08x]", ch,
			    iwl_read_direct32(priv, FH_TSSR_TX_STATUS_REG));
	}
	spin_unlock_irqrestore(&priv->lock, flags);

	if (!priv->txq)
		return;

	/* Unmap DMA from host system and free skb's */
	for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++)
		iwl_tx_queue_unmap(priv, txq_id);
}

/*
 * Find first available (lowest unused) Tx Queue, mark it "active".
 * Called only when finding queue for aggregation.
+0 −1
Original line number Diff line number Diff line
@@ -217,7 +217,6 @@ int iwlagn_txq_check_empty(struct iwl_priv *priv,
void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
				struct iwl_rx_mem_buffer *rxb);
int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index);
void iwlagn_txq_ctx_stop(struct iwl_priv *priv);

static inline u32 iwl_tx_status_to_mac80211(u32 status)
{
+0 −1
Original line number Diff line number Diff line
@@ -384,7 +384,6 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success);
void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq);
int iwl_queue_init(struct iwl_priv *priv, struct iwl_queue *q,
			  int count, int slots_num, u32 id);
void iwl_tx_queue_unmap(struct iwl_priv *priv, int txq_id);
void iwl_setup_watchdog(struct iwl_priv *priv);
/*****************************************************
 * TX power
+2 −2
Original line number Diff line number Diff line
@@ -694,8 +694,6 @@ struct iwl_hw_params {
 ****************************************************************************/
extern void iwl_update_chain_flags(struct iwl_priv *priv);
extern const u8 iwl_bcast_addr[ETH_ALEN];
extern int iwl_rxq_stop(struct iwl_priv *priv);
extern void iwl_txq_ctx_stop(struct iwl_priv *priv);
extern int iwl_queue_space(const struct iwl_queue *q);
static inline int iwl_queue_used(const struct iwl_queue *q, int i)
{
@@ -1234,6 +1232,7 @@ struct iwl_trans;
 * @rx_stop: stop the rx
 * @rx_free: frees the rx memory
 * @tx_init:inits the tx memory, allocate if needed
 * @tx_stop: stop the tx
 * @tx_free: frees the tx memory
 */
struct iwl_trans_ops {
@@ -1242,6 +1241,7 @@ struct iwl_trans_ops {
	void (*rx_free)(struct iwl_priv *priv);

	int (*tx_init)(struct iwl_priv *priv);
	int (*tx_stop)(struct iwl_priv *priv);
	void (*tx_free)(struct iwl_priv *priv);
};

Loading