wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
p2p_pd.c File Reference

Wi-Fi Direct - P2P provision discovery. More...

#include "includes.h"
#include "common.h"
#include "common/ieee802_11_defs.h"
#include "common/wpa_ctrl.h"
#include "wps/wps_defs.h"
#include "p2p_i.h"
#include "p2p.h"

Macros

#define MAX_PROV_DISC_REQ_RETRIES   120
 
#define P2PS_PD_RESP_CHECK(_val, _attr)
 

Functions

void p2p_process_prov_disc_req (struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len, int rx_freq)
 
void p2p_process_prov_disc_resp (struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len)
 
int p2p_send_prov_disc_req (struct p2p_data *p2p, struct p2p_device *dev, int join, int force_freq)
 
int p2p_prov_disc_req (struct p2p_data *p2p, const u8 *peer_addr, struct p2ps_provision *p2ps_prov, u16 config_methods, int join, int force_freq, int user_initiated_pd)
 Send Provision Discovery Request. More...
 
void p2p_reset_pending_pd (struct p2p_data *p2p)
 
void p2ps_prov_free (struct p2p_data *p2p)
 

Detailed Description

Wi-Fi Direct - P2P provision discovery.

Macro Definition Documentation

#define P2PS_PD_RESP_CHECK (   _val,
  _attr 
)
Value:
do { \
if ((_val) && !msg->_attr) { \
p2p_dbg(p2p, "P2PS PD Response missing " #_attr); \
return -1; \
} \
} while (0)

Function Documentation

int p2p_prov_disc_req ( struct p2p_data p2p,
const u8 *  peer_addr,
struct p2ps_provision p2ps_prov,
u16  config_methods,
int  join,
int  force_freq,
int  user_initiated_pd 
)

Send Provision Discovery Request.

Parameters
p2pP2P module context from p2p_init()
peer_addrMAC address of the peer P2P client
p2ps_provProvisioning info for P2PS
config_methodsWPS Config Methods value (only one bit set)
joinWhether this is used by a client joining an active group
force_freqForced TX frequency for the frame (mainly for the join case)
user_initiated_pdFlag to indicate if initiated by user or not
Returns
0 on success, -1 on failure

This function can be used to request a discovered P2P peer to display a PIN (config_methods = WPS_CONFIG_DISPLAY) or be prepared to enter a PIN from us (config_methods = WPS_CONFIG_KEYPAD). The Provision Discovery Request frame is transmitted once immediately and if no response is received, the frame will be sent again whenever the target device is discovered during device dsicovery (start with a p2p_find() call). Response from the peer is indicated with the p2p_config::prov_disc_resp() callback.