xref: /freebsd/sys/contrib/dev/rtw89/ps.h (revision 1c1f229e9156dd75cab5e0e3e586c5ef319d68ee)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2019-2020  Realtek Corporation
3  */
4 
5 #ifndef __RTW89_PS_H_
6 #define __RTW89_PS_H_
7 
8 void rtw89_enter_lps(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
9 		     bool ps_mode);
10 void rtw89_leave_lps(struct rtw89_dev *rtwdev);
11 void __rtw89_leave_ps_mode(struct rtw89_dev *rtwdev);
12 void __rtw89_enter_ps_mode(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif);
13 void rtw89_leave_ps_mode(struct rtw89_dev *rtwdev);
14 void rtw89_enter_ips(struct rtw89_dev *rtwdev);
15 void rtw89_leave_ips(struct rtw89_dev *rtwdev);
16 void rtw89_set_coex_ctrl_lps(struct rtw89_dev *rtwdev, bool btc_ctrl);
17 void rtw89_process_p2p_ps(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif);
18 void rtw89_recalc_lps(struct rtw89_dev *rtwdev);
19 
20 static inline void rtw89_leave_ips_by_hwflags(struct rtw89_dev *rtwdev)
21 {
22 	struct ieee80211_hw *hw = rtwdev->hw;
23 
24 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
25 		rtw89_leave_ips(rtwdev);
26 }
27 
28 static inline void rtw89_enter_ips_by_hwflags(struct rtw89_dev *rtwdev)
29 {
30 	struct ieee80211_hw *hw = rtwdev->hw;
31 
32 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
33 		rtw89_enter_ips(rtwdev);
34 }
35 
36 #endif
37