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