diff mbox

P2P: WFD primitives support patch.

Message ID 1343024650-29024-1-git-send-email-nirav.j2.shah@intel.com
State Changes Requested
Headers show

Commit Message

nirav shah July 23, 2012, 6:24 a.m. UTC
Add functionality to expose following additional properties

P2PDevice:
        - ProbeRequestIEs
        - ProbeResponseIEs

When the probe request/response are set they get appended to
the respective messages. These IEs can be used by the higher
layer application such as wifi display to encode specific
information required for its operation

Signed-off-by: Nirav Shah <nirav.j2.shah@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
---
 src/p2p/p2p.c                               |   94 +++++++++-
 src/p2p/p2p.h                               |   62 +++++++
 src/p2p/p2p_build.c                         |   18 ++
 src/p2p/p2p_group.c                         |    4 +-
 src/p2p/p2p_i.h                             |   16 ++
 wpa_supplicant/config.h                     |   27 ++-
 wpa_supplicant/dbus/dbus_new.c              |    8 +
 wpa_supplicant/dbus/dbus_new_handlers_p2p.c |  247 +++++++++++++++++++++++++++
 wpa_supplicant/dbus/dbus_new_handlers_p2p.h |   16 ++
 wpa_supplicant/p2p_supplicant.c             |   41 +++++
 10 files changed, 529 insertions(+), 4 deletions(-)

Comments

Jouni Malinen July 24, 2012, 8:47 a.m. UTC | #1
On Sun, Jul 22, 2012 at 11:24:10PM -0700, Nirav Shah wrote:
> Add functionality to expose following additional properties
> 
> P2PDevice:
>         - ProbeRequestIEs
>         - ProbeResponseIEs
> 
> When the probe request/response are set they get appended to
> the respective messages. These IEs can be used by the higher
> layer application such as wifi display to encode specific
> information required for its operation

Please note that I'm planning on committing a different way of
addressing Wi-Fi Display support as soon as the specification gets
published. As such, I'm not sure whether these changes to introduce IEs
into Probe Request/Response frames are really needed. Or are you
planning on using these for some other purposes? Please note that these
are not sufficient for Wi-Fi Display support.
nirav shah July 24, 2012, 6:53 p.m. UTC | #2
I know these are not sufficient for entire WFD support. This is just an initial patch to put forth a method to address the needs of wifi display. If this method is agreeable I do have a few more patches which do the same thing on other Management frames. 

Can you elaborate on what your suggestions are for how to implement WFD. 



-----Original Message-----
From: Jouni Malinen [mailto:j@w1.fi] 
Sent: Tuesday, July 24, 2012 1:47 AM
To: Shah, Nirav J2
Cc: hostap@lists.shmoo.com; Sane, Jayant
Subject: Re: [PATCH] P2P: WFD primitives support patch.

On Sun, Jul 22, 2012 at 11:24:10PM -0700, Nirav Shah wrote:
> Add functionality to expose following additional properties
> 
> P2PDevice:
>         - ProbeRequestIEs
>         - ProbeResponseIEs
> 
> When the probe request/response are set they get appended to the 
> respective messages. These IEs can be used by the higher layer 
> application such as wifi display to encode specific information 
> required for its operation

Please note that I'm planning on committing a different way of addressing Wi-Fi Display support as soon as the specification gets published. As such, I'm not sure whether these changes to introduce IEs into Probe Request/Response frames are really needed. Or are you planning on using these for some other purposes? Please note that these are not sufficient for Wi-Fi Display support.
Jouni Malinen Aug. 29, 2012, 7:07 p.m. UTC | #3
On Tue, Jul 24, 2012 at 06:53:07PM +0000, Shah, Nirav J2 wrote:
> I know these are not sufficient for entire WFD support. This is just an initial patch to put forth a method to address the needs of wifi display. If this method is agreeable I do have a few more patches which do the same thing on other Management frames. 
> 
> Can you elaborate on what your suggestions are for how to implement WFD. 

Sorry for the delay in this, but this was a bit difficult area for an
open source project.. Anyway, I have now pushed a set of patches to
allow WFD extensions to be used with wpa_supplicant (the commits are in
hostap.git master branch). I'm interested in hearing if this meets your
needs or if there are areas that would benefit of additional
extensions/changes. One obvious missing part is in the D-Bus interface
to control the new mechanisms to configure WFD subelements.
diff mbox

