Skip to content

Commit bddf590

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2016-04-11' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers patches for 4.7 Major changes: iwlwifi * support for Link Quality measurement * more work 9000 devices and MSIx * continuation of the Dynamic Queue Allocation work * make the paging less memory hungry * 9000 new Rx path * removal of IWLWIFI_UAPSD Kconfig option ath10k * implement push-pull tx model using mac80211 software queuing support * enable scan in AP mode (NL80211_FEATURE_AP_SCAN) wil6210 * add basic PBSS (Personal Basic Service Set) support * add initial P2P support * add oob_mode module parameter ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4923ec0 + 20ac1b3 commit bddf590

174 files changed

Lines changed: 7918 additions & 5930 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ Required properties:
55
* "qcom,ath10k"
66
* "qcom,ipq4019-wifi"
77

8-
PCI based devices uses compatible string "qcom,ath10k" and takes only
9-
calibration data via "qcom,ath10k-calibration-data". Rest of the properties
10-
are not applicable for PCI based devices.
8+
PCI based devices uses compatible string "qcom,ath10k" and takes calibration
9+
data along with board specific data via "qcom,ath10k-calibration-data".
10+
Rest of the properties are not applicable for PCI based devices.
1111

1212
AHB based devices (i.e. ipq4019) uses compatible string "qcom,ipq4019-wifi"
13-
and also uses most of the properties defined in this doc.
13+
and also uses most of the properties defined in this doc (except
14+
"qcom,ath10k-calibration-data"). It uses "qcom,ath10k-pre-calibration-data"
15+
to carry pre calibration data.
16+
17+
In general, entry "qcom,ath10k-pre-calibration-data" and
18+
"qcom,ath10k-calibration-data" conflict with each other and only one
19+
can be provided per device.
1420

1521
Optional properties:
1622
- reg: Address and length of the register set for the device.
@@ -35,8 +41,11 @@ Optional properties:
3541
- qcom,msi_addr: MSI interrupt address.
3642
- qcom,msi_base: Base value to add before writing MSI data into
3743
MSI address register.
38-
- qcom,ath10k-calibration-data : calibration data as an array, the
39-
length can vary between hw versions
44+
- qcom,ath10k-calibration-data : calibration data + board specific data
45+
as an array, the length can vary between
46+
hw versions.
47+
- qcom,ath10k-pre-calibration-data : pre calibration data as an array,
48+
the length can vary between hw versions.
4049

4150
Example (to supply the calibration data alone):
4251

@@ -105,5 +114,5 @@ wifi0: wifi@a000000 {
105114
"legacy";
106115
qcom,msi_addr = <0x0b006040>;
107116
qcom,msi_base = <0x40>;
108-
qcom,ath10k-calibration-data = [ 01 02 03 ... ];
117+
qcom,ath10k-pre-calibration-data = [ 01 02 03 ... ];
109118
};

‎drivers/net/wireless/ath/ath10k/ce.c‎

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr)
411411

412412
lockdep_assert_held(&ar_pci->ce_lock);
413413

414-
if (CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) == 0)
414+
if ((pipe->id != 5) &&
415+
CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) == 0)
415416
return -ENOSPC;
416417

417418
desc->addr = __cpu_to_le32(paddr);
@@ -425,6 +426,19 @@ int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr)
425426
return 0;
426427
}
427428

