diff options
author | Avinash Patil <patila@marvell.com> | 2013-01-02 19:56:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-07 15:16:59 -0500 |
commit | 54428c57b6d7a9dc172ecfa80b07f17431015d09 (patch) | |
tree | f06ff42515af3256d3b36d164a10ffe089273539 /drivers/net | |
parent | d35f1035b53e92167a8231e15121dd10f4aa8edd (diff) |
mwifiex: parse WMM IEs from hostapd for mwifiex AP
This patch adds support for parsing WMM IEs from hostapd
and setting them to FW via sys configure command.
Patch also sets wiphy flag to advertise AP uAPSD support.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/decl.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/fw.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/ioctl.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/uap_cmd.c | 44 |
6 files changed, 75 insertions, 7 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index a875499f8945..c4edb28cce08 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1327,6 +1327,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | mwifiex_set_ht_params(priv, bss_cfg, params); | 1329 | mwifiex_set_ht_params(priv, bss_cfg, params); |
1330 | mwifiex_set_wmm_params(priv, bss_cfg, params); | ||
1330 | 1331 | ||
1331 | if (params->inactivity_timeout > 0) { | 1332 | if (params->inactivity_timeout > 0) { |
1332 | /* sta_ao_timer/ps_sta_ao_timer is in unit of 100ms */ | 1333 | /* sta_ao_timer/ps_sta_ao_timer is in unit of 100ms */ |
@@ -2261,6 +2262,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) | |||
2261 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; | 2262 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; |
2262 | wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | | 2263 | wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | |
2263 | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | | 2264 | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | |
2265 | WIPHY_FLAG_AP_UAPSD | | ||
2264 | WIPHY_FLAG_CUSTOM_REGULATORY | | 2266 | WIPHY_FLAG_CUSTOM_REGULATORY | |
2265 | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; | 2267 | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; |
2266 | 2268 | ||
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h index e9357d87d327..e8a569aaa2e8 100644 --- a/drivers/net/wireless/mwifiex/decl.h +++ b/drivers/net/wireless/mwifiex/decl.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/wait.h> | 26 | #include <linux/wait.h> |
27 | #include <linux/timer.h> | 27 | #include <linux/timer.h> |
28 | #include <linux/ieee80211.h> | 28 | #include <linux/ieee80211.h> |
29 | #include <net/mac80211.h> | ||
29 | 30 | ||
30 | 31 | ||
31 | #define MWIFIEX_MAX_BSS_NUM (3) | 32 | #define MWIFIEX_MAX_BSS_NUM (3) |
@@ -58,6 +59,8 @@ | |||
58 | #define MWIFIEX_RTS_MAX_VALUE (2347) | 59 | #define MWIFIEX_RTS_MAX_VALUE (2347) |
59 | #define MWIFIEX_FRAG_MIN_VALUE (256) | 60 | #define MWIFIEX_FRAG_MIN_VALUE (256) |
60 | #define MWIFIEX_FRAG_MAX_VALUE (2346) | 61 | #define MWIFIEX_FRAG_MAX_VALUE (2346) |
62 | #define MWIFIEX_WMM_VERSION 0x01 | ||
63 | #define MWIFIEX_WMM_SUBTYPE 0x01 | ||
61 | 64 | ||
62 | #define MWIFIEX_RETRY_LIMIT 14 | 65 | #define MWIFIEX_RETRY_LIMIT 14 |
63 | #define MWIFIEX_SDIO_BLOCK_SIZE 256 | 66 | #define MWIFIEX_SDIO_BLOCK_SIZE 256 |
@@ -126,4 +129,19 @@ enum mwifiex_wmm_ac_e { | |||
126 | WMM_AC_VI, | 129 | WMM_AC_VI, |
127 | WMM_AC_VO | 130 | WMM_AC_VO |
128 | } __packed; | 131 | } __packed; |
132 | |||
133 | struct ieee_types_wmm_ac_parameters { | ||
134 | u8 aci_aifsn_bitmap; | ||
135 | u8 ecw_bitmap; | ||
136 | __le16 tx_op_limit; | ||
137 | } __packed; | ||
138 | |||
139 | struct mwifiex_types_wmm_info { | ||
140 | u8 oui[4]; | ||
141 | u8 subtype; | ||
142 | u8 version; | ||
143 | u8 qos_info; | ||
144 | u8 reserved; | ||
145 | struct ieee_types_wmm_ac_parameters ac_params[IEEE80211_NUM_ACS]; | ||
146 | } __packed; | ||
129 | #endif /* !_MWIFIEX_DECL_H_ */ | 147 | #endif /* !_MWIFIEX_DECL_H_ */ |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 4dc8e2e9a889..41c85dd78084 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -1131,12 +1131,6 @@ struct ieee_types_vendor_header { | |||
1131 | u8 version; | 1131 | u8 version; |
1132 | } __packed; | 1132 | } __packed; |
1133 | 1133 | ||
1134 | struct ieee_types_wmm_ac_parameters { | ||
1135 | u8 aci_aifsn_bitmap; | ||
1136 | u8 ecw_bitmap; | ||
1137 | __le16 tx_op_limit; | ||
1138 | } __packed; | ||
1139 | |||
1140 | struct ieee_types_wmm_parameter { | 1134 | struct ieee_types_wmm_parameter { |
1141 | /* | 1135 | /* |
1142 | * WMM Parameter IE - Vendor Specific Header: | 1136 | * WMM Parameter IE - Vendor Specific Header: |
@@ -1186,6 +1180,11 @@ struct mwifiex_ie_types_htcap { | |||
1186 | struct ieee80211_ht_cap ht_cap; | 1180 | struct ieee80211_ht_cap ht_cap; |
1187 | } __packed; | 1181 | } __packed; |
1188 | 1182 | ||
1183 | struct mwifiex_ie_types_wmmcap { | ||
1184 | struct mwifiex_ie_types_header header; | ||
1185 | struct mwifiex_types_wmm_info wmm_info; | ||
1186 | } __packed; | ||
1187 | |||
1189 | struct mwifiex_ie_types_htinfo { | 1188 | struct mwifiex_ie_types_htinfo { |
1190 | struct mwifiex_ie_types_header header; | 1189 | struct mwifiex_ie_types_header header; |
1191 | struct ieee80211_ht_operation ht_oper; | 1190 | struct ieee80211_ht_operation ht_oper; |
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h index 4e31c6013ebe..6095b3e53f4e 100644 --- a/drivers/net/wireless/mwifiex/ioctl.h +++ b/drivers/net/wireless/mwifiex/ioctl.h | |||
@@ -20,7 +20,6 @@ | |||
20 | #ifndef _MWIFIEX_IOCTL_H_ | 20 | #ifndef _MWIFIEX_IOCTL_H_ |
21 | #define _MWIFIEX_IOCTL_H_ | 21 | #define _MWIFIEX_IOCTL_H_ |
22 | 22 | ||
23 | #include <net/mac80211.h> | ||
24 | #include <net/lib80211.h> | 23 | #include <net/lib80211.h> |
25 | 24 | ||
26 | enum { | 25 | enum { |
@@ -107,6 +106,8 @@ struct mwifiex_uap_bss_param { | |||
107 | u8 rates[MWIFIEX_SUPPORTED_RATES]; | 106 | u8 rates[MWIFIEX_SUPPORTED_RATES]; |
108 | u32 sta_ao_timer; | 107 | u32 sta_ao_timer; |
109 | u32 ps_sta_ao_timer; | 108 | u32 ps_sta_ao_timer; |
109 | u8 qos_info; | ||
110 | struct mwifiex_types_wmm_info wmm_info; | ||
110 | }; | 111 | }; |
111 | 112 | ||
112 | enum { | 113 | enum { |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 1b3cfc821940..d717c9859fb9 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -890,6 +890,10 @@ void mwifiex_set_ht_params(struct mwifiex_private *priv, | |||
890 | struct cfg80211_ap_settings *params); | 890 | struct cfg80211_ap_settings *params); |
891 | void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, | 891 | void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, |
892 | struct cfg80211_ap_settings *params); | 892 | struct cfg80211_ap_settings *params); |
893 | void | ||
894 | mwifiex_set_wmm_params(struct mwifiex_private *priv, | ||
895 | struct mwifiex_uap_bss_param *bss_cfg, | ||
896 | struct cfg80211_ap_settings *params); | ||
893 | 897 | ||
894 | /* | 898 | /* |
895 | * This function checks if the queuing is RA based or not. | 899 | * This function checks if the queuing is RA based or not. |
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c index 8dd72240f162..6e76a15a8950 100644 --- a/drivers/net/wireless/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/mwifiex/uap_cmd.c | |||
@@ -219,6 +219,7 @@ void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config) | |||
219 | config->rts_threshold = 0x7FFF; | 219 | config->rts_threshold = 0x7FFF; |
220 | config->frag_threshold = 0x7FFF; | 220 | config->frag_threshold = 0x7FFF; |
221 | config->retry_limit = 0x7F; | 221 | config->retry_limit = 0x7F; |
222 | config->qos_info = 0xFF; | ||
222 | } | 223 | } |
223 | 224 | ||
224 | /* This function parses BSS related parameters from structure | 225 | /* This function parses BSS related parameters from structure |
@@ -297,6 +298,38 @@ mwifiex_uap_bss_wpa(u8 **tlv_buf, void *cmd_buf, u16 *param_size) | |||
297 | return; | 298 | return; |
298 | } | 299 | } |
299 | 300 | ||
301 | /* This function parses WMM related parameters from cfg80211_ap_settings | ||
302 | * structure and updates bss_config structure. | ||
303 | */ | ||
304 | void | ||
305 | mwifiex_set_wmm_params(struct mwifiex_private *priv, | ||
306 | struct mwifiex_uap_bss_param *bss_cfg, | ||
307 | struct cfg80211_ap_settings *params) | ||
308 | { | ||
309 | const u8 *vendor_ie; | ||
310 | struct ieee_types_header *wmm_ie; | ||
311 | u8 wmm_oui[] = {0x00, 0x50, 0xf2, 0x02}; | ||
312 | |||
313 | vendor_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, | ||
314 | WLAN_OUI_TYPE_MICROSOFT_WMM, | ||
315 | params->beacon.tail, | ||
316 | params->beacon.tail_len); | ||
317 | if (vendor_ie) { | ||
318 | wmm_ie = (struct ieee_types_header *)vendor_ie; | ||
319 | memcpy(&bss_cfg->wmm_info, wmm_ie + 1, | ||
320 | sizeof(bss_cfg->wmm_info)); | ||
321 | priv->wmm_enabled = 1; | ||
322 | } else { | ||
323 | memset(&bss_cfg->wmm_info, 0, sizeof(bss_cfg->wmm_info)); | ||
324 | memcpy(&bss_cfg->wmm_info.oui, wmm_oui, sizeof(wmm_oui)); | ||
325 | bss_cfg->wmm_info.subtype = MWIFIEX_WMM_SUBTYPE; | ||
326 | bss_cfg->wmm_info.version = MWIFIEX_WMM_VERSION; | ||
327 | priv->wmm_enabled = 0; | ||
328 | } | ||
329 | |||
330 | bss_cfg->qos_info = 0x00; | ||
331 | return; | ||
332 | } | ||
300 | /* This function parses BSS related parameters from structure | 333 | /* This function parses BSS related parameters from structure |
301 | * and prepares TLVs specific to WEP encryption. | 334 | * and prepares TLVs specific to WEP encryption. |
302 | * These TLVs are appended to command buffer. | 335 | * These TLVs are appended to command buffer. |
@@ -354,6 +387,7 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) | |||
354 | struct host_cmd_tlv_rates *tlv_rates; | 387 | struct host_cmd_tlv_rates *tlv_rates; |
355 | struct host_cmd_tlv_ageout_timer *ao_timer, *ps_ao_timer; | 388 | struct host_cmd_tlv_ageout_timer *ao_timer, *ps_ao_timer; |
356 | struct mwifiex_ie_types_htcap *htcap; | 389 | struct mwifiex_ie_types_htcap *htcap; |
390 | struct mwifiex_ie_types_wmmcap *wmm_cap; | ||
357 | struct mwifiex_uap_bss_param *bss_cfg = cmd_buf; | 391 | struct mwifiex_uap_bss_param *bss_cfg = cmd_buf; |
358 | int i; | 392 | int i; |
359 | u16 cmd_size = *param_size; | 393 | u16 cmd_size = *param_size; |
@@ -507,6 +541,16 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) | |||
507 | tlv += sizeof(struct mwifiex_ie_types_htcap); | 541 | tlv += sizeof(struct mwifiex_ie_types_htcap); |
508 | } | 542 | } |
509 | 543 | ||
544 | if (bss_cfg->wmm_info.qos_info != 0xFF) { | ||
545 | wmm_cap = (struct mwifiex_ie_types_wmmcap *)tlv; | ||
546 | wmm_cap->header.type = cpu_to_le16(WLAN_EID_VENDOR_SPECIFIC); | ||
547 | wmm_cap->header.len = cpu_to_le16(sizeof(wmm_cap->wmm_info)); | ||
548 | memcpy(&wmm_cap->wmm_info, &bss_cfg->wmm_info, | ||
549 | sizeof(wmm_cap->wmm_info)); | ||
550 | cmd_size += sizeof(struct mwifiex_ie_types_wmmcap); | ||
551 | tlv += sizeof(struct mwifiex_ie_types_wmmcap); | ||
552 | } | ||
553 | |||
510 | if (bss_cfg->sta_ao_timer) { | 554 | if (bss_cfg->sta_ao_timer) { |
511 | ao_timer = (struct host_cmd_tlv_ageout_timer *)tlv; | 555 | ao_timer = (struct host_cmd_tlv_ageout_timer *)tlv; |
512 | ao_timer->tlv.type = cpu_to_le16(TLV_TYPE_UAP_AO_TIMER); | 556 | ao_timer->tlv.type = cpu_to_le16(TLV_TYPE_UAP_AO_TIMER); |