Skip to content

Commit 525c207

Browse files
committed
mcux: wifi_nxp: Add IW610 host sleep support
Add host sleep feature support for IW610. Removed unecessary APIs of host sleep. Enable wlcmgr_mon_thread for IW610 to support power manager of Zephyr. Signed-off-by: Hui Bai <hui.bai@nxp.com>
1 parent 7a52cbb commit 525c207

File tree

6 files changed

+104
-508
lines changed

6 files changed

+104
-508
lines changed

mcux/middleware/wifi_nxp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ zephyr_compile_definitions_ifdef(CONFIG_NXP_IW610_MURATA_2LL_M2
192192
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A
193193
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A
194194
WIFI_BT_USE_M2_INTERFACE
195+
WIFI_IW610_BOARD_MURATA_2LL_M2
195196
)
196197

197198
zephyr_compile_definitions_ifdef(CONFIG_NXP_IW610_RD_USD

mcux/middleware/wifi_nxp/incl/wlcmgr/wlan.h

Lines changed: 14 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ int wlan_remove_all_network_profiles(void);
23782378
*/
23792379
void wlan_reset(cli_reset_option ResetOption);
23802380

2381-
#if defined(RW610)
2381+
#if defined(RW610) || defined(IW610)
23822382
/** Stop and remove all Wi-Fi network (access point).
23832383
*
23842384
* \return WM_SUCCESS if successful.
@@ -3422,7 +3422,6 @@ void wlan_subscribe_rssi_low_event(void);
34223422
#endif
34233423

34243424
#if CONFIG_HOST_SLEEP
3425-
#ifdef RW610
34263425
#if CONFIG_MEF_CFG
34273426
/** Wowlan (wake on wireless LAN) configuration.
34283427
* This function may be called to configure host sleep in firmware.
@@ -3460,7 +3459,6 @@ void wlan_config_host_sleep(bool is_manual, t_u8 is_periodic);
34603459
* \return kStatus_Success if successful else return -WM_FAIL.
34613460
*/
34623461
status_t wlan_hs_send_event(int id, void *data);
3463-
#endif /*RW610*/
34643462

34653463
/** Cancel host sleep.
34663464
* This function is called to cancel the host sleep in the firmware.
@@ -4062,14 +4060,6 @@ int wlan_get_tbtt_offset_stats(wlan_tbtt_offset_t *tbtt_offset);
40624060
*/
40634061
int wlan_set_packet_filters(wlan_flt_cfg_t *flt_cfg);
40644062

4065-
/**
4066-
* Use this API to enable ARP (address resolution protocol) offload in Wi-Fi firmware
4067-
*
4068-
* \return WM_SUCCESS if operation is successful.
4069-
* \return -WM_FAIL if command fails.
4070-
*/
4071-
int wlan_set_auto_arp(void);
4072-
40734063
#if CONFIG_AUTO_PING
40744064
/**
40754065
* Use this API to enable ping offload in Wi-Fi firmware.
@@ -4092,38 +4082,7 @@ int wlan_set_auto_ping(void);
40924082
int wlan_wowlan_cfg_ptn_match(wlan_wowlan_ptn_cfg_t *ptn_cfg);
40934083
#endif
40944084

4095-
/**
4096-
* Use this API to enable NS offload in Wi-Fi firmware.
4097-
*
4098-
* \return WM_SUCCESS if operation is successful.
4099-
* \return -WM_FAIL if command fails.
4100-
*/
4101-
int wlan_set_ipv6_ns_offload(void);
4102-
41034085
#if CONFIG_HOST_SLEEP
4104-
4105-
/** Use this API to set configuration before going to host sleep */
4106-
void wlan_hs_pre_cfg(void);
4107-
4108-
/** Use this API to get and print the reason of waking up from host sleep */
4109-
void wlan_hs_post_cfg(void);
4110-
4111-
/**
4112-
* Use this API to configure host sleep parameters in Wi-Fi firmware.
4113-
*
4114-
* \param[in] wakeup_condition: bit 0: WAKE_ON_ALL_BROADCAST
4115-
* bit 1: WAKE_ON_UNICAST
4116-
* bit 2: WAKE_ON_MAC_EVENT
4117-
* bit 3: WAKE_ON_MULTICAST
4118-
* bit 4: WAKE_ON_ARP_BROADCAST
4119-
* bit 6: WAKE_ON_MGMT_FRAME
4120-
* All bit 0 discard and not wakeup host
4121-
*
4122-
* \return WM_SUCCESS if operation is successful.
4123-
* \return -WM_FAIL if command fails.
4124-
*/
4125-
int wlan_send_host_sleep(uint32_t wakeup_condition);
4126-
41274086
/**
41284087
* Use this API to get host sleep wakeup reason from Wi-Fi firmware after waking up from host sleep by Wi-Fi.
41294088
*
@@ -4142,11 +4101,6 @@ int wlan_send_host_sleep(uint32_t wakeup_condition);
41424101
* \return -WM_FAIL if command fails.
41434102
*/
41444103
int wlan_get_wakeup_reason(uint16_t *hs_wakeup_reason);
4145-
4146-
#ifdef IW610
4147-
/** Use this API to register call back for host sleep confirm done*/
4148-
void wlan_register_hs_callback(void (*hs_notify_cb)(void));
4149-
#endif
41504104
#endif
41514105

41524106
/**
@@ -6734,6 +6688,19 @@ enum wlan_mef_type
67346688
*
67356689
*/
67366690
int wlan_mef_set_auto_arp(t_u8 mef_action);
6691+
6692+
/** This function set multicast packet as low power wake up condition.
6693+
*
6694+
* \param[in] mef_action: To be\n
6695+
* 0--discard multicast packet and not wake host\n
6696+
* 1--discard multicast packet and wake host\n
6697+
* 3--allow multicast packet and wake host.
6698+
*
6699+
* \return WM_SUCCESS if successful otherwise return -WM_FAIL.
6700+
*
6701+
*/
6702+
int wlan_mef_set_multicast(t_u8 mef_action);
6703+
67376704
/** This function set auto ping configuration.
67386705
*
67396706
* \param[in] mef_action: To be\n

mcux/middleware/wifi_nxp/wifidriver/wifi-sdio.c

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ uint8_t dev_mac_addr[MLAN_MAC_ADDR_LENGTH];
9999
uint8_t dev_mac_addr_uap[MLAN_MAC_ADDR_LENGTH];
100100
static uint8_t dev_fw_ver_ext[MLAN_MAX_VER_STR_LEN];
101101

102+
#if CONFIG_HOST_SLEEP
103+
extern int is_hs_handshake_done;
104+
extern bool skip_hs_handshake;
105+
extern void wlan_hs_hanshake_cfg(bool skip);
106+
#endif
107+
102108
static mlan_status wifi_send_fw_data(t_u8 *data, t_u32 txlen)
103109
{
104110
t_u32 tx_blocks = 0, buflen = 0;
@@ -119,6 +125,13 @@ static mlan_status wifi_send_fw_data(t_u8 *data, t_u32 txlen)
119125
if (data == NULL || txlen == 0)
120126
return MLAN_STATUS_FAILURE;
121127

128+
#if CONFIG_HOST_SLEEP
129+
if (skip_hs_handshake == true)
130+
{
131+
wlan_hs_hanshake_cfg(false);
132+
}
133+
#endif
134+
122135
w_pkt_d("Data TX SIG: Driver=>FW, len %d", txlen);
123136

124137
calculate_sdio_write_params(txlen, &tx_blocks, &buflen);
@@ -1598,6 +1611,13 @@ int wlan_send_sdio_cmd(t_u8 *buf, t_u32 tx_blocks, t_u32 buflen)
15981611

15991612
(void)wifi_sdio_lock();
16001613

1614+
#if CONFIG_HOST_SLEEP
1615+
if (skip_hs_handshake == true)
1616+
{
1617+
wlan_hs_hanshake_cfg(false);
1618+
}
1619+
#endif
1620+
16011621
(void)memcpy((void *)outbuf, (const void *)buf, tx_blocks * buflen);
16021622
sdio->pkttype = MLAN_TYPE_CMD;
16031623
sdio->size = sdio->hostcmd.size + INTF_HEADER_LEN;
@@ -1713,6 +1733,13 @@ static mlan_status wifi_tx_data(t_u8 start_port, t_u8 ports, t_u8 pkt_cnt, t_u32
17131733
}
17141734
#endif
17151735

1736+
#if CONFIG_HOST_SLEEP
1737+
if (skip_hs_handshake == true)
1738+
{
1739+
wlan_hs_hanshake_cfg(false);
1740+
}
1741+
#endif
1742+
17161743
calculate_sdio_write_params(txlen, &tx_blocks, &buflen);
17171744

17181745
if (pkt_cnt == 1)
@@ -2639,6 +2666,13 @@ mlan_status wlan_process_int_status(mlan_adapter *pmadapter)
26392666
t_u32 pre_wr_bitmap = pmadapter->mp_wr_bitmap;
26402667
#endif
26412668

2669+
#if CONFIG_HOST_SLEEP
2670+
if (skip_hs_handshake == true)
2671+
{
2672+
wlan_hs_hanshake_cfg(false);
2673+
}
2674+
#endif
2675+
26422676
/* Get the interrupt status */
26432677
wlan_interrupt(pmadapter);
26442678

@@ -3137,7 +3171,7 @@ void wifi_print_wakeup_reason(t_u16 hs_wakeup_reason)
31373171
{
31383172
if (hs_wakeup_reason == 0)
31393173
{
3140-
PRINTF("Woken up by unknown reason\r\n");
3174+
PRINTF("Woken up by pin\r\n");
31413175
}
31423176
else if (hs_wakeup_reason == 1)
31433177
{

0 commit comments

Comments
 (0)