Commit 25b8ab91 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'mac80211-for-net-2020-09-21' of...

Merge tag 'mac80211-for-net-2020-09-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211



Johannes Berg says:

====================
Just a few fixes:
 * fix using HE on 2.4 GHz
 * AQL (airtime queue limit) estimation & VHT160 fix
 * do not oversize A-MPDUs if local capability is smaller than peer's
 * fix radiotap on 6 GHz to not put 2.4 GHz flag
 * fix Kconfig for lib80211
 * little fixlet for 6 GHz channel number / frequency conversion
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 91b2c9a0 75bcbd69
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -560,7 +560,9 @@ static int ieee80211_fill_rx_status(struct ieee80211_rx_status *stat,
	if (rate->idx < 0 || !rate->count)
		return -1;

	if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH)
	if (rate->flags & IEEE80211_TX_RC_160_MHZ_WIDTH)
		stat->bw = RATE_INFO_BW_160;
	else if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH)
		stat->bw = RATE_INFO_BW_80;
	else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
		stat->bw = RATE_INFO_BW_40;
@@ -668,20 +670,26 @@ u32 ieee80211_calc_expected_tx_airtime(struct ieee80211_hw *hw,
		 * This will not be very accurate, but much better than simply
		 * assuming un-aggregated tx in all cases.
		 */
		if (duration > 400) /* <= VHT20 MCS2 1S */
		if (duration > 400 * 1024) /* <= VHT20 MCS2 1S */
			agg_shift = 1;
		else if (duration > 250) /* <= VHT20 MCS3 1S or MCS1 2S */
		else if (duration > 250 * 1024) /* <= VHT20 MCS3 1S or MCS1 2S */
			agg_shift = 2;
		else if (duration > 150) /* <= VHT20 MCS5 1S or MCS3 2S */
		else if (duration > 150 * 1024) /* <= VHT20 MCS5 1S or MCS2 2S */
			agg_shift = 3;
		else
		else if (duration > 70 * 1024) /* <= VHT20 MCS5 2S */
			agg_shift = 4;
		else if (stat.encoding != RX_ENC_HE ||
			 duration > 20 * 1024) /* <= HE40 MCS6 2S */
			agg_shift = 5;
		else
			agg_shift = 6;

		duration *= len;
		duration /= AVG_PKT_SIZE;
		duration /= 1024;
		duration += (overhead >> agg_shift);

		return duration + (overhead >> agg_shift);
		return max_t(u32, duration, 4);
	}

	if (!conf)
+2 −1
Original line number Diff line number Diff line
@@ -4861,6 +4861,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
	struct ieee80211_supported_band *sband;
	struct cfg80211_chan_def chandef;
	bool is_6ghz = cbss->channel->band == NL80211_BAND_6GHZ;
	bool is_5ghz = cbss->channel->band == NL80211_BAND_5GHZ;
	struct ieee80211_bss *bss = (void *)cbss->priv;
	int ret;
	u32 i;
@@ -4879,7 +4880,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
		ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
	}

	if (!sband->vht_cap.vht_supported && !is_6ghz) {
	if (!sband->vht_cap.vht_supported && is_5ghz) {
		ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
		ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
	}
+2 −1
Original line number Diff line number Diff line
@@ -451,7 +451,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
	else if (status->bw == RATE_INFO_BW_5)
		channel_flags |= IEEE80211_CHAN_QUARTER;

	if (status->band == NL80211_BAND_5GHZ)
	if (status->band == NL80211_BAND_5GHZ ||
	    status->band == NL80211_BAND_6GHZ)
		channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ;
	else if (status->encoding != RX_ENC_LEGACY)
		channel_flags |= IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ;
+4 −3
Original line number Diff line number Diff line
@@ -3353,6 +3353,7 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
		he_chandef.center_freq1 =
			ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0,
						       NL80211_BAND_6GHZ);
		if (support_80_80 || support_160)
			he_chandef.center_freq2 =
				ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1,
							       NL80211_BAND_6GHZ);
+4 −4
Original line number Diff line number Diff line
@@ -168,10 +168,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
	/* take some capabilities as-is */
	cap_info = le32_to_cpu(vht_cap_ie->vht_cap_info);
	vht_cap->cap = cap_info;
	vht_cap->cap &= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 |
			IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 |
			IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
			IEEE80211_VHT_CAP_RXLDPC |
	vht_cap->cap &= IEEE80211_VHT_CAP_RXLDPC |
			IEEE80211_VHT_CAP_VHT_TXOP_PS |
			IEEE80211_VHT_CAP_HTC_VHT |
			IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK |
@@ -180,6 +177,9 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(struct ieee80211_sub_if_data *sdata,
			IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
			IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN;

	vht_cap->cap |= min_t(u32, cap_info & IEEE80211_VHT_CAP_MAX_MPDU_MASK,
			      own_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK);

	/* and some based on our own capabilities */
	switch (own_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
	case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
Loading