162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
262306a36Sopenharmony_ci/* Copyright(c) 2018-2019  Realtek Corporation
362306a36Sopenharmony_ci */
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#ifndef __RTW_PS_H_
662306a36Sopenharmony_ci#define __RTW_PS_H_
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#define RTW_LPS_THRESHOLD	50
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#define POWER_MODE_ACK		BIT(6)
1162306a36Sopenharmony_ci#define POWER_MODE_PG		BIT(4)
1262306a36Sopenharmony_ci#define POWER_TX_WAKE		BIT(1)
1362306a36Sopenharmony_ci#define POWER_MODE_LCLK		BIT(0)
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#define LEAVE_LPS_TRY_CNT	5
1662306a36Sopenharmony_ci#define LEAVE_LPS_TIMEOUT	msecs_to_jiffies(100)
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciint rtw_enter_ips(struct rtw_dev *rtwdev);
1962306a36Sopenharmony_ciint rtw_leave_ips(struct rtw_dev *rtwdev);
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_civoid rtw_power_mode_change(struct rtw_dev *rtwdev, bool enter);
2262306a36Sopenharmony_civoid rtw_enter_lps(struct rtw_dev *rtwdev, u8 port_id);
2362306a36Sopenharmony_civoid rtw_leave_lps(struct rtw_dev *rtwdev);
2462306a36Sopenharmony_civoid rtw_leave_lps_deep(struct rtw_dev *rtwdev);
2562306a36Sopenharmony_cienum rtw_lps_deep_mode rtw_get_lps_deep_mode(struct rtw_dev *rtwdev);
2662306a36Sopenharmony_civoid rtw_recalc_lps(struct rtw_dev *rtwdev, struct ieee80211_vif *new_vif);
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#endif
29