aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorYoni Divinsky <yoni.divinsky@ti.com>2012-07-10 19:32:18 +0300
committerArik Nemtsov <arik@wizery.com>2012-07-30 17:48:04 +0300
commit549cc6951ce88bf063939f2d467bbd5499df32ac (patch)
treefaacbd355dc9cf5114c286d02969bb3ff9707c65 /src/common
parent748313224b1f3920a49c6985c9580872bf232b45 (diff)
downloadexternal_wpa_supplicant_8_ti-549cc6951ce88bf063939f2d467bbd5499df32ac.zip
external_wpa_supplicant_8_ti-549cc6951ce88bf063939f2d467bbd5499df32ac.tar.gz
external_wpa_supplicant_8_ti-549cc6951ce88bf063939f2d467bbd5499df32ac.tar.bz2
P2P: enable to set in the conf file the wmm params
In case of P2P GO, the wpa_supplicant uses the default hostapd parameters. In the default parameters the ACM bit for video and voice are set to 1, meaning, P2P devices and stations which are connected to the GO cannot pass voice or video data packets. Signed-hostap: Yoni Divinsky <yoni.divinsky@ti.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/wpa_common.c70
-rw-r--r--src/common/wpa_common.h9
2 files changed, 79 insertions, 0 deletions
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index 7a013a8..b339e2e 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -989,6 +989,76 @@ int wpa_compare_rsn_ie(int ft_initial_assoc,
return -1;
}
+int wpa_config_wmm_ac(struct wpa_wmm_ac_params wmm_ac_params[], char *name,
+ char *val)
+{
+ int num, v;
+ char *pos;
+ struct wpa_wmm_ac_params *ac;
+
+ /* skip 'wme_ac_' or 'wmm_ac_' prefix */
+ pos = name + 7;
+ if (os_strncmp(pos, "be_", 3) == 0) {
+ num = 0;
+ pos += 3;
+ } else if (os_strncmp(pos, "bk_", 3) == 0) {
+ num = 1;
+ pos += 3;
+ } else if (os_strncmp(pos, "vi_", 3) == 0) {
+ num = 2;
+ pos += 3;
+ } else if (os_strncmp(pos, "vo_", 3) == 0) {
+ num = 3;
+ pos += 3;
+ } else {
+ wpa_printf(MSG_ERROR, "Unknown WMM name '%s'", pos);
+ return -1;
+ }
+
+ ac = &wmm_ac_params[num];
+
+ if (os_strcmp(pos, "aifs") == 0) {
+ v = atoi(val);
+ if (v < 1 || v > 255) {
+ wpa_printf(MSG_ERROR, "Invalid AIFS value %d", v);
+ return -1;
+ }
+ ac->aifs = v;
+ } else if (os_strcmp(pos, "cwmin") == 0) {
+ v = atoi(val);
+ if (v < 0 || v > 12) {
+ wpa_printf(MSG_ERROR, "Invalid cwMin value %d", v);
+ return -1;
+ }
+ ac->cwmin = v;
+ } else if (os_strcmp(pos, "cwmax") == 0) {
+ v = atoi(val);
+ if (v < 0 || v > 12) {
+ wpa_printf(MSG_ERROR, "Invalid cwMax value %d", v);
+ return -1;
+ }
+ ac->cwmax = v;
+ } else if (os_strcmp(pos, "txop_limit") == 0) {
+ v = atoi(val);
+ if (v < 0 || v > 0xffff) {
+ wpa_printf(MSG_ERROR, "Invalid txop value %d", v);
+ return -1;
+ }
+ ac->txop_limit = v;
+ } else if (os_strcmp(pos, "acm") == 0) {
+ v = atoi(val);
+ if (v < 0 || v > 1) {
+ wpa_printf(MSG_ERROR, "Invalid acm value %d", v);
+ return -1;
+ }
+ ac->admission_control_mandatory = v;
+ } else {
+ wpa_printf(MSG_ERROR, "Unknown wmm_ac_ field '%s'", pos);
+ return -1;
+ }
+
+ return 0;
+}
#ifdef CONFIG_IEEE80211R
int wpa_insert_pmkid(u8 *ies, size_t ies_len, const u8 *pmkid)
diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
index 6b50997..a553b2f 100644
--- a/src/common/wpa_common.h
+++ b/src/common/wpa_common.h
@@ -296,6 +296,13 @@ struct rsn_rdie {
#pragma pack(pop)
#endif /* _MSC_VER */
+struct wpa_wmm_ac_params {
+ int cwmin;
+ int cwmax;
+ int aifs;
+ int txop_limit; /* in units of 32us */
+ int admission_control_mandatory;
+};
int wpa_eapol_key_mic(const u8 *key, int ver, const u8 *buf, size_t len,
u8 *mic);
@@ -375,4 +382,6 @@ struct wpa_ft_ies {
int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse);
+int wpa_config_wmm_ac(struct wpa_wmm_ac_params wmm_ac_params[], char *name,
+ char *val);
#endif /* WPA_COMMON_H */