Skip to content

Commit 9918be0

Browse files
marcanjannau
authored andcommitted
wifi: brcmfmac: Support bss_info up to v112
The structures are compatible and just add fields, so we can just treat it as always v112. If we start using new fields, that will have to be gated on the version. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 201cac9 commit 9918be0

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,8 +3410,9 @@ static s32 brcmf_inform_bss(struct brcmf_cfg80211_info *cfg)
34103410

34113411
bss_list = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
34123412
if (bss_list->count != 0 &&
3413-
bss_list->version != BRCMF_BSS_INFO_VERSION) {
3414-
bphy_err(drvr, "Version %d != WL_BSS_INFO_VERSION\n",
3413+
(bss_list->version < BRCMF_BSS_INFO_MIN_VERSION ||
3414+
bss_list->version > BRCMF_BSS_INFO_MAX_VERSION)) {
3415+
bphy_err(drvr, "BSS info version %d unsupported\n",
34153416
bss_list->version);
34163417
return -EOPNOTSUPP;
34173418
}

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#define BRCMF_ARP_OL_HOST_AUTO_REPLY 0x00000004
1919
#define BRCMF_ARP_OL_PEER_AUTO_REPLY 0x00000008
2020

21-
#define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */
21+
#define BRCMF_BSS_INFO_MIN_VERSION 109 /* min ver of brcmf_bss_info_le struct */
22+
#define BRCMF_BSS_INFO_MAX_VERSION 112 /* max ver of brcmf_bss_info_le struct */
2223
#define BRCMF_BSS_RSSI_ON_CHANNEL 0x0004
2324

2425
#define BRCMF_STA_BRCM 0x00000001 /* Running a Broadcom driver */
@@ -323,28 +324,56 @@ struct brcmf_bss_info_le {
323324
__le16 capability; /* Capability information */
324325
u8 SSID_len;
325326
u8 SSID[32];
327+
u8 bcnflags; /* additional flags w.r.t. beacon */
326328
struct {
327329
__le32 count; /* # rates in this set */
328330
u8 rates[16]; /* rates in 500kbps units w/hi bit set if basic */
329331
} rateset; /* supported rates */
330332
__le16 chanspec; /* chanspec for bss */
331333
__le16 atim_window; /* units are Kusec */
332-
u8 dtim_period; /* DTIM period */
334+
u8 dtim_period; /* DTIM period */
335+
u8 accessnet; /* from beacon interwork IE (if bcnflags) */
333336
__le16 RSSI; /* receive signal strength (in dBm) */
334337
s8 phy_noise; /* noise (in dBm) */
335338

336339
u8 n_cap; /* BSS is 802.11N Capable */
340+
u8 he_cap; /* BSS is he capable */
341+
u8 load; /* BSS Load from QBSS load IE if available */
337342
/* 802.11N BSS Capabilities (based on HT_CAP_*): */
338343
__le32 nbss_cap;
339344
u8 ctl_ch; /* 802.11N BSS control channel number */
340-
__le32 reserved32[1]; /* Reserved for expansion of BSS properties */
345+
u8 reserved1[3]; /* Reserved for expansion of BSS properties */
346+
__le16 vht_rxmcsmap; /* VHT rx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
347+
__le16 vht_txmcsmap; /* VHT tx mcs map (802.11ac IE, VHT_CAP_MCS_MAP_*) */
341348
u8 flags; /* flags */
342-
u8 reserved[3]; /* Reserved for expansion of BSS properties */
349+
u8 vht_cap; /* BSS is vht capable */
350+
u8 reserved2[2]; /* Reserved for expansion of BSS properties */
343351
u8 basic_mcs[BRCMF_MCSSET_LEN]; /* 802.11N BSS required MCS set */
344352

345353
__le16 ie_offset; /* offset at which IEs start, from beginning */
354+
u8 reserved3[2]; /* Reserved for expansion of BSS properties */
346355
__le32 ie_length; /* byte length of Information Elements */
347356
__le16 SNR; /* average SNR of during frame reception */
357+
__le16 vht_mcsmap; /**< STA's Associated vhtmcsmap */
358+
__le16 vht_mcsmap_prop; /**< STA's Associated prop vhtmcsmap */
359+
__le16 vht_txmcsmap_prop; /**< prop VHT tx mcs prop */
360+
__le32 he_mcsmap; /**< STA's Associated hemcsmap */
361+
__le32 he_rxmcsmap; /**< HE rx mcs map (802.11ax IE, HE_CAP_MCS_MAP_*) */
362+
__le32 he_txmcsmap; /**< HE tx mcs map (802.11ax IE, HE_CAP_MCS_MAP_*) */
363+
__le32 timestamp[2]; /* Beacon Timestamp for FAKEAP req */
364+
/* V112 fields follow */
365+
u8 eht_cap; /* BSS is EHT capable */
366+
u8 reserved4[3]; /* Reserved for expansion of BSS properties */
367+
/* by the spec. it is maximum 16 streams hence all mcs code for all nss may not fit
368+
* in a 32 bit mcs nss map but since this field only reflects the common mcs nss map
369+
* between that of the peer and our device so it's probably ok to make it 32 bit and
370+
* allow only a limited number of nss e.g. upto 8 of them in the map given the fact
371+
* that our device probably won't exceed 4 streams anyway...
372+
*/
373+
__le32 eht_mcsmap; /* STA's associated EHT mcs code map */
374+
/* FIXME: change the following mcs code map to uint32 if all mcs+nss can fit in */
375+
u8 eht_rxmcsmap[6]; /* EHT rx mcs code map */
376+
u8 eht_txmcsmap[6]; /* EHT tx mcs code map */
348377
/* Add new fields here */
349378
/* variable length Information Elements */
350379
};

0 commit comments

Comments
 (0)