1 From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
2 Date: Fri, 23 Oct 2015 18:01:05 +0530
3 Subject: [PATCH] ath10k: cleanup copy engine send completion
5 The physical address necessary to unmap DMA ('bufferp') is stored
6 in ath10k_skb_cb as 'paddr'. ath10k doesn't rely on the meta/transfer_id
7 when handling send completion (htc ep id is stored in sk_buff control
8 buffer). So the unused output arguments {bufferp, nbytesp and transfer_idp}
9 are removed from CE send completion. This change is needed before removing
10 the shadow copy of copy engine (CE) descriptors in follow up patch.
12 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
13 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
16 --- a/drivers/net/wireless/ath/ath10k/ce.c
17 +++ b/drivers/net/wireless/ath/ath10k/ce.c
18 @@ -578,17 +578,13 @@ int ath10k_ce_revoke_recv_next(struct at
19 * The caller takes responsibility for any necessary locking.
21 int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
22 - void **per_transfer_contextp,
24 - unsigned int *nbytesp,
25 - unsigned int *transfer_idp)
26 + void **per_transfer_contextp)
28 struct ath10k_ce_ring *src_ring = ce_state->src_ring;
29 u32 ctrl_addr = ce_state->ctrl_addr;
30 struct ath10k *ar = ce_state->ar;
31 unsigned int nentries_mask = src_ring->nentries_mask;
32 unsigned int sw_index = src_ring->sw_index;
33 - struct ce_desc *sdesc, *sbase;
34 unsigned int read_index;
36 if (src_ring->hw_index == sw_index) {
37 @@ -613,15 +609,6 @@ int ath10k_ce_completed_send_next_nolock
38 if (read_index == sw_index)
41 - sbase = src_ring->base_addr_owner_space;
42 - sdesc = CE_SRC_RING_TO_DESC(sbase, sw_index);
44 - /* Return data from completed source descriptor */
45 - *bufferp = __le32_to_cpu(sdesc->addr);
46 - *nbytesp = __le16_to_cpu(sdesc->nbytes);
47 - *transfer_idp = MS(__le16_to_cpu(sdesc->flags),
48 - CE_DESC_FLAGS_META_DATA);
50 if (per_transfer_contextp)
51 *per_transfer_contextp =
52 src_ring->per_transfer_context[sw_index];
53 @@ -696,10 +683,7 @@ int ath10k_ce_cancel_send_next(struct at
56 int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
57 - void **per_transfer_contextp,
59 - unsigned int *nbytesp,
60 - unsigned int *transfer_idp)
61 + void **per_transfer_contextp)
63 struct ath10k *ar = ce_state->ar;
64 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
65 @@ -707,9 +691,7 @@ int ath10k_ce_completed_send_next(struct
67 spin_lock_bh(&ar_pci->ce_lock);
68 ret = ath10k_ce_completed_send_next_nolock(ce_state,
69 - per_transfer_contextp,
72 + per_transfer_contextp);
73 spin_unlock_bh(&ar_pci->ce_lock);
76 --- a/drivers/net/wireless/ath/ath10k/ce.h
77 +++ b/drivers/net/wireless/ath/ath10k/ce.h
78 @@ -192,16 +192,10 @@ int ath10k_ce_completed_recv_next(struct
79 * Pops 1 completed send buffer from Source ring.
81 int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
82 - void **per_transfer_contextp,
84 - unsigned int *nbytesp,
85 - unsigned int *transfer_idp);
86 + void **per_transfer_contextp);
88 int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
89 - void **per_transfer_contextp,
91 - unsigned int *nbytesp,
92 - unsigned int *transfer_idp);
93 + void **per_transfer_contextp);
95 /*==================CE Engine Initialization=======================*/
97 --- a/drivers/net/wireless/ath/ath10k/pci.c
98 +++ b/drivers/net/wireless/ath/ath10k/pci.c
99 @@ -910,9 +910,8 @@ static int ath10k_pci_diag_read_mem(stru
103 - while (ath10k_ce_completed_send_next_nolock(ce_diag, NULL, &buf,
106 + while (ath10k_ce_completed_send_next_nolock(ce_diag,
109 if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) {
111 @@ -1073,9 +1072,8 @@ static int ath10k_pci_diag_write_mem(str
115 - while (ath10k_ce_completed_send_next_nolock(ce_diag, NULL, &buf,
118 + while (ath10k_ce_completed_send_next_nolock(ce_diag,
122 if (i++ > DIAG_ACCESS_CE_TIMEOUT_MS) {
123 @@ -1139,13 +1137,9 @@ static void ath10k_pci_htc_tx_cb(struct
124 struct ath10k *ar = ce_state->ar;
125 struct sk_buff_head list;
128 - unsigned int nbytes;
129 - unsigned int transfer_id;
131 __skb_queue_head_init(&list);
132 - while (ath10k_ce_completed_send_next(ce_state, (void **)&skb, &ce_data,
133 - &nbytes, &transfer_id) == 0) {
134 + while (ath10k_ce_completed_send_next(ce_state, (void **)&skb) == 0) {
135 /* no need to call tx completion for NULL pointers */
138 @@ -1215,12 +1209,8 @@ static void ath10k_pci_htt_tx_cb(struct
140 struct ath10k *ar = ce_state->ar;
143 - unsigned int nbytes;
144 - unsigned int transfer_id;
146 - while (ath10k_ce_completed_send_next(ce_state, (void **)&skb, &ce_data,
147 - &nbytes, &transfer_id) == 0) {
148 + while (ath10k_ce_completed_send_next(ce_state, (void **)&skb) == 0) {
149 /* no need to call tx completion for NULL pointers */
152 @@ -1796,12 +1786,8 @@ err_dma:
153 static void ath10k_pci_bmi_send_done(struct ath10k_ce_pipe *ce_state)
155 struct bmi_xfer *xfer;
157 - unsigned int nbytes;
158 - unsigned int transfer_id;
160 - if (ath10k_ce_completed_send_next(ce_state, (void **)&xfer, &ce_data,
161 - &nbytes, &transfer_id))
162 + if (ath10k_ce_completed_send_next(ce_state, (void **)&xfer))
165 xfer->tx_done = true;