338-v5.0-0003-brcmfmac-support-STA-info-struct-v7.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From a4dad0334732f62c67058037d9edb17945bec598 Mon Sep 17 00:00:00 2001
  2. From: Dan Haab <riproute@gmail.com>
  3. Date: Fri, 9 Nov 2018 09:38:55 -0700
  4. Subject: [PATCH] brcmfmac: support STA info struct v7
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. The newest firmwares provide STA info using v7 of the struct. As v7
  9. isn't backward compatible, a union is needed.
  10. Even though brcmfmac does not use any of the new info it's important to
  11. provide the proper struct buffer. Without this change new firmwares will
  12. fallback to the very limited v3 instead of something in between such as
  13. v4.
  14. Signed-off-by: Dan Haab <dan.haab@luxul.com>
  15. Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
  16. ---
  17. .../broadcom/brcm80211/brcmfmac/fwil_types.h | 40 ++++++++++++++++++----
  18. 1 file changed, 33 insertions(+), 7 deletions(-)
  19. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
  20. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
  21. @@ -167,6 +167,8 @@
  22. #define BRCMF_MFP_REQUIRED 2
  23. #define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8
  24. +
  25. +#define BRCMF_HE_CAP_MCS_MAP_NSS_MAX 8
  26. /* join preference types for join_pref iovar */
  27. enum brcmf_join_pref_types {
  28. @@ -565,13 +567,37 @@ struct brcmf_sta_info_le {
  29. __le32 rx_pkts_retried; /* # rx with retry bit set */
  30. __le32 tx_rate_fallback; /* lowest fallback TX rate */
  31. - /* Fields valid for ver >= 5 */
  32. - struct {
  33. - __le32 count; /* # rates in this set */
  34. - u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
  35. - u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
  36. - __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
  37. - } rateset_adv;
  38. + union {
  39. + struct {
  40. + struct {
  41. + __le32 count; /* # rates in this set */
  42. + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
  43. + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
  44. + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
  45. + } rateset_adv;
  46. + } v5;
  47. +
  48. + struct {
  49. + __le32 rx_dur_total; /* total user RX duration (estimated) */
  50. + __le16 chanspec; /** chanspec this sta is on */
  51. + __le16 pad_1;
  52. + struct {
  53. + __le16 version; /* version */
  54. + __le16 len; /* length */
  55. + __le32 count; /* # rates in this set */
  56. + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
  57. + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
  58. + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
  59. + __le16 he_mcs[BRCMF_HE_CAP_MCS_MAP_NSS_MAX]; /* supported he mcs index bit map per nss */
  60. + } rateset_adv; /* rateset along with mcs index bitmap */
  61. + __le16 wpauth; /* authentication type */
  62. + u8 algo; /* crypto algorithm */
  63. + u8 pad_2;
  64. + __le32 tx_rspec; /* Rate of last successful tx frame */
  65. + __le32 rx_rspec; /* Rate of last successful rx frame */
  66. + __le32 wnm_cap; /* wnm capabilities */
  67. + } v7;
  68. + };
  69. };
  70. struct brcmf_chanspec_list {