Skip to content

Commit b5b3c49

Browse files
MaochenWang1kartben
authored andcommitted
drivers: wifi: nxp: fix getting Wi-Fi status
Fix getting SAP and STA status for non-supplicant case. Signed-off-by: Maochen Wang <[email protected]>
1 parent 10d4de5 commit b5b3c49

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,11 +984,23 @@ static inline enum wifi_security_type nxp_wifi_security_type(enum wlan_security_
984984
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
985985
static int nxp_wifi_uap_status(const struct device *dev, struct wifi_iface_status *status)
986986
{
987-
enum wlan_connection_state connection_state = WLAN_DISCONNECTED;
987+
enum wlan_connection_state connection_state = WLAN_UAP_STOPPED;
988988
struct interface *if_handle = (struct interface *)&g_uap;
989989

990990
wlan_get_uap_connection_state(&connection_state);
991991

992+
switch (connection_state) {
993+
case WLAN_UAP_STARTED:
994+
status->state = WIFI_SAP_IFACE_ENABLED;
995+
break;
996+
case WLAN_UAP_STOPPED:
997+
status->state = WIFI_SAP_IFACE_DISABLED;
998+
break;
999+
default:
1000+
status->state = WIFI_SAP_IFACE_DISABLED;
1001+
break;
1002+
}
1003+
9921004
if (connection_state == WLAN_UAP_STARTED) {
9931005

9941006
if (!wlan_get_current_uap_network(&nxp_wlan_uap_network)) {
@@ -1065,7 +1077,8 @@ static int nxp_wifi_status(const struct device *dev, struct wifi_iface_status *s
10651077
status->state = WIFI_STATE_ASSOCIATING;
10661078
} else if (connection_state == WLAN_ASSOCIATED) {
10671079
status->state = WIFI_STATE_ASSOCIATED;
1068-
} else if (connection_state == WLAN_CONNECTED) {
1080+
} else if (connection_state == WLAN_AUTHENTICATED
1081+
|| connection_state == WLAN_CONNECTED) {
10691082
status->state = WIFI_STATE_COMPLETED;
10701083

10711084
if (!wlan_get_current_network(&nxp_wlan_network)) {

0 commit comments

Comments
 (0)