Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309497
b: refs/heads/master
c: ebed633
h: refs/heads/master
i:
  309495: dae037b
v: v3
  • Loading branch information
Emmanuel Grumbach authored and John W. Linville committed May 25, 2012
1 parent 9d03f3a commit 7ad9da9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 882dde8eb0d49ce0f853f8f4084dde56a21fe55f
refs/heads/master: ebed633c61c023e5d1aa4ed159cd67406e9e37c2
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void iwl_trans_tx_queue_set_status(struct iwl_trans *trans,
void iwl_trans_pcie_tx_agg_setup(struct iwl_trans *trans, int queue, int fifo,
int sta_id, int tid, int frame_limit, u16 ssn);
void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
int index, enum dma_data_direction dma_dir);
enum dma_data_direction dma_dir);
int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,
struct sk_buff_head *skbs);
int iwl_queue_space(const struct iwl_queue *q);
Expand Down
22 changes: 14 additions & 8 deletions trunk/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,41 +204,47 @@ static void iwlagn_unmap_tfd(struct iwl_trans *trans, struct iwl_cmd_meta *meta,
for (i = 1; i < num_tbs; i++)
dma_unmap_single(trans->dev, iwl_tfd_tb_get_addr(tfd, i),
iwl_tfd_tb_get_len(tfd, i), dma_dir);

tfd->num_tbs = 0;
}

/**
* iwlagn_txq_free_tfd - Free all chunks referenced by TFD [txq->q.read_ptr]
* @trans - transport private data
* @txq - tx queue
* @index - the index of the TFD to be freed
*@dma_dir - the direction of the DMA mapping
* @dma_dir - the direction of the DMA mapping
*
* Does NOT advance any TFD circular buffer read/write indexes
* Does NOT free the TFD itself (which is within circular buffer)
*/
void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
int index, enum dma_data_direction dma_dir)
enum dma_data_direction dma_dir)
{
struct iwl_tfd *tfd_tmp = txq->tfds;

/* rd_ptr is bounded by n_bd and idx is bounded by n_window */
int rd_ptr = txq->q.read_ptr;
int idx = get_cmd_index(&txq->q, rd_ptr);

lockdep_assert_held(&txq->lock);

iwlagn_unmap_tfd(trans, &txq->entries[index].meta,
&tfd_tmp[index], dma_dir);
/* We have only q->n_window txq->entries, but we use q->n_bd tfds */
iwlagn_unmap_tfd(trans, &txq->entries[idx].meta,
&tfd_tmp[rd_ptr], dma_dir);

/* free SKB */
if (txq->entries) {
struct sk_buff *skb;

skb = txq->entries[index].skb;
skb = txq->entries[idx].skb;

/* Can be called from irqs-disabled context
* If skb is not NULL, it means that the whole queue is being
* freed and that the queue is not empty - free the skb
*/
if (skb) {
iwl_op_mode_free_skb(trans->op_mode, skb);
txq->entries[index].skb = NULL;
txq->entries[idx].skb = NULL;
}
}
}
Expand Down Expand Up @@ -973,7 +979,7 @@ int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,

iwlagn_txq_inval_byte_cnt_tbl(trans, txq);

iwlagn_txq_free_tfd(trans, txq, txq->q.read_ptr, DMA_TO_DEVICE);
iwlagn_txq_free_tfd(trans, txq, DMA_TO_DEVICE);
freed++;
}

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,7 @@ static void iwl_tx_queue_unmap(struct iwl_trans *trans, int txq_id)

spin_lock_bh(&txq->lock);
while (q->write_ptr != q->read_ptr) {
/* The read_ptr needs to bound by q->n_window */
iwlagn_txq_free_tfd(trans, txq, get_cmd_index(q, q->read_ptr),
dma_dir);
iwlagn_txq_free_tfd(trans, txq, dma_dir);
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd);
}
spin_unlock_bh(&txq->lock);
Expand Down

0 comments on commit 7ad9da9

Please sign in to comment.