diff options
author | Maithili Hinge <maithili@marvell.com> | 2014-03-19 01:24:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-19 15:15:47 -0400 |
commit | 474a41e94dfc85167e1761bfbb8bf180f90633b2 (patch) | |
tree | 1cee8cb44e917384c6986a57486ca1601b20a484 | |
parent | c4bc980f1b34a8c172b3812e8c946368c730bddd (diff) |
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>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/fw.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/uap_cmd.c | 20 |
3 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index ee45d626eedb..21ee27ab7b74 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -2100,10 +2100,10 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info, | |||
2100 | else | 2100 | else |
2101 | ht_info->cap &= ~IEEE80211_HT_CAP_SGI_40; | 2101 | ht_info->cap &= ~IEEE80211_HT_CAP_SGI_40; |
2102 | 2102 | ||
2103 | if (ISSUPP_RXSTBC(adapter->hw_dot_11n_dev_cap)) | 2103 | if (adapter->user_dev_mcs_support == HT_STREAM_2X2) |
2104 | ht_info->cap |= 1 << IEEE80211_HT_CAP_RX_STBC_SHIFT; | 2104 | ht_info->cap |= 3 << IEEE80211_HT_CAP_RX_STBC_SHIFT; |
2105 | else | 2105 | else |
2106 | ht_info->cap &= ~(3 << IEEE80211_HT_CAP_RX_STBC_SHIFT); | 2106 | ht_info->cap |= 1 << IEEE80211_HT_CAP_RX_STBC_SHIFT; |
2107 | 2107 | ||
2108 | if (ISSUPP_TXSTBC(adapter->hw_dot_11n_dev_cap)) | 2108 | if (ISSUPP_TXSTBC(adapter->hw_dot_11n_dev_cap)) |
2109 | ht_info->cap |= IEEE80211_HT_CAP_TX_STBC; | 2109 | ht_info->cap |= IEEE80211_HT_CAP_TX_STBC; |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 341e41978ac6..b485dc1ae5eb 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -202,6 +202,11 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { | |||
202 | 202 | ||
203 | #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR | 203 | #define MWIFIEX_DEF_AMPDU IEEE80211_HT_AMPDU_PARM_FACTOR |
204 | 204 | ||
205 | #define GET_RXSTBC(x) (x & IEEE80211_HT_CAP_RX_STBC) | ||
206 | #define MWIFIEX_RX_STBC1 0x0100 | ||
207 | #define MWIFIEX_RX_STBC12 0x0200 | ||
208 | #define MWIFIEX_RX_STBC123 0x0300 | ||
209 | |||
205 | /* dev_cap bitmap | 210 | /* dev_cap bitmap |
206 | * BIT | 211 | * BIT |
207 | * 0-16 reserved | 212 | * 0-16 reserved |
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c index a6a6a53cda40..9be6544bdded 100644 --- a/drivers/net/wireless/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/mwifiex/uap_cmd.c | |||
@@ -159,6 +159,7 @@ mwifiex_set_ht_params(struct mwifiex_private *priv, | |||
159 | struct cfg80211_ap_settings *params) | 159 | struct cfg80211_ap_settings *params) |
160 | { | 160 | { |
161 | const u8 *ht_ie; | 161 | const u8 *ht_ie; |
162 | u16 cap_info; | ||
162 | 163 | ||
163 | if (!ISSUPP_11NENABLED(priv->adapter->fw_cap_info)) | 164 | if (!ISSUPP_11NENABLED(priv->adapter->fw_cap_info)) |
164 | return; | 165 | return; |
@@ -168,6 +169,25 @@ mwifiex_set_ht_params(struct mwifiex_private *priv, | |||
168 | if (ht_ie) { | 169 | if (ht_ie) { |
169 | memcpy(&bss_cfg->ht_cap, ht_ie + 2, | 170 | memcpy(&bss_cfg->ht_cap, ht_ie + 2, |
170 | sizeof(struct ieee80211_ht_cap)); | 171 | sizeof(struct ieee80211_ht_cap)); |
172 | cap_info = le16_to_cpu(bss_cfg->ht_cap.cap_info); | ||
173 | memset(&bss_cfg->ht_cap.mcs, 0, | ||
174 | priv->adapter->number_of_antenna); | ||
175 | switch (GET_RXSTBC(cap_info)) { | ||
176 | case MWIFIEX_RX_STBC1: | ||
177 | /* HT_CAP 1X1 mode */ | ||
178 | memset(&bss_cfg->ht_cap.mcs, 0xff, 1); | ||
179 | break; | ||
180 | case MWIFIEX_RX_STBC12: /* fall through */ | ||
181 | case MWIFIEX_RX_STBC123: | ||
182 | /* HT_CAP 2X2 mode */ | ||
183 | memset(&bss_cfg->ht_cap.mcs, 0xff, 2); | ||
184 | break; | ||
185 | default: | ||
186 | dev_warn(priv->adapter->dev, | ||
187 | "Unsupported RX-STBC, default to 2x2\n"); | ||
188 | memset(&bss_cfg->ht_cap.mcs, 0xff, 2); | ||
189 | break; | ||
190 | } | ||
171 | priv->ap_11n_enabled = 1; | 191 | priv->ap_11n_enabled = 1; |
172 | } else { | 192 | } else { |
173 | memset(&bss_cfg->ht_cap , 0, sizeof(struct ieee80211_ht_cap)); | 193 | memset(&bss_cfg->ht_cap , 0, sizeof(struct ieee80211_ht_cap)); |