From 871dba7cb31c058e752a40f0f85996d56e6a23d3 Mon Sep 17 00:00:00 2001 From: Shivani Baranwal Date: Fri, 25 Oct 2024 21:47:41 +0530 Subject: [PATCH] P2P2: Add support for PCC mode in starting autonomous GO 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 --- p2p.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/p2p.c b/p2p.c index 955194a..1e1c40d 100644 --- a/p2p.c +++ b/p2p.c @@ -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);