Skip to content

Commit 07328d9

Browse files
MaochenWang1kartben
authored andcommitted
drivers: wifi: nxp: Enable WIFI_NM for WIFI_NXP
Default enable WIFI_NM for both supplicant and embedded supplicant case, to distinguish STA and SAP interface when use L2 layer. Signed-off-by: Maochen Wang <[email protected]>
1 parent 49a2725 commit 07328d9

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

drivers/wifi/nxp/Kconfig.nxp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ menuconfig WIFI_NXP
88
select NET_L2_ETHERNET_MGMT if NETWORKING && NET_L2_ETHERNET
99
select SDHC if !SOC_SERIES_RW6XX
1010
select SDIO_STACK if !SOC_SERIES_RW6XX
11-
select WIFI_NM if WIFI_NM_WPA_SUPPLICANT
11+
select WIFI_NM
1212
depends on DT_HAS_NXP_WIFI_ENABLED
1313
help
1414
Enable NXP SoC Wi-Fi support.

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,8 +1543,13 @@ static void nxp_wifi_sta_init(struct net_if *iface)
15431543
eth_ctx->eth_if_type = L2_ETH_IF_TYPE_WIFI;
15441544
intf->netif = iface;
15451545
#ifdef CONFIG_WIFI_NM
1546+
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT
15461547
wifi_nm_register_mgd_type_iface(wifi_nm_get_instance("wifi_supplicant"),
15471548
WIFI_TYPE_STA, iface);
1549+
#else
1550+
wifi_nm_register_mgd_type_iface(wifi_nm_get_instance("wifi_sta"),
1551+
WIFI_TYPE_STA, iface);
1552+
#endif
15481553
#endif
15491554
g_mlan.state.interface = WLAN_BSS_TYPE_STA;
15501555

@@ -1578,9 +1583,15 @@ static void nxp_wifi_uap_init(struct net_if *iface)
15781583

15791584
eth_ctx->eth_if_type = L2_ETH_IF_TYPE_WIFI;
15801585
intf->netif = iface;
1586+
15811587
#ifdef CONFIG_WIFI_NM
1588+
#ifdef CONFIG_WIFI_NM_HOSTAPD_AP
15821589
wifi_nm_register_mgd_type_iface(wifi_nm_get_instance("hostapd"),
15831590
WIFI_TYPE_SAP, iface);
1591+
#else
1592+
wifi_nm_register_mgd_type_iface(wifi_nm_get_instance("wifi_sap"),
1593+
WIFI_TYPE_SAP, iface);
1594+
#endif
15841595
#endif
15851596
g_uap.state.interface = WLAN_BSS_TYPE_UAP;
15861597

@@ -1827,6 +1838,10 @@ static const struct wifi_mgmt_ops nxp_wifi_sta_mgmt = {
18271838
#endif
18281839
};
18291840

1841+
#if defined(CONFIG_WIFI_NM) && !defined(CONFIG_WIFI_NM_WPA_SUPPLICANT)
1842+
DEFINE_WIFI_NM_INSTANCE(wifi_sta, &nxp_wifi_sta_mgmt);
1843+
#endif
1844+
18301845
#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT)
18311846
static const struct zep_wpa_supp_dev_ops nxp_wifi_drv_ops = {
18321847
.init = wifi_nxp_wpa_supp_dev_init,
@@ -1901,6 +1916,10 @@ static const struct wifi_mgmt_ops nxp_wifi_uap_mgmt = {
19011916
#endif
19021917
};
19031918

1919+
#if defined(CONFIG_WIFI_NM) && !defined(CONFIG_WIFI_NM_HOSTAPD_AP)
1920+
DEFINE_WIFI_NM_INSTANCE(wifi_sap, &nxp_wifi_uap_mgmt);
1921+
#endif
1922+
19041923
static const struct net_wifi_mgmt_offload nxp_wifi_uap_apis = {
19051924
.wifi_iface.iface_api.init = nxp_wifi_uap_init,
19061925
.wifi_iface.set_config = nxp_wifi_set_config,

0 commit comments

Comments
 (0)