Patchwork P2P: make p2p_no_group_iface configurable with dbus

login
register
mail settings
Submitter Guoqiang Liu
Date March 17, 2014, 4:54 a.m.
Message ID <1395032040-9146-1-git-send-email-guoqiang.liu@archermind.com>
Download mbox | patch
Permalink /patch/330755/
State Accepted
Headers show

Comments

Guoqiang Liu - March 17, 2014, 4:54 a.m.
From: Guoqiang Liu <guoqiang.liu@archermind.com>

	Some old device need to set p2p_no_group_iface 1 to set up
a p2p connection, So open a dbus interface to configure it.

Signed-off-by: Guoqiang Liu <guoqiang.liu@archermind.com>
---
 wpa_supplicant/dbus/dbus_new_handlers_p2p.c |    8 ++++++++
 1 file changed, 8 insertions(+)
Jouni Malinen - March 21, 2014, 10:44 p.m.
On Mon, Mar 17, 2014 at 12:54:00PM +0800, Guoqiang Liu wrote:
> 	Some old device need to set p2p_no_group_iface 1 to set up
> a p2p connection, So open a dbus interface to configure it.

Thanks, applied.

Patch

diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index 2b83637..6403e14 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -825,6 +825,11 @@  dbus_bool_t wpas_dbus_getter_p2p_device_config(DBusMessageIter *iter,
 					 wpa_s->conf->disassoc_low_ack))
 		goto err_no_mem;
 
+	/* No Group Iface */
+	if (!wpa_dbus_dict_append_bool(&dict_iter, "NoGroupIface",
+				       wpa_s->conf->p2p_no_group_iface))
+		goto err_no_mem;
+
 	if (!wpa_dbus_dict_close_write(&variant_iter, &dict_iter) ||
 	    !dbus_message_iter_close_container(iter, &variant_iter))
 		goto err_no_mem;
@@ -974,6 +979,9 @@  dbus_bool_t wpas_dbus_setter_p2p_device_config(DBusMessageIter *iter,
 		else if (os_strcmp(entry.key, "disassoc_low_ack") == 0 &&
 			 entry.type == DBUS_TYPE_UINT32)
 			wpa_s->conf->disassoc_low_ack = entry.uint32_value;
+		else if ((os_strcmp(entry.key, "NoGroupIface") == 0) &&
+			 (entry.type == DBUS_TYPE_BOOLEAN))
+			wpa_s->conf->p2p_no_group_iface = entry.bool_value;
 		else
 			goto error;