diff mbox

[13/14] ctrl: Enable adding profiles for P2P device interface

Message ID 1444837400-17309-14-git-send-email-ilan.peer@intel.com
State Changes Requested
Headers show

Commit Message

Peer, Ilan Oct. 14, 2015, 3:43 p.m. UTC
From: Avraham Stern <avraham.stern@intel.com>

Redirect the commands ADD_NETWORK and SET_NETWORK from the global
control interface to the P2P Device interface to enable adding
netwrok profiles to the P2P Device interface.

This can be used to add persistent groups that will be used later
by the P2P Device to re-invoke the persistent group.

These commands are enabled on the global control interface only when
TESTING_OPTIONS is configured.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 wpa_supplicant/ctrl_iface.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jouni Malinen Oct. 31, 2015, 9:28 p.m. UTC | #1
On Thu, Oct 22, 2015 at 02:12:09PM +0000, Peer, Ilan wrote:
> > > Redirect the commands ADD_NETWORK and SET_NETWORK from the global
> > > control interface to the P2P Device interface to enable adding netwrok
> > > profiles to the P2P Device interface.

> These were under CONFIG_TESTING_OPTIONS since we were not aware of any real use case for this other than hwsim testing. They can be supported on global control interface without limitation AFAIC.

In general, it may be fine to add CONFIG_TESTING_OPTIONS blocks in the
implementation, but that is certainly not the preference and should be
left for cases where testing cannot be done without the change. In this
specific case, I don't see why this would need to be handled through
wpas_global_ctrl_iface_redir_p2p(), i.e., the test script should be
capable of directing the command to the appropriate interface directly.
Peer, Ilan Nov. 1, 2015, 2:20 p.m. UTC | #2
Hi Jouni,

> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Saturday, October 31, 2015 23:29
> To: Peer, Ilan
> Cc: hostap@lists.infradead.org; Stern, Avraham
> Subject: Re: [PATCH 13/14] ctrl: Enable adding profiles for P2P device
> interface
> 
> On Thu, Oct 22, 2015 at 02:12:09PM +0000, Peer, Ilan wrote:
> > > > Redirect the commands ADD_NETWORK and SET_NETWORK from the
> global
> > > > control interface to the P2P Device interface to enable adding
> > > > netwrok profiles to the P2P Device interface.
> 
> > These were under CONFIG_TESTING_OPTIONS since we were not aware of
> any real use case for this other than hwsim testing. They can be supported on
> global control interface without limitation AFAIC.
> 
> In general, it may be fine to add CONFIG_TESTING_OPTIONS blocks in the
> implementation, but that is certainly not the preference and should be left for
> cases where testing cannot be done without the change. In this specific case, I
> don't see why this would need to be handled through
> wpas_global_ctrl_iface_redir_p2p(), i.e., the test script should be capable of
> directing the command to the appropriate interface directly.
> 

Ok. Will change the test case to distinguish between a configurations with/without P2P Device interface.

Thanks,

Ilan.
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 95c572f..9f2a459 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -9117,6 +9117,9 @@  static char * wpas_global_ctrl_iface_redir_p2p(struct wpa_global *global,
 		"P2P_CANCEL",
 		"P2P_PRESENCE_REQ",
 		"P2P_EXT_LISTEN",
+#ifdef CONFIG_TESTING_OPTIONS
+		"ADD_NETWORK",
+#endif /* CONFIG_TESTING_OPTIONS */
 		NULL
 	};
 	static const char * prefix[] = {
@@ -9156,6 +9159,7 @@  static char * wpas_global_ctrl_iface_redir_p2p(struct wpa_global *global,
 #ifdef CONFIG_TESTING_OPTIONS
 		"MGMT_TX ",
 		"GET ",
+		"SET_NETWORK ",
 #endif /* CONFIG_TESTING_OPTIONS */
 		NULL
 	};