• 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: hmac侧ccpriv通用接口
15  * Create: 2023-02-25
16  */
17 #ifndef HMAC_CCPRIV_H
18 #define HMAC_CCPRIV_H
19 
20 #include "mac_vap_ext.h"
21 
22 #ifdef __cplusplus
23 #if __cplusplus
24 extern "C" {
25 #endif
26 #endif
27 
28 typedef osal_s32(*hmac_ccpriv_cmd_func)(hmac_vap_stru *hmac_vap, const osal_s8 *param);
29 
30 /* 私有命令入口结构定义 */
31 typedef struct {
32     struct osal_list_head entry_list;
33     hmac_ccpriv_cmd_func func; /* 命令对应处理函数 */
34     const osal_s8 *cmd_name; /* 命令字符串 */
35 } hmac_ccpriv_cmd_entry;
36 
37 osal_u32 hmac_ccpriv_init(osal_void);
38 osal_void hmac_ccpriv_deinit(osal_void);
39 /* 注意:cmd_name一定要传入常量字符串,否则注册有问题 */
40 osal_void hmac_ccpriv_register(const osal_s8 *cmd_name, hmac_ccpriv_cmd_func func);
41 osal_void hmac_ccpriv_unregister(const osal_s8 *cmd_name);
42 
43 osal_s32 hmac_ccpriv_get_one_arg(const osal_s8 **cmd, osal_s8 *arg, osal_u32 arg_len);
44 osal_s32 hmac_ccpriv_get_one_arg_digit(const osal_s8 **cmd, osal_s32 *data);
45 osal_s32 hmac_ccpriv_get_digit_with_range(const osal_s8 **src_head, osal_s32 min, osal_s32 max, osal_s32 *value);
46 osal_s32 hmac_ccpriv_get_s8_with_range(const osal_s8 **src_head, osal_s8 min, osal_s8 max, osal_s8 *value);
47 osal_s32 hmac_ccpriv_get_u8_with_check_max(const osal_s8 **src_head, osal_u8 max_value, osal_u8 *value);
48 osal_s32 hmac_ccpriv_get_digit_with_check_max(const osal_s8 **src_head, osal_u32 max_value, osal_u32 *value);
49 osal_u32 hmac_ccpriv_get_mac_addr_etc(const osal_s8 **param, osal_u8 mac_addr[]);
50 
51 #ifdef __cplusplus
52 #if __cplusplus
53 }
54 #endif
55 #endif
56 
57 #endif
58