Patch

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 35dc195..6cf6ff1 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -1794,8 +1794,10 @@  struct wpabuf * p2p_build_probe_resp_ies(struct p2p_data *p2p)
 	struct wpabuf *buf;
 	u8 *len;
 	int pw_id = -1;
+	struct wpabuf *custom_ies[P2P_MAX_PROBE_RESPONSE_IES];
+	int i = 0, num_ies = 0;
 
-	buf = wpabuf_alloc(1000);
+	buf = wpabuf_alloc(1500);
 	if (buf == NULL)
 		return NULL;
 
@@ -1816,6 +1818,17 @@  struct wpabuf * p2p_build_probe_resp_ies(struct p2p_data *p2p)
 	p2p_buf_add_device_info(buf, p2p, NULL);
 	p2p_buf_update_ie_hdr(buf, len);
 
+	/* Add custom ies corresponding to the device */
+	 num_ies = 0;
+	for (i = 0; i < P2P_MAX_PROBE_RESPONSE_IES; i++) {
+		if (p2p->proberesp_ies[i])
+			custom_ies[num_ies++] = p2p->proberesp_ies[i];
+	}
+	if (num_ies)
+		p2p_buf_add_custom_ies(buf, custom_ies, num_ies);
+
+	wpa_hexdump(MSG_DEBUG, "Probe response IEs: ",
+	wpabuf_head(buf), wpabuf_len(buf));
 	return buf;
 }
 
@@ -2479,6 +2492,73 @@  int p2p_add_wps_vendor_extension(struct p2p_data *p2p,
 	return 0;
 }
 
+void p2p_remove_all_probereq_ies(struct p2p_data *p2p)
+{
+	int i;
+
+	for (i = 0; i < P2P_MAX_PROBE_REQUEST_IES; i++) {
+		wpabuf_free(p2p->probereq_ies[i]);
+		p2p->probereq_ies[i] = NULL;
+	}
+}
+
+
+int p2p_add_probereq_ies(struct p2p_data *p2p,
+				 const struct wpabuf *ie)
+{
+	int i;
+
+	if (ie == NULL)
+		return -1;
+
+	for (i = 0; i < P2P_MAX_PROBE_REQUEST_IES; i++) {
+		if (p2p->probereq_ies[i] == NULL)
+			break;
+	}
+	if (i >= P2P_MAX_PROBE_REQUEST_IES)
+		return -1;
+
+	p2p->probereq_ies[i] = wpabuf_dup(ie);
+	if (p2p->probereq_ies[i] == NULL)
+		return -1;
+
+	return 0;
+}
+
+
+void p2p_remove_all_proberesp_ies(struct p2p_data *p2p)
+{
+	int i;
+
+	for (i = 0; i < P2P_MAX_PROBE_RESPONSE_IES; i++) {
+		wpabuf_free(p2p->proberesp_ies[i]);
+		p2p->proberesp_ies[i] = NULL;
+	}
+}
+
+
+int p2p_add_proberesp_ies(struct p2p_data *p2p,
+				 const struct wpabuf *ie)
+{
+	int i;
+
+	if (ie == NULL)
+		return -1;
+
+	for (i = 0; i < P2P_MAX_PROBE_RESPONSE_IES; i++) {
+		if (p2p->proberesp_ies[i] == NULL)
+			break;
+	}
+	if (i >= P2P_MAX_PROBE_RESPONSE_IES)
+		return -1;
+
+	p2p->proberesp_ies[i] = wpabuf_dup(ie);
+	if (p2p->proberesp_ies[i] == NULL)
+		return -1;
+
+	return 0;
+}
+
 
 int p2p_set_country(struct p2p_data *p2p, const char *country)
 {
@@ -2650,6 +2730,9 @@  void p2p_scan_res_handled(struct p2p_data *p2p)
 
 void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id)
 {
+	int i, num_ies;
+	struct wpabuf *custom_ies[P2P_MAX_PROBE_RESPONSE_IES];
+
 	u8 *len = p2p_buf_add_ie_hdr(ies);
 	p2p_buf_add_capability(ies, p2p->dev_capab &
 			       ~P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY, 0);
@@ -2664,6 +2747,15 @@  void p2p_scan_ie(struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id)
 					      p2p->ext_listen_interval);
 	/* TODO: p2p_buf_add_operating_channel() if GO */
 	p2p_buf_update_ie_hdr(ies, len);
