mac80211: brcmfmac: backport fixes from the 5.0-rc1
[openwrt/staging/jogo.git] / package / kernel / mac80211 / patches / brcm / 325-v5.0-brcmfmac-support-STA-info-struct-v7.patch
1 From 4282ff17e557d319e1b988fa4f582792cfaf6fff 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
9 The newest firmwares provide STA info using v7 of the struct. As v7
10 isn't backward compatible, a union is needed.
11
12 Even though brcmfmac does not use any of the new info it's important to
13 provide the proper struct buffer. Without this change new firmwares will
14 fallback to the very limited v3 instead of something in between such as
15 v4.
16
17 Signed-off-by: Dan Haab <dan.haab@luxul.com>
18 Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
19 Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
20 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
21 ---
22 .../broadcom/brcm80211/brcmfmac/fwil_types.h | 40 +++++++++++++++----
23 1 file changed, 33 insertions(+), 7 deletions(-)
24
25 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
26 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
27 @@ -176,6 +176,8 @@
28
29 #define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8
30
31 +#define BRCMF_HE_CAP_MCS_MAP_NSS_MAX 8
32 +
33 /* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each
34 * ioctl. It is relatively small because firmware has small maximum size input
35 * playload restriction for ioctls.
36 @@ -601,13 +603,37 @@ struct brcmf_sta_info_le {
37 __le32 rx_pkts_retried; /* # rx with retry bit set */
38 __le32 tx_rate_fallback; /* lowest fallback TX rate */
39
40 - /* Fields valid for ver >= 5 */
41 - struct {
42 - __le32 count; /* # rates in this set */
43 - u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
44 - u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
45 - __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
46 - } rateset_adv;
47 + union {
48 + struct {
49 + struct {
50 + __le32 count; /* # rates in this set */
51 + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
52 + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
53 + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
54 + } rateset_adv;
55 + } v5;
56 +
57 + struct {
58 + __le32 rx_dur_total; /* total user RX duration (estimated) */
59 + __le16 chanspec; /** chanspec this sta is on */
60 + __le16 pad_1;
61 + struct {
62 + __le16 version; /* version */
63 + __le16 len; /* length */
64 + __le32 count; /* # rates in this set */
65 + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
66 + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
67 + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
68 + __le16 he_mcs[BRCMF_HE_CAP_MCS_MAP_NSS_MAX]; /* supported he mcs index bit map per nss */
69 + } rateset_adv; /* rateset along with mcs index bitmap */
70 + __le16 wpauth; /* authentication type */
71 + u8 algo; /* crypto algorithm */
72 + u8 pad_2;
73 + __le32 tx_rspec; /* Rate of last successful tx frame */
74 + __le32 rx_rspec; /* Rate of last successful rx frame */
75 + __le32 wnm_cap; /* wnm capabilities */
76 + } v7;
77 + };
78 };
79
80 struct brcmf_chanspec_list {