Skip to content

Commit

Permalink
P2P2: Add support for PCC mode in starting autonomous GO
Browse files Browse the repository at this point in the history
Add support to set the P2P mode to PCC mode type during start of
autonomous P2P GO if requested to do so with the new parameter type,PCC.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
  • Loading branch information
Shivani Baranwal authored and Jouni Malinen committed Dec 20, 2024
1 parent 67af5c3 commit 871dba7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -1022,12 +1022,20 @@ cmd_sta_start_autonomous_go(struct sigma_dut *dut, struct sigma_conn *conn,
return -2;
}

if (dut->p2p_r2_capable)
snprintf(buf, sizeof(buf), "P2P_GROUP_ADD %sfreq=%d he p2p2",
dut->persistent ? "persistent " : "", freq);
else
if (dut->p2p_r2_capable) {
const char *type = get_param(cmd, "type");
int p2p_mode = 0;

if (type && strcasecmp(type, "PCC") == 0)
p2p_mode = 2;

snprintf(buf, sizeof(buf),
"P2P_GROUP_ADD %sfreq=%d p2pmode=%d he p2p2",
dut->persistent ? "persistent " : "", freq, p2p_mode);
} else {
snprintf(buf, sizeof(buf), "P2P_GROUP_ADD %sfreq=%d",
dut->persistent ? "persistent " : "", freq);
}

if (wpa_command(intf, buf) < 0) {
wpa_ctrl_detach(ctrl);
Expand Down

0 comments on commit 871dba7

Please sign in to comment.