Skip to content

Commit e1d2023

Browse files
gangli02carlescufi
authored andcommitted
drivers: wifi: nxp: change the dormant state
1) After the wifi driver successfully connects to the AP, the dormant state should be set to OFF. Once a deauth/disassoc frame is received or link lost occurs, the dormant state should be set to ON. 2) Enable CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO and CONFIG_NET_CONTEXT_PRIORITY to push high priority packets directly to network driver. Signed-off-by: Gang Li <[email protected]>
1 parent 70be6ad commit e1d2023

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,12 @@ int nxp_wifi_wlan_event_callback(enum wlan_event_reason reason, void *data)
138138
LOG_ERR("WLAN: initialization failed");
139139
break;
140140
case WLAN_REASON_AUTH_SUCCESS:
141-
net_eth_carrier_on(g_mlan.netif);
142141
LOG_DBG("WLAN: authenticated to nxp_wlan_network");
143142
break;
143+
case WLAN_REASON_ASSOC_SUCCESS:
144+
net_if_dormant_off(g_mlan.netif);
145+
LOG_DBG("WLAN: associated to nxp_wlan_network");
146+
break;
144147
case WLAN_REASON_SUCCESS:
145148
LOG_DBG("WLAN: connected to nxp_wlan_network");
146149
#ifndef CONFIG_WIFI_NM_WPA_SUPPLICANT
@@ -214,9 +217,13 @@ int nxp_wifi_wlan_event_callback(enum wlan_event_reason reason, void *data)
214217
wifi_mgmt_raise_disconnect_result_event(g_mlan.netif, 0);
215218
break;
216219
case WLAN_REASON_LINK_LOST:
217-
net_eth_carrier_off(g_mlan.netif);
220+
net_if_dormant_on(g_mlan.netif);
218221
LOG_WRN("WLAN: link lost");
219222
break;
223+
case WLAN_REASON_DISCONNECTED:
224+
net_if_dormant_on(g_mlan.netif);
225+
LOG_DBG("WLAN: deauth leaving");
226+
break;
220227
case WLAN_REASON_CHAN_SWITCH:
221228
LOG_DBG("WLAN: channel switch");
222229
break;
@@ -408,6 +415,12 @@ static int nxp_wifi_wlan_start(void)
408415

409416
s_nxp_wifi_State = NXP_WIFI_STARTED;
410417

418+
/* Initialize device as dormant */
419+
net_if_dormant_on(g_mlan.netif);
420+
421+
/* L1 network layer (physical layer) is up */
422+
net_eth_carrier_on(g_mlan.netif);
423+
411424
return 0;
412425
}
413426

samples/net/wifi/boards/rd_rw612_bga.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ CONFIG_NET_TC_TX_THREAD_BASE_PRIO=3
6565
CONFIG_NET_TC_RX_THREAD_BASE_PRIO=3
6666
CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY=3
6767
CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=3
68+
CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO=y
69+
CONFIG_NET_CONTEXT_PRIORITY=y
6870

6971
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
7072
CONFIG_WIFI_NM_WPA_SUPPLICANT_CLI=y

0 commit comments

Comments
 (0)