@@ -281,8 +281,10 @@ int wlan_host_sleep_state = HOST_SLEEP_PERIODIC;
281281 */
282282bool usart_suspend_flag = false;
283283#endif
284+ #if CONFIG_WAKE_TIMER_ENABLE
284285OSA_TIMER_HANDLE_DEFINE (wake_timer );
285286#endif
287+ #endif
286288int is_hs_handshake_done = 0 ;
287289/* indicate that we did not notify FW after host sleep wake up */
288290bool skip_hs_handshake = false;
@@ -1029,12 +1031,14 @@ status_t wlan_hs_send_event(int id, void *data)
10291031#endif
10301032
10311033#if CONFIG_POWER_MANAGER
1034+ #if CONFIG_WAKE_TIMER_ENABLE
10321035static void wake_timer_cb (osa_timer_arg_t arg )
10331036{
10341037 if (wakelock_isheld ())
10351038 wakelock_put ();
10361039}
10371040#endif
1041+ #endif
10381042
10391043#if CONFIG_MEF_CFG
10401044int wlan_wowlan_config (uint8_t is_mef , t_u32 wake_up_conds )
@@ -1164,11 +1168,13 @@ void wlan_config_host_sleep(bool is_manual, t_u8 is_periodic)
11641168#if CONFIG_POWER_MANAGER
11651169 /* Reset flag and stop timer if manual mode is selected without cancel periodic sleep */
11661170 wlan_host_sleep_state = HOST_SLEEP_DISABLE ;
1171+ #if CONFIG_WAKE_TIMER_ENABLE
11671172 if (OSA_TimerIsRunning ((osa_timer_handle_t )wake_timer ))
11681173 {
11691174 OSA_TimerDeactivate ((osa_timer_handle_t )wake_timer );
11701175 wakelock_put ();
11711176 }
1177+ #endif
11721178#endif
11731179 }
11741180}
@@ -1205,13 +1211,15 @@ void wlan_clear_host_sleep_config(void)
12051211#if CONFIG_UART_INTERRUPT
12061212 usart_suspend_flag = MFALSE ;
12071213#endif
1214+ #if CONFIG_WAKE_TIMER_ENABLE
12081215 if (OSA_TimerIsRunning ((osa_timer_handle_t )wake_timer ))
12091216 {
12101217 OSA_TimerDeactivate ((osa_timer_handle_t )wake_timer );
12111218 wakelock_put ();
12121219 }
12131220 is_hs_handshake_done = 0 ;
12141221#endif
1222+ #endif
12151223#if CONFIG_MEF_CFG
12161224 memset (& g_flt_cfg , 0x0 , sizeof (wlan_flt_cfg_t ));
12171225
@@ -10746,12 +10754,14 @@ static void wlcmgr_mon_task(void * data)
1074610754 struct wlan_message msg ;
1074710755
1074810756#if CONFIG_POWER_MANAGER
10757+ #if CONFIG_WAKE_TIMER_ENABLE
1074910758 status = OSA_TimerCreate ((osa_timer_handle_t )wake_timer , MSEC_TO_TICK (WAKE_TIMEOUT ),
1075010759 & wake_timer_cb , NULL , KOSA_TimerOnce , OSA_TIMER_NO_ACTIVATE );
1075110760 if (status != KOSA_StatusSuccess )
1075210761 {
1075310762 wlcm_e ("Unable to create wake timer" );
1075410763 }
10764+ #endif
1075510765#endif
1075610766 while (1 )
1075710767 {
@@ -10775,13 +10785,15 @@ static void wlcmgr_mon_task(void * data)
1077510785 {
1077610786#if CONFIG_POWER_MANAGER
1077710787#ifndef CONFIG_BT
10788+ #if CONFIG_WAKE_TIMER_ENABLE
1077810789 if (!wlan_is_manual && wlan_host_sleep_state == HOST_SLEEP_PERIODIC )
1077910790 {
1078010791 wakelock_get ();
1078110792 (void )OSA_TimerActivate ((osa_timer_handle_t )wake_timer );
1078210793 }
1078310794#endif
1078410795#endif
10796+ #endif
1078510797#ifndef RW610
1078610798 uint16_t hs_wakeup_reason = 0 ;
1078710799 (void )wifi_get_wakeup_reason (& hs_wakeup_reason );
@@ -10796,6 +10808,7 @@ static void wlcmgr_mon_task(void * data)
1079610808#endif
1079710809 }
1079810810#ifndef CONFIG_BT
10811+ #if CONFIG_WAKE_TIMER_ENABLE
1079910812 else if (msg .id == HOST_SLEEP_HANDSHAKE_SKIP )
1080010813 {
1080110814 if (wlan_host_sleep_state == HOST_SLEEP_PERIODIC )
@@ -10806,6 +10819,7 @@ static void wlcmgr_mon_task(void * data)
1080610819 }
1080710820#endif
1080810821#endif
10822+ #endif
1080910823#if CONFIG_WIFI_RECOVERY
1081010824 else if (msg .id == WIFI_RECOVERY_REQ )
1081110825 {
0 commit comments