Lines Matching refs:p2p
2 * Wi-Fi Direct - P2P group operations
18 #include "p2p.h"
23 u8 addr[ETH_ALEN]; /* P2P Interface Address */
24 u8 dev_addr[ETH_ALEN]; /* P2P Device Address */
32 * struct p2p_group - Internal P2P module per-group data
35 struct p2p_data *p2p;
46 struct p2p_group * p2p_group_init(struct p2p_data *p2p,
55 groups = os_realloc_array(p2p->groups, p2p->num_groups + 1,
61 groups[p2p->num_groups++] = group;
62 p2p->groups = groups;
64 group->p2p = p2p;
101 struct p2p_data *p2p;
106 p2p = group->p2p;
108 for (g = 0; g < p2p->num_groups; g++) {
109 if (p2p->groups[g] == group) {
110 while (g + 1 < p2p->num_groups) {
111 p2p->groups[g] = p2p->groups[g + 1];
114 p2p->num_groups--;
140 u8 dev_capab = group->p2p->dev_capab, group_capab = 0;
142 /* P2P Capability */
150 if (group->p2p->cfg->p2p_intra_bss)
154 if (group->p2p->cross_connect)
215 if (group->p2p->wfd_ie_beacon)
216 extra = wpabuf_len(group->p2p->wfd_ie_beacon);
219 if (group->p2p->vendor_elem &&
220 group->p2p->vendor_elem[VENDOR_ELEM_BEACON_P2P_GO])
221 extra += wpabuf_len(group->p2p->vendor_elem[VENDOR_ELEM_BEACON_P2P_GO]);
228 if (group->p2p->wfd_ie_beacon)
229 wpabuf_put_buf(ie, group->p2p->wfd_ie_beacon);
232 if (group->p2p->vendor_elem &&
233 group->p2p->vendor_elem[VENDOR_ELEM_BEACON_P2P_GO])
235 group->p2p->vendor_elem[VENDOR_ELEM_BEACON_P2P_GO]);
239 p2p_buf_add_device_id(ie, group->p2p->cfg->dev_addr);
361 if (!group->p2p->wfd_ie_probe_resp)
364 wfd_subelems = wpabuf_alloc(wpabuf_len(group->p2p->wfd_ie_probe_resp) +
368 if (group->p2p->wfd_dev_info)
369 wpabuf_put_buf(wfd_subelems, group->p2p->wfd_dev_info);
370 if (group->p2p->wfd_assoc_bssid)
372 group->p2p->wfd_assoc_bssid);
373 if (group->p2p->wfd_coupled_sink_info)
375 group->p2p->wfd_coupled_sink_info);
393 p2p_dbg(group->p2p, "WFD: WFD Session Info: %u descriptors",
419 p2p_dbg(group->p2p, "* P2P Group Info");
436 p2p_buf_add_group_id(buf, group->p2p->cfg->dev_addr, group->cfg->ssid,
452 /* P2P Device Info */
453 p2p_buf_add_device_info(p2p_subelems, group->p2p, NULL);
455 /* P2P Group Info: Only when at least one P2P Client is connected */
462 if (group->p2p->vendor_elem &&
463 group->p2p->vendor_elem[VENDOR_ELEM_PROBE_RESP_P2P_GO]) {
465 extra = wpabuf_dup(group->p2p->vendor_elem[VENDOR_ELEM_PROBE_RESP_P2P_GO]);
492 wpa_hexdump_buf(MSG_MSGDUMP, "P2P: Update GO Probe Response P2P IE",
499 wpa_hexdump_buf(MSG_MSGDUMP, "P2P: Update GO Beacon P2P IE",
509 * p2p_build_client_info - Build P2P Client Info Descriptor
511 * @p2p_ie: P2P IE from (Re)Association Request
513 * @dev_addr: Buffer for returning P2P Device Address
514 * Returns: P2P Client Info Descriptor or %NULL on failure
516 * This function builds P2P Client Info Descriptor based on the information
518 * build the P2P Group Info attribute for Probe Response frames.
544 spos = msg.p2p_device_info; /* P2P Device address */
546 /* P2P Client Info Descriptor */
549 /* P2P Device address */
551 /* P2P Interface address */
608 p2p_add_device(group->p2p, addr, 0, NULL, 0, ie, len, 0);
629 p2p_dbg(group->p2p, "Add client " MACSTR
630 " to group (p2p=%d wfd=%d client_info=%d); num_members=%u/%u",
655 if (group->p2p->vendor_elem &&
656 group->p2p->vendor_elem[VENDOR_ELEM_P2P_ASSOC_RESP])
657 extra += wpabuf_len(group->p2p->vendor_elem[VENDOR_ELEM_P2P_ASSOC_RESP]);
660 * (Re)Association Response - P2P IE
674 if (group->p2p->vendor_elem &&
675 group->p2p->vendor_elem[VENDOR_ELEM_P2P_ASSOC_RESP])
677 group->p2p->vendor_elem[VENDOR_ELEM_P2P_ASSOC_RESP]);
691 p2p_dbg(group->p2p, "Remove client " MACSTR
761 if (p2p_match_dev_type(group->p2p, wps))
774 int p2p_group_match_dev_id(struct p2p_group *group, struct wpabuf *p2p)
780 if (p2p_parse_p2p_ie(p2p, &msg))
786 if (os_memcmp(msg.device_id, group->p2p->cfg->dev_addr, ETH_ALEN) == 0)
787 return 1; /* Match with our P2P Device Address */
791 return 1; /* Match with group client P2P Device Address */
899 struct p2p_data *p2p = group->p2p;
904 p2p_dbg(group->p2p, "Requested client was not in this group "
910 p2p_dbg(group->p2p, "Requested client does not support client discoverability");
914 p2p_dbg(group->p2p, "Schedule GO Discoverability Request to be sent to "
924 p2p->pending_action_state = P2P_PENDING_GO_DISC_REQ;
925 if (p2p->cfg->send_action(p2p->cfg->cb_ctx, freq, m->addr,
930 p2p_dbg(p2p, "Failed to send Action frame");
955 p2p_dbg(group->p2p, "Client was not in this group");
959 wpa_hexdump(MSG_DEBUG, "P2P: Presence Request NoA", noa, noa_len);
961 if (group->p2p->cfg->get_noa)
962 curr_noa_len = group->p2p->cfg->get_noa(
963 group->p2p->cfg->cb_ctx, group->cfg->interface_addr,
968 p2p_dbg(group->p2p, "Failed to fetch current NoA");
970 p2p_dbg(group->p2p, "No NoA being advertized");
972 wpa_hexdump(MSG_DEBUG, "P2P: Current NoA", curr_noa,
1037 if (os_memcmp(group_id, group->p2p->cfg->dev_addr, ETH_ALEN) != 0)
1063 void p2p_loop_on_all_groups(struct p2p_data *p2p,
1070 for (i = 0; i < p2p->num_groups; i++) {
1071 if (!group_callback(p2p->groups[i], user_data))
1090 p2p_channels_union(&intersect, &group->p2p->cfg->channels,
1093 p2p_channels_dump(group->p2p,
1100 dev = p2p_get_device(group->p2p, m->dev_addr);
1108 p2p_channels_dump(group->p2p, "Group common channels", &intersect);