+
+	/* Set the custom IEs to be used in probe requests */
+	num_ies = 0;
+	for (i = 0; i < P2P_MAX_PROBE_REQUEST_IES; i++) {
+		if (p2p->probereq_ies[i])
+			custom_ies[num_ies++] = p2p->probereq_ies[i];
+	}
+	if (num_ies)
+		p2p_buf_add_custom_ies(ies, custom_ies, num_ies);
 }
 
 
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index 7e47270..e380f27 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -20,6 +20,23 @@ 
 #define P2P_MAX_REG_CLASS_CHANNELS 20
 
 /**
+ * P2P_MAX_PROBE_REQUEST_IES	- Maximum number of custom IEs that can
+ *				  added to probe requests
+ */
+#define P2P_MAX_PROBE_REQUEST_IES 10
+
+/**
+ * P2P_MAX_PROBE_RESPONSE_IES	- Maximum number of custom IEs that can
+ *				  added to probe responses (either to a
+ *				  p2p device or a group owner
+ */
+#define P2P_MAX_PROBE_RESPONSE_IES 10
+/**
+ * P2P_CUSTOM_IES_MAX_BYTE_SIZE Maximum size of each element of custom
+ *				ies in terms of number of bytes
+ */
+#define P2P_CUSTOM_IES_MAX_BYTE_SIZE 255
+/**
  * struct p2p_channels - List of supported channels
  */
 struct p2p_channels {
@@ -1660,6 +1677,51 @@  int p2p_add_wps_vendor_extension(struct p2p_data *p2p,
 				 const struct wpabuf *vendor_ext);
 
 /**
+ * p2p_remove_all_probereq_ies - Remove all the custom IEs associated with
+ *				 probe requests
+ * @p2p: P2P module context from p2p_init()
+ */
+void p2p_remove_all_probereq_ies(struct p2p_data *p2p);
+
+/**
+ * p2p_add_probereq_ie - Add a custom IE to be attached to probe requests
+ * @p2p: P2P module context from p2p_init()
+ * @ie: The IE to add (for attaching to probe requests)
+ * Returns: 0 on success, -1 on failure
+ *
+ * The wpabuf structures in the array are owned by the P2P
+ * module after this call.
+ */
+int p2p_add_probereq_ies(struct p2p_data *p2p,
+				 const struct wpabuf *ie);
+
+/**
+ * p2p_remove_all_proberesp_ies - Remove all the custom IEs associated with
+ *				 probe responses
+ * @p2p: P2P module context from p2p_init()
+ */
+void p2p_remove_all_proberesp_ies(struct p2p_data *p2p);
+
+/**
+ * p2p_add_proberesp_ie - Add a custom IE to be attached to probe responses
+ * @p2p: P2P module context from p2p_init()
+ * @ie: The IE to add (for attaching to probe responses)
+ * Returns: 0 on success, -1 on failure
+ *
+ * The wpabuf structures in the array are owned by the P2P
+ * module after this call.
+ */
+int p2p_add_proberesp_ies(struct p2p_data *p2p,
+				 const struct wpabuf *ie);
+/**
+ * p2p_group_update_ies - update probe response of the group with
+ * corresponding IEs.
+ * @group: Per-group P2P state for GO
+ * Returns: 0 on success, -1 on failure
+ */
+void p2p_group_update_ies(struct p2p_group *group);
+
+/**
  * p2p_set_oper_channel - Set the P2P operating channel
  * @p2p: P2P module context from p2p_init()
  * @op_reg_class: Operating regulatory class to set
diff --git a/src/p2p/p2p_build.c b/src/p2p/p2p_build.c
index def422d..3dcc569 100644
--- a/src/p2p/p2p_build.c
+++ b/src/p2p/p2p_build.c
@@ -428,3 +428,21 @@  void p2p_build_wps_ie(struct p2p_data *p2p, struct wpabuf *buf, int pw_id,
 
 	p2p_buf_update_ie_hdr(buf, len);
 }
+
+
+/*
+ * In order to support additional usages based on P2P there would be a need
+ * to add custom IEs to probe requests/responses transmitted by a P2P device.
+ * This utility method would allow doing that.
+ */
+void p2p_buf_add_custom_ies(struct wpabuf *buf, struct wpabuf *ies[], int num)
+{
+	int i;
+
+	for (i = 0; i < num; i++) {
+		if (wpabuf_tailroom(buf) <
+			wpabuf_len(ies[i]))
+			continue;
+		wpabuf_put_buf(buf, ies[i]);
+	}
+}
diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c
index 8d4a3cb..4d2aee8 100644
--- a/src/p2p/p2p_group.c
+++ b/src/p2p/p2p_group.c
@@ -40,7 +40,7 @@  struct p2p_group {
 };
 
 
-static void p2p_group_update_ies(struct p2p_group *group);
+void p2p_group_update_ies(struct p2p_group *group);
 
 
 struct p2p_group * p2p_group_init(struct p2p_data *p2p,
@@ -220,7 +220,7 @@  static struct wpabuf * p2p_group_build_probe_resp_ie(struct p2p_group *group)
 }
 
 
-static void p2p_group_update_ies(struct p2p_group *group)
+void p2p_group_update_ies(struct p2p_group *group)
 {
 	struct wpabuf *beacon_ie;
 	struct wpabuf *probe_resp_ie;
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index 39e879e..629fa0f 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -424,6 +424,20 @@  struct p2p_data {
 	 * in IDLE state.
 	 */
 	int pd_retries;
+
+	/*
+	 * Custom IES set to provide specific upper layer information
+	 * (example Wifi Display) during probe request. These are not
+	 * associated to vendor specific information.
+	 */
+	struct wpabuf *probereq_ies[P2P_MAX_PROBE_REQUEST_IES];
+
+	/*
+	 * Custom IES set to provide specific upper layer information
+	 * (example Wifi Display) during probe response. These are not
+	 * associated to vendor specific information.
+	 */
+	struct wpabuf *proberesp_ies[P2P_MAX_PROBE_RESPONSE_IES];
 };
 
 /**
@@ -582,6 +596,8 @@  void p2p_buf_add_noa(struct wpabuf *buf, u8 noa_index, u8 opp_ps, u8 ctwindow,
 		     struct p2p_noa_desc *desc1, struct p2p_noa_desc *desc2);
 void p2p_buf_add_ext_listen_timing(struct wpabuf *buf, u16 period,
 				   u16 interval);
+void p2p_buf_add_custom_ies(struct wpabuf *buf, struct wpabuf *ies[],
+				int num);
 void p2p_buf_add_p2p_interface(struct wpabuf *buf, struct p2p_data *p2p);
 void p2p_build_wps_ie(struct p2p_data *p2p, struct wpabuf *buf, int pw_id,
 		      int all_attr);
diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
index 46c4da2..7cc2eaa 100644
--- a/wpa_supplicant/config.h
+++ b/wpa_supplicant/config.h
@@ -27,7 +27,6 @@ 
 #include "config_ssid.h"
 #include "wps/wps.h"
 
-
 struct wpa_cred {
 	/**
 	 * next - Next credential in the list
@@ -165,6 +164,8 @@  struct wpa_cred {
 #define CFG_CHANGED_P2P_LISTEN_CHANNEL BIT(11)
 #define CFG_CHANGED_P2P_OPER_CHANNEL BIT(12)
 #define CFG_CHANGED_P2P_PREF_CHAN BIT(13)
+#define CFG_CHANGED_P2P_PROBEREQ_IES BIT(14)
+#define CFG_CHANGED_P2P_PROBERESP_IES BIT(15)
 
 /**
  * struct wpa_config - wpa_supplicant configuration data
@@ -661,6 +662,30 @@  struct wpa_config {
 	 * wps_nfc_dh_pubkey - NFC Device Password for password token
 	 */
 	struct wpabuf *wps_nfc_dev_pw;
+/**
+ * P2P_MAX_PROBE_REQUEST_IES	- Maximum number of custom IEs that can
+ *				  added to probe requests
+ */
+#define P2P_MAX_PROBE_REQUEST_IES 10
+
+/**
+ * P2P_MAX_PROBE_RESPONSE_IES	- Maximum number of custom IEs that can
+ *				  added to probe responses (either to a
+ *				  p2p device or a group owner
+ */
+#define P2P_MAX_PROBE_RESPONSE_IES 10
+	/*
+	 * Custom IES set to provide specific upper layer information
+	 * (example Wifi Display) during probe request. These are not
+	 * associated to vendor specific information.
+	 */
+	struct wpabuf *probereq_ies[P2P_MAX_PROBE_REQUEST_IES];
+	/*
+	 * Custom IES set to provide specific upper layer information
+	 * (example Wifi Display) during probe response. These are not
+	 * associated to vendor specific information.
+	 */
+	struct wpabuf *proberesp_ies[P2P_MAX_PROBE_RESPONSE_IES];
 };
 
 
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index a9957ab..23dbd4d 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -2749,6 +2749,14 @@  static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
 	  wpas_dbus_getter_persistent_groups,
 	  NULL
 	},
