Skip to content

Commit caf8612

Browse files
gangli02fabiobaltieri
authored andcommitted
drivers: wifi: nxp: add AP configuration cmd support
Implement NXP AP configuration parameter operations. Signed-off-by: Gang Li <[email protected]>
1 parent 4bfdb64 commit caf8612

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,38 @@ static int nxp_wifi_stop_ap(const struct device *dev)
545545
return 0;
546546
}
547547

548+
static int nxp_wifi_ap_config_params(const struct device *dev, struct wifi_ap_config_params *params)
549+
{
550+
nxp_wifi_ret_t status = NXP_WIFI_RET_SUCCESS;
551+
int ret = WM_SUCCESS;
552+
interface_t *if_handle = (interface_t *)dev->data;
553+
554+
if (if_handle->state.interface != WLAN_BSS_TYPE_UAP) {
555+
LOG_ERR("Wi-Fi not in uAP mode");
556+
return -EIO;
557+
}
558+
559+
if (s_nxp_wifi_State != NXP_WIFI_STARTED) {
560+
status = NXP_WIFI_RET_NOT_READY;
561+
}
562+
563+
if (status == NXP_WIFI_RET_SUCCESS) {
564+
if (params->type & WIFI_AP_CONFIG_PARAM_MAX_INACTIVITY) {
565+
ret = wlan_uap_set_sta_ageout_timer(params->max_inactivity * 10);
566+
if (ret != WM_SUCCESS) {
567+
status = NXP_WIFI_RET_FAIL;
568+
}
569+
} else {
570+
return -EINVAL;
571+
}
572+
}
573+
574+
if (status != NXP_WIFI_RET_SUCCESS) {
575+
return -EAGAIN;
576+
}
577+
578+
return 0;
579+
}
548580
#endif
549581

550582
static int nxp_wifi_process_results(unsigned int count)
@@ -1807,6 +1839,7 @@ static const struct wifi_mgmt_ops nxp_wifi_uap_mgmt = {
18071839
.get_power_save_config = nxp_wifi_get_power_save,
18081840
.set_btwt = nxp_wifi_set_btwt,
18091841
.ap_bandwidth = nxp_wifi_ap_bandwidth,
1842+
.ap_config_params = nxp_wifi_ap_config_params,
18101843
};
18111844

18121845
static const struct net_wifi_mgmt_offload nxp_wifi_uap_apis = {

0 commit comments

Comments
 (0)