Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53a70942 authored by Ganapathi Bhat's avatar Ganapathi Bhat Committed by Kalle Valo
Browse files

Revert "mwifiex: fix incorrect ht capability problem"



This reverts commit bcc920e8.

Drivers gets hardware info and updates ht_cap field of
wiphy->bands during initialization. Once updated during init,
ht_cap must not be modified as it reflects the capability
supported by hardwawre. Above patch tries to modify the ht_cap
field and this results in wrongly advertising capabilities during
association.

Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarGanapathi Bhat <gbhat@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent eaab43e5
Loading
Loading
Loading
Loading
+1 −43
Original line number Diff line number Diff line
@@ -146,7 +146,6 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
	size_t beacon_ie_len;
	struct mwifiex_bss_priv *bss_priv = (void *)bss->priv;
	const struct cfg80211_bss_ies *ies;
	int ret;

	rcu_read_lock();
	ies = rcu_dereference(bss->ies);
@@ -190,48 +189,7 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
	if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_SPECTRUM_MGMT)
		bss_desc->sensed_11h = true;

	ret = mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc);
	if (ret)
		return ret;

	/* Update HT40 capability based on current channel information */
	if (bss_desc->bcn_ht_oper && bss_desc->bcn_ht_cap) {
		u8 ht_param = bss_desc->bcn_ht_oper->ht_param;
		u8 radio = mwifiex_band_to_radio_type(bss_desc->bss_band);
		struct ieee80211_supported_band *sband =
						priv->wdev.wiphy->bands[radio];
		int freq = ieee80211_channel_to_frequency(bss_desc->channel,
							  radio);
		struct ieee80211_channel *chan =
			ieee80211_get_channel(priv->adapter->wiphy, freq);

		switch (ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
		case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
			if (chan->flags & IEEE80211_CHAN_NO_HT40PLUS) {
				sband->ht_cap.cap &=
					~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
				sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
			} else {
				sband->ht_cap.cap |=
					IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
					IEEE80211_HT_CAP_SGI_40;
			}
			break;
		case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
			if (chan->flags & IEEE80211_CHAN_NO_HT40MINUS) {
				sband->ht_cap.cap &=
					~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
				sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
			} else {
				sband->ht_cap.cap |=
					IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
					IEEE80211_HT_CAP_SGI_40;
			}
			break;
		}
	}

	return 0;
	return mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc);
}

void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv)