From 4ceaa0101461d15cd9e4e71985e4bd0d69630b09 Mon Sep 17 00:00:00 2001 From: csbobo <751541594@qq.com> Date: Fri, 22 Nov 2024 17:46:14 +0800 Subject: [PATCH] drivers: wifi: nxp: Fix the compilation error on the MIMXRT1170_EVK board with the NXP_88W8987_MURATA_1ZM_M2 WiFi module - Fix the compilation error on the MIMXRT1170_EVK board with the NXP_88W8987_MURATA_1ZM_M2 WiFi module - Support configuring Wi-Fi threads stack size Signed-off-by: csbobo <751541594@qq.com> --- CMakeLists.txt | 1 + mcux/middleware/wifi_nxp/CMakeLists.txt | 76 +++++++++++---- .../wifi_nxp/firmware_dnld/firmware_dnld.c | 2 + mcux/middleware/wifi_nxp/incl/nxp_wifi.h | 36 ++++--- .../sdio_nxp_abs/incl/mlan_sdio_api.h | 2 + .../wifi_nxp/sdio_nxp_abs/mlan_sdio.c | 97 ++++++++++++++++++- .../wifi_nxp/wifidriver/mlan_glue.c | 41 ++++---- .../wifi_nxp/wifidriver/wifi-sdio.c | 7 +- mcux/middleware/wifi_nxp/wifidriver/wifi.c | 32 +++--- mcux/middleware/wifi_nxp/wlcmgr/wlan.c | 14 ++- zephyr/blobs/SD8987/CMakeLists.txt | 3 + zephyr/module.yml | 10 +- 12 files changed, 243 insertions(+), 78 deletions(-) create mode 100644 zephyr/blobs/SD8987/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dd124b66..69df7da72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,3 +17,4 @@ else() endif() add_subdirectory(zephyr/src) +add_subdirectory_ifdef(CONFIG_NXP_88W8987 zephyr/blobs/SD8987) \ No newline at end of file diff --git a/mcux/middleware/wifi_nxp/CMakeLists.txt b/mcux/middleware/wifi_nxp/CMakeLists.txt index 3f3271b09..160590be3 100644 --- a/mcux/middleware/wifi_nxp/CMakeLists.txt +++ b/mcux/middleware/wifi_nxp/CMakeLists.txt @@ -24,120 +24,160 @@ zephyr_compile_definitions_ifdef(CONFIG_NXP_RW610 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW_rw610.h" ) -zephyr_compile_definitions_ifdef(CONFIG_88W8987_AW_CM358_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8987_AW_CM358_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_88W8987_AW_CM358MA_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8987_AW_CM358MA_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_88W8987_MURATA_1ZM_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8987_MURATA_1ZM_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1ZM_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x06 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x06 WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_88W8987_MURATA_1ZM_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8987_MURATA_1ZM_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1ZM_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x06 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x06 WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM457_USD +if(CONFIG_NXP_88W8987) +zephyr_include_directories( + wifi_bt_firmware/8987 +) + +zephyr_library_sources_ifdef(CONFIG_NXP_88W8987 + wifi_bt_firmware/8987/8987_cpu12.c +) +endif() + +if(CONFIG_NXP_IW416) +zephyr_include_directories( + wifi_bt_firmware/IW416 +) + +zephyr_library_sources_ifdef(CONFIG_NXP_IW416 + wifi_bt_firmware/IW416/IW416_cpu12.c +) +endif() + +if(CONFIG_NXP_88W8801) +zephyr_include_directories( + wifi_bt_firmware/8801 +) + +zephyr_library_sources_ifdef(CONFIG_NXP_88W8801 + wifi_bt_firmware/8801/8801_cpu1.c +) +endif() + +if(CONFIG_NXP_IW61X) +zephyr_include_directories( + wifi_bt_firmware/nw61x +) + +zephyr_library_sources_ifdef(CONFIG_NXP_IW61X + wifi_bt_firmware/nw61x/nw61x_cpu12_se.c +) +endif() + +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416_AW_AM457_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM457MA_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416_AW_AM457MA_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM510_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416_AW_AM510_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM510MA_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416_AW_AM510MA_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1XK_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW416_MURATA_1XK_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416_MURATA_1XK_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1XK_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x00 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW416_MURATA_1XK_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416_MURATA_1XK_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1XK_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x00 CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW612_MURATA_2EL_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW612_MURATA_2EL_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW612_MURATA_2EL_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW612_MURATA_2EL_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW611_MURATA_2DL_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW611_MURATA_2DL_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A WIFI_BT_USE_USD_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_IW611_MURATA_2DL_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_IW611_MURATA_2DL_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A WIFI_BT_USE_M2_INTERFACE ) -zephyr_compile_definitions_ifdef(CONFIG_88W8801_AW_NM191_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8801_AW_NM191_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x1B ) -zephyr_compile_definitions_ifdef(CONFIG_88W8801_AW_NM191MA_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8801_AW_NM191MA_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x1B ) -zephyr_compile_definitions_ifdef(CONFIG_88W8801_MURATA_2DS_USD +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8801_MURATA_2DS_USD WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2DS_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0E ) -zephyr_compile_definitions_ifdef(CONFIG_88W8801_MURATA_2DS_M2 +zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8801_MURATA_2DS_M2 WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2DS_WW.h" CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0E ) diff --git a/mcux/middleware/wifi_nxp/firmware_dnld/firmware_dnld.c b/mcux/middleware/wifi_nxp/firmware_dnld/firmware_dnld.c index 3665d54c8..424cee94c 100644 --- a/mcux/middleware/wifi_nxp/firmware_dnld/firmware_dnld.c +++ b/mcux/middleware/wifi_nxp/firmware_dnld/firmware_dnld.c @@ -248,8 +248,10 @@ int32_t firmware_download(const uint8_t *fw_start_addr, const size_t size, void if (ret != FWDNLD_STATUS_SUCCESS) { + fwdnld_io_d("firmware download failed"); return FWDNLD_STATUS_FAILURE; } + if (intf->intf_s.fwdnld_intf_check_ready) { return intf->intf_s.fwdnld_intf_check_ready(intf, NULL); diff --git a/mcux/middleware/wifi_nxp/incl/nxp_wifi.h b/mcux/middleware/wifi_nxp/incl/nxp_wifi.h index 758813e18..73cb81aa8 100644 --- a/mcux/middleware/wifi_nxp/incl/nxp_wifi.h +++ b/mcux/middleware/wifi_nxp/incl/nxp_wifi.h @@ -82,32 +82,40 @@ extern "C" { #define CONFIG_WIFI_STA_RECONNECT 1 #endif -#if CONFIG_NXP_WIFI_MON_THREAD_STACK_SIZE -#define CONFIG_MON_THREAD_STACK_SIZE CONFIG_NXP_WIFI_MON_THREAD_STACK_SIZE +#if CONFIG_NXP_WIFI_MON_TASK_STACK_SIZE +#define CONFIG_MON_STACK_SIZE CONFIG_NXP_WIFI_MON_TASK_STACK_SIZE #endif -#if CONFIG_NXP_WIFI_WLCMGR_STACK_SIZE -#define CONFIG_WLCMGR_STACK_SIZE CONFIG_NXP_WIFI_WLCMGR_STACK_SIZE +#if CONFIG_NXP_WIFI_WLCMGR_TASK_STACK_SIZE +#define CONFIG_WLCMGR_STACK_SIZE CONFIG_NXP_WIFI_WLCMGR_TASK_STACK_SIZE #endif -#if CONFIG_NXP_WIFI_WPS_STACK_SIZE -#define CONFIG_WPS_STACK_SIZE CONFIG_NXP_WIFI_WPS_STACK_SIZE +#if CONFIG_NXP_WIFI_WPS_TASK_STACK_SIZE +#define CONFIG_WPS_STACK_SIZE CONFIG_NXP_WIFI_WPS_TASK_STACK_SIZE #endif -#if CONFIG_NXP_WIFI_POWERSAVE_STACK_SIZE -#define CONFIG_POWERSAVE_STACK_SIZE CONFIG_NXP_WIFI_POWERSAVE_STACK_SIZE +#if CONFIG_NXP_WIFI_POWERSAVE_TASK_STACK_SIZE +#define CONFIG_POWERSAVE_STACK_SIZE CONFIG_NXP_WIFI_POWERSAVE_TASK_STACK_SIZE #endif -#if CONFIG_NXP_WIFI_TX_STACK_SIZE -#define CONFIG_TX_STACK_SIZE CONFIG_NXP_WIFI_TX_STACK_SIZE +#if CONFIG_NXP_WIFI_TX_TASK_STACK_SIZE +#define CONFIG_TX_STACK_SIZE CONFIG_NXP_WIFI_TX_TASK_STACK_SIZE #endif -#if CONFIG_NXP_WIFI_DRIVER_STACK_SIZE -#define CONFIG_DRIVER_STACK_SIZE CONFIG_NXP_WIFI_DRIVER_STACK_SIZE +#if CONFIG_NXP_WIFI_DRIVER_TASK_STACK_SIZE +#define CONFIG_DRIVER_STACK_SIZE CONFIG_NXP_WIFI_DRIVER_TASK_STACK_SIZE #endif -#if CONFIG_NXP_WIFI_DHCP_SERVER_STACK_SIZE -#define CONFIG_DHCP_SERVER_STACK_SIZE CONFIG_NXP_WIFI_DHCP_SERVER_STACK_SIZE +#if CONFIG_NXP_WIFI_DHCP_SERVER_TASK_STACK_SIZE +#define CONFIG_DHCP_SERVER_STACK_SIZE CONFIG_NXP_WIFI_DHCP_SERVER_TASK_STACK_SIZE +#endif + +#if CONFIG_NXP_WIFI_CORE_TASK_STACK_SIZE +#define CONFIG_CORE_STACK_SIZE CONFIG_NXP_WIFI_CORE_TASK_STACK_SIZE +#endif + +#if CONFIG_NXP_WIFI_SCAN_TASK_STACK_SIZE +#define CONFIG_SCAN_STACK_SIZE CONFIG_NXP_WIFI_SCAN_TASK_STACK_SIZE #endif #if CONFIG_NXP_WIFI_11AX diff --git a/mcux/middleware/wifi_nxp/sdio_nxp_abs/incl/mlan_sdio_api.h b/mcux/middleware/wifi_nxp/sdio_nxp_abs/incl/mlan_sdio_api.h index 27dfdd4bc..80095317b 100644 --- a/mcux/middleware/wifi_nxp/sdio_nxp_abs/incl/mlan_sdio_api.h +++ b/mcux/middleware/wifi_nxp/sdio_nxp_abs/incl/mlan_sdio_api.h @@ -45,6 +45,7 @@ #define sdio_d(...) #endif /* CONFIG_WIFI_SDIO_DEBUG */ +#ifndef __ZEPHYR__ #define SDIO_GO_IDLE_STATE ((uint8_t)0) #define SDIO_SET_REL_ADDR ((uint8_t)3) #define SDIO_SDIO_SEN_OP_COND ((uint8_t)5) @@ -54,6 +55,7 @@ /* Depends on DMA_BUFSZ */ #define DMA_BOUNDARY_SIZE (512 * 1024) +#endif /** Read Card Register * diff --git a/mcux/middleware/wifi_nxp/sdio_nxp_abs/mlan_sdio.c b/mcux/middleware/wifi_nxp/sdio_nxp_abs/mlan_sdio.c index e3cb7c440..d7e787b8d 100644 --- a/mcux/middleware/wifi_nxp/sdio_nxp_abs/mlan_sdio.c +++ b/mcux/middleware/wifi_nxp/sdio_nxp_abs/mlan_sdio.c @@ -7,14 +7,16 @@ * SPDX-License-Identifier: BSD-3-Clause * */ -#include -#include -#include + #include #include +#include +#include #include +#include + #define SDIO_CMD_TIMEOUT 2000 const struct device *sdhc_dev = DEVICE_DT_GET(DT_BUS(DT_COMPAT_GET_ANY_STATUS_OKAY(nxp_wifi))); @@ -87,9 +89,96 @@ void sdio_enable_interrupt(void) return; } +struct wifi_gpio_config +{ +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), pdn_gpios) + const struct gpio_dt_spec pdn; +#endif +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), wl_rst_gpios) + const struct gpio_dt_spec wl_rst; +#endif +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), bt_rst_gpios) + const struct gpio_dt_spec bt_rst; +#endif +}; + +static const struct wifi_gpio_config wifi_gpio = { +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), pdn_gpios) + .pdn = GPIO_DT_SPEC_GET(DT_NODELABEL(wifi), pdn_gpios), +#endif +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), wl_rst_gpios) + .wl_rst = GPIO_DT_SPEC_GET(DT_NODELABEL(wifi), wl_rst_gpios), +#endif +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), bt_rst_gpios) + .bt_rst = GPIO_DT_SPEC_GET(DT_NODELABEL(wifi), bt_rst_gpios), +#endif +}; + +void BOARD_WIFI_BT_Enable(bool enable) +{ + if (enable) + { +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), pdn_gpios) + gpio_pin_set_dt(&wifi_gpio.pdn, 1); + k_msleep(100); +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), wl_rst_gpios) + gpio_pin_set_dt(&wifi_gpio.wl_rst, 1); +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), bt_rst_gpios) + gpio_pin_set_dt(&wifi_gpio.bt_rst, 1); +#endif + + k_msleep(100); + } + else + { +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), wl_rst_gpios) + gpio_pin_set_dt(&wifi_gpio.wl_rst, 0); +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), bt_rst_gpios) + gpio_pin_set_dt(&wifi_gpio.bt_rst, 0); +#endif + + k_msleep(10); + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), pdn_gpios) + gpio_pin_set_dt(&wifi_gpio.pdn, 0); +#endif + + k_msleep(100); + } +} + static void sdio_controller_init(void) { (void)memset(&wm_g_sd, 0, sizeof(struct sd_card)); + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), wl_rst_gpios) + if (gpio_pin_configure_dt(&wifi_gpio.wl_rst, GPIO_OUTPUT) < 0) + { + sdio_e("Failed to configure WiFi reset pin"); + } +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), pdn_gpios) + if (gpio_pin_configure_dt(&wifi_gpio.pdn, GPIO_OUTPUT) < 0) + { + sdio_e("Failed to configure power down pin"); + } +#endif + +#if DT_NODE_HAS_PROP(DT_NODELABEL(wifi), bt_rst_gpios) + if (gpio_pin_configure_dt(&wifi_gpio.bt_rst, GPIO_OUTPUT) < 0) + { + sdio_e("Failed to configure BT reset pin"); + } +#endif + + BOARD_WIFI_BT_Enable(false); } static int sdio_card_init(void) @@ -97,6 +186,8 @@ static int sdio_card_init(void) int ret = WM_SUCCESS; uint32_t resp; + BOARD_WIFI_BT_Enable(true); + if (!device_is_ready(sdhc_dev)) { sdio_e("SD controller not ready"); diff --git a/mcux/middleware/wifi_nxp/wifidriver/mlan_glue.c b/mcux/middleware/wifi_nxp/wifidriver/mlan_glue.c index dd2402d67..018bc89ab 100644 --- a/mcux/middleware/wifi_nxp/wifidriver/mlan_glue.c +++ b/mcux/middleware/wifi_nxp/wifidriver/mlan_glue.c @@ -3405,24 +3405,6 @@ int wifi_process_cmd_response(HostCmd_DS_COMMAND *resp) rv = wlan_ops_sta_process_cmdresp(pmpriv, command, resp, NULL); } break; -#ifdef SD8801 - case HostCmd_CMD_ROBUST_COEX: - { - const HostCmd_DS_ExtBLECoex_Config_t *coex = &resp->params.ext_ble_coex_cfg; - if (coex->action == HostCmd_ACT_GEN_GET) - { - if (wm_wifi.cmd_resp_priv != NULL) - { - wifi_ext_coex_stats_t *stats = (wifi_ext_coex_stats_t *)wm_wifi.cmd_resp_priv; - stats->ext_radio_req_count = coex->coex_cfg_data.EXT_RADIO_REQ_count; - stats->ext_radio_pri_count = coex->coex_cfg_data.EXT_RADIO_PRI_count; - stats->wlan_grant_count = coex->coex_cfg_data.WLAN_GRANT_count; - } - } - wm_wifi.cmd_resp_status = WM_SUCCESS; - } - break; -#endif #if CONFIG_11N case HostCmd_CMD_11N_CFG: rv = wlan_ret_11n_cfg(pmpriv, resp, NULL); @@ -4697,14 +4679,33 @@ int wifi_process_cmd_response(HostCmd_DS_COMMAND *resp) wm_wifi.cmd_resp_status = -WM_FAIL; break; #endif -#if (CONFIG_COEX_DUTY_CYCLE) || (CONFIG_EXTERNAL_COEX_PTA) || (CONFIG_IMD3_CFG) case HostCmd_CMD_ROBUST_COEX: + { + +#ifdef SD8801 + const HostCmd_DS_ExtBLECoex_Config_t *coex = &resp->params.ext_ble_coex_cfg; + if (coex->action == HostCmd_ACT_GEN_GET) + { + if (wm_wifi.cmd_resp_priv != NULL) + { + wifi_ext_coex_stats_t *stats = (wifi_ext_coex_stats_t *)wm_wifi.cmd_resp_priv; + stats->ext_radio_req_count = coex->coex_cfg_data.EXT_RADIO_REQ_count; + stats->ext_radio_pri_count = coex->coex_cfg_data.EXT_RADIO_PRI_count; + stats->wlan_grant_count = coex->coex_cfg_data.WLAN_GRANT_count; + } + } + wm_wifi.cmd_resp_status = WM_SUCCESS; +#endif + +#if (CONFIG_COEX_DUTY_CYCLE) || (CONFIG_EXTERNAL_COEX_PTA) || (CONFIG_IMD3_CFG) if (resp->result == HostCmd_RESULT_OK) wm_wifi.cmd_resp_status = WM_SUCCESS; else wm_wifi.cmd_resp_status = -WM_FAIL; - break; #endif + } + break; + #if (CONFIG_WIFI_IND_RESET) && (CONFIG_WIFI_IND_DNLD) case HostCmd_CMD_INDEPENDENT_RESET_CFG: { diff --git a/mcux/middleware/wifi_nxp/wifidriver/wifi-sdio.c b/mcux/middleware/wifi_nxp/wifidriver/wifi-sdio.c index fa304634c..d9f1665f6 100644 --- a/mcux/middleware/wifi_nxp/wifidriver/wifi-sdio.c +++ b/mcux/middleware/wifi_nxp/wifidriver/wifi-sdio.c @@ -233,6 +233,7 @@ static void wifi_sdio_wait_for_cmdresp() { /* assert as command flow cannot work anymore */ assert(0); + wifi_e("wifi_sdio_wait_for_cmdresp failed"); } } @@ -654,7 +655,7 @@ static mlan_status wlan_decode_rx_packet(t_u8 *pmbuf, t_u32 upld_type) } else #endif /* CONFIG_P2P */ - if ((fw_init_cfg == 0U) && (bus.event_queue != NULL)) + if ((fw_init_cfg == 0U) && (bus.event_queue != NULL)) { if (upld_type == MLAN_TYPE_CMD) { @@ -2757,8 +2758,8 @@ void handle_cdint(int error) if (!error && g_txrx_flag) { g_txrx_flag = false; -#if CONFIG_ZEPHYR - (void)OSA_EventNotifyPost(wm_wifi.wifi_core_task_Handle); +#ifdef __ZEPHYR__ + (void)OSA_TaskNotifyPost(wm_wifi.wifi_core_task_Handle); #else (void)OSA_EventSet((osa_event_handle_t)wm_wifi.wifi_event_Handle, WIFI_EVENT_SDIO); #endif diff --git a/mcux/middleware/wifi_nxp/wifidriver/wifi.c b/mcux/middleware/wifi_nxp/wifidriver/wifi.c index 5a737bd96..dc2643584 100644 --- a/mcux/middleware/wifi_nxp/wifidriver/wifi.c +++ b/mcux/middleware/wifi_nxp/wifidriver/wifi.c @@ -58,8 +58,8 @@ t_u64 csi_event_data_len = 0; extern wifi_ecsa_status_control ecsa_status_control; #endif -#if !CONFIG_WIFI_CORE_STACK_SIZE -#define CONFIG_WIFI_CORE_STACK_SIZE (2048) +#ifndef CONFIG_NXP_WIFI_CORE_TASK_STACK_SIZE +#define CONFIG_CORE_STACK_SIZE (2048) #endif #define MAX_MCAST_LEN (MLAN_MAX_MULTICAST_LIST_SIZE * MLAN_MAC_ADDR_LENGTH) @@ -151,52 +151,52 @@ typedef enum __mlan_status static void wifi_core_task(osa_task_param_t arg); /* OSA_TASKS: name, priority, instances, stackSz, useFloat */ -static OSA_TASK_DEFINE(wifi_core_task, OSA_PRIORITY_HIGH, 1, CONFIG_WIFI_CORE_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wifi_core_task, OSA_PRIORITY_HIGH, 1, CONFIG_CORE_STACK_SIZE, 0); #endif -#if !CONFIG_WIFI_SCAN_STACK_SIZE -#define CONFIG_WIFI_SCAN_STACK_SIZE (2048) +#ifndef CONFIG_NXP_WIFI_SCAN_TASK_STACK_SIZE +#define CONFIG_SCAN_STACK_SIZE (2048) #endif static void wifi_scan_task(osa_task_param_t arg); /* OSA_TASKS: name, priority, instances, stackSz, useFloat */ -static OSA_TASK_DEFINE(wifi_scan_task, OSA_PRIORITY_NORMAL, 1, CONFIG_WIFI_SCAN_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wifi_scan_task, OSA_PRIORITY_NORMAL, 1, CONFIG_SCAN_STACK_SIZE, 0); -#if !CONFIG_WIFI_DRIVER_STACK_SIZE -#define CONFIG_WIFI_DRIVER_STACK_SIZE (2048) +#ifndef CONFIG_NXP_WIFI_DRIVER_TASK_STACK_SIZE +#define CONFIG_DRIVER_STACK_SIZE (2048) #endif static void wifi_drv_task(osa_task_param_t arg); /* OSA_TASKS: name, priority, instances, stackSz, useFloat */ -static OSA_TASK_DEFINE(wifi_drv_task, OSA_PRIORITY_HIGH, 1, CONFIG_WIFI_DRIVER_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wifi_drv_task, OSA_PRIORITY_HIGH, 1, CONFIG_DRIVER_STACK_SIZE, 0); #if CONFIG_WMM -#if !CONFIG_WIFI_DRV_TX_STACK_SIZE -#define CONFIG_WIFI_DRV_TX_STACK_SIZE (2048) +#ifndef CONFIG_NXP_WIFI_TX_TASK_STACK_SIZE +#define CONFIG_TX_STACK_SIZE (2048) #endif static void wifi_drv_tx_task(osa_task_param_t arg); /* OSA_TASKS: name, priority, instances, stackSz, useFloat */ #ifdef RW610 -static OSA_TASK_DEFINE(wifi_drv_tx_task, OSA_PRIORITY_ABOVE_NORMAL, 1, CONFIG_WIFI_DRV_TX_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wifi_drv_tx_task, OSA_PRIORITY_ABOVE_NORMAL, 1, CONFIG_TX_STACK_SIZE, 0); #else -static OSA_TASK_DEFINE(wifi_drv_tx_task, OSA_PRIORITY_HIGH, 1, CONFIG_WIFI_DRV_TX_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wifi_drv_tx_task, OSA_PRIORITY_HIGH, 1, CONFIG_TX_STACK_SIZE, 0); #endif #endif -#if !CONFIG_WIFI_POWERSAVE_STACK_SIZE -#define CONFIG_WIFI_POWERSAVE_STACK_SIZE (1024) +#ifndef CONFIG_NXP_WIFI_POWERSAVE_TASK_STACK_SIZE +#define CONFIG_POWERSAVE_STACK_SIZE (1024) #endif static void wifi_powersave_task(osa_task_param_t arg); /* OSA_TASKS: name, priority, instances, stackSz, useFloat */ -static OSA_TASK_DEFINE(wifi_powersave_task, OSA_PRIORITY_NORMAL, 1, CONFIG_WIFI_POWERSAVE_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wifi_powersave_task, OSA_PRIORITY_NORMAL, 1, CONFIG_POWERSAVE_STACK_SIZE, 0); int wifi_set_mac_multicast_addr(const char *mlist, t_u32 num_of_addr); int wrapper_get_wpa_ie_in_assoc(uint8_t *wpa_ie); diff --git a/mcux/middleware/wifi_nxp/wlcmgr/wlan.c b/mcux/middleware/wifi_nxp/wlcmgr/wlan.c index 4ef0fd910..337ae22d8 100644 --- a/mcux/middleware/wifi_nxp/wlcmgr/wlan.c +++ b/mcux/middleware/wifi_nxp/wlcmgr/wlan.c @@ -358,7 +358,9 @@ static struct wifi_scan_params_t g_wifi_scan_params = {NULL, 60, 250}; +#ifndef CONFIG_NXP_WIFI_WLCMGR_TASK_STACK_SIZE #define CONFIG_WLCMGR_STACK_SIZE (5120) +#endif static void wlcmgr_task(osa_task_param_t arg); @@ -366,7 +368,9 @@ static void wlcmgr_task(osa_task_param_t arg); static OSA_TASK_DEFINE(wlcmgr_task, OSA_PRIORITY_HIGH, 1, CONFIG_WLCMGR_STACK_SIZE, 0); #if CONFIG_WPS2 +#ifndef CONFIG_NXP_WIFI_WPS_TASK_STACK_SIZE #define CONFIG_WPS_STACK_SIZE (5120) +#endif static void wps_task(osa_task_param_t arg); @@ -421,13 +425,15 @@ static struct wps_config wps_conf = { #endif /* CONFIG_WPS2 */ #ifdef RW610 -/*wlmon_mon_task takes 2640B with supplicant control interface API*/ -#define CONFIG_WLCMGR_MON_STACK_SIZE (3072) +/*wlmon_mon_task takes 3072B with supplicant control interface API*/ +#ifndef CONFIG_NXP_WIFI_MON_TASK_STACK_SIZE +#define CONFIG_MON_STACK_SIZE (3072) +#endif static void wlcmgr_mon_task(osa_task_param_t arg); /* OSA_TASKS: name, priority, instances, stackSz, useFloat */ -static OSA_TASK_DEFINE(wlcmgr_mon_task, OSA_PRIORITY_NORMAL , 1, CONFIG_WLCMGR_MON_STACK_SIZE, 0); +static OSA_TASK_DEFINE(wlcmgr_mon_task, OSA_PRIORITY_NORMAL , 1, CONFIG_MON_STACK_SIZE, 0); /* The monitor thread event queue receives events from the power manager * wlan notifier when idle hook is invoked and host is ready to enter @@ -1784,6 +1790,7 @@ static bool is_sta_connecting(void) #endif } +#if defined(RW610) static bool is_sta_idle(void) { #if CONFIG_WIFI_NM_WPA_SUPPLICANT @@ -1794,6 +1801,7 @@ static bool is_sta_idle(void) return (wlan.sta_state == CM_STA_IDLE); #endif } +#endif /* Check whether we are allowed to start a user-requested scan right now. */ static bool is_scanning_allowed(void) diff --git a/zephyr/blobs/SD8987/CMakeLists.txt b/zephyr/blobs/SD8987/CMakeLists.txt new file mode 100644 index 000000000..10f6892f3 --- /dev/null +++ b/zephyr/blobs/SD8987/CMakeLists.txt @@ -0,0 +1,3 @@ +zephyr_include_directories( + ./ +) \ No newline at end of file diff --git a/zephyr/module.yml b/zephyr/module.yml index fa2731e17..3a510175b 100644 --- a/zephyr/module.yml +++ b/zephyr/module.yml @@ -45,4 +45,12 @@ blobs: license-path: zephyr/blobs/license/LA_OPT_NXP_Software_License.txt url: https://github.com/nxp-mcuxpresso/mcux-sdk-middleware-bluetooth-controller/raw/refs/tags/MCUX_2.16.000/bin/mcxw71_nbu_ble_1_9_14_0.sb3 description: "BLE Controller for MCXW71 boards" - +#SD8987 + - path: SD8987/sduart8987_wlan_bt.bin.inc + sha256: e8f0db42a54769d5d1c54f2b931121713211d3925acb3c8753f117f6376c8ffb + type: img + version: '1.0' + license-path: zephyr/blobs/license/LA_OPT_NXP_Software_License.txt + url: https://raw.githubusercontent.com/NXP/wifi_nxp/mcux_wifi_release/wifi_bt_firmware/8987/sduart8987_wlan_bt.bin.inc + description: "Firmware for NXP SD8987 Wi-Fi + Bluetooth single-chip solution" + doc-url: https://github.com/NXP/wifi_nxp/blob/mcux_wifi_release/wifi_bt_firmware/version.txt \ No newline at end of file