net: wifi_mgmt: add DPP reconfig support
Hostap does not support wpa_cli DPP reconfig command. So add wifi_mgmt DPP reconfig command and api. Signed-off-by: Fengming Ye <frank.ye@nxp.com>
This commit is contained in:
parent
27d882e740
commit
c642b44c95
3 changed files with 36 additions and 1 deletions
|
|
@ -871,7 +871,9 @@ enum wifi_dpp_op {
|
|||
/** Set configurator parameters */
|
||||
WIFI_DPP_SET_CONF_PARAM,
|
||||
/** Set DPP rx response wait timeout */
|
||||
WIFI_DPP_SET_WAIT_RESP_TIME
|
||||
WIFI_DPP_SET_WAIT_RESP_TIME,
|
||||
/** Reconfigure DPP network */
|
||||
WIFI_DPP_RECONFIG
|
||||
};
|
||||
|
||||
/** Wi-Fi DPP crypto Elliptic Curves */
|
||||
|
|
@ -1008,6 +1010,8 @@ struct wifi_dpp_params {
|
|||
int id;
|
||||
/** Timeout for DPP frame response rx */
|
||||
int dpp_resp_wait_time;
|
||||
/** network id for reconfig */
|
||||
int network_id;
|
||||
/** DPP QR-CODE, max for SHA512 */
|
||||
uint8_t dpp_qr_code[WIFI_DPP_QRCODE_MAX_LEN + 1];
|
||||
/** Request response reusing request buffer.
|
||||
|
|
|
|||
|
|
@ -1874,6 +1874,9 @@ static int dpp_params_to_cmd(struct wifi_dpp_params *params, char *cmd, size_t m
|
|||
snprintf(pos, end - pos, "SET dpp_resp_wait_time %d",
|
||||
params->dpp_resp_wait_time);
|
||||
break;
|
||||
case WIFI_DPP_RECONFIG:
|
||||
snprintf(pos, end - pos, "DPP_RECONFIG %d", params->network_id);
|
||||
break;
|
||||
default:
|
||||
wpa_printf(MSG_ERROR, "Unknown DPP action");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -2616,6 +2616,30 @@ static int cmd_wifi_dpp_ap_auth_init(const struct shell *sh, size_t argc, char *
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cmd_wifi_dpp_reconfig(const struct shell *sh, size_t argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
struct net_if *iface = net_if_get_wifi_sta();
|
||||
struct wifi_dpp_params params = {0};
|
||||
|
||||
params.action = WIFI_DPP_RECONFIG;
|
||||
|
||||
if (argc >= 2) {
|
||||
params.network_id = shell_strtol(argv[1], 10, &ret);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
PR_ERROR("parse DPP args fail\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (net_mgmt(NET_REQUEST_WIFI_DPP, iface, ¶ms, sizeof(params))) {
|
||||
PR_WARNING("Failed to request DPP action\n");
|
||||
return -ENOEXEC;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cmd_wifi_pmksa_flush(const struct shell *sh, size_t argc, char *argv[])
|
||||
{
|
||||
struct net_if *iface = net_if_get_wifi_sta();
|
||||
|
|
@ -2763,6 +2787,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
|
|||
"AP DPP start auth request as enrollee:\n"
|
||||
"-p --peer <peer_bootstrap_id>\n",
|
||||
cmd_wifi_dpp_ap_auth_init, 3, 0),
|
||||
SHELL_CMD_ARG(reconfig, NULL,
|
||||
" reconfig network by id:\n"
|
||||
"<network_id>\n",
|
||||
cmd_wifi_dpp_reconfig, 2, 0),
|
||||
SHELL_SUBCMD_SET_END
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue