diff options
author | Govind Singh <govinds@qti.qualcomm.com> | 2017-12-21 04:00:58 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2017-12-27 05:06:40 -0500 |
commit | 5dac5f3772f64a3bc4ba44075304511ab21ee95a (patch) | |
tree | 897b705c6ed7ed3778865e149c3507c73e8a127f | |
parent | a91a626baa1566a5514654b7c0d910417d6790e8 (diff) |
ath10k: Use dma_addr_t for ce buffers to support 64bit target
CE send and receive API's are using u32 ring address, which
truncates the address for target with 64bit addressing range.
Use dma_addr_t for ce buffers to support target with extended
addressing range.
Signed-off-by: Govind Singh <govinds@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath10k/ce.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/ce.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/pci.c | 4 |
3 files changed, 18 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index a8afd690290f..9aa214b1eb48 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c | |||
@@ -329,7 +329,7 @@ static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar, | |||
329 | */ | 329 | */ |
330 | int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, | 330 | int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, |
331 | void *per_transfer_context, | 331 | void *per_transfer_context, |
332 | u32 buffer, | 332 | dma_addr_t buffer, |
333 | unsigned int nbytes, | 333 | unsigned int nbytes, |
334 | unsigned int transfer_id, | 334 | unsigned int transfer_id, |
335 | unsigned int flags) | 335 | unsigned int flags) |
@@ -413,7 +413,7 @@ void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe) | |||
413 | 413 | ||
414 | int ath10k_ce_send(struct ath10k_ce_pipe *ce_state, | 414 | int ath10k_ce_send(struct ath10k_ce_pipe *ce_state, |
415 | void *per_transfer_context, | 415 | void *per_transfer_context, |
416 | u32 buffer, | 416 | dma_addr_t buffer, |
417 | unsigned int nbytes, | 417 | unsigned int nbytes, |
418 | unsigned int transfer_id, | 418 | unsigned int transfer_id, |
419 | unsigned int flags) | 419 | unsigned int flags) |
@@ -459,7 +459,8 @@ int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe) | |||
459 | return CE_RING_DELTA(nentries_mask, write_index, sw_index - 1); | 459 | return CE_RING_DELTA(nentries_mask, write_index, sw_index - 1); |
460 | } | 460 | } |
461 | 461 | ||
462 | int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr) | 462 | int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, |
463 | dma_addr_t paddr) | ||
463 | { | 464 | { |
464 | struct ath10k *ar = pipe->ar; | 465 | struct ath10k *ar = pipe->ar; |
465 | struct ath10k_ce *ce = ath10k_ce_priv(ar); | 466 | struct ath10k_ce *ce = ath10k_ce_priv(ar); |
@@ -508,7 +509,8 @@ void ath10k_ce_rx_update_write_idx(struct ath10k_ce_pipe *pipe, u32 nentries) | |||
508 | dest_ring->write_index = write_index; | 509 | dest_ring->write_index = write_index; |
509 | } | 510 | } |
510 | 511 | ||
511 | int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr) | 512 | int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, |
513 | dma_addr_t paddr) | ||
512 | { | 514 | { |
513 | struct ath10k *ar = pipe->ar; | 515 | struct ath10k *ar = pipe->ar; |
514 | struct ath10k_ce *ce = ath10k_ce_priv(ar); | 516 | struct ath10k_ce *ce = ath10k_ce_priv(ar); |
@@ -593,7 +595,7 @@ int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state, | |||
593 | 595 | ||
594 | int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state, | 596 | int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state, |
595 | void **per_transfer_contextp, | 597 | void **per_transfer_contextp, |
596 | u32 *bufferp) | 598 | dma_addr_t *bufferp) |
597 | { | 599 | { |
598 | struct ath10k_ce_ring *dest_ring; | 600 | struct ath10k_ce_ring *dest_ring; |
599 | unsigned int nentries_mask; | 601 | unsigned int nentries_mask; |
@@ -701,7 +703,7 @@ int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state, | |||
701 | /* NB: Modeled after ath10k_ce_completed_send_next */ | 703 | /* NB: Modeled after ath10k_ce_completed_send_next */ |
702 | int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state, | 704 | int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state, |
703 | void **per_transfer_contextp, | 705 | void **per_transfer_contextp, |
704 | u32 *bufferp, | 706 | dma_addr_t *bufferp, |
705 | unsigned int *nbytesp, | 707 | unsigned int *nbytesp, |
706 | unsigned int *transfer_idp) | 708 | unsigned int *transfer_idp) |
707 | { | 709 | { |
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h index bdec794704d9..f36ad51e2b52 100644 --- a/drivers/net/wireless/ath/ath10k/ce.h +++ b/drivers/net/wireless/ath/ath10k/ce.h | |||
@@ -160,7 +160,7 @@ struct ath10k_ce { | |||
160 | */ | 160 | */ |
161 | int ath10k_ce_send(struct ath10k_ce_pipe *ce_state, | 161 | int ath10k_ce_send(struct ath10k_ce_pipe *ce_state, |
162 | void *per_transfer_send_context, | 162 | void *per_transfer_send_context, |
163 | u32 buffer, | 163 | dma_addr_t buffer, |
164 | unsigned int nbytes, | 164 | unsigned int nbytes, |
165 | /* 14 bits */ | 165 | /* 14 bits */ |
166 | unsigned int transfer_id, | 166 | unsigned int transfer_id, |
@@ -168,7 +168,7 @@ int ath10k_ce_send(struct ath10k_ce_pipe *ce_state, | |||
168 | 168 | ||
169 | int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, | 169 | int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, |
170 | void *per_transfer_context, | 170 | void *per_transfer_context, |
171 | u32 buffer, | 171 | dma_addr_t buffer, |
172 | unsigned int nbytes, | 172 | unsigned int nbytes, |
173 | unsigned int transfer_id, | 173 | unsigned int transfer_id, |
174 | unsigned int flags); | 174 | unsigned int flags); |
@@ -180,8 +180,10 @@ int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe); | |||
180 | /*==================Recv=======================*/ | 180 | /*==================Recv=======================*/ |
181 | 181 | ||
182 | int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe); | 182 | int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe); |
183 | int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr); | 183 | int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, |
184 | int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr); | 184 | dma_addr_t paddr); |
185 | int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, | ||
186 | dma_addr_t paddr); | ||
185 | void ath10k_ce_rx_update_write_idx(struct ath10k_ce_pipe *pipe, u32 nentries); | 187 | void ath10k_ce_rx_update_write_idx(struct ath10k_ce_pipe *pipe, u32 nentries); |
186 | 188 | ||
187 | /* recv flags */ | 189 | /* recv flags */ |
@@ -222,7 +224,7 @@ void ath10k_ce_free_pipe(struct ath10k *ar, int ce_id); | |||
222 | */ | 224 | */ |
223 | int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state, | 225 | int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state, |
224 | void **per_transfer_contextp, | 226 | void **per_transfer_contextp, |
225 | u32 *bufferp); | 227 | dma_addr_t *bufferp); |
226 | 228 | ||
227 | int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state, | 229 | int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state, |
228 | void **per_transfer_contextp, | 230 | void **per_transfer_contextp, |
@@ -235,7 +237,7 @@ int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state, | |||
235 | */ | 237 | */ |
236 | int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state, | 238 | int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state, |
237 | void **per_transfer_contextp, | 239 | void **per_transfer_contextp, |
238 | u32 *bufferp, | 240 | dma_addr_t *bufferp, |
239 | unsigned int *nbytesp, | 241 | unsigned int *nbytesp, |
240 | unsigned int *transfer_idp); | 242 | unsigned int *transfer_idp); |
241 | 243 | ||
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index ffea348b2190..4e3e7a89d422 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c | |||
@@ -1858,7 +1858,7 @@ int ath10k_pci_hif_exchange_bmi_msg(struct ath10k *ar, | |||
1858 | 1858 | ||
1859 | ret = ath10k_pci_bmi_wait(ar, ce_tx, ce_rx, &xfer); | 1859 | ret = ath10k_pci_bmi_wait(ar, ce_tx, ce_rx, &xfer); |
1860 | if (ret) { | 1860 | if (ret) { |
1861 | u32 unused_buffer; | 1861 | dma_addr_t unused_buffer; |
1862 | unsigned int unused_nbytes; | 1862 | unsigned int unused_nbytes; |
1863 | unsigned int unused_id; | 1863 | unsigned int unused_id; |
1864 | 1864 | ||
@@ -1871,7 +1871,7 @@ int ath10k_pci_hif_exchange_bmi_msg(struct ath10k *ar, | |||
1871 | 1871 | ||
1872 | err_resp: | 1872 | err_resp: |
1873 | if (resp) { | 1873 | if (resp) { |
1874 | u32 unused_buffer; | 1874 | dma_addr_t unused_buffer; |
1875 | 1875 | ||
1876 | ath10k_ce_revoke_recv_next(ce_rx, NULL, &unused_buffer); | 1876 | ath10k_ce_revoke_recv_next(ce_rx, NULL, &unused_buffer); |
1877 | dma_unmap_single(ar->dev, resp_paddr, | 1877 | dma_unmap_single(ar->dev, resp_paddr, |