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

Commit 474a41e9 authored by Maithili Hinge's avatar Maithili Hinge Committed by John W. Linville
Browse files

mwifiex: update MCS set as per RX-STBC bit from hostapd



To set AP in 1X1 or 2X2 mode through hostapd, we need to set
RX-STBC* in hostapd.conf file. Depending upon RX-STBC bit in
ht_cap IE received from hostapd, we need to update mcs set in
bss_cfg appropriately before starting AP.

Signed-off-by: default avatarMaithili Hinge <maithili@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c4bc980f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2100,10 +2100,10 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
	else
		ht_info->cap &= ~IEEE80211_HT_CAP_SGI_40;

	if (ISSUPP_RXSTBC(adapter->hw_dot_11n_dev_cap))
		ht_info->cap |= 1 << IEEE80211_HT_CAP_RX_STBC_SHIFT;
	if (adapter->user_dev_mcs_support == HT_STREAM_2X2)
		ht_info->cap |= 3 << IEEE80211_HT_CAP_RX_STBC_SHIFT;
	else
		ht_info->cap &= ~(3 << IEEE80211_HT_CAP_RX_STBC_SHIFT);
		ht_info->cap |= 1 << IEEE80211_HT_CAP_RX_STBC_SHIFT;

	if (ISSUPP_TXSTBC(adapter->hw_dot_11n_dev_cap))
		ht_info->cap |= IEEE80211_HT_CAP_TX_STBC;
+5 −0
Original line number Diff line number Diff line
@@ -202,6 +202,11 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {

#define MWIFIEX_DEF_AMPDU	IEEE80211_HT_AMPDU_PARM_FACTOR

#define GET_RXSTBC(x) (x & IEEE80211_HT_CAP_RX_STBC)
#define MWIFIEX_RX_STBC1	0x0100
#define MWIFIEX_RX_STBC12	0x0200
#define MWIFIEX_RX_STBC123	0x0300

/* dev_cap bitmap
 * BIT
 * 0-16		reserved
+20 −0
Original line number Diff line number Diff line
@@ -159,6 +159,7 @@ mwifiex_set_ht_params(struct mwifiex_private *priv,
		      struct cfg80211_ap_settings *params)
{
	const u8 *ht_ie;
	u16 cap_info;

	if (!ISSUPP_11NENABLED(priv->adapter->fw_cap_info))
		return;
@@ -168,6 +169,25 @@ mwifiex_set_ht_params(struct mwifiex_private *priv,
	if (ht_ie) {
		memcpy(&bss_cfg->ht_cap, ht_ie + 2,
		       sizeof(struct ieee80211_ht_cap));
		cap_info = le16_to_cpu(bss_cfg->ht_cap.cap_info);
		memset(&bss_cfg->ht_cap.mcs, 0,
		       priv->adapter->number_of_antenna);
		switch (GET_RXSTBC(cap_info)) {
		case MWIFIEX_RX_STBC1:
			/* HT_CAP 1X1 mode */
			memset(&bss_cfg->ht_cap.mcs, 0xff, 1);
			break;
		case MWIFIEX_RX_STBC12:	/* fall through */
		case MWIFIEX_RX_STBC123:
			/* HT_CAP 2X2 mode */
			memset(&bss_cfg->ht_cap.mcs, 0xff, 2);
			break;
		default:
			dev_warn(priv->adapter->dev,
				 "Unsupported RX-STBC, default to 2x2\n");
			memset(&bss_cfg->ht_cap.mcs, 0xff, 2);
			break;
		}
		priv->ap_11n_enabled = 1;
	} else {
		memset(&bss_cfg->ht_cap , 0, sizeof(struct ieee80211_ht_cap));