348-v5.2-brcmfmac-set-txflow-request-id-from-1-to-pktids-arra.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 2d91c8ad068a5cad4d9e7ece8dc811a697c7176a Mon Sep 17 00:00:00 2001
  2. From: Wright Feng <Wright.Feng@cypress.com>
  3. Date: Fri, 26 Apr 2019 03:41:46 +0000
  4. Subject: [PATCH] brcmfmac: set txflow request id from 1 to pktids array size
  5. Some PCIE firmwares drop txstatus if pktid is 0 and make packet held in
  6. host side and never be released. If that packet type is 802.1x, the
  7. pend_8021x_cnt value will be always greater than 0 and show "Timed out
  8. waiting for no pending 802.1x packets" error message when sending key to
  9. dongle every time.
  10. To be compatible with all firmwares, host should set txflow request id
  11. from 1 instead of from 0.
  12. Signed-off-by: Wright Feng <wright.feng@cypress.com>
  13. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  14. ---
  15. drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 6 +++---
  16. 1 file changed, 3 insertions(+), 3 deletions(-)
  17. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
  18. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
  19. @@ -375,7 +375,7 @@ brcmf_msgbuf_get_pktid(struct device *de
  20. struct brcmf_msgbuf_pktid *pktid;
  21. struct sk_buff *skb;
  22. - if (idx >= pktids->array_size) {
  23. + if (idx < 0 || idx >= pktids->array_size) {
  24. brcmf_err("Invalid packet id %d (max %d)\n", idx,
  25. pktids->array_size);
  26. return NULL;
  27. @@ -745,7 +745,7 @@ static void brcmf_msgbuf_txflow(struct b
  28. tx_msghdr = (struct msgbuf_tx_msghdr *)ret_ptr;
  29. tx_msghdr->msg.msgtype = MSGBUF_TYPE_TX_POST;
  30. - tx_msghdr->msg.request_id = cpu_to_le32(pktid);
  31. + tx_msghdr->msg.request_id = cpu_to_le32(pktid + 1);
  32. tx_msghdr->msg.ifidx = brcmf_flowring_ifidx_get(flow, flowid);
  33. tx_msghdr->flags = BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3;
  34. tx_msghdr->flags |= (skb->priority & 0x07) <<
  35. @@ -882,7 +882,7 @@ brcmf_msgbuf_process_txstatus(struct brc
  36. u16 flowid;
  37. tx_status = (struct msgbuf_tx_status *)buf;
  38. - idx = le32_to_cpu(tx_status->msg.request_id);
  39. + idx = le32_to_cpu(tx_status->msg.request_id) - 1;
  40. flowid = le16_to_cpu(tx_status->compl_hdr.flow_ring_id);
  41. flowid -= BRCMF_H2D_MSGRING_FLOWRING_IDSTART;
  42. skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev,