diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mwifiex/11ac.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/11ac.h | 17 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/fw.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/ioctl.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmd.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmdresp.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/uap_cmd.c | 55 |
9 files changed, 129 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/11ac.c b/drivers/net/wireless/mwifiex/11ac.c index cf43b3c29250..de0a63469cb1 100644 --- a/drivers/net/wireless/mwifiex/11ac.c +++ b/drivers/net/wireless/mwifiex/11ac.c | |||
@@ -259,3 +259,22 @@ int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv, | |||
259 | 259 | ||
260 | return ret_len; | 260 | return ret_len; |
261 | } | 261 | } |
262 | |||
263 | int mwifiex_cmd_11ac_cfg(struct mwifiex_private *priv, | ||
264 | struct host_cmd_ds_command *cmd, u16 cmd_action, | ||
265 | struct mwifiex_11ac_vht_cfg *cfg) | ||
266 | { | ||
267 | struct host_cmd_11ac_vht_cfg *vhtcfg = &cmd->params.vht_cfg; | ||
268 | |||
269 | cmd->command = cpu_to_le16(HostCmd_CMD_11AC_CFG); | ||
270 | cmd->size = cpu_to_le16(sizeof(struct host_cmd_11ac_vht_cfg) + | ||
271 | S_DS_GEN); | ||
272 | vhtcfg->action = cpu_to_le16(cmd_action); | ||
273 | vhtcfg->band_config = cfg->band_config; | ||
274 | vhtcfg->misc_config = cfg->misc_config; | ||
275 | vhtcfg->cap_info = cpu_to_le32(cfg->cap_info); | ||
276 | vhtcfg->mcs_tx_set = cpu_to_le32(cfg->mcs_tx_set); | ||
277 | vhtcfg->mcs_rx_set = cpu_to_le32(cfg->mcs_rx_set); | ||
278 | |||
279 | return 0; | ||
280 | } | ||
diff --git a/drivers/net/wireless/mwifiex/11ac.h b/drivers/net/wireless/mwifiex/11ac.h index 80fd1ba46200..7c2c69b5b3eb 100644 --- a/drivers/net/wireless/mwifiex/11ac.h +++ b/drivers/net/wireless/mwifiex/11ac.h | |||
@@ -20,7 +20,24 @@ | |||
20 | #ifndef _MWIFIEX_11AC_H_ | 20 | #ifndef _MWIFIEX_11AC_H_ |
21 | #define _MWIFIEX_11AC_H_ | 21 | #define _MWIFIEX_11AC_H_ |
22 | 22 | ||
23 | #define VHT_CFG_2GHZ BIT(0) | ||
24 | #define VHT_CFG_5GHZ BIT(1) | ||
25 | |||
26 | enum vht_cfg_misc_config { | ||
27 | VHT_CAP_TX_OPERATION = 1, | ||
28 | VHT_CAP_ASSOCIATION, | ||
29 | VHT_CAP_UAP_ONLY | ||
30 | }; | ||
31 | |||
32 | #define DEFAULT_VHT_MCS_SET 0xfffa | ||
33 | #define DISABLE_VHT_MCS_SET 0xffff | ||
34 | |||
35 | #define VHT_BW_80_160_80P80 BIT(2) | ||
36 | |||
23 | int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv, | 37 | int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv, |
24 | struct mwifiex_bssdescriptor *bss_desc, | 38 | struct mwifiex_bssdescriptor *bss_desc, |
25 | u8 **buffer); | 39 | u8 **buffer); |
40 | int mwifiex_cmd_11ac_cfg(struct mwifiex_private *priv, | ||
41 | struct host_cmd_ds_command *cmd, u16 cmd_action, | ||
42 | struct mwifiex_11ac_vht_cfg *cfg); | ||
26 | #endif /* _MWIFIEX_11AC_H_ */ | 43 | #endif /* _MWIFIEX_11AC_H_ */ |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index dbf5b1289516..95f3306e2836 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1374,6 +1374,13 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
1374 | } | 1374 | } |
1375 | 1375 | ||
1376 | mwifiex_set_ht_params(priv, bss_cfg, params); | 1376 | mwifiex_set_ht_params(priv, bss_cfg, params); |
1377 | |||
1378 | if (priv->adapter->is_hw_11ac_capable) { | ||
1379 | mwifiex_set_vht_params(priv, bss_cfg, params); | ||
1380 | mwifiex_set_vht_width(priv, params->chandef.width, | ||
1381 | priv->ap_11ac_enabled); | ||
1382 | } | ||
1383 | |||
1377 | mwifiex_set_wmm_params(priv, bss_cfg, params); | 1384 | mwifiex_set_wmm_params(priv, bss_cfg, params); |
1378 | 1385 | ||
1379 | if (params->inactivity_timeout > 0) { | 1386 | if (params->inactivity_timeout > 0) { |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 57c5defe1f9d..1f7578d553ec 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -295,6 +295,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { | |||
295 | #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa | 295 | #define HostCmd_CMD_PCIE_DESC_DETAILS 0x00fa |
296 | #define HostCmd_CMD_MGMT_FRAME_REG 0x010c | 296 | #define HostCmd_CMD_MGMT_FRAME_REG 0x010c |
297 | #define HostCmd_CMD_REMAIN_ON_CHAN 0x010d | 297 | #define HostCmd_CMD_REMAIN_ON_CHAN 0x010d |
298 | #define HostCmd_CMD_11AC_CFG 0x0112 | ||
298 | 299 | ||
299 | #define PROTOCOL_NO_SECURITY 0x01 | 300 | #define PROTOCOL_NO_SECURITY 0x01 |
300 | #define PROTOCOL_STATIC_WEP 0x02 | 301 | #define PROTOCOL_STATIC_WEP 0x02 |
@@ -1363,6 +1364,15 @@ struct host_cmd_ds_sys_config { | |||
1363 | u8 tlv[0]; | 1364 | u8 tlv[0]; |
1364 | }; | 1365 | }; |
1365 | 1366 | ||
1367 | struct host_cmd_11ac_vht_cfg { | ||
1368 | __le16 action; | ||
1369 | u8 band_config; | ||
1370 | u8 misc_config; | ||
1371 | __le32 cap_info; | ||
1372 | __le32 mcs_tx_set; | ||
1373 | __le32 mcs_rx_set; | ||
1374 | } __packed; | ||
1375 | |||
1366 | struct host_cmd_tlv_akmp { | 1376 | struct host_cmd_tlv_akmp { |
1367 | struct host_cmd_tlv tlv; | 1377 | struct host_cmd_tlv tlv; |
1368 | __le16 key_mgmt; | 1378 | __le16 key_mgmt; |
@@ -1620,6 +1630,7 @@ struct host_cmd_ds_command { | |||
1620 | struct host_cmd_ds_802_11_eeprom_access eeprom; | 1630 | struct host_cmd_ds_802_11_eeprom_access eeprom; |
1621 | struct host_cmd_ds_802_11_subsc_evt subsc_evt; | 1631 | struct host_cmd_ds_802_11_subsc_evt subsc_evt; |
1622 | struct host_cmd_ds_sys_config uap_sys_config; | 1632 | struct host_cmd_ds_sys_config uap_sys_config; |
1633 | struct host_cmd_11ac_vht_cfg vht_cfg; | ||
1623 | } params; | 1634 | } params; |
1624 | } __packed; | 1635 | } __packed; |
1625 | 1636 | ||
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h index 91d522c746ed..7f27e45680b5 100644 --- a/drivers/net/wireless/mwifiex/ioctl.h +++ b/drivers/net/wireless/mwifiex/ioctl.h | |||
@@ -272,6 +272,14 @@ struct mwifiex_ds_pm_cfg { | |||
272 | } param; | 272 | } param; |
273 | }; | 273 | }; |
274 | 274 | ||
275 | struct mwifiex_11ac_vht_cfg { | ||
276 | u8 band_config; | ||
277 | u8 misc_config; | ||
278 | u32 cap_info; | ||
279 | u32 mcs_tx_set; | ||
280 | u32 mcs_rx_set; | ||
281 | }; | ||
282 | |||
275 | struct mwifiex_ds_11n_tx_cfg { | 283 | struct mwifiex_ds_11n_tx_cfg { |
276 | u16 tx_htcap; | 284 | u16 tx_htcap; |
277 | u16 tx_htinfo; | 285 | u16 tx_htinfo; |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 920657587fff..975bc186a643 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -913,8 +913,14 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, | |||
913 | void mwifiex_set_ht_params(struct mwifiex_private *priv, | 913 | void mwifiex_set_ht_params(struct mwifiex_private *priv, |
914 | struct mwifiex_uap_bss_param *bss_cfg, | 914 | struct mwifiex_uap_bss_param *bss_cfg, |
915 | struct cfg80211_ap_settings *params); | 915 | struct cfg80211_ap_settings *params); |
916 | void mwifiex_set_vht_params(struct mwifiex_private *priv, | ||
917 | struct mwifiex_uap_bss_param *bss_cfg, | ||
918 | struct cfg80211_ap_settings *params); | ||
916 | void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, | 919 | void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, |
917 | struct cfg80211_ap_settings *params); | 920 | struct cfg80211_ap_settings *params); |
921 | void mwifiex_set_vht_width(struct mwifiex_private *priv, | ||
922 | enum nl80211_chan_width width, | ||
923 | bool ap_11ac_disable); | ||
918 | void | 924 | void |
919 | mwifiex_set_wmm_params(struct mwifiex_private *priv, | 925 | mwifiex_set_wmm_params(struct mwifiex_private *priv, |
920 | struct mwifiex_uap_bss_param *bss_cfg, | 926 | struct mwifiex_uap_bss_param *bss_cfg, |
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c index a2ae690a0a67..b193e25977d2 100644 --- a/drivers/net/wireless/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/mwifiex/sta_cmd.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "main.h" | 24 | #include "main.h" |
25 | #include "wmm.h" | 25 | #include "wmm.h" |
26 | #include "11n.h" | 26 | #include "11n.h" |
27 | #include "11ac.h" | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * This function prepares command to set/get RSSI information. | 30 | * This function prepares command to set/get RSSI information. |
@@ -1258,6 +1259,9 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, | |||
1258 | cpu_to_le16(sizeof(struct host_cmd_ds_remain_on_chan) + | 1259 | cpu_to_le16(sizeof(struct host_cmd_ds_remain_on_chan) + |
1259 | S_DS_GEN); | 1260 | S_DS_GEN); |
1260 | break; | 1261 | break; |
1262 | case HostCmd_CMD_11AC_CFG: | ||
1263 | ret = mwifiex_cmd_11ac_cfg(priv, cmd_ptr, cmd_action, data_buf); | ||
1264 | break; | ||
1261 | case HostCmd_CMD_P2P_MODE_CFG: | 1265 | case HostCmd_CMD_P2P_MODE_CFG: |
1262 | cmd_ptr->command = cpu_to_le16(cmd_no); | 1266 | cmd_ptr->command = cpu_to_le16(cmd_no); |
1263 | cmd_ptr->params.mode_cfg.action = cpu_to_le16(cmd_action); | 1267 | cmd_ptr->params.mode_cfg.action = cpu_to_le16(cmd_action); |
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 80b9f2238001..c7dc450f0bf3 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c | |||
@@ -907,6 +907,8 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, | |||
907 | case HostCmd_CMD_REMAIN_ON_CHAN: | 907 | case HostCmd_CMD_REMAIN_ON_CHAN: |
908 | ret = mwifiex_ret_remain_on_chan(priv, resp, data_buf); | 908 | ret = mwifiex_ret_remain_on_chan(priv, resp, data_buf); |
909 | break; | 909 | break; |
910 | case HostCmd_CMD_11AC_CFG: | ||
911 | break; | ||
910 | case HostCmd_CMD_P2P_MODE_CFG: | 912 | case HostCmd_CMD_P2P_MODE_CFG: |
911 | ret = mwifiex_ret_p2p_mode_cfg(priv, resp, data_buf); | 913 | ret = mwifiex_ret_p2p_mode_cfg(priv, resp, data_buf); |
912 | break; | 914 | break; |
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c index 6e76a15a8950..b04b1db29100 100644 --- a/drivers/net/wireless/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/mwifiex/uap_cmd.c | |||
@@ -18,6 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "main.h" | 20 | #include "main.h" |
21 | #include "11ac.h" | ||
21 | 22 | ||
22 | /* This function parses security related parameters from cfg80211_ap_settings | 23 | /* This function parses security related parameters from cfg80211_ap_settings |
23 | * and sets into FW understandable bss_config structure. | 24 | * and sets into FW understandable bss_config structure. |
@@ -177,6 +178,60 @@ mwifiex_set_ht_params(struct mwifiex_private *priv, | |||
177 | return; | 178 | return; |
178 | } | 179 | } |
179 | 180 | ||
181 | /* This function updates 11ac related parameters from IE | ||
182 | * and sets them into bss_config structure. | ||
183 | */ | ||
184 | void mwifiex_set_vht_params(struct mwifiex_private *priv, | ||
185 | struct mwifiex_uap_bss_param *bss_cfg, | ||
186 | struct cfg80211_ap_settings *params) | ||
187 | { | ||
188 | const u8 *vht_ie; | ||
189 | |||
190 | vht_ie = cfg80211_find_ie(WLAN_EID_VHT_CAPABILITY, params->beacon.tail, | ||
191 | params->beacon.tail_len); | ||
192 | if (vht_ie) { | ||
193 | memcpy(&bss_cfg->vht_cap, vht_ie + 2, | ||
194 | sizeof(struct ieee80211_vht_cap)); | ||
195 | priv->ap_11ac_enabled = 1; | ||
196 | } else { | ||
197 | priv->ap_11ac_enabled = 0; | ||
198 | } | ||
199 | |||
200 | return; | ||
201 | } | ||
202 | |||
203 | /* Enable VHT only when cfg80211_ap_settings has VHT IE. | ||
204 | * Otherwise disable VHT. | ||
205 | */ | ||
206 | void mwifiex_set_vht_width(struct mwifiex_private *priv, | ||
207 | enum nl80211_chan_width width, | ||
208 | bool ap_11ac_enable) | ||
209 | { | ||
210 | struct mwifiex_adapter *adapter = priv->adapter; | ||
211 | struct mwifiex_11ac_vht_cfg vht_cfg; | ||
212 | |||
213 | vht_cfg.band_config = VHT_CFG_5GHZ; | ||
214 | vht_cfg.cap_info = adapter->hw_dot_11ac_dev_cap; | ||
215 | |||
216 | if (!ap_11ac_enable) { | ||
217 | vht_cfg.mcs_tx_set = DISABLE_VHT_MCS_SET; | ||
218 | vht_cfg.mcs_rx_set = DISABLE_VHT_MCS_SET; | ||
219 | } else { | ||
220 | vht_cfg.mcs_tx_set = DEFAULT_VHT_MCS_SET; | ||
221 | vht_cfg.mcs_rx_set = DEFAULT_VHT_MCS_SET; | ||
222 | } | ||
223 | |||
224 | vht_cfg.misc_config = VHT_CAP_UAP_ONLY; | ||
225 | |||
226 | if (ap_11ac_enable && width >= NL80211_CHAN_WIDTH_80) | ||
227 | vht_cfg.misc_config |= VHT_BW_80_160_80P80; | ||
228 | |||
229 | mwifiex_send_cmd_sync(priv, HostCmd_CMD_11AC_CFG, | ||
230 | HostCmd_ACT_GEN_SET, 0, &vht_cfg); | ||
231 | |||
232 | return; | ||
233 | } | ||
234 | |||
180 | /* This function finds supported rates IE from beacon parameter and sets | 235 | /* This function finds supported rates IE from beacon parameter and sets |
181 | * these rates into bss_config structure. | 236 | * these rates into bss_config structure. |
182 | */ | 237 | */ |