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 * 文 件 名 : hmac_smps.h
15 * 生成日期 : 2014年4月17日
16 * 功能描述 : hmac_smps.c 的头文件
17 */
18
19 #ifndef __HMAC_SMPS_H__
20 #define __HMAC_SMPS_H__
21
22 #ifdef _PRE_WLAN_FEATURE_SMPS
23
24 /*****************************************************************************
25 1 其他头文件包含
26 *****************************************************************************/
27 #include "oal_ext_if.h"
28 #include "hmac_main.h"
29 #include "oam_ext_if.h"
30 #include "mac_resource_ext.h"
31 #include "dmac_ext_if_hcm.h"
32 #include "mac_device_ext.h"
33 #include "mac_vap_ext.h"
34 #include "hmac_vap.h"
35 #include "mac_user_ext.h"
36
37 #ifdef __cplusplus
38 #if __cplusplus
39 extern "C" {
40 #endif
41 #endif
42
43 #undef THIS_FILE_ID
44 #define THIS_FILE_ID OAM_FILE_ID_HMAC_SMPS_H
45 /*****************************************************************************
46 2 宏定义
47 *****************************************************************************/
48
49
50 /*****************************************************************************
51 3 枚举定义
52 *****************************************************************************/
53
54
55 /*****************************************************************************
56 4 全局变量声明
57 *****************************************************************************/
58
59
60 /*****************************************************************************
61 5 消息头定义
62 *****************************************************************************/
63
64
65 /*****************************************************************************
66 6 消息定义
67 *****************************************************************************/
68
69
70 /*****************************************************************************
71 7 STRUCT定义
72 *****************************************************************************/
73
74
75 /*****************************************************************************
76 8 UNION定义
77 *****************************************************************************/
78
79
80 /*****************************************************************************
81 9 OTHERS定义
82 *****************************************************************************/
83
84
85 /*****************************************************************************
86 10 函数声明
87 *****************************************************************************/
88 extern osal_u32 hmac_smps_update_user_status(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user);
89
90 osal_u8 hmac_smps_get_hal_mode(osal_u8 dev_smps_mode);
91
92 osal_void hmac_smps_send_action(hmac_vap_stru *hmac_vap, wlan_mib_mimo_power_save_enum_uint8 smps_mode,
93 oal_bool_enum_uint8 bool_code);
94
95 osal_u32 hmac_check_smps_field(hmac_vap_stru *hmac_vap, osal_u8 *payload, osal_u32 msg_len,
96 hmac_user_stru *hmac_user);
97
98 osal_u32 hmac_mgmt_rx_smps_frame(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user, const osal_u8 *frame_payload);
99
100 extern osal_s32 hmac_config_set_smps_mode(hmac_vap_stru *hmac_vap, frw_msg *msg);
101
102 osal_u8 hmac_user_get_smps_mode(const hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user);
103
104 /*****************************************************************************
105 功能描述 : 填写SM Power Save字段
106 *****************************************************************************/
hmac_calc_smps_field(osal_u8 smps)107 static inline osal_u8 hmac_calc_smps_field(osal_u8 smps)
108 {
109 if (smps == WLAN_MIB_MIMO_POWER_SAVE_DYNAMIC) {
110 return MAC_SMPS_DYNAMIC_MODE;
111 } else if (smps == WLAN_MIB_MIMO_POWER_SAVE_STATIC) {
112 return MAC_SMPS_STATIC_MODE;
113 }
114
115 return MAC_SMPS_MIMO_MODE;
116 }
117 #ifdef __cplusplus
118 #if __cplusplus
119 }
120 #endif
121 #endif
122
123 #endif /* end of _PRE_WLAN_FEATURE_SMPS */
124
125 #endif /* end of hmac_smps.h */