aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-08-30 21:14:26 +0300
committerArik Nemtsov <arik@wizery.com>2012-09-04 20:46:20 +0300
commit0e1be19fca6749a3da319d0d6eec876f88b121c8 (patch)
tree84a3304d19f04a53a53283dda04e79660b95b08c /wpa_supplicant
parentc811c2a5582055a3939511b6d21e8eb23fe25009 (diff)
downloadexternal_wpa_supplicant_8_ti-0e1be19fca6749a3da319d0d6eec876f88b121c8.zip
external_wpa_supplicant_8_ti-0e1be19fca6749a3da319d0d6eec876f88b121c8.tar.gz
external_wpa_supplicant_8_ti-0e1be19fca6749a3da319d0d6eec876f88b121c8.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 and p2p_connect 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.c4
4 files changed, 15 insertions, 2 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index f392497..8bae7b7 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -2994,6 +2994,7 @@ static const struct global_parse_data global_fields[] = {
{ BIN(wps_nfc_dh_privkey), 0 },
{ BIN(wps_nfc_dev_pw), 0 },
{ INT(p2p_go_max_inactivity), 0 },
+ { INT(p2p_go_ht40), 0 },
{ INT_RANGE(sched_scan_num_short_intervals, 0,
MAX_NUM_SCHED_SCAN_SHORT_INTERVALS), 0 },
{ INT_RANGE(sched_scan_short_interval, 1, MAX_SCHED_SCAN_INTERVAL), 0 },
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index fd9ba78..568af0d 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -692,6 +692,16 @@ struct wpa_config {
int p2p_go_max_inactivity;
/**
+ * p2p_go_ht40 - Default mode for HT40 enable when operating as GO.
+ *
+ * This will take effect for p2p_group_add and p2p_connect. 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;
+
+ /**
* sched_scan_short_interval - Initial interval for sched scan in secs
* sched scan will start with this interval for num_short_intervals
* intervals and then switch to a longer interval defined by
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index b99517b..32c6990 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -896,6 +896,8 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->p2p_go_max_inactivity != DEFAULT_P2P_GO_MAX_INACTIVITY)
fprintf(f, "p2p_go_max_inactivity=%u\n",
config->p2p_go_max_inactivity);
+ if (config->p2p_go_ht40)
+ fprintf(f, "p2p_go_ht40=%u\n", config->p2p_go_ht40);
if (config->sched_scan_num_short_intervals !=
DEFAULT_SCHED_SCAN_NUM_SHORT_INTERVALS)
fprintf(f, "sched_scan_num_short_intervals=%u\n",
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index d061630..2fdd535 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -3086,7 +3086,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;
#ifdef ANDROID_P2P
no_p2p_conc = os_strstr(pos, " no_p2p_conc") != NULL;
#endif
@@ -3595,7 +3595,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,