• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: Header file of HAL power save public interfaces .
15  * Create: 2020-8-8
16  */
17 #ifndef __HAL_POWER_SAVE_H__
18 #define __HAL_POWER_SAVE_H__
19 
20 #include "hal_common_ops.h"
21 
22 /*****************************************************************************
23  * 1 其他头文件包含
24  *****************************************************************************/
25 /*****************************************************************************
26  * STA ps feature
27  *****************************************************************************/
28 #ifdef _PRE_WLAN_FEATURE_TXOPPS
29 /*****************************************************************************
30  * 功能描述  : 设置PA_TXOP_PS_CTRL_REG寄存器中使能字段
31  *****************************************************************************/
hal_set_txop_ps_enable(hal_to_dmac_device_stru * hal_device,osal_u8 on_off)32 static  INLINE__ osal_void hal_set_txop_ps_enable(hal_to_dmac_device_stru *hal_device, osal_u8 on_off)
33 {
34     hal_public_hook_func(_set_txop_ps_enable)(hal_device, on_off);
35 }
36 
37 /*****************************************************************************
38  * 功能描述  : 设置PA_TXOP_PS_CTRL_REG寄存器中condition1使能
39  *****************************************************************************/
hal_set_txop_ps_condition1(osal_u8 on_off)40 static  INLINE__ osal_void hal_set_txop_ps_condition1(osal_u8 on_off)
41 {
42     hal_public_hook_func(_set_txop_ps_condition1)(on_off);
43 }
44 
45 /*****************************************************************************
46  * 功能描述  : 设置PA_TXOP_PS_CTRL_REG寄存器中conditon2使能字段
47  *****************************************************************************/
hal_set_txop_ps_condition2(osal_u8 on_off)48 static  INLINE__ osal_void hal_set_txop_ps_condition2(osal_u8 on_off)
49 {
50     hal_public_hook_func(_set_txop_ps_condition2)(on_off);
51 }
52 
53 /*****************************************************************************
54  * 功能描述  : 设置mac partial aid寄存器
55  *****************************************************************************/
hal_set_txop_ps_partial_aid(const hal_to_dmac_vap_stru * hal_vap,osal_u32 partial_aid)56 static  INLINE__ osal_void hal_set_txop_ps_partial_aid(const hal_to_dmac_vap_stru *hal_vap, osal_u32 partial_aid)
57 {
58     hal_public_hook_func(_set_txop_ps_partial_aid)(hal_vap, partial_aid);
59 }
60 #endif
61 
62 #ifdef _PRE_WLAN_FEATURE_SMPS
63 /*****************************************************************************
64  * 功能描述  : 设置PA_SMPS_CTRL_REG寄存器中SMPS的模式
65  *****************************************************************************/
hal_set_smps_mode(osal_u8 smps_mode)66 static  INLINE__ osal_void hal_set_smps_mode(osal_u8 smps_mode)
67 {
68     hal_public_hook_func(_set_smps_mode)(smps_mode);
69 }
70 #endif
71 /*****************************************************************************
72  功能描述  : 低功耗唤醒后清除rx中断,防止rx中断里保留上一次睡前的值造成rx new
73 *****************************************************************************/
hal_psm_clear_mac_rx_isr(osal_void)74 static  INLINE__ osal_void hal_psm_clear_mac_rx_isr(osal_void)
75 {
76     hal_public_hook_func(_psm_clear_mac_rx_isr)();
77 }
78 
79 #ifndef _PRE_WLAN_FEATURE_WS63
80 /*****************************************************************************
81  * 功能描述  : 设置mac aid寄存器
82  *****************************************************************************/
hal_set_mac_aid(const hal_to_dmac_vap_stru * hal_vap,osal_u16 aid)83 static  INLINE__ osal_void hal_set_mac_aid(const hal_to_dmac_vap_stru *hal_vap, osal_u16 aid)
84 {
85     hal_public_hook_func(_set_mac_aid)(hal_vap, aid);
86 }
87 
88 /*****************************************************************************
89  * 功能描述  : 设置PSM寄存器中tbtt offset的值
90  *****************************************************************************/
hal_set_tbtt_offset(const hal_to_dmac_vap_stru * hal_vap,osal_u16 offset)91 static  INLINE__ osal_void hal_set_tbtt_offset(const hal_to_dmac_vap_stru *hal_vap, osal_u16 offset)
92 {
93     hal_public_hook_func(_set_tbtt_offset)(hal_vap, offset);
94 }
95 
96 /*****************************************************************************
97  * 功能描述  : 设置PSM寄存器中ext tbtt offset的值
98  *****************************************************************************/
hal_set_psm_ext_tbtt_offset(const hal_to_dmac_vap_stru * hal_vap,osal_u16 offset)99 static  INLINE__ osal_void hal_set_psm_ext_tbtt_offset(const hal_to_dmac_vap_stru *hal_vap, osal_u16 offset)
100 {
101     hal_public_hook_func(_set_psm_ext_tbtt_offset)(hal_vap, offset);
102 }
103 
104 /*****************************************************************************
105  * 功能描述  : 设置beacon period寄存器
106  *****************************************************************************/
hal_vap_set_psm_beacon_period(const hal_to_dmac_vap_stru * hal_vap,osal_u32 beacon_period)107 static  INLINE__ osal_void hal_vap_set_psm_beacon_period(const hal_to_dmac_vap_stru *hal_vap,
108     osal_u32 beacon_period)
109 {
110     hal_public_hook_func(_set_psm_beacon_period)(hal_vap, beacon_period);
111 }
112 
113 /*****************************************************************************
114  * 功能描述  : 设置beacon等待的超时值
115  *****************************************************************************/
hal_set_beacon_timeout(osal_u16 value)116 static  INLINE__ osal_void hal_set_beacon_timeout(osal_u16 value)
117 {
118     hal_public_hook_func(_set_beacon_timeout)(value);
119 }
120 
121 /*****************************************************************************
122  * AP ps feature
123  *****************************************************************************/
124 /*****************************************************************************
125  * 功能描述  : 使能sta ps ctrl寄存器
126  *****************************************************************************/
hal_tx_enable_peer_sta_ps_ctrl(osal_u8 lut_index)127 static  INLINE__ osal_void hal_tx_enable_peer_sta_ps_ctrl(osal_u8 lut_index)
128 {
129     hal_public_hook_func(_tx_enable_peer_sta_ps_ctrl)(lut_index);
130 }
131 
132 /*****************************************************************************
133  * 功能描述  : 去使能sta ps ctrl寄存器
134  *****************************************************************************/
hal_tx_disable_peer_sta_ps_ctrl(osal_u8 lut_index)135 static  INLINE__ osal_void hal_tx_disable_peer_sta_ps_ctrl(osal_u8 lut_index)
136 {
137     hal_public_hook_func(_tx_disable_peer_sta_ps_ctrl)(lut_index);
138 }
139 
140 /*****************************************************************************
141  * 功能描述  : 禁能resp_ps_bit_ctrl
142  *****************************************************************************/
hal_tx_disable_resp_ps_bit_ctrl(osal_u8 lut_index)143 static  INLINE__ osal_void hal_tx_disable_resp_ps_bit_ctrl(osal_u8 lut_index)
144 {
145     hal_public_hook_func(_tx_disable_resp_ps_bit_ctrl)(lut_index);
146 }
147 #endif
148 #ifdef _PRE_WLAN_FEATURE_WUR_TX
hal_vap_send_wur_beacon_pkt(wur_bcn_reg_param_stru * wur_bcn_param)149 static  INLINE__ osal_void hal_vap_send_wur_beacon_pkt(wur_bcn_reg_param_stru *wur_bcn_param)
150 {
151     hal_public_hook_func(_vap_send_wur_beacon_pkt)(wur_bcn_param);
152 }
153 
hal_vap_set_wur_twbtt(osal_u16 wur_offset_twbtt,osal_u8 twbtt_en)154 static  INLINE__ osal_void hal_vap_set_wur_twbtt(osal_u16 wur_offset_twbtt, osal_u8 twbtt_en)
155 {
156     hal_public_hook_func(_vap_set_wur_twbtt)(wur_offset_twbtt, twbtt_en);
157 }
158 
hal_vap_set_wur_beacon_en(osal_u8 wur_bcn_data_rate,osal_u8 wur_bcn_vap_en)159 static  INLINE__ osal_void hal_vap_set_wur_beacon_en(osal_u8 wur_bcn_data_rate, osal_u8 wur_bcn_vap_en)
160 {
161     hal_public_hook_func(_vap_set_wur_beacon_en)(wur_bcn_data_rate, wur_bcn_vap_en);
162 }
163 
hal_write_wur_beacon(osal_u16 id)164 static  INLINE__ osal_void hal_write_wur_beacon(osal_u16 id)
165 {
166     hal_public_hook_func(_write_wur_beacon)(id);
167 }
168 
hal_write_wur_fl_wake(wur_wakeup_reg_param_stru * wur_wakeup_param)169 static  INLINE__ osal_void hal_write_wur_fl_wake(wur_wakeup_reg_param_stru *wur_wakeup_param)
170 {
171     hal_public_hook_func(_write_wur_fl_wake)(wur_wakeup_param);
172 }
173 
hal_write_wur_short_wake(osal_u16 wur_id)174 static  INLINE__ osal_void hal_write_wur_short_wake(osal_u16 wur_id)
175 {
176     hal_public_hook_func(_write_wur_short_wake)(wur_id);
177 }
178 
hal_vap_set_wur(const hal_to_dmac_vap_stru * hal_vap,wur_reg_param_stru * wur_param,osal_u8 count)179 static  INLINE__ osal_void hal_vap_set_wur(const hal_to_dmac_vap_stru *hal_vap, wur_reg_param_stru *wur_param,
180     osal_u8 count)
181 {
182     hal_public_hook_func(_vap_set_wur)(hal_vap, wur_param, count);
183 }
184 #endif
185 
186 #endif /* end of hal_power_save.h */
187 
188