<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Arend,<div>first of all thank you for your time.</div><div>I' m going to try to give you a summary of what I want to do.</div><div><br></div><div>I want to develop an app which implements WiFi Direct Protocol.</div><div>In particular I need to be sure that it performs GO Negotiation procedure correctly.</div><div>According to what android guide says, if I want that a device (D1) starts a connection with another device (D2),&nbsp;</div><div>D1 has to call connect() method.</div><div>This method admits as parameter an object called config.</div><div>config contains 3 fields:</div><div><ul><li><span style="color: rgb(34, 34, 34); line-height: 19px; background-color: rgb(247, 247, 247);"><font face="Calibri" style="font-size: 12pt;" size="3">The device MAC address that uniquely identifies a Wi-Fi p2p device to connect to (in my example it will be MAC of D2)</font></span></li><li>groupOwnerIntent of D1 (since it is starting the connection)</li><li>wps info of D1 (since it is starting the connection)</li></ul>After that android will use WifiNative class to send the command to wpa_supplicant.</div><div>Now, wpa_supplicant takes charge of building the GO negotiation request to send it to D2.&nbsp;</div><div><br></div><div>Which is the behaviour of D2 after receiving D1 GO negotiation request?</div><div><br></div><div>In my app I've tried to instantiate a&nbsp;<span style="font-size: 12pt;">config</span><span style="font-size: 12pt;">&nbsp;object &nbsp;containing GO intent of D2, but D1 becames always GO, even if GO intent of D2 is greater than D1 one.</span></div><div><span style="font-size: 12pt;"><br></span></div><div><span style="font-size: 12pt;"><br></span></div><div>Thanks&nbsp;</div><div>Andrea</div><div><br><div>&gt; Date: Thu, 15 May 2014 21:27:28 +0200<br>&gt; From: arend@broadcom.com<br>&gt; To: andrea.chittano@hotmail.it<br>&gt; CC: moon.linux@yahoo.com; hostap@lists.shmoo.com<br>&gt; Subject: Re: Wifi Direct GO Negotiation<br>&gt; <br>&gt; On 05/15/14 18:25, Andrea Chittano wrote:<br>&gt; &gt; Sorry guys for my inexperience, but this thing are driving me mad.<br>&gt; &gt;<br>&gt; &gt; Tell me if i'm wrong.<br>&gt; &gt; Does the function at line 525 of the following link<br>&gt; &gt;<br>&gt; &gt; http://code.metager.de/source/xref/hostapd-wpa_supplicant/src/p2p/p2p_go_neg.c?r=0e0e1e564f3dd8d2a6b645d079b46eba0acc7f83<br>&gt; &gt;<br>&gt; &gt; that is<br>&gt; &gt;<br>&gt; &gt; *void*  p2p_process_go_neg_req  &lt;http://code.metager.de/source/s?defs=p2p_process_go_neg_req&amp;project=hostapd-wpa_supplicant&gt;(*struct*  p2p_data  &lt;http://code.metager.de/source/s?defs=p2p_data&amp;project=hostapd-wpa_supplicant&gt;  *p2p  &lt;http://code.metager.de/source/s?defs=p2p&amp;project=hostapd-wpa_supplicant&gt;,*const*  u8  &lt;http://code.metager.de/source/s?defs=u8&amp;project=hostapd-wpa_supplicant&gt;  *sa  &lt;http://code.metager.de/source/s?defs=sa&amp;project=hostapd-wpa_supplicant&gt;,<br>&gt; &gt;                         *const*  u8  &lt;http://code.metager.de/source/s?defs=u8&amp;project=hostapd-wpa_supplicant&gt;  *data  &lt;http://code.metager.de/source/s?defs=data&amp;project=hostapd-wpa_supplicant&gt;,size_t  &lt;http://code.metager.de/source/s?defs=size_t&amp;project=hostapd-wpa_supplicant&gt;  len  &lt;http://code.metager.de/source/s?defs=len&amp;project=hostapd-wpa_supplicant&gt;,*int*  rx_freq  &lt;http://code.metager.de/source/s?defs=rx_freq&amp;project=hostapd-wpa_supplicant&gt;)<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; represent the processing (performed by Device2) of the GO negotiation<br>&gt; &gt; request that Device1 sent Device2?<br>&gt; &gt;<br>&gt; &gt; This function performs at line 687<br>&gt; &gt;<br>&gt; &gt; p2p_go_det  &lt;http://code.metager.de/source/s?refs=p2p_go_det&amp;project=hostapd-wpa_supplicant&gt;(p2p  &lt;http://code.metager.de/source/s?defs=p2p&amp;project=hostapd-wpa_supplicant&gt;-&gt;go_intent  &lt;http://code.metager.de/source/s?defs=go_intent&amp;project=hostapd-wpa_supplicant&gt;, *msg  &lt;http://code.metager.de/source/s?defs=msg&amp;project=hostapd-wpa_supplicant&gt;.go_inten  &lt;http://code.metager.de/source/s?defs=go_intent&amp;project=hostapd-wpa_supplicant&gt;t)<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; which returns the highest GO intent between local GO intent and received<br>&gt; &gt; one.<br>&gt; &gt; If I'm not wrong, according to what Arend told me Device2 get local GO<br>&gt; &gt; intent from wpa_supplicant configuration file. But I've found only one<br>&gt; &gt; way to set the local GO intent and it is here :<br>&gt; &gt;<br>&gt; &gt; http://code.metager.de/source/xref/hostapd-wpa_supplicant/src/p2p/p2p.c<br>&gt; &gt;<br>&gt; &gt; at line 1387, into the function<br>&gt; &gt;<br>&gt; &gt; *int*  p2p_connect  &lt;http://code.metager.de/source/s?refs=p2p_connect&amp;project=hostapd-wpa_supplicant&gt;(*struct*  p2p_data  &lt;http://code.metager.de/source/s?defs=p2p_data&amp;project=hostapd-wpa_supplicant&gt;  *p2p  &lt;http://code.metager.de/source/s?refs=p2p&amp;project=hostapd-wpa_supplicant&gt;,*const*  u8  &lt;http://code.metager.de/source/s?defs=u8&amp;project=hostapd-wpa_supplicant&gt;  *peer_addr  &lt;http://code.metager.de/source/s?refs=peer_addr&amp;project=hostapd-wpa_supplicant&gt;,<br>&gt; &gt;                 *enum*  p2p_wps_method  &lt;http://code.metager.de/source/s?defs=p2p_wps_method&amp;project=hostapd-wpa_supplicant&gt;  wps_method  &lt;http://code.metager.de/source/s?defs=wps_method&amp;project=hostapd-wpa_supplicant&gt;,<br>&gt; &gt;                 *int*  go_intent  &lt;http://code.metager.de/source/s?defs=go_intent&amp;project=hostapd-wpa_supplicant&gt;,*const*  u8  &lt;http://code.metager.de/source/s?defs=u8&amp;project=hostapd-wpa_supplicant&gt;  *own_interface_addr  &lt;http://code.metager.de/source/s?defs=own_interface_addr&amp;project=hostapd-wpa_supplicant&gt;,<br>&gt; &gt;                 *unsigned*  *int*  force_freq  &lt;http://code.metager.de/source/s?defs=force_freq&amp;project=hostapd-wpa_supplicant&gt;,*int*  persistent_group  &lt;http://code.metager.de/source/s?defs=persistent_group&amp;project=hostapd-wpa_supplicant&gt;,<br>&gt; &gt;                 *const*  u8  &lt;http://code.metager.de/source/s?defs=u8&amp;project=hostapd-wpa_supplicant&gt;  *force_ssid  &lt;http://code.metager.de/source/s?defs=force_ssid&amp;project=hostapd-wpa_supplicant&gt;,size_t  &lt;http://code.metager.de/source/s?defs=size_t&amp;project=hostapd-wpa_supplicant&gt;  force_ssid_len  &lt;http://code.metager.de/source/s?defs=force_ssid_len&amp;project=hostapd-wpa_supplicant&gt;,<br>&gt; &gt;                 *int*  pd_before_go_neg  &lt;http://code.metager.de/source/xref/hostapd-wpa_supplicant/src/p2p/p2p.c#pd_before_go_neg&gt;,*unsigned*  *int*  pref_freq  &lt;http://code.metager.de/source/s?defs=pref_freq&amp;project=hostapd-wpa_supplicant&gt;,u16  &lt;http://code.metager.de/source/s?defs=u16&amp;project=hostapd-wpa_supplicant&gt;  oob_pw_id  &lt;http://code.metager.de/source/s?defs=oob_pw_id&amp;project=hostapd-wpa_supplicant&gt;)<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; According to what specifications say, it is used to start a GO negotiation.<br>&gt; &gt; So my question is, how can I set the local GO intent for Device2 without<br>&gt; &gt; using p2p_connect() function?<br>&gt; &gt; I would make it by means of an android application. Can I do this?<br>&gt; <br>&gt; Maybe it would help to give some high-level information on what you are <br>&gt; trying to do. I am not familiar with Android solution, but most likely <br>&gt; Android provides an API for applications that is handled by their <br>&gt; framework/middleware to get it in wpa_supplicant (see [1]).<br>&gt; <br>&gt; Regards,<br>&gt; Arend<br>&gt; <br>&gt; [1] http://developer.android.com/guide/topics/connectivity/wifip2p.html<br>&gt; <br>&gt; &gt; Thanks for your help.<br>&gt; &gt; Andrea<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;  &gt; Date: Wed, 14 May 2014 10:21:56 -0700<br>&gt; &gt;  &gt; From: moon.linux@yahoo.com<br>&gt; &gt;  &gt; Subject: Re: Wifi Direct GO Negotiation<br>&gt; &gt;  &gt; To: arend@broadcom.com; andrea.chittano@hotmail.it<br>&gt; &gt;  &gt; CC: hostap@lists.shmoo.com<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; Hi Arend,<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; I agree with what you said regarding the AP.<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; One more question: Any device with WPS capabilty can join a P2P network.<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; Thanks.<br>&gt; &gt;  &gt; -Anand Moon<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; On Wednesday, May 14, 2014 2:56 PM, Arend van Spriel<br>&gt; &gt; &lt;arend@broadcom.com&gt; wrote:<br>&gt; &gt;  &gt; On 14-05-14 05:03, Anand Moon wrote:<br>&gt; &gt;  &gt; &gt; Hi All,<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; I would like to add new question to this thread.<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; If the AP has the capability to support p2p and wps, how will<br>&gt; &gt;  &gt; &gt; these two devices communicate with the AP.<br>&gt; &gt;  &gt; &gt; Will this AP become P2P group owner (P2P Go) and the other devices<br>&gt; &gt; P2P Clients ?<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; I am not sure whether this scenario makes sense. P2P typically involves<br>&gt; &gt;  &gt; two STAs. They may be connected to some AP, but if both are connected to<br>&gt; &gt;  &gt; the same AP there may be not so much need to setup a P2P connection.<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; &gt; I would like to know how to judge if the wireless interface<br>&gt; &gt; supports P2P<br>&gt; &gt;  &gt; &gt; is it with the "Supported interface modes" or "Supported RX frame<br>&gt; &gt; types" ?<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; If the device support following p2p mode then how do we need to<br>&gt; &gt; configure them.<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; Supported interface modes:<br>&gt; &gt;  &gt; &gt; * IBSS<br>&gt; &gt;  &gt; &gt; * managed<br>&gt; &gt;  &gt; &gt; * AP * AP/VLAN<br>&gt; &gt;  &gt; &gt; * monitor<br>&gt; &gt;  &gt; &gt; * mesh point<br>&gt; &gt;  &gt; &gt; * P2P-client<br>&gt; &gt;  &gt; &gt; * P2P-GO<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; How do we configure these P2P modes for interface?<br>&gt; &gt;  &gt; &gt; Please share your thoughts.<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; Just use nl80211 API, ie. NL80211_CMD_SET_INTERFACE. wpa_supplicant is<br>&gt; &gt;  &gt; doing that in src/drivers/driver_nl80211.c<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; Regards,<br>&gt; &gt;  &gt; Arend<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; &gt; -Anand Moon<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; On Tuesday, May 13, 2014 6:31 PM, Arend van Spriel<br>&gt; &gt; &lt;arend@broadcom.com&gt; wrote:<br>&gt; &gt;  &gt; &gt; On 05/13/14 14:03, Andrea Chittano wrote:<br>&gt; &gt;  &gt; &gt;&gt; Hi, my name is Andrea.<br>&gt; &gt;  &gt; &gt;&gt; I'm working on WiFi Direct and I found a thread about it.<br>&gt; &gt;  &gt; &gt;&gt; I've some doubts about it.<br>&gt; &gt;  &gt; &gt;&gt; Let's suppose we have 2 devices. Let's call D1 and D2.<br>&gt; &gt;  &gt; &gt;&gt; Let's suppose D1 sends a request of connection to D2 (D1 doesn't known<br>&gt; &gt;  &gt; &gt;&gt; D2 so no persistent connection there exist).<br>&gt; &gt;  &gt; &gt;&gt; The first step that wpa_supplicant on D1 is to send a GO negotiation<br>&gt; &gt;  &gt; &gt;&gt; request containing, among all,GO intent (of D1).<br>&gt; &gt;  &gt; &gt;&gt; I want to understand how wpa_supplicant on D2 acquires the GO<br>&gt; &gt; intent of<br>&gt; &gt;  &gt; &gt;&gt; D2 in order to compare it with whichone sent by D1.<br>&gt; &gt;  &gt; &gt;&gt; Can someone explain me this?<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; Both devices have their own go intent configuration in wpa_supplicant<br>&gt; &gt;  &gt; &gt; configuration file. D2 sends own go intent value in the GO negotiation<br>&gt; &gt;  &gt; &gt; response. The device with the highest GO intent will become GO.<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; Regards,<br>&gt; &gt;  &gt; &gt; Arend<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt;&gt; Thanks,<br>&gt; &gt;  &gt; &gt;&gt; Andrea<br>&gt; &gt;  &gt; &gt;&gt;<br>&gt; &gt;  &gt; &gt;&gt;<br>&gt; &gt;  &gt; &gt;&gt;<br>&gt; &gt;  &gt; &gt;&gt; _______________________________________________<br>&gt; &gt;  &gt; &gt;&gt; HostAP mailing list<br>&gt; &gt;  &gt; &gt;&gt; HostAP@lists.shmoo.com<br>&gt; &gt;  &gt; &gt;&gt; http://lists.shmoo.com/mailman/listinfo/hostap<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt; &gt; _______________________________________________<br>&gt; &gt;  &gt; &gt; HostAP mailing list<br>&gt; &gt;  &gt; &gt; HostAP@lists.shmoo.com<br>&gt; &gt;  &gt; &gt; http://lists.shmoo.com/mailman/listinfo/hostap<br>&gt; &gt;  &gt; &gt;<br>&gt; &gt;  &gt;<br>&gt; <br></div></div>                                               </div></body>
</html>