kernel: bump 4.14 to 4.14.72
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / 340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch
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
9 That struct is used when querying firmware for the STA. It seem is has
10 been changing during the time. Luckily its format seems to be backward
11 compatible starting with v2 (the only breakage was v1 -> v2).
12
13 The version that was supported by brcmfmac so far was v4. It was what
14 43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly)
15 were using. It also seems to be used by early 4366c0 firmwares
16 (10.10.69.6908 and 10.10.69.69017).
17
18 The problem appears when switching to the 10.10.122.20 firmware. It uses
19 v5 and instead of falling back to v4 when submitted buffer isn't big
20 enough it fallbacks to the v3.
21
22 To receive all v4 specific info with the newest firmware we have to
23 submit a struct (buffer) that matches v5.
24
25 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
26 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
27 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
28 ---
29 .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 14 ++++++++++++++
30 1 file changed, 14 insertions(+)
31
32 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
33 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h
34 @@ -174,6 +174,8 @@
35 #define BRCMF_MFP_CAPABLE 1
36 #define BRCMF_MFP_REQUIRED 2
37
38 +#define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8
39 +
40 /* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each
41 * ioctl. It is relatively small because firmware has small maximum size input
42 * playload restriction for ioctls.
43 @@ -550,6 +552,8 @@ struct brcmf_sta_info_le {
44 /* w/hi bit set if basic */
45 __le32 in; /* seconds elapsed since associated */
46 __le32 listen_interval_inms; /* Min Listen interval in ms for STA */
47 +
48 + /* Fields valid for ver >= 3 */
49 __le32 tx_pkts; /* # of packets transmitted */
50 __le32 tx_failures; /* # of packets failed */
51 __le32 rx_ucast_pkts; /* # of unicast packets received */
52 @@ -558,6 +562,8 @@ struct brcmf_sta_info_le {
53 __le32 rx_rate; /* Rate of last successful rx frame */
54 __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */
55 __le32 rx_decrypt_failures; /* # of packet decrypted failed */
56 +
57 + /* Fields valid for ver >= 4 */
58 __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */
59 __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */
60 __le32 tx_mcast_pkts; /* # of mcast pkts txed */
61 @@ -594,6 +600,14 @@ struct brcmf_sta_info_le {
62 */
63 __le32 rx_pkts_retried; /* # rx with retry bit set */
64 __le32 tx_rate_fallback; /* lowest fallback TX rate */
65 +
66 + /* Fields valid for ver >= 5 */
67 + struct {
68 + __le32 count; /* # rates in this set */
69 + u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */
70 + u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */
71 + __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */
72 + } rateset_adv;
73 };
74
75 struct brcmf_chanspec_list {