These fixes were originally embedded in a patch
"ath10k_sdio: virtual scatter gather for receive"
posted by Alagu Sankar [off-list ref]
https://patchwork.kernel.org/patch/9979579/
However, while that patch implements scatter gather
(without using the proper sg types), it also
includes several other random fixes, including
but not limited to checkpatch.pl fixes.
This patch series is an attempt to extract
the most essential fixes included in that commit.
Each fix is now an individual commit, as upstream
requires that each logical change is self contained.
All of these fixes are essential to get working
sdio support for ath10k.
Other patches are needed to get working sdio support,
including the high-latency patch series from Erik Stromdahl.
Niklas Cassel (3):
ath10k: sdio: use same endpoint id for all packets in a bundle
ath10k: sdio: allocate correct size for RECV_1MORE_BLOCK rx packets
ath10k: sdio: set skb len for all rx packets
drivers/net/wireless/ath/ath10k/htc.h | 1 +
drivers/net/wireless/ath/ath10k/sdio.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
--
2.17.1
Without this, packets larger than 1500 will silently be dropped.
Easily reproduced by sending a ping packet with a size larger
than 1500.
Signed-off-by: Alagu Sankar <redacted>
Signed-off-by: Niklas Cassel <redacted>
---
drivers/net/wireless/ath/ath10k/sdio.c | 1 +
1 file changed, 1 insertion(+)
All packets in a bundle should use the same endpoint id as the
first lookahead.
This matches how things are done is ath6kl, however,
this patch can theoretically handle several bundles
in ath10k_sdio_mbox_rx_process_packets().
Without this patch we get lots of errors about invalid endpoint id:
ath10k_sdio mmc2:0001:1: invalid endpoint in look-ahead: 224
ath10k_sdio mmc2:0001:1: failed to get pending recv messages: -12
ath10k_sdio mmc2:0001:1: failed to process pending SDIO interrupts: -12
Signed-off-by: Alagu Sankar <redacted>
Signed-off-by: Niklas Cassel <redacted>
---
drivers/net/wireless/ath/ath10k/sdio.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
@@ -434,12 +434,14 @@ static int ath10k_sdio_mbox_rx_process_packets(struct ath10k *ar,enumath10k_htc_ep_idid;intret,i,*n_lookahead_local;u32*lookaheads_local;+intlookahead_idx=0;for(i=0;i<ar_sdio->n_rx_pkts;i++){lookaheads_local=lookaheads;n_lookahead_local=n_lookahead;-id=((structath10k_htc_hdr*)&lookaheads[i])->eid;+id=((structath10k_htc_hdr*)+&lookaheads[lookahead_idx++])->eid;if(id>=ATH10K_HTC_EP_COUNT){ath10k_warn(ar,"invalid endpoint in look-ahead: %d\n",
@@ -462,6 +464,7 @@ static int ath10k_sdio_mbox_rx_process_packets(struct ath10k *ar,/* Only read lookahead's from RX trailers*forthelastpacketinabundle.*/+lookahead_idx--;lookaheads_local=NULL;n_lookahead_local=NULL;}
Without this, when receiving a packet that has this flag set
from firmware, we will read invalid trailer data from the packet,
which will be shown as various errors, e.g. "sdio mbox lookahead
is zero" or "invalid rx packet" or "payload length x exceeds max
htc length".
Signed-off-by: Alagu Sankar <redacted>
Signed-off-by: Niklas Cassel <redacted>
---
drivers/net/wireless/ath/ath10k/htc.h | 1 +
drivers/net/wireless/ath/ath10k/sdio.c | 3 +++
2 files changed, 4 insertions(+)
From: Kalle Valo <hidden> Date: 2018-07-02 14:23:19
Niklas Cassel [off-list ref] wrote:
All packets in a bundle should use the same endpoint id as the
first lookahead.
This matches how things are done is ath6kl, however,
this patch can theoretically handle several bundles
in ath10k_sdio_mbox_rx_process_packets().
Without this patch we get lots of errors about invalid endpoint id:
ath10k_sdio mmc2:0001:1: invalid endpoint in look-ahead: 224
ath10k_sdio mmc2:0001:1: failed to get pending recv messages: -12
ath10k_sdio mmc2:0001:1: failed to process pending SDIO interrupts: -12
Co-Developed-by: Niklas Cassel <redacted>
Signed-off-by: Alagu Sankar <redacted>
Signed-off-by: Niklas Cassel <redacted>
Signed-off-by: Kalle Valo <redacted>
From: Kalle Valo <hidden> Date: 2018-07-02 14:23:26
Niklas Cassel [off-list ref] wrote:
All packets in a bundle should use the same endpoint id as the
first lookahead.
This matches how things are done is ath6kl, however,
this patch can theoretically handle several bundles
in ath10k_sdio_mbox_rx_process_packets().
Without this patch we get lots of errors about invalid endpoint id:
ath10k_sdio mmc2:0001:1: invalid endpoint in look-ahead: 224
ath10k_sdio mmc2:0001:1: failed to get pending recv messages: -12
ath10k_sdio mmc2:0001:1: failed to process pending SDIO interrupts: -12
Co-Developed-by: Niklas Cassel <redacted>
Signed-off-by: Alagu Sankar <redacted>
Signed-off-by: Niklas Cassel <redacted>
Signed-off-by: Kalle Valo <redacted>