diff options
author | Rajkumar Manoharan <rmanohar@qca.qualcomm.com> | 2012-08-15 23:07:44 +0300 |
---|---|---|
committer | Arik Nemtsov <arik@wizery.com> | 2012-09-04 16:00:29 +0300 |
commit | d6800fcaed9648e29b0ae52f0289c46852cf25b4 (patch) | |
tree | 8b4666b41b6f51953138c05d08ee63366f961d39 | |
parent | 989a796c078f377f1640e42e6c7957effc3c24e2 (diff) | |
download | external_wpa_supplicant_8_ti-d6800fcaed9648e29b0ae52f0289c46852cf25b4.zip external_wpa_supplicant_8_ti-d6800fcaed9648e29b0ae52f0289c46852cf25b4.tar.gz external_wpa_supplicant_8_ti-d6800fcaed9648e29b0ae52f0289c46852cf25b4.tar.bz2 |
P2P: Add optional "ht40" argument for p2p_connect
This can be used to start negotiated GO in 40 MHz channel width
in 5GHz band.
Signed-hostap: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
-rw-r--r-- | wpa_supplicant/ctrl_iface.c | 8 | ||||
-rw-r--r-- | wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 2 | ||||
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 14 | ||||
-rw-r--r-- | wpa_supplicant/p2p_supplicant.h | 2 | ||||
-rw-r--r-- | wpa_supplicant/wpa_cli.c | 2 | ||||
-rw-r--r-- | wpa_supplicant/wpa_supplicant_i.h | 1 |
6 files changed, 21 insertions, 8 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index d59e6e0..d061630 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3050,13 +3050,15 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, int go_intent = -1; int freq = 0; int pd; + int ht40; #ifdef ANDROID_P2P int no_p2p_conc; #endif /* <addr> <"pbc" | "pin" | PIN> [label|display|keypad] * [persistent|persistent=<network id>] - * [join] [auth] [go_intent=<0..15>] [freq=<in MHz>] [provdisc] */ + * [join] [auth] [go_intent=<0..15>] [freq=<in MHz>] [provdisc] + * [ht40] */ if (hwaddr_aton(cmd, addr)) return -1; @@ -3084,6 +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; #ifdef ANDROID_P2P no_p2p_conc = os_strstr(pos, " no_p2p_conc") != NULL; #endif @@ -3142,7 +3145,8 @@ static int p2p_ctrl_connect(struct wpa_supplicant *wpa_s, char *cmd, new_pin = wpas_p2p_connect(wpa_s, addr, pin, wps_method, persistent_group, automatic, join, - auth, go_intent, freq, persistent_id, pd); + auth, go_intent, freq, persistent_id, pd, + ht40); if (new_pin == -2) { os_memcpy(buf, "FAIL-CHANNEL-UNAVAILABLE\n", 25); return 25; diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index 6599e8a..241a2e8 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -504,7 +504,7 @@ DBusMessage * wpas_dbus_handler_p2p_connect(DBusMessage *message, new_pin = wpas_p2p_connect(wpa_s, addr, pin, wps_method, persistent_group, 0, join, authorize_only, - go_intent, freq, -1, 0); + go_intent, freq, -1, 0, 0); if (new_pin >= 0) { char npin[9]; diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 8f35aab..fb0c45b 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -1031,6 +1031,9 @@ void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res) return; } + if (wpa_s->p2p_go_ht40) + res->ht40 = 1; + wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_GO_NEG_SUCCESS); wpas_notify_p2p_go_neg_completed(wpa_s, res); @@ -2884,7 +2887,8 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s, wpa_s->p2p_go_intent, wpa_s->p2p_connect_freq, wpa_s->p2p_persistent_id, - wpa_s->p2p_pd_before_go_neg); + wpa_s->p2p_pd_before_go_neg, + wpa_s->p2p_go_ht40); return; } @@ -3170,6 +3174,7 @@ static int wpas_p2p_join_start(struct wpa_supplicant *wpa_s) * parameters or -1 to generate new values (SSID/passphrase) * @pd: Whether to send Provision Discovery prior to GO Negotiation as an * interoperability workaround when initiating group formation + * @ht40: Start GO with 40 MHz channel width * Returns: 0 or new PIN (if pin was %NULL) on success, -1 on unspecified * failure, -2 on failure due to channel not currently available, * -3 if forced channel is not supported @@ -3177,7 +3182,8 @@ static int wpas_p2p_join_start(struct wpa_supplicant *wpa_s) int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr, const char *pin, enum p2p_wps_method wps_method, int persistent_group, int auto_join, int join, int auth, - int go_intent, int freq, int persistent_id, int pd) + int go_intent, int freq, int persistent_id, int pd, + int ht40) { int force_freq = 0, oper_freq = 0; u8 bssid[ETH_ALEN]; @@ -3209,6 +3215,7 @@ int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr, wpa_s->p2p_connect_freq = freq; wpa_s->p2p_fallback_to_go_neg = 0; wpa_s->p2p_pd_before_go_neg = !!pd; + wpa_s->p2p_go_ht40 = !!ht40; if (pin) os_strlcpy(wpa_s->p2p_pin, pin, sizeof(wpa_s->p2p_pin)); @@ -5064,7 +5071,8 @@ static void wpas_p2p_fallback_to_go_neg(struct wpa_supplicant *wpa_s, wpa_s->p2p_wps_method, wpa_s->p2p_persistent_group, 0, 0, 0, wpa_s->p2p_go_intent, wpa_s->p2p_connect_freq, wpa_s->p2p_persistent_id, - wpa_s->p2p_pd_before_go_neg); + wpa_s->p2p_pd_before_go_neg, + wpa_s->p2p_go_ht40); } diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplicant.h index 13d408c..f24fb28 100644 --- a/wpa_supplicant/p2p_supplicant.h +++ b/wpa_supplicant/p2p_supplicant.h @@ -21,7 +21,7 @@ int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr, const char *pin, enum p2p_wps_method wps_method, int persistent_group, int auto_join, int join, int auth, int go_intent, int freq, int persistent_id, - int pd); + int pd, int ht40); void wpas_p2p_remain_on_channel_cb(struct wpa_supplicant *wpa_s, unsigned int freq, unsigned int duration); void wpas_p2p_cancel_remain_on_channel_cb(struct wpa_supplicant *wpa_s, diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index b9164e7..3f94854 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -3270,7 +3270,7 @@ static struct wpa_cli_cmd wpa_cli_commands[] = { { "p2p_stop_find", wpa_cli_cmd_p2p_stop_find, cli_cmd_flag_none, "= stop P2P Devices search" }, { "p2p_connect", wpa_cli_cmd_p2p_connect, cli_cmd_flag_none, - "<addr> <\"pbc\"|PIN> = connect to a P2P Devices" }, + "<addr> <\"pbc\"|PIN> [ht40] = connect to a P2P Device" }, { "p2p_listen", wpa_cli_cmd_p2p_listen, cli_cmd_flag_none, "[timeout] = listen for P2P Devices for up-to timeout seconds" }, { "p2p_group_remove", wpa_cli_cmd_p2p_group_remove, cli_cmd_flag_none, diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 9968386..74faada 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -541,6 +541,7 @@ struct wpa_supplicant { unsigned int p2p_persistent_group:1; unsigned int p2p_fallback_to_go_neg:1; unsigned int p2p_pd_before_go_neg:1; + unsigned int p2p_go_ht40:1; int p2p_persistent_id; int p2p_go_intent; int p2p_connect_freq; |