wpa_supplicant / hostapd
2.5
|
Wi-Fi Direct - P2P module. More...
Go to the source code of this file.
Data Structures | |
struct | p2p_channels |
List of supported channels. More... | |
struct | p2p_channels::p2p_reg_class |
Supported regulatory class. More... | |
struct | p2p_go_neg_results |
P2P Group Owner Negotiation results. More... | |
struct | p2ps_provision |
struct | p2ps_advertisement |
struct | p2p_peer_info |
P2P peer information. More... | |
struct | p2p_channel |
struct | p2p_config |
P2P configuration. More... | |
struct | p2p_group_config |
P2P group configuration. More... | |
struct | p2p_nfc_params |
Macros | |
#define | P2PS_SETUP_NONE 0 |
#define | P2PS_SETUP_NEW BIT(0) |
#define | P2PS_SETUP_CLIENT BIT(1) |
#define | P2PS_SETUP_GROUP_OWNER BIT(2) |
#define | P2PS_WILD_HASH_STR "org.wi-fi.wfds" |
#define | P2PS_HASH_LEN 6 |
#define | P2P_MAX_QUERY_HASH 6 |
#define | P2PS_FEATURE_CAPAB_CPT_MAX 2 |
#define | P2P_MAX_PREF_CHANNELS 100 |
Maximum number of preferred channels. | |
#define | P2P_MAX_REG_CLASSES 10 |
Maximum number of regulatory classes. | |
#define | P2P_MAX_REG_CLASS_CHANNELS 20 |
Maximum number of channels per regulatory class. | |
#define | P2P_MAX_CHANNELS 50 |
#define | P2P_MAX_WPS_VENDOR_EXT 10 |
#define | P2P_SEC_DEVICE_TYPES 5 |
Maximum number of secondary device types. | |
Enumerations | |
enum | p2p_wps_method { WPS_NOT_READY, WPS_PIN_DISPLAY, WPS_PIN_KEYPAD, WPS_PBC, WPS_NFC, WPS_P2PS } |
enum | p2p_scan_type { P2P_SCAN_SOCIAL, P2P_SCAN_FULL, P2P_SCAN_SPECIFIC, P2P_SCAN_SOCIAL_PLUS_ONE } |
enum | p2p_prov_disc_status { P2P_PROV_DISC_SUCCESS, P2P_PROV_DISC_TIMEOUT, P2P_PROV_DISC_REJECTED, P2P_PROV_DISC_TIMEOUT_JOIN, P2P_PROV_DISC_INFO_UNAVAILABLE } |
enum | p2p_discovery_type { P2P_FIND_START_WITH_FULL, P2P_FIND_ONLY_SOCIAL, P2P_FIND_PROGRESSIVE } |
enum | p2p_invite_role { P2P_INVITE_ROLE_GO, P2P_INVITE_ROLE_ACTIVE_GO, P2P_INVITE_ROLE_CLIENT } |
enum | p2p_probe_req_status { P2P_PREQ_MALFORMED, P2P_PREQ_NOT_LISTEN, P2P_PREQ_NOT_P2P, P2P_PREQ_NOT_PROCESSED, P2P_PREQ_PROCESSED } |
enum p2p_probe_req_status More... | |
enum | p2p_send_action_result { P2P_SEND_ACTION_SUCCESS, P2P_SEND_ACTION_NO_ACK, P2P_SEND_ACTION_FAILED } |
Functions | |
struct p2p_data * | p2p_init (const struct p2p_config *cfg) |
Initialize P2P module. More... | |
void | p2p_deinit (struct p2p_data *p2p) |
Deinitialize P2P module. More... | |
void | p2p_flush (struct p2p_data *p2p) |
Flush P2P module state. More... | |
int | p2p_unauthorize (struct p2p_data *p2p, const u8 *addr) |
Unauthorize the specified peer device. More... | |
int | p2p_set_dev_name (struct p2p_data *p2p, const char *dev_name) |
Set device name. More... | |
int | p2p_set_manufacturer (struct p2p_data *p2p, const char *manufacturer) |
int | p2p_set_model_name (struct p2p_data *p2p, const char *model_name) |
int | p2p_set_model_number (struct p2p_data *p2p, const char *model_number) |
int | p2p_set_serial_number (struct p2p_data *p2p, const char *serial_number) |
void | p2p_set_config_methods (struct p2p_data *p2p, u16 config_methods) |
void | p2p_set_uuid (struct p2p_data *p2p, const u8 *uuid) |
int | p2p_set_pri_dev_type (struct p2p_data *p2p, const u8 *pri_dev_type) |
Set primary device type. More... | |
int | p2p_set_sec_dev_types (struct p2p_data *p2p, const u8 dev_types[][8], size_t num_dev_types) |
Set secondary device types. More... | |
int | p2p_set_country (struct p2p_data *p2p, const char *country) |
int | p2p_find (struct p2p_data *p2p, unsigned int timeout, enum p2p_discovery_type type, unsigned int num_req_dev_types, const u8 *req_dev_types, const u8 *dev_id, unsigned int search_delay, u8 seek_count, const char **seek_string, int freq) |
Start P2P Find (Device Discovery) More... | |
void | p2p_notify_scan_trigger_status (struct p2p_data *p2p, int status) |
Indicate scan trigger status. More... | |
void | p2p_stop_find (struct p2p_data *p2p) |
Stop P2P Find (Device Discovery) More... | |
void | p2p_stop_find_for_freq (struct p2p_data *p2p, int freq) |
Stop P2P Find for next oper on specific freq. More... | |
int | p2p_listen (struct p2p_data *p2p, unsigned int timeout) |
Start P2P Listen state for specified duration. More... | |
void | p2p_stop_listen (struct p2p_data *p2p) |
Stop P2P Listen. More... | |
int | p2p_connect (struct p2p_data *p2p, const u8 *peer_addr, enum p2p_wps_method wps_method, int go_intent, const u8 *own_interface_addr, unsigned int force_freq, int persistent_group, const u8 *force_ssid, size_t force_ssid_len, int pd_before_go_neg, unsigned int pref_freq, u16 oob_pw_id) |
Start P2P group formation (GO negotiation) More... | |
int | p2p_authorize (struct p2p_data *p2p, const u8 *peer_addr, enum p2p_wps_method wps_method, int go_intent, const u8 *own_interface_addr, unsigned int force_freq, int persistent_group, const u8 *force_ssid, size_t force_ssid_len, unsigned int pref_freq, u16 oob_pw_id) |
Authorize P2P group formation (GO negotiation) More... | |
int | p2p_reject (struct p2p_data *p2p, const u8 *peer_addr) |
Reject peer device (explicitly block connection attempts) More... | |
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_sd_request (struct p2p_data *p2p, const u8 *dst, const struct wpabuf *tlvs) |
Schedule a service discovery query. More... | |
int | p2p_sd_cancel_request (struct p2p_data *p2p, void *req) |
Cancel a pending service discovery query. More... | |
void | p2p_sd_response (struct p2p_data *p2p, int freq, const u8 *dst, u8 dialog_token, const struct wpabuf *resp_tlvs) |
Send response to a service discovery query. More... | |
void | p2p_sd_service_update (struct p2p_data *p2p) |
Indicate a change in local services. More... | |
int | p2p_invite (struct p2p_data *p2p, const u8 *peer, enum p2p_invite_role role, const u8 *bssid, const u8 *ssid, size_t ssid_len, unsigned int force_freq, const u8 *go_dev_addr, int persistent_group, unsigned int pref_freq, int dev_pw_id) |
Invite a P2P Device into a group. More... | |
int | p2p_presence_req (struct p2p_data *p2p, const u8 *go_interface_addr, const u8 *own_interface_addr, unsigned int freq, u32 duration1, u32 interval1, u32 duration2, u32 interval2) |
Request GO presence. More... | |
int | p2p_ext_listen (struct p2p_data *p2p, unsigned int period, unsigned int interval) |
Set Extended Listen Timing. More... | |
void | p2p_wps_success_cb (struct p2p_data *p2p, const u8 *mac_addr) |
Report successfully completed WPS provisioning. More... | |
void | p2p_group_formation_failed (struct p2p_data *p2p) |
Report failed WPS provisioning. More... | |
u16 | p2p_get_provisioning_info (struct p2p_data *p2p, const u8 *addr) |
Get any stored provisioning info. More... | |
void | p2p_clear_provisioning_info (struct p2p_data *p2p, const u8 *addr) |
Clear any stored provisioning info. More... | |
enum p2p_probe_req_status | p2p_probe_req_rx (struct p2p_data *p2p, const u8 *addr, const u8 *dst, const u8 *bssid, const u8 *ie, size_t ie_len, unsigned int rx_freq) |
Report reception of a Probe Request frame. More... | |
void | p2p_rx_action (struct p2p_data *p2p, const u8 *da, const u8 *sa, const u8 *bssid, u8 category, const u8 *data, size_t len, int freq) |
Report received Action frame. More... | |
int | p2p_scan_res_handler (struct p2p_data *p2p, const u8 *bssid, int freq, struct os_reltime *rx_time, int level, const u8 *ies, size_t ies_len) |
Indicate a P2P scan results. More... | |
void | p2p_scan_res_handled (struct p2p_data *p2p) |
Indicate end of scan results. More... | |
void | p2p_send_action_cb (struct p2p_data *p2p, unsigned int freq, const u8 *dst, const u8 *src, const u8 *bssid, enum p2p_send_action_result result) |
Notify TX status of an Action frame. More... | |
void | p2p_listen_cb (struct p2p_data *p2p, unsigned int freq, unsigned int duration) |
Indicate the start of a requested Listen state. More... | |
int | p2p_listen_end (struct p2p_data *p2p, unsigned int freq) |
Indicate the end of a requested Listen state. More... | |
void | p2p_deauth_notif (struct p2p_data *p2p, const u8 *bssid, u16 reason_code, const u8 *ie, size_t ie_len) |
void | p2p_disassoc_notif (struct p2p_data *p2p, const u8 *bssid, u16 reason_code, const u8 *ie, size_t ie_len) |
struct p2p_group * | p2p_group_init (struct p2p_data *p2p, struct p2p_group_config *config) |
Initialize P2P group. More... | |
void | p2p_group_deinit (struct p2p_group *group) |
Deinitialize P2P group. More... | |
int | p2p_group_notif_assoc (struct p2p_group *group, const u8 *addr, const u8 *ie, size_t len) |
Notification of P2P client association with GO. More... | |
struct wpabuf * | p2p_group_assoc_resp_ie (struct p2p_group *group, u8 status) |
Build P2P IE for (re)association response. More... | |
void | p2p_group_notif_disassoc (struct p2p_group *group, const u8 *addr) |
Notification of P2P client disassociation from GO. More... | |
void | p2p_group_notif_formation_done (struct p2p_group *group) |
Notification of completed group formation. More... | |
int | p2p_group_notif_noa (struct p2p_group *group, const u8 *noa, size_t noa_len) |
Notification of NoA change. More... | |
int | p2p_group_match_dev_type (struct p2p_group *group, struct wpabuf *wps) |
Match device types in group with requested type. More... | |
int | p2p_group_match_dev_id (struct p2p_group *group, struct wpabuf *p2p) |
Match P2P Device Address in group with requested device id. | |
int | p2p_group_go_discover (struct p2p_group *group, const u8 *dev_id, const u8 *searching_dev, int rx_freq) |
Send GO Discoverability Request to a group client. More... | |
int | p2p_ie_text (struct wpabuf *p2p_ie, char *buf, char *end) |
Build text format description of P2P IE. More... | |
int | p2p_scan_result_text (const u8 *ies, size_t ies_len, char *buf, char *end) |
Build text format description of P2P IE. More... | |
int | p2p_parse_dev_addr_in_p2p_ie (struct wpabuf *p2p_ie, u8 *dev_addr) |
Parse P2P Device Address from a concatenated P2P IE. More... | |
int | p2p_parse_dev_addr (const u8 *ies, size_t ies_len, u8 *dev_addr) |
Parse P2P Device Address from P2P IE(s) More... | |
int | p2p_assoc_req_ie (struct p2p_data *p2p, const u8 *bssid, u8 *buf, size_t len, int p2p_group, struct wpabuf *p2p_ie) |
Build P2P IE for (Re)Association Request frame. More... | |
void | p2p_scan_ie (struct p2p_data *p2p, struct wpabuf *ies, const u8 *dev_id) |
Build P2P IE for Probe Request. More... | |
size_t | p2p_scan_ie_buf_len (struct p2p_data *p2p) |
Get maximum buffer length needed for p2p_scan_ie. More... | |
int | p2p_go_params (struct p2p_data *p2p, struct p2p_go_neg_results *params) |
Generate random P2P group parameters. More... | |
u8 | p2p_get_group_capab (const struct wpabuf *p2p_ie) |
Get Group Capability from P2P IE data. More... | |
int | p2p_get_cross_connect_disallowed (const struct wpabuf *p2p_ie) |
Does WLAN AP disallows cross connection. More... | |
const u8 * | p2p_get_go_dev_addr (const struct wpabuf *p2p_ie) |
Get P2P Device Address from P2P IE data. More... | |
const struct p2p_peer_info * | p2p_get_peer_info (struct p2p_data *p2p, const u8 *addr, int next) |
Get P2P peer information. More... | |
int | p2p_get_peer_info_txt (const struct p2p_peer_info *info, char *buf, size_t buflen) |
Get internal P2P peer information in text format. More... | |
int | p2p_peer_known (struct p2p_data *p2p, const u8 *addr) |
Check whether P2P peer is known. More... | |
void | p2p_set_client_discoverability (struct p2p_data *p2p, int enabled) |
Set client discoverability capability. More... | |
void | p2p_set_managed_oper (struct p2p_data *p2p, int enabled) |
Set managed P2P Device operations capability. More... | |
int | p2p_config_get_random_social (struct p2p_config *p2p, u8 *op_class, u8 *op_channel) |
Return a random social channel. More... | |
int | p2p_set_listen_channel (struct p2p_data *p2p, u8 reg_class, u8 channel, u8 forced) |
u8 | p2p_get_listen_channel (struct p2p_data *p2p) |
int | p2p_set_ssid_postfix (struct p2p_data *p2p, const u8 *postfix, size_t len) |
int | p2p_get_interface_addr (struct p2p_data *p2p, const u8 *dev_addr, u8 *iface_addr) |
int | p2p_get_dev_addr (struct p2p_data *p2p, const u8 *iface_addr, u8 *dev_addr) |
void | p2p_set_peer_filter (struct p2p_data *p2p, const u8 *addr) |
void | p2p_set_cross_connect (struct p2p_data *p2p, int enabled) |
Set cross connection capability. More... | |
int | p2p_get_oper_freq (struct p2p_data *p2p, const u8 *iface_addr) |
void | p2p_set_intra_bss_dist (struct p2p_data *p2p, int enabled) |
Set intra BSS distribution. More... | |
int | p2p_channels_includes_freq (const struct p2p_channels *channels, unsigned int freq) |
int | p2p_channels_to_freqs (const struct p2p_channels *channels, int *freq_list, unsigned int max_len) |
int | p2p_supported_freq (struct p2p_data *p2p, unsigned int freq) |
Check whether channel is supported for P2P. More... | |
int | p2p_supported_freq_go (struct p2p_data *p2p, unsigned int freq) |
Check whether channel is supported for P2P GO operation. More... | |
int | p2p_supported_freq_cli (struct p2p_data *p2p, unsigned int freq) |
Check whether channel is supported for P2P client operation. More... | |
unsigned int | p2p_get_pref_freq (struct p2p_data *p2p, const struct p2p_channels *channels) |
Get channel from preferred channel list. More... | |
void | p2p_update_channel_list (struct p2p_data *p2p, const struct p2p_channels *chan, const struct p2p_channels *cli_chan) |
void | p2p_set_best_channels (struct p2p_data *p2p, int freq_24, int freq_5, int freq_overall) |
Update best channel information. More... | |
void | p2p_set_own_freq_preference (struct p2p_data *p2p, int freq) |
Set own preference for channel. More... | |
const u8 * | p2p_get_go_neg_peer (struct p2p_data *p2p) |
unsigned int | p2p_get_group_num_members (struct p2p_group *group) |
Get number of members in group. More... | |
int | p2p_client_limit_reached (struct p2p_group *group) |
Check if client limit is reached. More... | |
const u8 * | p2p_iterate_group_members (struct p2p_group *group, void **next) |
Iterate group members. More... | |
const u8 * | p2p_group_get_dev_addr (struct p2p_group *group, const u8 *addr) |
Get a P2P Device Address of a client in a group. More... | |
int | p2p_group_is_client_connected (struct p2p_group *group, const u8 *dev_addr) |
Check whether a specific client is connected. More... | |
const struct p2p_group_config * | p2p_group_get_config (struct p2p_group *group) |
Get the group configuration. More... | |
void | p2p_loop_on_all_groups (struct p2p_data *p2p, int(*group_callback)(struct p2p_group *group, void *user_data), void *user_data) |
Run the given callback on all groups. More... | |
const struct p2p_peer_info * | p2p_get_peer_found (struct p2p_data *p2p, const u8 *addr, int next) |
Get P2P peer info structure of a found peer. More... | |
void | p2p_remove_wps_vendor_extensions (struct p2p_data *p2p) |
Remove WPS vendor extensions. More... | |
int | p2p_add_wps_vendor_extension (struct p2p_data *p2p, const struct wpabuf *vendor_ext) |
Add a WPS vendor extension. More... | |
int | p2p_set_oper_channel (struct p2p_data *p2p, u8 op_reg_class, u8 op_channel, int cfg_op_channel) |
Set the P2P operating channel. More... | |
int | p2p_set_pref_chan (struct p2p_data *p2p, unsigned int num_pref_chan, const struct p2p_channel *pref_chan) |
Set P2P preferred channel list. More... | |
int | p2p_set_no_go_freq (struct p2p_data *p2p, const struct wpa_freq_range_list *list) |
Set no GO channel ranges. More... | |
int | p2p_in_progress (struct p2p_data *p2p) |
Check whether a P2P operation is progress. More... | |
const char * | p2p_wps_method_text (enum p2p_wps_method method) |
void | p2p_set_config_timeout (struct p2p_data *p2p, u8 go_timeout, u8 client_timeout) |
Set local config timeouts. More... | |
int | p2p_set_wfd_ie_beacon (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_probe_req (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_probe_resp (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_assoc_req (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_invitation (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_prov_disc_req (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_prov_disc_resp (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_ie_go_neg (struct p2p_data *p2p, struct wpabuf *ie) |
int | p2p_set_wfd_dev_info (struct p2p_data *p2p, const struct wpabuf *elem) |
int | p2p_set_wfd_assoc_bssid (struct p2p_data *p2p, const struct wpabuf *elem) |
int | p2p_set_wfd_coupled_sink_info (struct p2p_data *p2p, const struct wpabuf *elem) |
struct wpabuf * | wifi_display_encaps (struct wpabuf *subelems) |
int | p2p_set_disc_int (struct p2p_data *p2p, int min_disc_int, int max_disc_int, int max_disc_tu) |
Set min/max discoverable interval for p2p_find. More... | |
const char * | p2p_get_state_txt (struct p2p_data *p2p) |
Get current P2P state for debug purposes. More... | |
struct wpabuf * | p2p_build_nfc_handover_req (struct p2p_data *p2p, int client_freq, const u8 *go_dev_addr, const u8 *ssid, size_t ssid_len) |
struct wpabuf * | p2p_build_nfc_handover_sel (struct p2p_data *p2p, int client_freq, const u8 *go_dev_addr, const u8 *ssid, size_t ssid_len) |
int | p2p_process_nfc_connection_handover (struct p2p_data *p2p, struct p2p_nfc_params *params) |
void | p2p_set_authorized_oob_dev_pw_id (struct p2p_data *p2p, u16 dev_pw_id, int go_intent, const u8 *own_interface_addr) |
int | p2p_set_passphrase_len (struct p2p_data *p2p, unsigned int len) |
void | p2p_loop_on_known_peers (struct p2p_data *p2p, void(*peer_callback)(struct p2p_peer_info *peer, void *user_data), void *user_data) |
void | p2p_set_vendor_elems (struct p2p_data *p2p, struct wpabuf **vendor_elem) |
void | p2p_set_intended_addr (struct p2p_data *p2p, const u8 *intended_addr) |
struct p2ps_advertisement * | p2p_service_p2ps_id (struct p2p_data *p2p, u32 adv_id) |
int | p2p_service_add_asp (struct p2p_data *p2p, int auto_accept, u32 adv_id, const char *adv_str, u8 svc_state, u16 config_methods, const char *svc_info, const u8 *cpt_priority) |
int | p2p_service_del_asp (struct p2p_data *p2p, u32 adv_id) |
void | p2p_service_flush_asp (struct p2p_data *p2p) |
struct p2ps_advertisement * | p2p_get_p2ps_adv_list (struct p2p_data *p2p) |
void | p2p_expire_peers (struct p2p_data *p2p) |
Periodic cleanup function to expire peers. More... | |
void | p2p_set_own_pref_freq_list (struct p2p_data *p2p, const unsigned int *pref_freq_list, unsigned int size) |
int | p2p_group_get_common_freqs (struct p2p_group *group, int *common_freqs, unsigned int *num) |
Get the group common frequencies. More... | |
Wi-Fi Direct - P2P module.
enum p2p_probe_req_status |
enum p2p_probe_req_status
P2P_PREQ_MALFORMED | frame was not well-formed |
P2P_PREQ_NOT_LISTEN | device isn't in listen state, frame ignored |
P2P_PREQ_NOT_P2P | frame was not a P2P probe request |
P2P_PREQ_P2P_NOT_PROCESSED | frame was P2P but wasn't processed |
P2P_PREQ_P2P_PROCESSED | frame has been processed by P2P |
Add a WPS vendor extension.
p2p | P2P module context from p2p_init() |
vendor_ext | The vendor extensions to add |
The wpabuf structures in the array are owned by the P2P module after this call.
int p2p_assoc_req_ie | ( | struct p2p_data * | p2p, |
const u8 * | bssid, | ||
u8 * | buf, | ||
size_t | len, | ||
int | p2p_group, | ||
struct wpabuf * | p2p_ie | ||
) |
Build P2P IE for (Re)Association Request frame.
p2p | P2P module context from p2p_init() |
bssid | BSSID |
buf | Buffer for writing the P2P IE |
len | Maximum buf length in octets |
p2p_group | Whether this is for association with a P2P GO |
p2p_ie | Reassembled P2P IE data from scan results or NULL if none |
int p2p_authorize | ( | struct p2p_data * | p2p, |
const u8 * | peer_addr, | ||
enum p2p_wps_method | wps_method, | ||
int | go_intent, | ||
const u8 * | own_interface_addr, | ||
unsigned int | force_freq, | ||
int | persistent_group, | ||
const u8 * | force_ssid, | ||
size_t | force_ssid_len, | ||
unsigned int | pref_freq, | ||
u16 | oob_pw_id | ||
) |
Authorize P2P group formation (GO negotiation)
p2p | P2P module context from p2p_init() |
peer_addr | MAC address of the peer P2P client |
wps_method | WPS method to be used in provisioning |
go_intent | Local GO intent value (1..15) |
own_interface_addr | Intended interface address to use with the group |
force_freq | The only allowed channel frequency in MHz or 0 |
persistent_group | Whether to create a persistent group (0 = no, 1 = persistent group without persistent reconnect, 2 = persistent group with persistent reconnect) |
force_ssid | Forced SSID for the group if we become GO or NULL to generate a new SSID |
force_ssid_len | Length of $force_ssid buffer |
pref_freq | Preferred operating frequency in MHz or 0 (this is only used if force_freq == 0) |
This is like p2p_connect(), but the actual group negotiation is not initiated automatically, i.e., the other end is expected to do that.
void p2p_clear_provisioning_info | ( | struct p2p_data * | p2p, |
const u8 * | addr | ||
) |
Clear any stored provisioning info.
p2p | P2P module context from p2p_init() |
iface_addr | Peer P2P Device Address |
This function is used to clear stored WPS provisioning info for the given peer.
int p2p_client_limit_reached | ( | struct p2p_group * | group | ) |
Check if client limit is reached.
group | P2P group context from p2p_group_init() |
int p2p_config_get_random_social | ( | struct p2p_config * | p2p, |
u8 * | op_class, | ||
u8 * | op_channel | ||
) |
Return a random social channel.
p2p | P2P config |
op_class | Selected operating class |
op_channel | Selected social channel |
This function is used before p2p_init is called. A random social channel from supports bands 2.4 GHz (channels 1,6,11) and 60 GHz (channel 2) is returned on success.
int p2p_connect | ( | struct p2p_data * | p2p, |
const u8 * | peer_addr, | ||
enum p2p_wps_method | wps_method, | ||
int | go_intent, | ||
const u8 * | own_interface_addr, | ||
unsigned int | force_freq, | ||
int | persistent_group, | ||
const u8 * | force_ssid, | ||
size_t | force_ssid_len, | ||
int | pd_before_go_neg, | ||
unsigned int | pref_freq, | ||
u16 | oob_pw_id | ||
) |
Start P2P group formation (GO negotiation)
p2p | P2P module context from p2p_init() |
peer_addr | MAC address of the peer P2P client |
wps_method | WPS method to be used in provisioning |
go_intent | Local GO intent value (1..15) |
own_interface_addr | Intended interface address to use with the group |
force_freq | The only allowed channel frequency in MHz or 0 |
persistent_group | Whether to create a persistent group (0 = no, 1 = persistent group without persistent reconnect, 2 = persistent group with persistent reconnect) |
force_ssid | Forced SSID for the group if we become GO or NULL to generate a new SSID |
force_ssid_len | Length of $force_ssid buffer |
pd_before_go_neg | Whether to send Provision Discovery prior to GO Negotiation as an interoperability workaround when initiating group formation |
pref_freq | Preferred operating frequency in MHz or 0 (this is only used if force_freq == 0) |
void p2p_deinit | ( | struct p2p_data * | p2p | ) |
Deinitialize P2P module.
p2p | P2P module context from p2p_init() |
void p2p_expire_peers | ( | struct p2p_data * | p2p | ) |
Periodic cleanup function to expire peers.
p2p | P2P module context from p2p_init() |
This is a cleanup function that the entity calling p2p_init() is expected to call periodically to clean up expired peer entries.
int p2p_ext_listen | ( | struct p2p_data * | p2p, |
unsigned int | period, | ||
unsigned int | interval | ||
) |
Set Extended Listen Timing.
p2p | P2P module context from p2p_init() |
freq | Group operating frequence (in MHz) |
period | Availability period in milliseconds (1-65535; 0 to disable) |
interval | Availability interval in milliseconds (1-65535; 0 to disable) |
This function can be used to enable or disable (period = interval = 0) Extended Listen Timing. When enabled, the P2P Device will become discoverable (go into Listen State) every interval milliseconds for at least period milliseconds.
int p2p_find | ( | struct p2p_data * | p2p, |
unsigned int | timeout, | ||
enum p2p_discovery_type | type, | ||
unsigned int | num_req_dev_types, | ||
const u8 * | req_dev_types, | ||
const u8 * | dev_id, | ||
unsigned int | search_delay, | ||
u8 | seek_count, | ||
const char ** | seek_string, | ||
int | freq | ||
) |
Start P2P Find (Device Discovery)
p2p | P2P module context from p2p_init() |
timeout | Timeout for find operation in seconds or 0 for no timeout |
type | Device Discovery type |
num_req_dev_types | Number of requested device types |
req_dev_types | Requested device types array, must be an array containing num_req_dev_types * WPS_DEV_TYPE_LEN bytes; NULL if no requested device types. |
dev_id | Device ID to search for or NULL to find all devices |
search_delay | Extra delay in milliseconds between search iterations |
seek_count | Number of ASP Service Strings in the seek_string array |
seek_string | ASP Service Strings to query for in Probe Requests |
freq | Requested first scan frequency (in MHz) to modify type == P2P_FIND_START_WITH_FULL behavior. 0 = Use normal full scan. If p2p_find is already in progress, this parameter is ignored and full scan will be executed. |
void p2p_flush | ( | struct p2p_data * | p2p | ) |
Flush P2P module state.
p2p | P2P module context from p2p_init() |
This command removes the P2P module state like peer device entries.
int p2p_get_cross_connect_disallowed | ( | const struct wpabuf * | p2p_ie | ) |
Does WLAN AP disallows cross connection.
p2p_ie | P2P IE(s) contents |
const u8* p2p_get_go_dev_addr | ( | const struct wpabuf * | p2p_ie | ) |
Get P2P Device Address from P2P IE data.
p2p_ie | P2P IE(s) contents |
u8 p2p_get_group_capab | ( | const struct wpabuf * | p2p_ie | ) |
Get Group Capability from P2P IE data.
p2p_ie | P2P IE(s) contents |
unsigned int p2p_get_group_num_members | ( | struct p2p_group * | group | ) |
Get number of members in group.
group | P2P group context from p2p_group_init() |
const struct p2p_peer_info* p2p_get_peer_found | ( | struct p2p_data * | p2p, |
const u8 * | addr, | ||
int | next | ||
) |
Get P2P peer info structure of a found peer.
p2p | P2P module context from p2p_init() |
addr | P2P Device Address of the peer or NULL to indicate the first peer |
next | Whether to select the peer entry following the one indicated by addr |
const struct p2p_peer_info* p2p_get_peer_info | ( | struct p2p_data * | p2p, |
const u8 * | addr, | ||
int | next | ||
) |
Get P2P peer information.
p2p | P2P module context from p2p_init() |
addr | P2P Device Address of the peer or NULL to indicate the first peer |
next | Whether to select the peer entry following the one indicated by addr |
int p2p_get_peer_info_txt | ( | const struct p2p_peer_info * | info, |
char * | buf, | ||
size_t | buflen | ||
) |
Get internal P2P peer information in text format.
info | Pointer to P2P peer info from p2p_get_peer_info() |
buf | Buffer for returning text |
buflen | Maximum buffer length |
Note: This information is internal to the P2P module and subject to change. As such, this should not really be used by external programs for purposes other than debugging.
unsigned int p2p_get_pref_freq | ( | struct p2p_data * | p2p, |
const struct p2p_channels * | channels | ||
) |
Get channel from preferred channel list.
p2p | P2P module context from p2p_init() |
channels | List of channels |
u16 p2p_get_provisioning_info | ( | struct p2p_data * | p2p, |
const u8 * | addr | ||
) |
Get any stored provisioning info.
p2p | P2P module context from p2p_init() |
addr | Peer P2P Device Address |
This function is used to retrieve stored WPS provisioning info for the given peer.
const char* p2p_get_state_txt | ( | struct p2p_data * | p2p | ) |
Get current P2P state for debug purposes.
p2p | P2P module context from p2p_init() |
It should be noted that the P2P module state names are internal information and subject to change at any point, i.e., this information should be used mainly for debugging purposes.
int p2p_go_params | ( | struct p2p_data * | p2p, |
struct p2p_go_neg_results * | params | ||
) |
Generate random P2P group parameters.
p2p | P2P module context from p2p_init() |
params | Buffer for parameters |
Build P2P IE for (re)association response.
group | P2P group context from p2p_group_init() |
status | Status value (P2P_SC_SUCCESS if association succeeded) |
The caller is responsible for freeing the returned buffer with wpabuf_free().
void p2p_group_deinit | ( | struct p2p_group * | group | ) |
Deinitialize P2P group.
group | P2P group context from p2p_group_init() |
void p2p_group_formation_failed | ( | struct p2p_data * | p2p | ) |
Report failed WPS provisioning.
p2p | P2P module context from p2p_init() |
This function is used to report failed group formation. This can happen either due to failed WPS provisioning or due to 15 second timeout during the provisioning phase.
int p2p_group_get_common_freqs | ( | struct p2p_group * | group, |
int * | common_freqs, | ||
unsigned int * | num | ||
) |
Get the group common frequencies.
group | P2P group context from p2p_group_init() |
common_freqs | On return will hold the group common frequencies |
num | On return will hold the number of group common frequencies |
const struct p2p_group_config* p2p_group_get_config | ( | struct p2p_group * | group | ) |
Get the group configuration.
group | P2P group context from p2p_group_init() |
const u8* p2p_group_get_dev_addr | ( | struct p2p_group * | group, |
const u8 * | addr | ||
) |
Get a P2P Device Address of a client in a group.
group | P2P group context from p2p_group_init() |
addr | P2P Interface Address of the client |
int p2p_group_go_discover | ( | struct p2p_group * | group, |
const u8 * | dev_id, | ||
const u8 * | searching_dev, | ||
int | rx_freq | ||
) |
Send GO Discoverability Request to a group client.
group | P2P group context from p2p_group_init() |
struct p2p_group* p2p_group_init | ( | struct p2p_data * | p2p, |
struct p2p_group_config * | config | ||
) |
Initialize P2P group.
p2p | P2P module context from p2p_init() |
config | P2P group configuration (will be freed by p2p_group_deinit()) |
This function is used to initialize per-group P2P module context. Currently, this is only used to manage GO functionality and P2P clients do not need to create an instance of this per-group information.
int p2p_group_is_client_connected | ( | struct p2p_group * | group, |
const u8 * | dev_addr | ||
) |
Check whether a specific client is connected.
group | P2P group context from p2p_group_init() |
addr | P2P Device Address of the client |
Match device types in group with requested type.
group | P2P group context from p2p_group_init() |
wps | WPS TLVs from Probe Request frame (concatenated WPS IEs) |
This function can be used to match the Requested Device Type attribute in WPS IE with the device types of a group member for deciding whether a GO should reply to a Probe Request frame. Match will be reported if the WPS IE is not requested any specific device type.
int p2p_group_notif_assoc | ( | struct p2p_group * | group, |
const u8 * | addr, | ||
const u8 * | ie, | ||
size_t | len | ||
) |
Notification of P2P client association with GO.
group | P2P group context from p2p_group_init() |
addr | Interface address of the P2P client |
ie | IEs from the (Re)association Request frame |
len | Length of the ie buffer in octets |
void p2p_group_notif_disassoc | ( | struct p2p_group * | group, |
const u8 * | addr | ||
) |
Notification of P2P client disassociation from GO.
group | P2P group context from p2p_group_init() |
addr | Interface address of the P2P client |
void p2p_group_notif_formation_done | ( | struct p2p_group * | group | ) |
Notification of completed group formation.
group | P2P group context from p2p_group_init() |
int p2p_group_notif_noa | ( | struct p2p_group * | group, |
const u8 * | noa, | ||
size_t | noa_len | ||
) |
Notification of NoA change.
group | P2P group context from p2p_group_init() |
noa | Notice of Absence attribute payload, NULL if none |
noa_len | Length of noa buffer in octets |
Notify the P2P group management about a new NoA contents. This will be inserted into the P2P IEs in Beacon and Probe Response frames with rest of the group information.
int p2p_ie_text | ( | struct wpabuf * | p2p_ie, |
char * | buf, | ||
char * | end | ||
) |
Build text format description of P2P IE.
p2p_ie | P2P IE |
buf | Buffer for returning text |
end | Pointer to the end of the buf area |
This function can be used to parse P2P IE contents into text format field=value lines.
int p2p_in_progress | ( | struct p2p_data * | p2p | ) |
Check whether a P2P operation is progress.
p2p | P2P module context from p2p_init() |
struct p2p_data* p2p_init | ( | const struct p2p_config * | cfg | ) |
Initialize P2P module.
cfg | P2P module configuration |
This function is used to initialize global P2P module context (one per device). The P2P module will keep a copy of the configuration data, so the caller does not need to maintain this structure. However, the callback functions and the context parameters to them must be kept available until the P2P module is deinitialized with p2p_deinit().
int p2p_invite | ( | struct p2p_data * | p2p, |
const u8 * | peer, | ||
enum p2p_invite_role | role, | ||
const u8 * | bssid, | ||
const u8 * | ssid, | ||
size_t | ssid_len, | ||
unsigned int | force_freq, | ||
const u8 * | go_dev_addr, | ||
int | persistent_group, | ||
unsigned int | pref_freq, | ||
int | dev_pw_id | ||
) |
Invite a P2P Device into a group.
p2p | P2P module context from p2p_init() |
peer | Device Address of the peer P2P Device |
role | Local role in the group |
bssid | Group BSSID or NULL if not known |
ssid | Group SSID |
ssid_len | Length of ssid in octets |
force_freq | The only allowed channel frequency in MHz or 0 |
go_dev_addr | Forced GO Device Address or NULL if none |
persistent_group | Whether this is to reinvoke a persistent group |
pref_freq | Preferred operating frequency in MHz or 0 (this is only used if force_freq == 0) |
dev_pw_id | Device Password ID from OOB Device Password (NFC) static handover case or -1 if not used |
const u8* p2p_iterate_group_members | ( | struct p2p_group * | group, |
void ** | next | ||
) |
Iterate group members.
group | P2P group context from p2p_group_init() |
next | iteration pointer, must be a pointer to a void * that is set to NULL on the first call and not modified later |
int p2p_listen | ( | struct p2p_data * | p2p, |
unsigned int | timeout | ||
) |
Start P2P Listen state for specified duration.
p2p | P2P module context from p2p_init() |
timeout | Listen state duration in milliseconds |
This function can be used to request the P2P module to keep the device discoverable on the listen channel for an extended set of time. At least in its current form, this is mainly used for testing purposes and may not be of much use for normal P2P operations.
void p2p_listen_cb | ( | struct p2p_data * | p2p, |
unsigned int | freq, | ||
unsigned int | duration | ||
) |
Indicate the start of a requested Listen state.
p2p | P2P module context from p2p_init() |
freq | Listen channel frequency in MHz |
duration | Duration for the Listen state in milliseconds |
This function is used to indicate that a Listen state requested with struct p2p_config::start_listen() callback has started.
int p2p_listen_end | ( | struct p2p_data * | p2p, |
unsigned int | freq | ||
) |
Indicate the end of a requested Listen state.
p2p | P2P module context from p2p_init() |
freq | Listen channel frequency in MHz |
This function is used to indicate that a Listen state requested with struct p2p_config::start_listen() callback has ended.
void p2p_loop_on_all_groups | ( | struct p2p_data * | p2p, |
int(*)(struct p2p_group *group, void *user_data) | group_callback, | ||
void * | user_data | ||
) |
Run the given callback on all groups.
p2p | P2P module context from p2p_init() |
group_callback | The callback function pointer |
user_data | Some user data pointer which can be NULL |
The group_callback function can stop the iteration by returning 0.
void p2p_notify_scan_trigger_status | ( | struct p2p_data * | p2p, |
int | status | ||
) |
Indicate scan trigger status.
p2p | P2P module context from p2p_init() |
status | 0 on success, -1 on failure |
int p2p_parse_dev_addr | ( | const u8 * | ies, |
size_t | ies_len, | ||
u8 * | dev_addr | ||
) |
Parse P2P Device Address from P2P IE(s)
ies | Information elements from scan results |
ies_len | ies buffer length in octets |
dev_addr | Buffer for returning P2P Device Address |
int p2p_parse_dev_addr_in_p2p_ie | ( | struct wpabuf * | p2p_ie, |
u8 * | dev_addr | ||
) |
Parse P2P Device Address from a concatenated P2P IE.
p2p_ie | P2P IE |
dev_addr | Buffer for returning P2P Device Address |
int p2p_peer_known | ( | struct p2p_data * | p2p, |
const u8 * | addr | ||
) |
Check whether P2P peer is known.
p2p | P2P module context from p2p_init() |
addr | P2P Device Address of the peer |
int p2p_presence_req | ( | struct p2p_data * | p2p, |
const u8 * | go_interface_addr, | ||
const u8 * | own_interface_addr, | ||
unsigned int | freq, | ||
u32 | duration1, | ||
u32 | interval1, | ||
u32 | duration2, | ||
u32 | interval2 | ||
) |
Request GO presence.
p2p | P2P module context from p2p_init() |
go_interface_addr | GO P2P Interface Address |
own_interface_addr | Own P2P Interface Address for this group |
freq | Group operating frequence (in MHz) |
duration1 | Preferred presence duration in microseconds |
interval1 | Preferred presence interval in microseconds |
duration2 | Acceptable presence duration in microseconds |
interval2 | Acceptable presence interval in microseconds |
If both duration and interval values are zero, the parameter pair is not specified (i.e., to remove Presence Request, use duration1 = interval1 = 0).
enum p2p_probe_req_status p2p_probe_req_rx | ( | struct p2p_data * | p2p, |
const u8 * | addr, | ||
const u8 * | dst, | ||
const u8 * | bssid, | ||
const u8 * | ie, | ||
size_t | ie_len, | ||
unsigned int | rx_freq | ||
) |
Report reception of a Probe Request frame.
p2p | P2P module context from p2p_init() |
addr | Source MAC address |
dst | Destination MAC address if available or NULL |
bssid | BSSID if available or NULL |
ie | Information elements from the Probe Request frame body |
ie_len | Length of ie buffer in octets |
rx_freq | Probe Request frame RX frequency |
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.
p2p | P2P module context from p2p_init() |
peer_addr | MAC address of the peer P2P client |
p2ps_prov | Provisioning info for P2PS |
config_methods | WPS Config Methods value (only one bit set) |
join | Whether this is used by a client joining an active group |
force_freq | Forced TX frequency for the frame (mainly for the join case) |
user_initiated_pd | Flag to indicate if initiated by user or not |
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.
int p2p_reject | ( | struct p2p_data * | p2p, |
const u8 * | peer_addr | ||
) |
Reject peer device (explicitly block connection attempts)
p2p | P2P module context from p2p_init() |
peer_addr | MAC address of the peer P2P client |
void p2p_remove_wps_vendor_extensions | ( | struct p2p_data * | p2p | ) |
Remove WPS vendor extensions.
p2p | P2P module context from p2p_init() |
void p2p_rx_action | ( | struct p2p_data * | p2p, |
const u8 * | da, | ||
const u8 * | sa, | ||
const u8 * | bssid, | ||
u8 | category, | ||
const u8 * | data, | ||
size_t | len, | ||
int | freq | ||
) |
Report received Action frame.
p2p | P2P module context from p2p_init() |
da | Destination address of the received Action frame |
sa | Source address of the received Action frame |
bssid | Address 3 of the received Action frame |
category | Category of the received Action frame |
data | Action frame body after the Category field |
len | Length of the data buffer in octets |
freq | Frequency (in MHz) on which the frame was received |
Build P2P IE for Probe Request.
p2p | P2P module context from p2p_init() |
ies | Buffer for writing P2P IE |
dev_id | Device ID to search for or NULL for any |
size_t p2p_scan_ie_buf_len | ( | struct p2p_data * | p2p | ) |
Get maximum buffer length needed for p2p_scan_ie.
p2p | P2P module context from p2p_init() |
void p2p_scan_res_handled | ( | struct p2p_data * | p2p | ) |
Indicate end of scan results.
p2p | P2P module context from p2p_init() |
This function is called to indicate that all P2P scan results from a scan have been reported with zero or more calls to p2p_scan_res_handler(). This function must be called as a response to successful struct p2p_config::p2p_scan() call if none of the p2p_scan_res_handler() calls stopped iteration.
int p2p_scan_res_handler | ( | struct p2p_data * | p2p, |
const u8 * | bssid, | ||
int | freq, | ||
struct os_reltime * | rx_time, | ||
int | level, | ||
const u8 * | ies, | ||
size_t | ies_len | ||
) |
Indicate a P2P scan results.
p2p | P2P module context from p2p_init() |
bssid | BSSID of the scan result |
freq | Frequency of the channel on which the device was found in MHz |
rx_time | Time when the result was received |
level | Signal level (signal strength of the received Beacon/Probe Response frame) |
ies | Pointer to IEs from the scan result |
ies_len | Length of the ies buffer |
This function is called to indicate a scan result entry with P2P IE from a scan requested with struct p2p_config::p2p_scan(). This can be called during the actual scan process (i.e., whenever a new device is found) or as a sequence of calls after the full scan has been completed. The former option can result in optimized operations, but may not be supported by all driver/firmware designs. The ies buffer need to include at least the P2P IE, but it is recommended to include all IEs received from the device. The caller does not need to check that the IEs contain a P2P IE before calling this function since frames will be filtered internally if needed.
This function will return 1 if it wants to stop scan result iteration (and scan in general if it is still in progress). This is used to allow faster start of a pending operation, e.g., to start a pending GO negotiation.
int p2p_scan_result_text | ( | const u8 * | ies, |
size_t | ies_len, | ||
char * | buf, | ||
char * | end | ||
) |
Build text format description of P2P IE.
ies | Information elements from scan results |
ies_len | ies buffer length in octets |
buf | Buffer for returning text |
end | Pointer to the end of the buf area |
This function can be used to parse P2P IE contents into text format field=value lines.
int p2p_sd_cancel_request | ( | struct p2p_data * | p2p, |
void * | req | ||
) |
Cancel a pending service discovery query.
p2p | P2P module context from p2p_init() |
req | Query reference from p2p_sd_request() |
Schedule a service discovery query.
p2p | P2P module context from p2p_init() |
dst | Destination peer or NULL to apply for all peers |
tlvs | P2P Service Query TLV(s) |
Response to the query is indicated with the p2p_config::sd_response() callback.
void p2p_sd_response | ( | struct p2p_data * | p2p, |
int | freq, | ||
const u8 * | dst, | ||
u8 | dialog_token, | ||
const struct wpabuf * | resp_tlvs | ||
) |
Send response to a service discovery query.
p2p | P2P module context from p2p_init() |
freq | Frequency from p2p_config::sd_request() callback |
dst | Destination address from p2p_config::sd_request() callback |
dialog_token | Dialog token from p2p_config::sd_request() callback |
resp_tlvs | P2P Service Response TLV(s) |
This function is called as a response to the request indicated with p2p_config::sd_request() callback.
void p2p_sd_service_update | ( | struct p2p_data * | p2p | ) |
Indicate a change in local services.
p2p | P2P module context from p2p_init() |
This function needs to be called whenever there is a change in availability of the local services. This will increment the Service Update Indicator value which will be used in SD Request and Response frames.
void p2p_send_action_cb | ( | struct p2p_data * | p2p, |
unsigned int | freq, | ||
const u8 * | dst, | ||
const u8 * | src, | ||
const u8 * | bssid, | ||
enum p2p_send_action_result | result | ||
) |
Notify TX status of an Action frame.
p2p | P2P module context from p2p_init() |
freq | Channel frequency in MHz |
dst | Destination MAC address (Address 1) |
src | Source MAC address (Address 2) |
bssid | BSSID (Address 3) |
result | Result of the transmission attempt |
This function is used to indicate the result of an Action frame transmission that was requested with struct p2p_config::send_action() callback.
void p2p_set_best_channels | ( | struct p2p_data * | p2p, |
int | freq_24, | ||
int | freq_5, | ||
int | freq_overall | ||
) |
Update best channel information.
p2p | P2P module context from p2p_init() |
freq_24 | Frequency (MHz) of best channel in 2.4 GHz band |
freq_5 | Frequency (MHz) of best channel in 5 GHz band |
freq_overall | Frequency (MHz) of best channel overall |
void p2p_set_client_discoverability | ( | struct p2p_data * | p2p, |
int | enabled | ||
) |
Set client discoverability capability.
p2p | P2P module context from p2p_init() |
enabled | Whether client discoverability will be enabled |
This function can be used to disable (and re-enable) client discoverability. This capability is enabled by default and should not be disabled in normal use cases, i.e., this is mainly for testing purposes.
void p2p_set_config_timeout | ( | struct p2p_data * | p2p, |
u8 | go_timeout, | ||
u8 | client_timeout | ||
) |
Set local config timeouts.
p2p | P2P module context from p2p_init() |
go_timeout | Time in 10 ms units it takes to start the GO mode |
client_timeout | Time in 10 ms units it takes to start the client mode |
void p2p_set_cross_connect | ( | struct p2p_data * | p2p, |
int | enabled | ||
) |
Set cross connection capability.
p2p | P2P module context from p2p_init() |
enabled | Whether cross connection will be enabled |
int p2p_set_dev_name | ( | struct p2p_data * | p2p, |
const char * | dev_name | ||
) |
Set device name.
p2p | P2P module context from p2p_init() |
This function can be used to update the P2P module configuration with information that was not available at the time of the p2p_init() call.
int p2p_set_disc_int | ( | struct p2p_data * | p2p, |
int | min_disc_int, | ||
int | max_disc_int, | ||
int | max_disc_tu | ||
) |
Set min/max discoverable interval for p2p_find.
p2p | P2P module context from p2p_init() |
min_disc_int | minDiscoverableInterval (in units of 100 TU); default 1 |
max_disc_int | maxDiscoverableInterval (in units of 100 TU); default 3 |
max_disc_tu | Maximum number of TUs (1.024 ms) for discoverable interval; or -1 not to limit |
This function can be used to configure minDiscoverableInterval and maxDiscoverableInterval parameters for the Listen state during device discovery (p2p_find). A random number of 100 TU units is picked for each Listen state iteration from [min_disc_int,max_disc_int] range.
max_disc_tu can be used to futher limit the discoverable duration. However, it should be noted that use of this parameter is not recommended since it would not be compliant with the P2P specification.
void p2p_set_intra_bss_dist | ( | struct p2p_data * | p2p, |
int | enabled | ||
) |
Set intra BSS distribution.
p2p | P2P module context from p2p_init() |
enabled | Whether intra BSS distribution will be enabled |
void p2p_set_managed_oper | ( | struct p2p_data * | p2p, |
int | enabled | ||
) |
Set managed P2P Device operations capability.
p2p | P2P module context from p2p_init() |
enabled | Whether managed P2P Device operations will be enabled |
int p2p_set_no_go_freq | ( | struct p2p_data * | p2p, |
const struct wpa_freq_range_list * | list | ||
) |
Set no GO channel ranges.
p2p | P2P module context from p2p_init() |
list | Channel ranges or NULL to remove restriction |
int p2p_set_oper_channel | ( | struct p2p_data * | p2p, |
u8 | op_reg_class, | ||
u8 | op_channel, | ||
int | cfg_op_channel | ||
) |
Set the P2P operating channel.
p2p | P2P module context from p2p_init() |
op_reg_class | Operating regulatory class to set |
op_channel | operating channel to set |
cfg_op_channel | : Whether op_channel is hardcoded in configuration |
void p2p_set_own_freq_preference | ( | struct p2p_data * | p2p, |
int | freq | ||
) |
Set own preference for channel.
p2p | P2P module context from p2p_init() |
freq | Frequency (MHz) of the preferred channel or 0 if no preference |
This function can be used to set a preference on the operating channel based on frequencies used on the other virtual interfaces that share the same radio. If non-zero, this is used to try to avoid multi-channel concurrency.
int p2p_set_pref_chan | ( | struct p2p_data * | p2p, |
unsigned int | num_pref_chan, | ||
const struct p2p_channel * | pref_chan | ||
) |
Set P2P preferred channel list.
p2p | P2P module context from p2p_init() |
num_pref_chan | Number of entries in pref_chan list |
pref_chan | Preferred channels or NULL to remove preferences |
int p2p_set_pri_dev_type | ( | struct p2p_data * | p2p, |
const u8 * | pri_dev_type | ||
) |
Set primary device type.
p2p | P2P module context from p2p_init() |
This function can be used to update the P2P module configuration with information that was not available at the time of the p2p_init() call.
int p2p_set_sec_dev_types | ( | struct p2p_data * | p2p, |
const u8 | dev_types[][8], | ||
size_t | num_dev_types | ||
) |
Set secondary device types.
p2p | P2P module context from p2p_init() |
This function can be used to update the P2P module configuration with information that was not available at the time of the p2p_init() call.
void p2p_stop_find | ( | struct p2p_data * | p2p | ) |
Stop P2P Find (Device Discovery)
p2p | P2P module context from p2p_init() |
void p2p_stop_find_for_freq | ( | struct p2p_data * | p2p, |
int | freq | ||
) |
Stop P2P Find for next oper on specific freq.
p2p | P2P module context from p2p_init() |
freq | Frequency in MHz for next operation |
This is like p2p_stop_find(), but Listen state is not stopped if we are already on the same frequency.
void p2p_stop_listen | ( | struct p2p_data * | p2p | ) |
Stop P2P Listen.
p2p | P2P module context from p2p_init() |
int p2p_supported_freq | ( | struct p2p_data * | p2p, |
unsigned int | freq | ||
) |
Check whether channel is supported for P2P.
p2p | P2P module context from p2p_init() |
freq | Channel frequency in MHz |
int p2p_supported_freq_cli | ( | struct p2p_data * | p2p, |
unsigned int | freq | ||
) |
Check whether channel is supported for P2P client operation.
p2p | P2P module context from p2p_init() |
freq | Channel frequency in MHz |
int p2p_supported_freq_go | ( | struct p2p_data * | p2p, |
unsigned int | freq | ||
) |
Check whether channel is supported for P2P GO operation.
p2p | P2P module context from p2p_init() |
freq | Channel frequency in MHz |
int p2p_unauthorize | ( | struct p2p_data * | p2p, |
const u8 * | addr | ||
) |
Unauthorize the specified peer device.
p2p | P2P module context from p2p_init() |
addr | P2P peer entry to be unauthorized |
This command removes any connection authorization from the specified P2P peer device address. This can be used, e.g., to cancel effect of a previous p2p_authorize() or p2p_connect() call that has not yet resulted in completed GO Negotiation.
void p2p_wps_success_cb | ( | struct p2p_data * | p2p, |
const u8 * | mac_addr | ||
) |
Report successfully completed WPS provisioning.
p2p | P2P module context from p2p_init() |
mac_addr | Peer address |
This function is used to report successfully completed WPS provisioning during group formation in both GO/Registrar and client/Enrollee roles.