diff options
Diffstat (limited to 'net/mac80211/util.c')
| -rw-r--r-- | net/mac80211/util.c | 40 | 
1 files changed, 28 insertions, 12 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 49cb96d25169..39fa2a50385d 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1112,10 +1112,6 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,  			} else  				elem_parse_failed = true;  			break; -		case WLAN_EID_CHALLENGE: -			elems->challenge = pos; -			elems->challenge_len = elen; -			break;  		case WLAN_EID_VENDOR_SPECIFIC:  			if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 &&  			    pos[2] == 0xf2) { @@ -1395,8 +1391,8 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,  static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,  					    struct ieee802_11_elems *elems, -					    u8 *transmitter_bssid, -					    u8 *bss_bssid, +					    const u8 *transmitter_bssid, +					    const u8 *bss_bssid,  					    u8 *nontransmitted_profile)  {  	const struct element *elem, *sub; @@ -1461,16 +1457,20 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len,  	return found ? profile_len : 0;  } -u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, -			       struct ieee802_11_elems *elems, -			       u64 filter, u32 crc, u8 *transmitter_bssid, -			       u8 *bss_bssid) +struct ieee802_11_elems *ieee802_11_parse_elems_crc(const u8 *start, size_t len, +						    bool action, u64 filter, +						    u32 crc, +						    const u8 *transmitter_bssid, +						    const u8 *bss_bssid)  { +	struct ieee802_11_elems *elems;  	const struct element *non_inherit = NULL;  	u8 *nontransmitted_profile;  	int nontransmitted_profile_len = 0; -	memset(elems, 0, sizeof(*elems)); +	elems = kzalloc(sizeof(*elems), GFP_ATOMIC); +	if (!elems) +		return NULL;  	elems->ie_start = start;  	elems->total_len = len; @@ -1516,7 +1516,9 @@ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,  	kfree(nontransmitted_profile); -	return crc; +	elems->crc = crc; + +	return elems;  }  void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata, @@ -3383,6 +3385,7 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,  	const struct ieee80211_sta_he_cap *he_cap;  	struct cfg80211_chan_def he_chandef = *chandef;  	const struct ieee80211_he_6ghz_oper *he_6ghz_oper; +	struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;  	bool support_80_80, support_160;  	u8 he_phy_cap;  	u32 freq; @@ -3427,6 +3430,19 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,  	he_chandef.chan = ieee80211_get_channel(sdata->local->hw.wiphy, freq);  	switch (u8_get_bits(he_6ghz_oper->control, +			    IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO)) { +	case IEEE80211_6GHZ_CTRL_REG_LPI_AP: +		bss_conf->power_type = IEEE80211_REG_LPI_AP; +		break; +	case IEEE80211_6GHZ_CTRL_REG_SP_AP: +		bss_conf->power_type = IEEE80211_REG_SP_AP; +		break; +	default: +		bss_conf->power_type = IEEE80211_REG_UNSET_AP; +		break; +	} + +	switch (u8_get_bits(he_6ghz_oper->control,  			    IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH)) {  	case IEEE80211_HE_6GHZ_OPER_CTRL_CHANWIDTH_20MHZ:  		he_chandef.width = NL80211_CHAN_WIDTH_20;  | 
