static struct wpabuf * p2p_group_build_beacon_ie(struct p2p_group *group) { struct wpabuf *ie; u8 *len; size_t extra = 0; #ifdef CONFIG_WIFI_DISPLAY if (group->p2p->wfd_ie_beacon) extra = wpabuf_len(group->p2p->wfd_ie_beacon); #endif /* CONFIG_WIFI_DISPLAY */ ie = wpabuf_alloc(257 + extra); if (ie == NULL) return NULL; #ifdef CONFIG_WIFI_DISPLAY if (group->p2p->wfd_ie_beacon) wpabuf_put_buf(ie, group->p2p->wfd_ie_beacon); #endif /* CONFIG_WIFI_DISPLAY */ len = p2p_buf_add_ie_hdr(ie); p2p_group_add_common_ies(group, ie); p2p_buf_add_device_id(ie, group->p2p->cfg->dev_addr); p2p_group_add_noa(ie, group->noa); p2p_buf_update_ie_hdr(ie, len); return ie; }
static struct wpabuf * p2p_group_build_beacon_ie(struct p2p_group *group) { struct wpabuf *ie; u8 *len; ie = wpabuf_alloc(257); if (ie == NULL) return NULL; len = p2p_buf_add_ie_hdr(ie); p2p_group_add_common_ies(group, ie); #ifdef ANDROID_BRCM_P2P_PATCH /* P2P_ADDR: Use p2p_dev_addr instead of own mac addr*/ p2p_buf_add_device_id(ie, group->p2p->cfg->p2p_dev_addr); #else p2p_buf_add_device_id(ie, group->p2p->cfg->dev_addr); #endif p2p_group_add_noa(ie, group->noa); p2p_buf_update_ie_hdr(ie, len); return ie; }
static struct wpabuf * p2p_group_build_beacon_ie(struct p2p_group *group) { struct wpabuf *ie; u8 *len; ie = wpabuf_alloc(257); if (ie == NULL) return NULL; len = p2p_buf_add_ie_hdr(ie); p2p_group_add_common_ies(group, ie); p2p_buf_add_device_id(ie, group->p2p->cfg->dev_addr); p2p_group_add_noa(ie, group->noa); p2p_buf_update_ie_hdr(ie, len); return ie; }
static struct wpabuf * p2p_build_dev_disc_req(struct p2p_data *p2p, struct p2p_device *go, const u8 *dev_id) { struct wpabuf *buf; u8 *len; buf = wpabuf_alloc(100); if (buf == NULL) return NULL; go->dialog_token++; if (go->dialog_token == 0) go->dialog_token = 1; p2p_buf_add_public_action_hdr(buf, P2P_DEV_DISC_REQ, go->dialog_token); len = p2p_buf_add_ie_hdr(buf); p2p_buf_add_device_id(buf, dev_id); p2p_buf_add_group_id(buf, go->info.p2p_device_addr, go->oper_ssid, go->oper_ssid_len); p2p_buf_update_ie_hdr(buf, len); return buf; }