Skip to content

Commit 4ad05aa

Browse files
fengming-yekartben
authored andcommitted
drivers: wifi: nxp: fix soft AP auto start
Fix soft AP net iface auto up after init. Set dormant off/on when soft AP start/stop, to align with STA. Signed-off-by: Fengming Ye <[email protected]>
1 parent 9f9325b commit 4ad05aa

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ int nxp_wifi_wlan_event_callback(enum wlan_event_reason reason, void *data)
229229
break;
230230
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
231231
case WLAN_REASON_UAP_SUCCESS:
232-
net_eth_carrier_on(g_uap.netif);
233232
LOG_DBG("WLAN: UAP Started");
234233
#ifndef CONFIG_WIFI_NM_HOSTAPD_AP
235234
ret = wlan_get_current_uap_network_ssid(uap_ssid);
@@ -252,7 +251,7 @@ int nxp_wifi_wlan_event_callback(enum wlan_event_reason reason, void *data)
252251
return 0;
253252
}
254253
net_if_ipv4_set_netmask_by_addr(g_uap.netif, &dhcps_addr4, &netmask_addr);
255-
net_if_up(g_uap.netif);
254+
net_if_dormant_off(g_uap.netif);
256255

257256
if (net_addr_pton(AF_INET, CONFIG_NXP_WIFI_SOFTAP_IP_BASE, &base_addr) < 0) {
258257
LOG_ERR("Invalid CONFIG_NXP_WIFI_SOFTAP_IP_BASE");
@@ -312,7 +311,7 @@ int nxp_wifi_wlan_event_callback(enum wlan_event_reason reason, void *data)
312311
LOG_DBG("%d", disassoc_resp->reason_code);
313312
break;
314313
case WLAN_REASON_UAP_STOPPED:
315-
net_eth_carrier_off(g_uap.netif);
314+
net_if_dormant_on(g_uap.netif);
316315
LOG_DBG("WLAN: UAP Stopped");
317316

318317
net_dhcpv4_server_stop(g_uap.netif);
@@ -421,6 +420,14 @@ static int nxp_wifi_wlan_start(void)
421420
/* L1 network layer (physical layer) is up */
422421
net_eth_carrier_on(g_mlan.netif);
423422

423+
#ifdef CONFIG_NXP_WIFI_SOFTAP_SUPPORT
424+
/* Initialize device as dormant */
425+
net_if_dormant_on(g_uap.netif);
426+
427+
/* L1 network layer (physical layer) is up */
428+
net_eth_carrier_on(g_uap.netif);
429+
#endif
430+
424431
return 0;
425432
}
426433

0 commit comments

Comments
 (0)