Skip to content

Commit

Permalink
cfg80211: parse multi-bssid only if HW supports it
Browse files Browse the repository at this point in the history
Parsing and exposing nontransmitted APs is problematic
when underlying HW doesn't support it. Do it only if
driver indicated support. Allow HE restriction as well,
since the HE spec defined the exact manner that Multiple
BSSID set should behave. APs that not support the HE
spec will have less predictable Multiple BSSID set
support/behavior

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Sara Sharon authored and Johannes Berg committed Feb 8, 2019
1 parent 7011ba5 commit 213ed57
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -4315,6 +4315,11 @@ struct cfg80211_pmsr_capabilities {
* @txq_memory_limit: configuration internal TX queue memory limit
* @txq_quantum: configuration of internal TX queue scheduler quantum
*
* @support_mbssid: can HW support association with nontransmitted AP
* @support_only_he_mbssid: don't parse MBSSID elements if it is not
* HE AP, in order to avoid compatibility issues.
* @support_mbssid must be set for this to have any effect.
*
* @pmsr_capa: peer measurement capabilities
*/
struct wiphy {
Expand Down Expand Up @@ -4455,6 +4460,9 @@ struct wiphy {
u32 txq_memory_limit;
u32 txq_quantum;

u8 support_mbssid:1,
support_only_he_mbssid:1;

const struct cfg80211_pmsr_capabilities *pmsr_capa;

char priv[0] __aligned(NETDEV_ALIGN);
Expand Down
11 changes: 10 additions & 1 deletion net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,11 @@ static void cfg80211_parse_mbssid_data(struct wiphy *wiphy,
return;
if (!cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ie, ielen))
return;
if (!wiphy->support_mbssid)
return;
if (wiphy->support_only_he_mbssid &&
!cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY, ie, ielen))
return;

new_ie = kmalloc(IEEE80211_MAX_DATA_LEN, gfp);
if (!new_ie)
Expand Down Expand Up @@ -1701,7 +1706,11 @@ cfg80211_inform_bss_frame_data(struct wiphy *wiphy,

res = cfg80211_inform_single_bss_frame_data(wiphy, data, mgmt,
len, NULL, gfp);
if (!res || !cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ie, ielen))
if (!res || !wiphy->support_mbssid ||
!cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ie, ielen))
return res;
if (wiphy->support_only_he_mbssid &&
!cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY, ie, ielen))
return res;

/* process each non-transmitting bss */
Expand Down

0 comments on commit 213ed57

Please sign in to comment.