xref: /linux/drivers/net/wireless/realtek/rtw89/ps.h (revision fd7d598270724cc787982ea48bbe17ad383a8b7f)
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 void rtw89_p2p_noa_renew(struct rtw89_vif *rtwvif);
20 void rtw89_p2p_noa_append(struct rtw89_vif *rtwvif,
21 			  const struct ieee80211_p2p_noa_desc *desc);
22 u8 rtw89_p2p_noa_fetch(struct rtw89_vif *rtwvif, void **data);
23 
24 static inline void rtw89_leave_ips_by_hwflags(struct rtw89_dev *rtwdev)
25 {
26 	struct ieee80211_hw *hw = rtwdev->hw;
27 
28 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
29 		rtw89_leave_ips(rtwdev);
30 }
31 
32 static inline void rtw89_enter_ips_by_hwflags(struct rtw89_dev *rtwdev)
33 {
34 	struct ieee80211_hw *hw = rtwdev->hw;
35 
36 	if (hw->conf.flags & IEEE80211_CONF_IDLE)
37 		rtw89_enter_ips(rtwdev);
38 }
39 
40 #endif
41