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 for hmac_achba.c. 15 * Create: 2023-04-17 16 */ 17 18 #ifndef HMAC_ACHBA_H 19 #define HMAC_ACHBA_H 20 21 /***************************************************************************** 22 1 其他头文件包含 23 *****************************************************************************/ 24 #include "dmac_ext_if_hcm.h" 25 26 #ifdef __cplusplus 27 #if __cplusplus 28 extern "C" { 29 #endif 30 #endif 31 32 #undef THIS_FILE_ID 33 #define THIS_FILE_ID OAM_FILE_ID_HMAC_ACHBA_H 34 35 /***************************************************************************** 36 2 宏定义 37 *****************************************************************************/ 38 #define MAC_ORGANIZATION_IDENTIFIER_LEN 3 /* organization identifiter 长度 */ 39 #define MAC_SUB_TYPE_LEN 1 /* sub_type 长度 */ 40 #define MAC_CHBA_CAP_INFO_LEN 16 /* chba capability info 长度 */ 41 #define MAC_EXT_ACHBA_SUB_TYPE_IE 0x30 /* chba_capablityinfo SUB_TYPE字段 */ 42 /***************************************************************************** 43 3 枚举定义 44 *****************************************************************************/ 45 46 /***************************************************************************** 47 4 全局变量声明 48 *****************************************************************************/ 49 50 /***************************************************************************** 51 5 消息头定义 52 *****************************************************************************/ 53 54 55 /***************************************************************************** 56 6 消息定义 57 *****************************************************************************/ 58 59 60 /***************************************************************************** 61 7 STRUCT定义 62 *****************************************************************************/ 63 64 typedef osal_s32 (*oal_achba_get_chba_cap)(oal_net_device_stru *netdev, osal_u8 *buff, osal_u32 buff_len); 65 typedef osal_s32 (*oal_achba_wifi_link_add)(oal_net_device_stru *netdev, const osal_u8 *user_mac, osal_u32 mac_len, 66 const osal_s8 *achba_cap, osal_u32 cap_len); 67 typedef osal_s32 (*oal_achba_wifi_link_del)(oal_net_device_stru *netdev, osal_s32 achba_link_id); 68 typedef osal_s32 (*oal_achba_wifi_link_keepalive)(oal_net_device_stru *netdev, osal_s32 achba_link_id, 69 osal_u32 keep_ind); 70 typedef osal_u8 (*hmac_set_achba_cap_ie_cb)(hmac_vap_stru *hmac_vap, osal_u8 *buffer); 71 typedef osal_void (*hmac_process_update_achba_cb)(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user, osal_u8 *payload, 72 osal_u16 msg_len); 73 typedef osal_void (*hmac_user_del_achba_cb)(hmac_vap_stru *hmac_vap); 74 75 struct oal_achba_callee_intfs { 76 oal_achba_get_chba_cap get_chba_cap; 77 oal_achba_wifi_link_add wifi_link_add; 78 oal_achba_wifi_link_del wifi_link_del; 79 }; 80 struct oal_achba_caller_intfs { 81 oal_achba_wifi_link_keepalive achba_keepalive; 82 }; 83 typedef struct { 84 osal_s32 achba_link_id; 85 osal_u32 keep_ind; 86 } mac_set_achba_link_ind; 87 88 /***************************************************************************** 89 8 UNION定义 90 *****************************************************************************/ 91 92 93 /***************************************************************************** 94 9 OTHERS定义 95 *****************************************************************************/ 96 97 98 /***************************************************************************** 99 10 函数声明 100 *****************************************************************************/ 101 extern osal_s32 hmac_achba_get_achba_link_id(void); 102 extern osal_u32 hmac_achba_get_keepalive_ind(void); 103 extern osal_s32 oal_achba_register_wifi_intfs(struct oal_achba_callee_intfs *callee_intfs, 104 struct oal_achba_caller_intfs *caller_intfs); 105 extern osal_s32 hmac_config_ind_achba_keepalive(hmac_vap_stru *mac_vap, frw_msg *msg); 106 static osal_u32 hmac_achba_init_weakref(osal_void) __attribute__ ((weakref("hmac_achba_init"), used)); 107 static osal_void hmac_achba_deinit_weakref(osal_void) __attribute__ ((weakref("hmac_achba_deinit"), used)); 108 109 #ifdef __cplusplus 110 #if __cplusplus 111 } 112 #endif 113 #endif 114 115 #endif /* end of hmac_achba */