+	{ "ProbeRequestIEs", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "aay",
+	  wpas_dbus_getter_p2p_probereq_ies,
+	  wpas_dbus_setter_p2p_probereq_ies,
+	},
+	{ "ProbeResponseIEs", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "aay",
+	  wpas_dbus_getter_p2p_proberesp_ies,
+	  wpas_dbus_setter_p2p_proberesp_ies,
+	},
 #endif /* CONFIG_P2P */
 	{ "DisconnectReason", WPAS_DBUS_NEW_IFACE_INTERFACE, "i",
 	  wpas_dbus_getter_disconnect_reason,
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index f4541f7..c503050 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -2134,6 +2134,253 @@  error:
 	return wpas_dbus_error_invalid_args(message, NULL);
 }
 
+/**
+ * wpas_dbus_getter_p2p_probereq_ies - Get the custom ies set for
+ *	p2p probe request from the supplicant
+ * @iter: Pointer to incoming dbus message iter
+ * @error: Location to store error on failure
+ * @user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "Properties" property of a p2p device.
+ */
+dbus_bool_t wpas_dbus_getter_p2p_probereq_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data)
+{
+	struct wpa_supplicant *wpa_s = user_data;
+	struct wpabuf *probereq_ies[P2P_MAX_PROBE_REQUEST_IES];
+	int num_ies, i;
+
+	/* Probe request IEs */
+	num_ies = 0;
+	for (i = 0; i < P2P_MAX_PROBE_REQUEST_IES; i++) {
+		if (wpa_s->conf->probereq_ies[i] == NULL)
+			continue;
+		probereq_ies[num_ies++] =
+			wpa_s->conf->probereq_ies[i];
+	}
+
+	if (!wpas_dbus_simple_array_array_property_getter(iter,
+			DBUS_TYPE_BYTE,
+			probereq_ies, num_ies,
+			error)) {
+		dbus_set_error_const(error, DBUS_ERROR_FAILED,
+				"no memory");
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+/**
+ * wpas_dbus_getter_p2p_proberesp_ies - Get the custom ies set for
+ *	p2p probe response from the supplicant
+ * @iter: Pointer to incoming dbus message iter
+ * @error: Location to store error on failure
+ * @user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "Properties" property of a p2p device.
+ */
+dbus_bool_t wpas_dbus_getter_p2p_proberesp_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data)
+{
+	struct wpa_supplicant *wpa_s = user_data;
+	struct wpabuf *proberesp_ies[P2P_MAX_PROBE_RESPONSE_IES];
+	int num_ies, i;
+
+	/* Probe response IEs */
+	num_ies = 0;
+	for (i = 0; i < P2P_MAX_PROBE_RESPONSE_IES; i++) {
+		if (wpa_s->conf->proberesp_ies[i] == NULL)
+			continue;
+		proberesp_ies[num_ies++] =
+		wpa_s->conf->proberesp_ies[i];
+	}
+
+	if (!wpas_dbus_simple_array_array_property_getter(iter,
+			DBUS_TYPE_BYTE,
+			proberesp_ies, num_ies,
+			error)) {
+		dbus_set_error_const(error, DBUS_ERROR_FAILED,
+			"no memory");
+	return FALSE;
+	}
+
+	return TRUE;
+}
+
+/**
+ * PRIVATE read_byte_array_from_dbus - Reads an array of bytes from the
+ *	dbus. Can be called by setter call-backs
+ * @iter: Pointer to incoming dbus message iter
+ * @dest: Copy read data into the wpabuf struct
+ * @max_byte_len: Maximum size of the data to be read
+ * Returns: data_len: The size of the data read in bytes
+ */
+
+static int read_byte_array_from_dbus(DBusMessageIter iter,
+				u8 *dest, int max_byte_length)
+{
+
+	int blob_len = 0;
+	DBusMessageIter simple_iter;
+
+	dbus_message_iter_recurse(&iter, &simple_iter);
+
+	while (dbus_message_iter_get_arg_type(&simple_iter) ==
+		DBUS_TYPE_BYTE) {
+		/* There is more data */
+		if (blob_len == max_byte_length) {
+
+			/*Reached max size, cannot read any more data*/
+			wpa_printf(MSG_DEBUG, "DBUS: Read Failed, "
+				"Data too big: Max size = %d", max_byte_length);
+			return -1;
+		}
+
+		/* Read the next byte*/
+		dbus_message_iter_get_basic(&simple_iter,
+				&dest[blob_len]);
+
+		dbus_message_iter_next(&simple_iter);
+		wpa_printf(MSG_DEBUG, "%x ", dest[blob_len]);
+		blob_len++;
+	}
+
+	return blob_len;
+}
+
+/**
+ * wpas_dbus_setter_p2p_probereq_ies - Set the custom ies information
+ *	to be used by the supplicant for probe request
+ * @iter: Pointer to incoming dbus message iter
+ * @error: Location to store error on failure
+ * @user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Setter for "Properties" property of a p2p device.
+ */
+
+dbus_bool_t wpas_dbus_setter_p2p_probereq_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data)
+{
+	struct wpa_supplicant *wpa_s = user_data;
+	DBusMessageIter variant_iter, array_iter;
+	u8 blob_data[P2P_CUSTOM_IES_MAX_BYTE_SIZE];
+	int num_ies = 0, i = 0, blob_len = 0;
+	struct wpabuf *probereq_ies[P2P_MAX_PROBE_REQUEST_IES];
+
+	dbus_message_iter_recurse(iter, &variant_iter);
+	if (dbus_message_iter_get_arg_type(&variant_iter) != DBUS_TYPE_ARRAY)
+		return FALSE;
+
+	dbus_message_iter_recurse(&variant_iter, &array_iter);
+
+	while ((num_ies < P2P_MAX_PROBE_REQUEST_IES) &&
+		(dbus_message_iter_get_arg_type(&array_iter) ==
+			DBUS_TYPE_ARRAY)) {
+		/* Read the next byte array from the dbus*/
+		blob_len = read_byte_array_from_dbus(array_iter, &blob_data[0],
+				P2P_CUSTOM_IES_MAX_BYTE_SIZE);
+		if (blob_len < 0)
+			continue;
+
+		probereq_ies[num_ies] = wpabuf_alloc_copy(blob_data, blob_len);
+		if (probereq_ies[num_ies] == NULL)
+			goto error;
+		num_ies++;
+		dbus_message_iter_next(&array_iter);
+	}
+	/* Save data */
+	for (i = 0; i < P2P_MAX_PROBE_REQUEST_IES; i++) {
+		wpabuf_free(wpa_s->conf->probereq_ies[i]);
+		wpa_s->conf->probereq_ies[i] = NULL;
+		if (i < num_ies)
+			wpa_s->conf->probereq_ies[i] =
+				probereq_ies[i];
+	}
+
+	wpa_s->conf->changed_parameters |=
+		CFG_CHANGED_P2P_PROBEREQ_IES;
+	/* Supplicant config changed update P2P */
+	wpa_supplicant_update_config(wpa_s);
+
+	return TRUE;
+
+error:
+	while (--num_ies)
+		wpabuf_free(probereq_ies[num_ies]);
+
+	return FALSE;
+}
+
+/**
+ * wpas_dbus_setter_p2p_proberesp_ies - Set the custom ies information
+ *	to be used by the supplicant for probe response
+ * @iter: Pointer to incoming dbus message iter
+ * @error: Location to store error on failure
+ * @user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Setter for "Properties" property of a p2p device.
+ */
+
+dbus_bool_t wpas_dbus_setter_p2p_proberesp_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data)
+{
+	struct wpa_supplicant *wpa_s = user_data;
+	DBusMessageIter variant_iter, array_iter;
+	u8 blob_data[P2P_CUSTOM_IES_MAX_BYTE_SIZE];
+	int num_ies = 0, i = 0, blob_len = 0;
+	struct wpabuf *proberesp_ies[P2P_MAX_PROBE_RESPONSE_IES];
+
+	dbus_message_iter_recurse(iter, &variant_iter);
+	if (dbus_message_iter_get_arg_type(&variant_iter) != DBUS_TYPE_ARRAY)
+		return FALSE;
+
+	dbus_message_iter_recurse(&variant_iter, &array_iter);
+
+	while ((num_ies < P2P_MAX_PROBE_RESPONSE_IES) &&
+		(dbus_message_iter_get_arg_type(&array_iter) ==
+			DBUS_TYPE_ARRAY)) {
+		/* Read the next byte array from the dbus*/
+		if (read_byte_array_from_dbus(array_iter, blob_data,
+			P2P_CUSTOM_IES_MAX_BYTE_SIZE) < 0)
+			continue;
+
+		proberesp_ies[num_ies] = wpabuf_alloc_copy(blob_data, blob_len);
+		if (proberesp_ies[num_ies] == NULL)
+			goto error;
+		num_ies++;
+		dbus_message_iter_next(&array_iter);
+	}
+	/* Save data */
+	for (i = 0; i < P2P_MAX_PROBE_RESPONSE_IES; i++) {
+		wpabuf_free(wpa_s->conf->proberesp_ies[i]);
+		wpa_s->conf->proberesp_ies[i] = NULL;
+		if (i < num_ies)
+			wpa_s->conf->proberesp_ies[i] =
+				proberesp_ies[i];
+	}
+
+	wpa_s->conf->changed_parameters |=
+		CFG_CHANGED_P2P_PROBERESP_IES;
+	/* Supplicant config changed update P2P */
+	wpa_supplicant_update_config(wpa_s);
+
+	return TRUE;
+
+error:
+	while (--num_ies)
+		wpabuf_free(proberesp_ies[num_ies]);
+
+	return FALSE;
+}
 
 DBusMessage * wpas_dbus_handler_p2p_delete_service(
 	DBusMessage *message, struct wpa_supplicant *wpa_s)
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
index a11b3c8..12259e2 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.h
@@ -109,6 +109,22 @@  dbus_bool_t wpas_dbus_getter_p2p_peergo(DBusMessageIter *iter,
 					DBusError *error,
 					void *user_data);
 
