Skip to content

Commit

Permalink
P2P2: Allow PASN parameters to be configured verification
Browse files Browse the repository at this point in the history
This allows the supported DH groups for PASN to be configured.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
  • Loading branch information
Shivani Baranwal authored and Jouni Malinen committed Dec 20, 2024
1 parent 19b5881 commit 67af5c3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions p2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,23 @@ static enum sigma_cmd_result cmd_sta_set_p2p(struct sigma_dut *dut,
return ERROR_SEND_STATUS;
}

val = get_param(cmd, "PASN");
if (val && strcasecmp(val, "Enable") == 0) {
/* Support Wi-Fi Direct R2 capabilities */
sigma_dut_print(dut, DUT_MSG_INFO, "PASN Enable");
val = get_param(cmd, "PASN_Unsupported_DH_Group");
if (val) {
if (atoi(val) == 20)
dut->pasn_type &= ~0xc;
else if (atoi(val) == 19)
dut->pasn_type &= ~0x3;
}
snprintf(buf, sizeof(buf), "P2P_SET pasn_type %d",
dut->pasn_type);
if (wpa_command(intf, buf) < 0)
return ERROR_SEND_STATUS;
}

val = get_param(cmd, "Service_Discovery");
if (val) {
int sd = atoi(val);
Expand Down Expand Up @@ -1922,6 +1939,7 @@ enum sigma_cmd_result sta_p2p_reset_default(struct sigma_dut *dut,
dut->go = 0;
dut->p2p_client = 0;
dut->wps_method = WFA_CS_WPS_NOT_READY;
dut->pasn_type = 0xf;

grp = dut->groups;
while (grp) {
Expand Down
1 change: 1 addition & 0 deletions sigma_dut.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ static void set_defaults(struct sigma_dut *dut)
#endif /* ANDROID */
dut->autoconnect_default = 1;
set_host_name(dut);
dut->pasn_type = 0xf;
}


Expand Down
1 change: 1 addition & 0 deletions sigma_dut.h
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,7 @@ struct sigma_dut {
* values */
bool usd_enabled;
bool p2p_r2_capable;
u8 pasn_type;
};


Expand Down

0 comments on commit 67af5c3

Please sign in to comment.