p2p->cfg->chan_switch_req_enable = val;
}
+
+void p2p_set_invitation_op_freq(struct p2p_data *p2p, int freq)
+{
+ u8 op_class, channel;
+
+ if (freq == -1) {
+ p2p->cfg->inv_op_class = 0;
+ p2p->cfg->inv_op_channel = 0;
+ return;
+ }
+
+ if (p2p_freq_to_channel(freq, &op_class, &channel) < 0)
+ return;
+
+ p2p->cfg->inv_op_class = op_class;
+ p2p->cfg->inv_op_channel = channel;
+}
+
#endif /* CONFIG_TESTING_OPTIONS */
*/
bool chan_switch_req_enable;
+#ifdef CONFIG_TESTING_OPTIONS
+ /**
+ * Operating class for own operational channel in Invitation Response
+ */
+ u8 inv_op_class;
+
+ /**
+ * inv_op_channel - Own operational channel in Invitation Response
+ */
+ u8 inv_op_channel;
+#endif /* CONFIG_TESTING_OPTIONS */
+
/**
* cb_ctx - Context to use with callback functions
*/
void p2p_set_twt_power_mgmt(struct p2p_data *p2p, int val);
void p2p_set_dev_addr(struct p2p_data *p2p, const u8 *addr);
void p2p_set_chan_switch_req_enable(struct p2p_data *p2p, bool val);
+void p2p_set_invitation_op_freq(struct p2p_data *p2p, int freq);
int p2p_get_listen_freq(struct p2p_data *p2p, const u8 *peer_addr);
int p2p_initiate_pasn_auth(struct p2p_data *p2p, const u8 *addr, int freq);
p2p_dbg(p2p, "Own default op_class %d channel %d",
p2p->op_reg_class, p2p->op_channel);
+#ifdef CONFIG_TESTING_OPTIONS
+ if (p2p->cfg->inv_op_class) {
+ /* Override configuration as a starting point */
+ p2p->op_reg_class = p2p->cfg->inv_op_class;
+ p2p->op_channel = p2p->cfg->inv_op_channel;
+ p2p_dbg(p2p,
+ "Override Invitation op_class %d channel %d",
+ p2p->op_reg_class, p2p->op_channel);
+ }
+#endif /* CONFIG_TESTING_OPTIONS */
+
/* Use peer preference if specified and compatible */
if (msg.operating_channel) {
int req_freq;
p2p_set_chan_switch_req_enable(wpa_s->global->p2p, atoi(param));
return 0;
}
+
+ if (os_strcmp(cmd, "inv_oper_freq") == 0) {
+ p2p_set_invitation_op_freq(wpa_s->global->p2p, atoi(param));
+ return 0;
+ }
#endif /* CONFIG_TESTING_OPTIONS */
wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown P2P_SET field value '%s'",
#ifdef CONFIG_TESTING_OPTIONS
os_free(wpa_s->get_pref_freq_list_override);
wpa_s->get_pref_freq_list_override = NULL;
+ p2p_set_invitation_op_freq(wpa_s->global->p2p, -1);
#endif /* CONFIG_TESTING_OPTIONS */
wpas_p2p_stop_find(wpa_s);