332-v4.19-0005-brcmfmac-update-STA-info-struct-to-the-v5.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From 07b1ae46874949252625c96f309f96ca0f337020 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Thu, 28 Jun 2018 12:36:23 +0200
  4. Subject: [PATCH] brcmfmac: update STA info struct to the v5
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. That struct is used when querying firmware for the STA. It seem is has
  9. been changing during the time. Luckily its format seems to be backward
  10. compatible starting with v2 (the only breakage was v1 -> v2).
  11. The version that was supported by brcmfmac so far was v4. It was what
  12. 43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly)
  13. were using. It also seems to be used by early 4366c0 firmwares
  14. (10.10.69.6908 and 10.10.69.69017).
  15. The problem appears when switching to the 10.10.122.20 firmware. It uses
  16. v5 and instead of falling back to v4 when submitted buffer isn't big
  17. enough it fallbacks to the v3.
  18. To receive all v4 specific info with the newest firmware we have to
  19. submit a struct (buffer) that matches v5.
  20. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  21. Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  22. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  23. ---
  24. .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 14 ++++++++++++++
  25. 1 file changed, 14 insertions(+)
  26. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
  27. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
  28. @@ -165,6 +165,8 @@
  29. #define BRCMF_MFP_NONE 0
  30. #define BRCMF_MFP_CAPABLE 1
  31. #define BRCMF_MFP_REQUIRED 2
  32. +
  33. +#define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8
  34. /* join preference types for join_pref iovar */
  35. enum brcmf_join_pref_types {
  36. @@ -514,6 +516,8 @@ struct brcmf_sta_info_le {
  37. /* w/hi bit set if basic */
  38. __le32 in; /* seconds elapsed since associated */
  39. __le32 listen_interval_inms; /* Min Listen interval in ms for STA */
  40. +
  41. + /* Fields valid for ver >= 3 */
  42. __le32 tx_pkts; /* # of packets transmitted */
  43. __le32 tx_failures; /* # of packets failed */
  44. __le32 rx_ucast_pkts; /* # of unicast packets received */
  45. @@ -522,6 +526,8 @@ struct brcmf_sta_info_le {
  46. __le32 rx_rate; /* Rate of last successful rx frame */
  47. __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */
  48. __le32 rx_decrypt_failures; /* # of packet decrypted failed */
  49. +
  50. + /* Fields valid for ver >= 4 */
  51. __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */
  52. __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */
  53. __le32 tx_mcast_pkts; /* # of mcast pkts txed */
  54. @@ -558,6 +564,14 @@ struct brcmf_sta_info_le {
  55. */
  56. __le32 rx_pkts_retried; /* # rx with retry bit set */
  57. __le32 tx_rate_fallback; /* lowest fallback TX rate */
  58. +
  59. + /* Fields valid for ver >= 5 */
  60. + struct {
  61. + __le32 count; /* # rates in this set */
  62. + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
  63. + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
  64. + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
  65. + } rateset_adv;
  66. };
  67. struct brcmf_chanspec_list {