aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
index bb0a3141852..1b2aed62c7e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
@@ -58,7 +58,7 @@ void iwl_trans_txq_update_byte_cnt_tbl(struct iwl_trans *trans,
58 u16 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; 58 u16 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE;
59 __le16 bc_ent; 59 __le16 bc_ent;
60 struct iwl_tx_cmd *tx_cmd = 60 struct iwl_tx_cmd *tx_cmd =
61 (struct iwl_tx_cmd *) txq->cmd[txq->q.write_ptr]->payload; 61 (void *) txq->entries[txq->q.write_ptr].cmd->payload;
62 62
63 scd_bc_tbl = trans_pcie->scd_bc_tbls.addr; 63 scd_bc_tbl = trans_pcie->scd_bc_tbls.addr;
64 64
@@ -221,13 +221,14 @@ void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
221 221
222 lockdep_assert_held(&txq->lock); 222 lockdep_assert_held(&txq->lock);
223 223
224 iwlagn_unmap_tfd(trans, &txq->meta[index], &tfd_tmp[index], dma_dir); 224 iwlagn_unmap_tfd(trans, &txq->entries[index].meta,
225 &tfd_tmp[index], dma_dir);
225 226
226 /* free SKB */ 227 /* free SKB */
227 if (txq->skbs) { 228 if (txq->entries) {
228 struct sk_buff *skb; 229 struct sk_buff *skb;
229 230
230 skb = txq->skbs[index]; 231 skb = txq->entries[index].skb;
231 232
232 /* Can be called from irqs-disabled context 233 /* Can be called from irqs-disabled context
233 * If skb is not NULL, it means that the whole queue is being 234 * If skb is not NULL, it means that the whole queue is being
@@ -235,7 +236,7 @@ void iwlagn_txq_free_tfd(struct iwl_trans *trans, struct iwl_tx_queue *txq,
235 */ 236 */
236 if (skb) { 237 if (skb) {
237 iwl_op_mode_free_skb(trans->op_mode, skb); 238 iwl_op_mode_free_skb(trans->op_mode, skb);
238 txq->skbs[index] = NULL; 239 txq->entries[index].skb = NULL;
239 } 240 }
240 } 241 }
241} 242}
@@ -358,7 +359,7 @@ static void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_trans *trans,
358 u8 sta_id = 0; 359 u8 sta_id = 0;
359 __le16 bc_ent; 360 __le16 bc_ent;
360 struct iwl_tx_cmd *tx_cmd = 361 struct iwl_tx_cmd *tx_cmd =
361 (struct iwl_tx_cmd *) txq->cmd[txq->q.read_ptr]->payload; 362 (void *)txq->entries[txq->q.read_ptr].cmd->payload;
362 363
363 WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX); 364 WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX);
364 365
@@ -578,8 +579,8 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
578 } 579 }
579 580
580 idx = get_cmd_index(q, q->write_ptr); 581 idx = get_cmd_index(q, q->write_ptr);
581 out_cmd = txq->cmd[idx]; 582 out_cmd = txq->entries[idx].cmd;
582 out_meta = &txq->meta[idx]; 583 out_meta = &txq->entries[idx].meta;
583 584
584 memset(out_meta, 0, sizeof(*out_meta)); /* re-initialize to NULL */ 585 memset(out_meta, 0, sizeof(*out_meta)); /* re-initialize to NULL */
585 if (cmd->flags & CMD_WANT_SKB) 586 if (cmd->flags & CMD_WANT_SKB)
@@ -772,8 +773,8 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb,
772 spin_lock(&txq->lock); 773 spin_lock(&txq->lock);
773 774
774 cmd_index = get_cmd_index(&txq->q, index); 775 cmd_index = get_cmd_index(&txq->q, index);
775 cmd = txq->cmd[cmd_index]; 776 cmd = txq->entries[cmd_index].cmd;
776 meta = &txq->meta[cmd_index]; 777 meta = &txq->entries[cmd_index].meta;
777 778
778 iwlagn_unmap_tfd(trans, meta, &txq->tfds[index], 779 iwlagn_unmap_tfd(trans, meta, &txq->tfds[index],
779 DMA_BIDIRECTIONAL); 780 DMA_BIDIRECTIONAL);
@@ -905,8 +906,8 @@ cancel:
905 * in later, it will possibly set an invalid 906 * in later, it will possibly set an invalid
906 * address (cmd->meta.source). 907 * address (cmd->meta.source).
907 */ 908 */
908 trans_pcie->txq[trans_pcie->cmd_queue].meta[cmd_idx].flags &= 909 trans_pcie->txq[trans_pcie->cmd_queue].
909 ~CMD_WANT_SKB; 910 entries[cmd_idx].meta.flags &= ~CMD_WANT_SKB;
910 } 911 }
911 912
912 if (cmd->resp_pkt) { 913 if (cmd->resp_pkt) {
@@ -961,12 +962,12 @@ int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,
961 q->read_ptr != index; 962 q->read_ptr != index;
962 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 963 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
963 964
964 if (WARN_ON_ONCE(txq->skbs[txq->q.read_ptr] == NULL)) 965 if (WARN_ON_ONCE(txq->entries[txq->q.read_ptr].skb == NULL))
965 continue; 966 continue;
966 967
967 __skb_queue_tail(skbs, txq->skbs[txq->q.read_ptr]); 968 __skb_queue_tail(skbs, txq->entries[txq->q.read_ptr].skb);
968 969
969 txq->skbs[txq->q.read_ptr] = NULL; 970 txq->entries[txq->q.read_ptr].skb = NULL;
970 971
971 iwlagn_txq_inval_byte_cnt_tbl(trans, txq); 972 iwlagn_txq_inval_byte_cnt_tbl(trans, txq);
972 973