+dbus_bool_t wpas_dbus_getter_p2p_probereq_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data);
+
+dbus_bool_t wpas_dbus_setter_p2p_probereq_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data);
+
+dbus_bool_t wpas_dbus_getter_p2p_proberesp_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data);
+
+dbus_bool_t wpas_dbus_setter_p2p_proberesp_ies(DBusMessageIter *iter,
+					DBusError *error,
+					void *user_data);
+
 /*
  * P2P Peer properties.
  */
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 218ed2f..faecb1b 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4424,6 +4424,47 @@  void wpas_p2p_update_config(struct wpa_supplicant *wpa_s)
 		}
 	}
 
+	if (wpa_s->conf->changed_parameters & CFG_CHANGED_P2P_PROBEREQ_IES) {
+		int i;
+		p2p_remove_all_probereq_ies(p2p);
+		for (i = 0; i < P2P_MAX_PROBE_REQUEST_IES; i++) {
+			if (wpa_s->conf->probereq_ies[i] == NULL)
+				continue;
+			p2p_add_probereq_ies(
+				p2p, wpa_s->conf->probereq_ies[i]);
+		}
+		/*TODO:wpas_p2p_custom_ies_update(wpa_s, 1);*/
+	}
+	if (wpa_s->conf->changed_parameters & CFG_CHANGED_P2P_PROBERESP_IES) {
+		int i;
+		struct wpa_ssid *ssid;
+		int go_mode = 0;
+
+		p2p_remove_all_proberesp_ies(p2p);
+		for (i = 0; i < P2P_MAX_PROBE_RESPONSE_IES; i++) {
+			if (wpa_s->conf->proberesp_ies[i] == NULL)
+				continue;
+			p2p_add_proberesp_ies(
+				p2p, wpa_s->conf->proberesp_ies[i]);
+		}
+		/*TODO: wpas_p2p_custom_ies_update(wpa_s, 0);*/
+
+		/*
+		 * If we are in GO mode currently then also update
+		 * the group's IEs
+		 */
+		ssid = wpa_s->conf->ssid;
+		if (ssid) {
+			go_mode = !(ssid->mode != WPAS_MODE_P2P_GO &&
+					ssid->mode != WPAS_MODE_AP &&
+					ssid->mode !=
+					WPAS_MODE_P2P_GROUP_FORMATION);
+			if ((wpa_s->wpa_state == WPA_COMPLETED) && go_mode &&
+				wpa_s->p2p_group)
+				p2p_group_update_ies(wpa_s->p2p_group);
+		}
+	}
+
 	if ((wpa_s->conf->changed_parameters & CFG_CHANGED_COUNTRY) &&
 	    wpa_s->conf->country[0] && wpa_s->conf->country[1]) {
 		char country[3];