dev->wps_method = wps_method;
dev->status = P2P_SC_SUCCESS;
+
+ if (force_freq)
+ dev->flags |= P2P_DEV_FORCE_FREQ;
+ else
+ dev->flags &= ~P2P_DEV_FORCE_FREQ;
+
if (p2p->p2p_scan_running) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: p2p_scan running - delay connect send");
dev->wps_method = wps_method;
dev->status = P2P_SC_SUCCESS;
+ if (force_freq)
+ dev->flags |= P2P_DEV_FORCE_FREQ;
+ else
+ dev->flags &= ~P2P_DEV_FORCE_FREQ;
+
return 0;
}
"country=%c%c\n"
"oper_freq=%d\n"
"req_config_methods=0x%x\n"
- "flags=%s%s%s%s%s%s%s%s%s%s%s%s%s\n"
+ "flags=%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n"
"status=%d\n"
"wait_count=%u\n"
"invitation_reqs=%u\n",
"[WAIT_GO_NEG_CONFIRM]" : "",
dev->flags & P2P_DEV_GROUP_CLIENT_ONLY ?
"[GROUP_CLIENT_ONLY]" : "",
+ dev->flags & P2P_DEV_FORCE_FREQ ?
+ "[FORCE_FREQ" : "",
dev->status,
dev->wait_count,
dev->invitation_reqs);
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Starting "
"GO Negotiation with previously authorized "
"peer");
- /* TODO: check if force_freq is needed */
- p2p->op_reg_class = p2p->cfg->op_reg_class;
- p2p->op_channel = p2p->cfg->op_channel;
- os_memcpy(&p2p->channels, &p2p->cfg->channels,
- sizeof(struct p2p_channels));
+ if (!(dev->flags & P2P_DEV_FORCE_FREQ)) {
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
+ "P2P: Use default channel settings");
+ p2p->op_reg_class = p2p->cfg->op_reg_class;
+ p2p->op_channel = p2p->cfg->op_channel;
+ os_memcpy(&p2p->channels, &p2p->cfg->channels,
+ sizeof(struct p2p_channels));
+ } else {
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
+ "P2P: Use previously configured "
+ "forced channel settings");
+ }
}
dev->flags &= ~P2P_DEV_NOT_YET_READY;
#define P2P_DEV_WAIT_GO_NEG_RESPONSE BIT(10)
#define P2P_DEV_WAIT_GO_NEG_CONFIRM BIT(11)
#define P2P_DEV_GROUP_CLIENT_ONLY BIT(12)
+#define P2P_DEV_FORCE_FREQ BIT(13)
unsigned int flags;
int status; /* enum p2p_status_code */