From 8e0a0428052f7511a4f12145188369d3e3b25e10 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 13 Nov 2019 16:23:44 +0100 Subject: [PATCH] Disable messages about power save in Monitor mode --- core/rtw_pwrctrl.c | 47 +++++++++------------------------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 08ce9cf..2f4db00 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -286,7 +286,7 @@ void rtw_ps_processor(_adapter *padapter) _enter_pwrlock(&adapter_to_pwrctl(padapter)->lock); ps_deny = rtw_ps_deny_get(padapter); _exit_pwrlock(&adapter_to_pwrctl(padapter)->lock); - if (ps_deny != 0) { + if ((ps_deny & (~(1<mlmepriv; - - if (tx) { /* from tx */ xmit_cnt += tx_packets; @@ -867,7 +865,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; #endif -#ifdef CONFIG_WMMPS_STA +#ifdef CONFIG_WMMPS_STA struct registry_priv *pregistrypriv = &padapter->registrypriv; #endif #ifdef CONFIG_P2P @@ -884,8 +882,6 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode u8 lps_pg_hdl_id = 0; #endif - - if (ps_mode > PM_Card_Disable) { return; } @@ -895,7 +891,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode return; #ifndef CONFIG_BT_COEXIST -#ifdef CONFIG_WMMPS_STA +#ifdef CONFIG_WMMPS_STA if (!rtw_is_wmmps_mode(padapter)) #endif /* CONFIG_WMMPS_STA */ if ((pwrpriv->smart_ps == smart_ps) && @@ -1081,11 +1077,10 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode } #endif -#ifdef CONFIG_WMMPS_STA +#ifdef CONFIG_WMMPS_STA pwrpriv->wmm_smart_ps = pregistrypriv->wmm_smart_ps; #endif /* CONFIG_WMMPS_STA */ - - + if (check_fwstate(pmlmepriv, _FW_LINKED)) rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode)); #ifdef CONFIG_WOWLAN @@ -1194,10 +1189,10 @@ void LPS_Enter(PADAPTER padapter, const char *msg) if (rtw_is_wmmps_mode(padapter)) msg = "WMMPS_IDLE"; #endif /* CONFIG_WMMPS_STA */ - + sprintf(buf, "WIFI-%s", msg); pwrpriv->bpower_saving = _TRUE; - + #ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS pwrpriv->pwr_saving_start_time = rtw_get_current_time(); #endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */ @@ -1227,7 +1222,6 @@ void LPS_Leave(PADAPTER padapter, const char *msg) struct debug_priv *pdbgpriv = &dvobj->drv_dbg; #endif - /* RTW_INFO("+LeisurePSLeave\n"); */ #ifdef CONFIG_BT_COEXIST @@ -1242,11 +1236,11 @@ void LPS_Leave(PADAPTER padapter, const char *msg) if (rtw_is_wmmps_mode(padapter)) msg = "WMMPS_BUSY"; #endif /* CONFIG_WMMPS_STA */ - + sprintf(buf, "WIFI-%s", msg); rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, buf); -#ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS +#ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time); #endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */ } @@ -1431,7 +1425,6 @@ void LPS_Leave_check( systime start_time; u8 bReady; - pwrpriv = adapter_to_pwrctl(padapter); bReady = _FALSE; @@ -1653,7 +1646,6 @@ static void pwr_rpwm_timeout_handler(void *FunctionContext) PADAPTER padapter; struct pwrctrl_priv *pwrpriv; - padapter = (PADAPTER)FunctionContext; pwrpriv = adapter_to_pwrctl(padapter); if (!padapter) @@ -1683,7 +1675,6 @@ __inline static void unregister_task_alive(struct pwrctrl_priv *pwrctrl, u32 tag pwrctrl->alives &= ~tag; } - /* * Description: * Check if the fw_pwrstate is okay for I/O. @@ -1733,7 +1724,6 @@ s32 rtw_register_task_alive(PADAPTER padapter, u32 task) } #endif /* CONFIG_DETECT_CPWM_BY_POLLING */ - return res; } @@ -1752,7 +1742,6 @@ void rtw_unregister_task_alive(PADAPTER padapter, u32 task) struct pwrctrl_priv *pwrctrl; u8 pslv; - pwrctrl = adapter_to_pwrctl(padapter); pslv = PS_STATE_S0; @@ -1832,7 +1821,6 @@ s32 rtw_register_tx_alive(PADAPTER padapter) } #endif /* CONFIG_DETECT_CPWM_BY_POLLING */ - return res; } @@ -1883,7 +1871,6 @@ s32 rtw_register_cmd_alive(PADAPTER padapter) } #endif /* CONFIG_DETECT_CPWM_BY_POLLING */ - return res; } @@ -1926,7 +1913,6 @@ s32 rtw_register_evt_alive(PADAPTER padapter) { struct pwrctrl_priv *pwrctrl; - pwrctrl = adapter_to_pwrctl(padapter); _enter_pwrlock(&pwrctrl->lock); @@ -1935,7 +1921,6 @@ s32 rtw_register_evt_alive(PADAPTER padapter) _exit_pwrlock(&pwrctrl->lock); - return _SUCCESS; } @@ -1953,7 +1938,6 @@ void rtw_unregister_tx_alive(PADAPTER padapter) struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); u8 pslv, i; - pwrctrl = adapter_to_pwrctl(padapter); pslv = PS_STATE_S0; @@ -2011,7 +1995,6 @@ void rtw_unregister_cmd_alive(PADAPTER padapter) struct pwrctrl_priv *pwrctrl; u8 pslv, i; - pwrctrl = adapter_to_pwrctl(padapter); pslv = PS_STATE_S0; @@ -2063,14 +2046,12 @@ void rtw_unregister_rx_alive(PADAPTER padapter) { struct pwrctrl_priv *pwrctrl; - pwrctrl = adapter_to_pwrctl(padapter); _enter_pwrlock(&pwrctrl->lock); unregister_task_alive(pwrctrl, RECV_ALIVE); - _exit_pwrlock(&pwrctrl->lock); } @@ -2079,12 +2060,10 @@ void rtw_unregister_evt_alive(PADAPTER padapter) { struct pwrctrl_priv *pwrctrl; - pwrctrl = adapter_to_pwrctl(padapter); unregister_task_alive(pwrctrl, EVT_ALIVE); - _exit_pwrlock(&pwrctrl->lock); } @@ -2109,7 +2088,6 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) return; #endif - #ifdef PLATFORM_WINDOWS pwrctrlpriv->pnp_current_pwr_state = NdisDeviceStateD0; #endif @@ -2255,10 +2233,8 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter) rtw_hal_set_hwreg(padapter, HW_VAR_LPS_POFF_INIT, 0); #endif - } - void rtw_free_pwrctrl_priv(PADAPTER adapter) { struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(adapter); @@ -2268,10 +2244,8 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter) return; #endif - /* _rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */ - #ifdef CONFIG_RESUME_IN_WORKQUEUE if (pwrctrlpriv->rtw_workqueue) { flush_workqueue(pwrctrlpriv->rtw_workqueue); @@ -2399,7 +2373,6 @@ void rtw_register_early_suspend(struct pwrctrl_priv *pwrpriv) pwrpriv->early_suspend.resume = rtw_late_resume; register_early_suspend(&pwrpriv->early_suspend); - } void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) @@ -2476,7 +2449,6 @@ u8 rtw_interface_ps_func(_adapter *padapter, HAL_INTF_PS_FUNC efunc_id, u8 *val) return bResult; } - inline void rtw_set_ips_deny(_adapter *padapter, u32 ms) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); @@ -2509,7 +2481,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) if (rtw_time_after(rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time)) pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms); - if (pwrpriv->ps_processing) { RTW_INFO("%s wait ps_processing...\n", __func__); while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000)