Skip to content

Commit

Permalink
drivers: wifi: nxp: fix getting Wi-Fi status
Browse files Browse the repository at this point in the history
Fix getting SAP and STA status for non-supplicant case.

Signed-off-by: Maochen Wang <[email protected]>
  • Loading branch information
MaochenWang1 authored and kartben committed Dec 16, 2024
1 parent 10d4de5 commit b5b3c49
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions drivers/wifi/nxp/nxp_wifi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,11 +984,23 @@ static inline enum wifi_security_type nxp_wifi_security_type(enum wlan_security_
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
static int nxp_wifi_uap_status(const struct device *dev, struct wifi_iface_status *status)
{
enum wlan_connection_state connection_state = WLAN_DISCONNECTED;
enum wlan_connection_state connection_state = WLAN_UAP_STOPPED;
struct interface *if_handle = (struct interface *)&g_uap;

wlan_get_uap_connection_state(&connection_state);

switch (connection_state) {
case WLAN_UAP_STARTED:
status->state = WIFI_SAP_IFACE_ENABLED;
break;
case WLAN_UAP_STOPPED:
status->state = WIFI_SAP_IFACE_DISABLED;
break;
default:
status->state = WIFI_SAP_IFACE_DISABLED;
break;
}

if (connection_state == WLAN_UAP_STARTED) {

if (!wlan_get_current_uap_network(&nxp_wlan_uap_network)) {
Expand Down Expand Up @@ -1065,7 +1077,8 @@ static int nxp_wifi_status(const struct device *dev, struct wifi_iface_status *s
status->state = WIFI_STATE_ASSOCIATING;
} else if (connection_state == WLAN_ASSOCIATED) {
status->state = WIFI_STATE_ASSOCIATED;
} else if (connection_state == WLAN_CONNECTED) {
} else if (connection_state == WLAN_AUTHENTICATED
|| connection_state == WLAN_CONNECTED) {
status->state = WIFI_STATE_COMPLETED;

if (!wlan_get_current_network(&nxp_wlan_network)) {
Expand Down

0 comments on commit b5b3c49

Please sign in to comment.