[PATCH 00/20] wpa_s: p2p: support nl80211 P2P_DEVICE interface

Arend van Spriel arend at broadcom.com
Wed May 22 16:15:59 EDT 2013

On 05/21/2013 02:02 PM, Jouni Malinen wrote:
> On Tue, May 21, 2013 at 01:53:38PM +0200, Arend van Spriel wrote:
>> On 05/19/2013 09:08 PM, Jouni Malinen wrote:
>>> Thanks. I started applying commits, but had to stop with that pretty
>>> quickly since this broke number of things in my tests (including hostapd
>>> build and wpa_supplicant start).. I think I managed to fix most of the
>>> issues, but this still does not work in my hwsim tests.
>> Can you elaborate what does not work in you hwsim tests. I tested
>> with your devel branch and I can connect and ping. However, I am
>> using 3.10-rc1 on the peer using P2P Device interface. Reason for
>> this is that it needs a nl80211 patch to make P2P_FIND succeed.
> I did not see device discovery working. hwsim0 shows Probe Request
> frames, but there was no reporting if Probe Request frames to
> wpa_supplicant and as such, no responses to these.
>>    commit 97990a060e6757f48b931a3946b17c1c4362c3fb
>>    Author: Johannes Berg <johannes.berg at intel.com>
>>    Date:   Fri Apr 19 01:02:55 2013 +0200
>>        nl80211: allow using wdev identifiers to get scan results
> I'd assume I had that in my tests. I was using a wireless-testing.git
> snapshot. Anyway, whether I had that there or not does not matter since
> there is obviously at least one snapshot of the kernel where this breaks
> P2P completely at least for hwsim tests. I cannot apply such changes
> into hostap.git without protection that avoids regressions with any past
> kernel snapshot in the default configuration. It would be unfortunate if
> we have managed to push kernel changes in to claim support for this
> without it actually working. That would mean that there may be need for
> manual configuration to enable this in wpa_supplicant and/or a new
> capability bit in the kernel once things start working.

The drivers are indicating whether P2P Device is supported. Our brcmfmac 
driver had it set to 3.9 but it was removed as wpa_supplicant had no 
support. Bit of a chicken-egg story. Also at least a number of issues in 
cfg80211 and mac80211 has been found and fixed in 3.10-rc1, so wireless 
drivers can start to consider announcing P2P Device support. A quick 
grep in v3.9 shows iwlwifi and mac80211_hwsim are the only driver 
reporting P2P Device support. That should only be true when cfg80211 and 
mac80211 changes are also applied to 3.9 kernel and those will probably 
not work because cfg80211 and mac80211 fixes are missing.

I decided to dive into hwsim tests and tested test_p2p_discovery.py with 
3.10-rc1 kernel. Device discovery works for test_discovery(), but 
Provision Discovery fails unless I create the control interfaces on 
p2p-dev-wlanX in run-tests.py. So it seems not all p2p commands are 
truly global.

The other test test_discovery_group_client also fails, but that is 
because p2p0.conf has 'p2p_no_group_iface=1' so it tries to change 
p2p-dev-wlan0 from P2P_DEVICE into P2P_GO, but mac80211_hwsim does not 
allow this (see below). This happens both with control interface on 
wlan0 and on p2p-dev-wlan0 so P2P_GROUP_ADD is indeed a global p2p 
command. I think the 'p2p_no_group_iface' configuration should be 
evaluated against the interface combinations from the driver.

static const struct ieee80211_iface_limit hwsim_if_limits[] = {
         { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
         { .max = 2048,  .types = BIT(NL80211_IFTYPE_STATION) |
                                  BIT(NL80211_IFTYPE_P2P_CLIENT) |
#ifdef CONFIG_MAC80211_MESH
                                  BIT(NL80211_IFTYPE_MESH_POINT) |
                                  BIT(NL80211_IFTYPE_AP) |
                                  BIT(NL80211_IFTYPE_P2P_GO) },
         { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) },

Hope we can make an effort to get wpa_supplicant provide P2P Device 
support for 3.10+ kernels.


More information about the HostAP mailing list