WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hmac_feature_main.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2021-2022. All rights reserved.
3 * Description: Header file of hmac&dmac message id defined.
4 * Create: 2021-07-14
5 */
6
7#ifndef WLAN_FEATURE_H
8#define WLAN_FEATURE_H
9
10#include "mac_vap_ext.h"
11#include "mac_device_ext.h"
12#include "mac_user_ext.h"
13
14#ifdef __cplusplus
15#if __cplusplus
16extern "C" {
17#endif
18#endif
19
27
28/*****************************************************************************
29 函 数 名 : hmac_device_get_feature_ptr
30 功能描述 : 通过特性索引获取hmac_device下的特性指针
31*****************************************************************************/
32static INLINE__ osal_void *hmac_device_get_feature_ptr(hmac_device_stru *hmac_device,
33 wlan_feature_index_enum feature_index)
34{
35 return (osal_void *)hmac_device->hmac_device_feature_arr[feature_index];
36}
37
38/*****************************************************************************
39 函 数 名 : hmac_device_feature_registered
40 功能描述 : 在hmac_device结构体下注册特性指针
41*****************************************************************************/
42static INLINE__ osal_u32 hmac_device_feature_registered(hmac_device_stru *hmac_device,
43 wlan_feature_index_enum feature_index, osal_void *feature_ptr)
44{
45 if (hmac_device->hmac_device_feature_arr[feature_index] != OAL_PTR_NULL) {
46 return OAL_FAIL;
47 }
48 hmac_device->hmac_device_feature_arr[feature_index] = feature_ptr;
49
50 return OAL_SUCC;
51}
52
53/*****************************************************************************
54 函 数 名 : hmac_device_feature_cancellation
55 功能描述 : 在hmac_device结构体下去注册特性指针
56*****************************************************************************/
57static INLINE__ osal_void hmac_device_feature_unregister(hmac_device_stru *hmac_device,
58 wlan_feature_index_enum feature_index)
59{
60 hmac_device->hmac_device_feature_arr[feature_index] = OAL_PTR_NULL;
61}
62
63/*****************************************************************************
64 函 数 名 : hmac_device_feature_init
65 功能描述 : 在hmac_device结构体下特性指针数组内存申请
66*****************************************************************************/
67static INLINE__ osal_u32 hmac_device_feature_init(hmac_device_stru *hmac_device)
68{
69 if (hmac_device->hmac_device_feature_arr == OAL_PTR_NULL) {
72 if (hmac_device->hmac_device_feature_arr == OAL_PTR_NULL) {
73 return OAL_FAIL;
74 }
75 }
77 0, sizeof(osal_void *) * WLAN_FEATURE_INDEX_BUTT);
78
79 return OAL_SUCC;
80}
81
82/*****************************************************************************
83 函 数 名 : hmac_device_feature_deinit
84 功能描述 : 在hmac_device结构体下特性指针数组内存释放
85*****************************************************************************/
86static INLINE__ osal_u32 hmac_device_feature_deinit(hmac_device_stru *hmac_device)
87{
88 if (hmac_device->hmac_device_feature_arr != OAL_PTR_NULL) {
91 }
92
93 return OAL_SUCC;
94}
95
96/*****************************************************************************
97 函 数 名 : hmac_vap_get_feature_ptr
98 功能描述 : 通过特性索引获取hmac_vap下的特性指针
99*****************************************************************************/
100static INLINE__ osal_void *hmac_vap_get_feature_ptr(const hmac_vap_stru *hmac_vap,
101 wlan_feature_index_enum feature_index)
102{
103 if (hmac_vap->hmac_vap_feature_arr == OSAL_NULL) {
104 return OSAL_NULL;
105 }
106 return (osal_void *)hmac_vap->hmac_vap_feature_arr[feature_index];
107}
108
109/*****************************************************************************
110 函 数 名 : hmac_vap_feature_registered
111 功能描述 : 在hmac_vap结构体下注册特性指针
112*****************************************************************************/
113static INLINE__ osal_u32 hmac_vap_feature_registered(hmac_vap_stru *hmac_vap,
114 wlan_feature_index_enum feature_index, osal_void *feature_ptr)
115{
116 if (hmac_vap->hmac_vap_feature_arr[feature_index] != OAL_PTR_NULL) {
117 return OAL_FAIL;
118 }
119 hmac_vap->hmac_vap_feature_arr[feature_index] = feature_ptr;
120
121 return OAL_SUCC;
122}
123
124/*****************************************************************************
125 函 数 名 : hmac_vap_feature_cancellation
126 功能描述 : 在hmac_vap结构体下去注册特性指针
127*****************************************************************************/
128static INLINE__ osal_void hmac_vap_feature_unregister(hmac_vap_stru *hmac_vap,
129 wlan_feature_index_enum feature_index)
130{
131 hmac_vap->hmac_vap_feature_arr[feature_index] = OAL_PTR_NULL;
132}
133
134/*****************************************************************************
135 函 数 名 : hmac_vap_feature_init
136 功能描述 : 在hmac_vap结构体下特性指针数组内存申请
137*****************************************************************************/
138static INLINE__ osal_u32 hmac_vap_feature_init(hmac_vap_stru *hmac_vap)
139{
140 if (hmac_vap->hmac_vap_feature_arr != OAL_PTR_NULL) {
141 return OAL_SUCC;
142 }
143
146 if (hmac_vap->hmac_vap_feature_arr == OAL_PTR_NULL) {
147 return OAL_FAIL;
148 }
150 0, sizeof(osal_void *) * WLAN_FEATURE_INDEX_BUTT);
151
152 return OAL_SUCC;
153}
154
155/*****************************************************************************
156 函 数 名 : hmac_vap_feature_deinit
157 功能描述 : 在hmac_vap结构体下特性指针数组内存释放
158*****************************************************************************/
159static INLINE__ osal_u32 hmac_vap_feature_deinit(hmac_vap_stru *hmac_vap)
160{
161 if (hmac_vap->hmac_vap_feature_arr != OAL_PTR_NULL) {
164 }
165
166 return OAL_SUCC;
167}
168
169/*****************************************************************************
170 函 数 名 : hmac_user_get_feature_ptr
171 功能描述 : 通过特性索引获取hmac_user下的特性指针
172*****************************************************************************/
173static INLINE__ osal_u8 *hmac_user_get_feature_ptr(hmac_user_stru *hmac_user,
174 wlan_feature_index_enum feature_index)
175{
176 return (osal_u8 *)hmac_user->hmac_user_feature_arr[feature_index];
177}
178
179/*****************************************************************************
180 函 数 名 : hmac_user_feature_registered
181 功能描述 : 在hmac_user结构体下注册特性指针
182*****************************************************************************/
183static INLINE__ osal_u32 hmac_user_feature_registered(hmac_user_stru *hmac_user,
184 wlan_feature_index_enum feature_index, osal_void *feature_ptr)
185{
186 if (hmac_user->hmac_user_feature_arr[feature_index] != OAL_PTR_NULL) {
187 return OAL_FAIL;
188 }
189 hmac_user->hmac_user_feature_arr[feature_index] = feature_ptr;
190
191 return OAL_SUCC;
192}
193
194/*****************************************************************************
195 函 数 名 : hmac_user_feature_cancellation
196 功能描述 : 在hmac_user结构体下去注册特性指针
197*****************************************************************************/
198static INLINE__ osal_void hmac_user_feature_unregister(hmac_user_stru *hmac_user,
199 wlan_feature_index_enum feature_index)
200{
201 hmac_user->hmac_user_feature_arr[feature_index] = OAL_PTR_NULL;
202}
203
204/*****************************************************************************
205 函 数 名 : hmac_user_feature_init
206 功能描述 : 在hmac_user结构体下特性指针数组内存申请
207*****************************************************************************/
208static INLINE__ osal_u32 hmac_user_feature_init(hmac_user_stru *hmac_user)
209{
210 if (hmac_user->hmac_user_feature_arr == OAL_PTR_NULL) {
213 if (hmac_user->hmac_user_feature_arr == OAL_PTR_NULL) {
214 return OAL_FAIL;
215 }
216 }
218 0, sizeof(osal_void *) * WLAN_FEATURE_INDEX_BUTT);
219
220 return OAL_SUCC;
221}
222
223/*****************************************************************************
224 函 数 名 : hmac_user_feature_deinit
225 功能描述 : 在hmac_user结构体下特性指针数组内存释放
226*****************************************************************************/
227static INLINE__ osal_u32 hmac_user_feature_deinit(hmac_user_stru *hmac_user)
228{
229 if (hmac_user->hmac_user_feature_arr != OAL_PTR_NULL) {
232 }
233
234 return OAL_SUCC;
235}
236
237#ifdef __cplusplus
238#if __cplusplus
239 }
240#endif
241#endif
242
243#endif
@ OAL_FAIL
Definition common_error_code_rom.h:570
@ OAL_SUCC
Definition common_error_code_rom.h:18
wlan_feature_index_enum
Definition hmac_feature_main.h:20
@ WLAN_FEATURE_INDEX_DFS
Definition hmac_feature_main.h:22
@ WLAN_FEATURE_INDEX_BTCOEX
Definition hmac_feature_main.h:24
@ WLAN_FEATURE_INDEX_M2S
Definition hmac_feature_main.h:23
@ WLAN_FEATURE_INDEX_FTM
Definition hmac_feature_main.h:21
@ WLAN_FEATURE_INDEX_BUTT
Definition hmac_feature_main.h:25
#define oal_mem_free(_p_data, _uc_lock)
Definition oal_mem_hcm.h:47
#define oal_mem_alloc(_en_pool_id, _us_len, _uc_lock)
Definition oal_mem_hcm.h:45
@ OAL_MEM_POOL_ID_LOCAL
Definition oal_mem_hcm.h:59
@ OAL_TRUE
Definition oal_types_device_rom.h:42
#define OAL_PTR_NULL
Definition oal_types_device_rom.h:30
#define INLINE__
Definition osal_list.h:25
unsigned char osal_u8
Definition osal_types.h:11
#define OSAL_NULL
Definition osal_types.h:65
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
errno_t memset_s(void *dest, size_t destMax, int c, size_t count)
Definition mac_device_ext.h:856
osal_void ** hmac_device_feature_arr
Definition mac_device_ext.h:937
Definition mac_user_ext.h:519
osal_void ** hmac_user_feature_arr
Definition mac_user_ext.h:702
Definition mac_vap_ext.h:2019
osal_void ** hmac_vap_feature_arr
Definition mac_vap_ext.h:2356