162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 262306a36Sopenharmony_ci/* Copyright(c) 2019-2020 Realtek Corporation 362306a36Sopenharmony_ci */ 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#ifndef __RTW89_PS_H_ 662306a36Sopenharmony_ci#define __RTW89_PS_H_ 762306a36Sopenharmony_ci 862306a36Sopenharmony_civoid rtw89_enter_lps(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif, 962306a36Sopenharmony_ci bool ps_mode); 1062306a36Sopenharmony_civoid rtw89_leave_lps(struct rtw89_dev *rtwdev); 1162306a36Sopenharmony_civoid __rtw89_leave_ps_mode(struct rtw89_dev *rtwdev); 1262306a36Sopenharmony_civoid __rtw89_enter_ps_mode(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif); 1362306a36Sopenharmony_civoid rtw89_leave_ps_mode(struct rtw89_dev *rtwdev); 1462306a36Sopenharmony_civoid rtw89_enter_ips(struct rtw89_dev *rtwdev); 1562306a36Sopenharmony_civoid rtw89_leave_ips(struct rtw89_dev *rtwdev); 1662306a36Sopenharmony_civoid rtw89_set_coex_ctrl_lps(struct rtw89_dev *rtwdev, bool btc_ctrl); 1762306a36Sopenharmony_civoid rtw89_process_p2p_ps(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif); 1862306a36Sopenharmony_civoid rtw89_recalc_lps(struct rtw89_dev *rtwdev); 1962306a36Sopenharmony_civoid rtw89_p2p_noa_renew(struct rtw89_vif *rtwvif); 2062306a36Sopenharmony_civoid rtw89_p2p_noa_append(struct rtw89_vif *rtwvif, 2162306a36Sopenharmony_ci const struct ieee80211_p2p_noa_desc *desc); 2262306a36Sopenharmony_ciu8 rtw89_p2p_noa_fetch(struct rtw89_vif *rtwvif, void **data); 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_cistatic inline void rtw89_leave_ips_by_hwflags(struct rtw89_dev *rtwdev) 2562306a36Sopenharmony_ci{ 2662306a36Sopenharmony_ci struct ieee80211_hw *hw = rtwdev->hw; 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci if (hw->conf.flags & IEEE80211_CONF_IDLE) 2962306a36Sopenharmony_ci rtw89_leave_ips(rtwdev); 3062306a36Sopenharmony_ci} 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_cistatic inline void rtw89_enter_ips_by_hwflags(struct rtw89_dev *rtwdev) 3362306a36Sopenharmony_ci{ 3462306a36Sopenharmony_ci struct ieee80211_hw *hw = rtwdev->hw; 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci if (hw->conf.flags & IEEE80211_CONF_IDLE) 3762306a36Sopenharmony_ci rtw89_enter_ips(rtwdev); 3862306a36Sopenharmony_ci} 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#endif 41