forked from luck/tmp_suning_uos_patched
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: Maithili Hinge <maithili@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
c4bc980f1b
commit
474a41e94d
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue
Block a user