429+
void ath10k_ce_rx_update_write_idx(struct ath10k_ce_pipe *pipe, u32 nentries)
430+
{
431+
struct ath10k *ar = pipe->ar;
432+
struct ath10k_ce_ring *dest_ring = pipe->dest_ring;
433+
unsigned int nentries_mask = dest_ring->nentries_mask;
434+
unsigned int write_index = dest_ring->write_index;
435+
u32 ctrl_addr = pipe->ctrl_addr;
436+
437+
write_index = CE_RING_IDX_ADD(nentries_mask, write_index, nentries);
438+
ath10k_ce_dest_ring_write_index_set(ar, ctrl_addr, write_index);
439+
dest_ring->write_index = write_index;
440+
}
441+
428442
int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr)
429443
{
430444
struct ath10k *ar = pipe->ar;
@@ -444,14 +458,10 @@ int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr)
444458
*/
445459
int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state,
446460
void **per_transfer_contextp,
447-
u32 *bufferp,
448-
unsigned int *nbytesp,
449-
unsigned int *transfer_idp,
450-
unsigned int *flagsp)
461+
unsigned int *nbytesp)
451462
{
452463
struct ath10k_ce_ring *dest_ring = ce_state->dest_ring;
453464
unsigned int nentries_mask = dest_ring->nentries_mask;
454-
struct ath10k *ar = ce_state->ar;
455465
unsigned int sw_index = dest_ring->sw_index;
456466

457467
struct ce_desc *base = dest_ring->base_addr_owner_space;
@@ -476,21 +486,17 @@ int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state,
476486
desc->nbytes = 0;
477487

478488
/* Return data from completed destination descriptor */
479-
*bufferp = __le32_to_cpu(sdesc.addr);
480489
*nbytesp = nbytes;
481-
*transfer_idp = MS(__le16_to_cpu(sdesc.flags), CE_DESC_FLAGS_META_DATA);
482-
483-
if (__le16_to_cpu(sdesc.flags) & CE_DESC_FLAGS_BYTE_SWAP)
484-
*flagsp = CE_RECV_FLAG_SWAPPED;
485-
else
486-
*flagsp = 0;
487490

488491
if (per_transfer_contextp)
489492
*per_transfer_contextp =
490493
dest_ring->per_transfer_context[sw_index];
491494

492-
/* sanity */
493-
dest_ring->per_transfer_context[sw_index] = NULL;
495+
/* Copy engine 5 (HTT Rx) will reuse the same transfer context.
496+
* So update transfer context all CEs except CE5.
497+
*/
498+
if (ce_state->id != 5)
499+
dest_ring->per_transfer_context[sw_index] = NULL;
494500

495501
/* Update sw_index */
496502
sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index);
@@ -501,10 +507,7 @@ int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state,
501507

502508
int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,
503509
void **per_transfer_contextp,
504-
u32 *bufferp,
505-
unsigned int *nbytesp,
506-
unsigned int *transfer_idp,
507-
unsigned int *flagsp)
510+
unsigned int *nbytesp)
508511
{
509512
struct ath10k *ar = ce_state->ar;
510513
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
@@ -513,8 +516,7 @@ int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,
513516
spin_lock_bh(&ar_pci->ce_lock);
514517
ret = ath10k_ce_completed_recv_next_nolock(ce_state,
515518
per_transfer_contextp,
516-
bufferp, nbytesp,
517-
transfer_idp, flagsp);
519+
nbytesp);
518520
spin_unlock_bh(&ar_pci->ce_lock);
519521

520522
return ret;

‎drivers/net/wireless/ath/ath10k/ce.h‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/* Maximum number of Copy Engine's supported */
2424
#define CE_COUNT_MAX 12
25-
#define CE_HTT_H2T_MSG_SRC_NENTRIES 4096
25+
#define CE_HTT_H2T_MSG_SRC_NENTRIES 8192
2626

2727
/* Descriptor rings must be aligned to this boundary */
2828
#define CE_DESC_RING_ALIGN 8
@@ -166,6 +166,7 @@ int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe);
166166
int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe);
167167
int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr);
168168
int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr);
169+
void ath10k_ce_rx_update_write_idx(struct ath10k_ce_pipe *pipe, u32 nentries);
169170

170171
/* recv flags */
171172
/* Data is byte-swapped */
@@ -177,10 +178,7 @@ int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr);
177178
*/
178179
int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state,
179180
void **per_transfer_contextp,
180-
u32 *bufferp,
181-
unsigned int *nbytesp,
182-
unsigned int *transfer_idp,
183-
unsigned int *flagsp);
181+
unsigned int *nbytesp);
184182
/*
185183
* Supply data for the next completed unprocessed send descriptor.
186184
* Pops 1 completed send buffer from Source ring.
@@ -212,10 +210,7 @@ int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
212210

213211
int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state,
214212
void **per_transfer_contextp,
215-
u32 *bufferp,
216-
unsigned int *nbytesp,
217-
unsigned int *transfer_idp,
218-
unsigned int *flagsp);
213+
unsigned int *nbytesp);
219214

220215
/*
221216
* Support clean shutdown by allowing the caller to cancel
@@ -416,6 +411,8 @@ static inline u32 ath10k_ce_base_address(struct ath10k *ar, unsigned int ce_id)
416411
(((int)(toidx)-(int)(fromidx)) & (nentries_mask))
417412

418413
#define CE_RING_IDX_INCR(nentries_mask, idx) (((idx) + 1) & (nentries_mask))
414+
#define CE_RING_IDX_ADD(nentries_mask, idx, num) \
415+
(((idx) + (num)) & (nentries_mask))
419416

420417
#define CE_WRAPPER_INTERRUPT_SUMMARY_HOST_MSI_LSB \
421418
ar->regs->ce_wrap_intr_sum_host_msi_lsb

0 commit comments

Comments
 (0)