aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-09-30 17:35:51 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-30 17:35:51 (GMT)
commita93a15bbfd43e70393974da81deb12cdb4e85ebd (patch)
tree9b4e70527c53d6da3f1b42cd3877bfb6823accd1 /wpa_supplicant
parent369c8d7bcd1ad7f96db31df14361f67146d568c0 (diff)
downloadhostap-a93a15bbfd43e70393974da81deb12cdb4e85ebd.zip
hostap-a93a15bbfd43e70393974da81deb12cdb4e85ebd.tar.gz
hostap-a93a15bbfd43e70393974da81deb12cdb4e85ebd.tar.bz2
P2P: Add a conf parameter to start a GO as HT40 if allowed
When specified in the conf file this parameter will make all invocations of p2p_group_add, p2p_connect, and p2p_invite behave as if "ht40" has been specified on the command line. This shouldn't do harm since regulatory constraints and driver capabilities are consulted anyway before starting HT40 mode. Signed-hostap: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/config.c1
-rw-r--r--wpa_supplicant/config.h10
-rw-r--r--wpa_supplicant/config_file.c2
-rw-r--r--wpa_supplicant/ctrl_iface.c6
4 files changed, 16 insertions, 3 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 674766e..2b66c01 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -3006,6 +3006,7 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(p2p_intra_bss, 0, 1), CFG_CHANGED_P2P_INTRA_BSS },
{ INT(p2p_group_idle), 0 },
{ FUNC(p2p_pref_chan), CFG_CHANGED_P2P_PREF_CHAN },
+ { INT(p2p_go_ht40), 0 },
#endif /* CONFIG_P2P */
{ FUNC(country), CFG_CHANGED_COUNTRY },
{ INT(bss_max_count), 0 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index b889ab8..02fc596 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -747,6 +747,16 @@ struct wpa_config {
* matching network block
*/
int auto_interworking;
+
+ /**
+ * p2p_go_ht40 - Default mode for HT40 enable when operating as GO.
+ *
+ * This will take effect for p2p_group_add, p2p_connect, and p2p_invite.
+ * Note that regulatory constraints and driver capabilities are
+ * consulted anyway, so setting it to 1 can't do real harm.
+ * By default: 0 (disabled)
+ */
+ int p2p_go_ht40;
};
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index 531957a..bd9c17f 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -868,6 +868,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
}
fprintf(f, "\n");
}
+ if (config->p2p_go_ht40)
+ fprintf(f, "p2p_go_ht40=%u\n", config->p2p_go_ht40);
#endif /* CONFIG_P2P */
if (config->country[0] && config->country[1]) {
fprintf(f, "country=%c%c\n",
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index e209d8a..3a4364a 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -3241,7 +3241,7 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd,
auth = os_strstr(pos, " auth") != NULL;
automatic = os_strstr(pos, " auto") != NULL;
pd = os_strstr(pos, " provdisc") != NULL;
- ht40 = os_strstr(pos, " ht40") != NULL;
+ ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40;
pos2 = os_strstr(pos, " go_intent=");
if (pos2) {
@@ -3672,7 +3672,7 @@ static int p2p_ctrl_invite_persistent(struct wpa_supplicant *wpa_s, char *cmd)
return -1;
}
- ht40 = os_strstr(cmd, " ht40") != NULL;
+ ht40 = (os_strstr(cmd, " ht40") != NULL) || wpa_s->conf->p2p_go_ht40;
return wpas_p2p_invite(wpa_s, _peer, ssid, NULL, freq, ht40);
}
@@ -3748,7 +3748,7 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
if (pos)
freq = atoi(pos + 5);
- ht40 = os_strstr(cmd, "ht40") != NULL;
+ ht40 = (os_strstr(cmd, "ht40") != NULL) || wpa_s->conf->p2p_go_ht40;
if (os_strncmp(cmd, "persistent=", 11) == 0)
return p2p_ctrl_group_add_persistent(wpa_s, cmd + 11, freq,