Skip to content

Commit

Permalink
P2P2: Split sta_p2p_reset handling into two parts
Browse files Browse the repository at this point in the history
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
  • Loading branch information
Shivani Baranwal authored and Jouni Malinen committed Dec 20, 2024
1 parent 961b7fc commit 4d2b29a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
15 changes: 12 additions & 3 deletions p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,9 +1901,9 @@ static enum sigma_cmd_result cmd_sta_get_psk(struct sigma_dut *dut,
}


enum sigma_cmd_result cmd_sta_p2p_reset(struct sigma_dut *dut,
struct sigma_conn *conn,
struct sigma_cmd *cmd)
enum sigma_cmd_result sta_p2p_reset_default(struct sigma_dut *dut,
struct sigma_conn *conn,
struct sigma_cmd *cmd)
{
const char *intf = get_param(cmd, "interface");
struct wfa_cs_p2p_group *grp, *prev;
Expand Down Expand Up @@ -1982,6 +1982,15 @@ enum sigma_cmd_result cmd_sta_p2p_reset(struct sigma_dut *dut,
}


static enum sigma_cmd_result cmd_sta_p2p_reset(struct sigma_dut *dut,
struct sigma_conn *conn,
struct sigma_cmd *cmd)
{
dut->program = PROGRAM_P2P;
return sta_p2p_reset_default(dut, conn, cmd);
}


static enum sigma_cmd_result cmd_sta_get_p2p_ip_config(struct sigma_dut *dut,
struct sigma_conn *conn,
struct sigma_cmd *cmd)
Expand Down
6 changes: 3 additions & 3 deletions sigma_dut.h
Original file line number Diff line number Diff line change
Expand Up @@ -1431,9 +1431,9 @@ void stop_dhcp(struct sigma_dut *dut, const char *group_ifname, int go);
int p2p_discover_peer(struct sigma_dut *dut, const char *ifname,
const char *peer, int full);
const char * get_p2p_group_ifname(struct sigma_dut *dut, const char *ifname);
enum sigma_cmd_result cmd_sta_p2p_reset(struct sigma_dut *dut,
struct sigma_conn *conn,
struct sigma_cmd *cmd);
enum sigma_cmd_result sta_p2p_reset_default(struct sigma_dut *dut,
struct sigma_conn *conn,
struct sigma_cmd *cmd);

/* basic.c */
void basic_register_cmds(void);
Expand Down
2 changes: 1 addition & 1 deletion sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -11444,7 +11444,7 @@ static enum sigma_cmd_result cmd_sta_reset_default(struct sigma_dut *dut,
wpa_command(intf, "STA_AUTOCONNECT 0");

if (dut->program != PROGRAM_VHT)
return cmd_sta_p2p_reset(dut, conn, cmd);
return sta_p2p_reset_default(dut, conn, cmd);

return 1;
}
Expand Down

0 comments on commit 4d2b29a

Please sign in to comment.