NOTE: this page is for archival only, see the note at the end of the page.

P2P howto

prerequisites

In order to test P2P, you need:

  • a current wireless-testing kernel (or compat-wireless equivalent)
  • wpa_supplicant from the hostap git branch:

    git clone git://w1.fi/srv/git/hostap.git
  • an Atheros ath9k device (or your own, if you want to make it work, but suggest having ath9k to test against)

Make sure to always update them together, since work is still going into both that needs to be synchronised.

patching & compiling

kernel

For ath9k, a small kernel patch is required:

--- wireless-testing.orig/drivers/net/wireless/ath/ath9k/recv.c 2010-06-20 20:20:23.000000000 -0700
+++ wireless-testing/drivers/net/wireless/ath/ath9k/recv.c      2010-06-20 20:21:07.000000000 -0700
@@ -463,6 +463,11 @@ u32 ath_calcrxfilter(struct ath_softc *s
                rfilt |= ATH9K_RX_FILTER_MCAST_BCAST_ALL;
        }
 
+       /*
+        * For P2P tests, allow Probe Request frames to go through in all
+        * modes.
+        */
+       rfilt |= ATH9K_RX_FILTER_PROBEREQ;
        return rfilt;
 
 #undef RX_FILTER_PRESERVE

(you'll need to apply this patch manually because it's whitespace damaged)

With just this patch, P2P may still use CCK bitrates which is contrary to what the spec says, but it's good enough for functional testing.

wpa_supplicant

Use this config file for compiling:

CONFIG_DRIVER_NL80211=y

# optional, depending on libnl version you want to use:
# CONFIG_LIBNL20=y

CONFIG_CTRL_IFACE=y

CONFIG_WPS=y
CONFIG_WPS2=y

CONFIG_P2P=y
CONFIG_AP=y

running

Start wpa_supplicant with this config file:

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1

# optional, can be useful for monitoring, forces
# wpa_supplicant to use only channel 1 rather than
# 1, 6 and 11:
#p2p_listen_reg_class=81
#p2p_listen_channel=1
#p2p_oper_reg_class=81
#p2p_oper_channel=1

like this:

./wpa_supplicant -Dnl80211 -c /path/to/p2p.conf -i wlan0 -dt

Then start ./wpa_cli and use the various p2p_* commands, for example:

p2p_find
[wait for peer to be found]
p2p_connect <peer-mac-addr> pbc go_intent=<0..15>

(or you can use pin of course.)


This is a static dump of the wiki, taken after locking it in January 2015. The new wiki is at https://wireless.wiki.kernel.org/.
versions of this page: last, v5, v4, v3, v2, v1