Skip to content

Commit f8acf35

Browse files
gangli02nashif
authored andcommitted
drivers: wifi: nxp: fix build failure after disabling 802.11ax
Fixed build error, when disabling 802.11ax, if-else does not match. Fixes #81117 Signed-off-by: Gang Li <[email protected]>
1 parent 9643ca2 commit f8acf35

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,20 @@ int nxp_wifi_wlan_event_callback(enum wlan_event_reason reason, void *data)
276276
case WLAN_REASON_UAP_CLIENT_CONN:
277277
wlan_get_current_uap_network(&nxp_wlan_network);
278278
#ifdef CONFIG_NXP_WIFI_11AX
279-
if (nxp_wlan_network.dot11ax) {
280-
ap_sta_info.link_mode = WIFI_6;
281-
}
279+
if (nxp_wlan_network.dot11ax) {
280+
ap_sta_info.link_mode = WIFI_6;
281+
} else
282282
#endif
283283
#ifdef CONFIG_NXP_WIFI_11AC
284-
else if (nxp_wlan_network.dot11ac) {
284+
if (nxp_wlan_network.dot11ac) {
285285
ap_sta_info.link_mode = WIFI_5;
286-
}
286+
} else
287287
#endif
288-
else if (nxp_wlan_network.dot11n) {
288+
if (nxp_wlan_network.dot11n) {
289289
ap_sta_info.link_mode = WIFI_4;
290-
} else {
291-
ap_sta_info.link_mode = WIFI_3;
292-
}
290+
} else {
291+
ap_sta_info.link_mode = WIFI_3;
292+
}
293293

294294
memcpy(ap_sta_info.mac, data, WIFI_MAC_ADDR_LEN);
295295
ap_sta_info.mac_length = WIFI_MAC_ADDR_LEN;
@@ -968,15 +968,15 @@ static int nxp_wifi_status(const struct device *dev, struct wifi_iface_status *s
968968
#ifdef CONFIG_NXP_WIFI_11AX
969969
if (nxp_wlan_network.dot11ax) {
970970
status->link_mode = WIFI_6;
971-
}
971+
} else
972972
#endif
973973
#ifdef CONFIG_NXP_WIFI_11AC
974-
else if (nxp_wlan_network.dot11ac) {
975-
status->link_mode = WIFI_5;
976-
}
974+
if (nxp_wlan_network.dot11ac) {
975+
status->link_mode = WIFI_5;
976+
} else
977977
#endif
978-
else if (nxp_wlan_network.dot11n) {
979-
status->link_mode = WIFI_4;
978+
if (nxp_wlan_network.dot11n) {
979+
status->link_mode = WIFI_4;
980980
} else {
981981
status->link_mode = WIFI_3;
982982
}
@@ -1335,6 +1335,7 @@ static int nxp_wifi_reg_domain(const struct device *dev, struct wifi_reg_domain
13351335
return 0;
13361336
}
13371337

1338+
#ifdef CONFIG_NXP_WIFI_11AX_TWT
13381339
static int nxp_wifi_set_twt(const struct device *dev, struct wifi_twt_params *params)
13391340
{
13401341
wlan_twt_setup_config_t twt_setup_conf;
@@ -1367,6 +1368,7 @@ static int nxp_wifi_set_twt(const struct device *dev, struct wifi_twt_params *pa
13671368

13681369
return ret;
13691370
}
1371+
#endif
13701372

13711373
static void nxp_wifi_sta_init(struct net_if *iface)
13721374
{
@@ -1654,7 +1656,9 @@ static const struct wifi_mgmt_ops nxp_wifi_sta_mgmt = {
16541656
.cfg_11k = nxp_wifi_11k_cfg,
16551657
.set_power_save = nxp_wifi_power_save,
16561658
.get_power_save_config = nxp_wifi_get_power_save,
1659+
#ifdef CONFIG_NXP_WIFI_11AX_TWT
16571660
.set_twt = nxp_wifi_set_twt,
1661+
#endif
16581662
};
16591663

16601664
#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT)

0 commit comments

Comments
 (0)