wpa_printf(MSG_DEBUG, "P2P: * Channel List");
}
+#ifdef ANDROID_P2P
/* Adds a given channel as the only channel in channel list attribute */
void p2p_buf_add_oper_as_channel_list(struct wpabuf *buf, const char *country,
u8 reg_class, u8 channel)
WPA_PUT_LE16(len, (u8 *) wpabuf_put(buf, 0) - len - 2);
wpa_printf(MSG_DEBUG, "P2P: * Oper as Channel List %u", channel);
}
+#endif
void p2p_buf_add_status(struct wpabuf *buf, u8 status)
{
p2p_buf_add_ext_listen_timing(buf, p2p->ext_listen_period,
p2p->ext_listen_interval);
p2p_buf_add_intended_addr(buf, p2p->intended_addr);
+#ifdef ANDROID_P2P
if (p2p->cfg->p2p_concurrency == P2P_SINGLE_CHANNEL_CONCURRENT && p2p->op_channel) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Force channel list %d", p2p->op_channel);
p2p_buf_add_oper_as_channel_list(buf, p2p->cfg->country, p2p->op_reg_class,
p2p->op_channel);
} else {
+#endif
p2p_buf_add_channel_list(buf, p2p->cfg->country, &p2p->channels);
+#ifdef ANDROID_P2P
}
+#endif
p2p_buf_add_device_info(buf, p2p, peer);
p2p_buf_add_operating_channel(buf, p2p->cfg->country,
p2p->op_reg_class, p2p->op_channel);
p2p_buf_add_go_intent(buf, (p2p->go_intent << 1) | tie_breaker);
p2p_buf_add_config_timeout(buf, p2p->go_timeout, p2p->client_timeout);
if (peer && peer->go_state == REMOTE_GO) {
+#ifdef ANDROID_P2P
if (p2p->cfg->p2p_concurrency == P2P_SINGLE_CHANNEL_CONCURRENT && p2p->op_channel) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Forcing a channel ");
p2p_buf_add_operating_channel(buf, p2p->cfg->country,
p2p->op_reg_class, p2p->op_channel);
} else {
+#endif
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Omit Operating "
"Channel attribute");
+#ifdef ANDROID_P2P
}
+#endif
} else {
p2p_buf_add_operating_channel(buf, p2p->cfg->country,
p2p->op_reg_class,
}
p2p_buf_add_intended_addr(buf, p2p->intended_addr);
+#ifdef ANDROID_P2P
if (p2p->cfg->p2p_concurrency == P2P_SINGLE_CHANNEL_CONCURRENT && p2p->op_channel) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Force channel list %d", p2p->op_channel);
p2p_buf_add_oper_as_channel_list(buf, p2p->cfg->country, p2p->op_reg_class,
p2p->op_channel);
} else {
+#endif
if (status || peer == NULL) {
p2p_buf_add_channel_list(buf, p2p->cfg->country,
&p2p->channels);
&res);
p2p_buf_add_channel_list(buf, p2p->cfg->country, &res);
}
+#ifdef ANDROID_P2P
}
+#endif
p2p_buf_add_device_info(buf, p2p, peer);
if (peer && peer->go_state == LOCAL_GO) {
#endif /* CONFIG_P2P_STRICT */
}
+#ifdef ANDROID_P2P
if (msg.operating_channel) {
dev->oper_freq = p2p_channel_to_freq((const char *)
msg.operating_channel,
"channel preference: %d MHz", dev->oper_freq);
} else
dev->oper_freq = 0;
+#endif
if (!msg.channel_list) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
p2p->op_reg_class, p2p->op_channel);
if (p2p->inv_bssid_set)
p2p_buf_add_group_bssid(buf, p2p->inv_bssid);
+#ifdef ANDROID_P2P
if (p2p->cfg->p2p_concurrency == P2P_SINGLE_CHANNEL_CONCURRENT && p2p->op_channel) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "Forcing channel list %d", p2p->op_channel);
p2p_buf_add_oper_as_channel_list(buf, p2p->cfg->country, p2p->op_reg_class,
p2p->op_channel);
} else {
+#endif
p2p_buf_add_channel_list(buf, p2p->cfg->country, &p2p->channels);
+#ifdef ANDROID_P2P
}
+#endif
if (go_dev_addr)
dev_addr = go_dev_addr;
else if (p2p->inv_role == P2P_INVITE_ROLE_CLIENT)
reg_class, channel);
if (group_bssid)
p2p_buf_add_group_bssid(buf, group_bssid);
+#ifdef ANDROID_P2P
if (p2p->cfg->p2p_concurrency == P2P_SINGLE_CHANNEL_CONCURRENT && channel) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "Forcing channel list %d", channel);
p2p_buf_add_oper_as_channel_list(buf, p2p->cfg->country,
reg_class, channel);
} else {
+#endif
if (channels)
p2p_buf_add_channel_list(buf, p2p->cfg->country, channels);
+#ifdef ANDROID_P2P
}
+#endif
p2p_buf_update_ie_hdr(buf, len);
#ifdef CONFIG_WIFI_DISPLAY
{
enum p2p_invite_role role;
u8 *bssid = NULL;
+#ifdef ANDROID_P2P
int force_freq = 0, oper_freq = 0;
+#endif
wpa_s->p2p_persistent_go_freq = freq;
wpa_s->p2p_go_ht40 = !!ht40;
}
wpa_s->pending_invite_ssid_id = ssid->id;
+#ifdef ANDROID_P2P
if (wpa_s->current_ssid && wpa_drv_get_bssid(wpa_s, bssid) == 0 &&
wpa_s->assoc_freq)
oper_freq = wpa_s->assoc_freq;
"interface", oper_freq);
force_freq = oper_freq;
}
-
+#endif
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_MGMT)
return wpa_drv_p2p_invite(wpa_s, peer_addr, role, bssid,
ssid->ssid, ssid->ssid_len,
if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
return -1;
+#ifdef ANDROID_P2P
return p2p_invite(wpa_s->global->p2p, peer_addr, role, bssid,
ssid->ssid, ssid->ssid_len, force_freq, go_dev_addr, 1);
+#else
+ return p2p_invite(wpa_s->global->p2p, peer_addr, role, bssid,
+ ssid->ssid, ssid->ssid_len, freq, go_dev_addr, 1);
+#endif
}