1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __FRW_MAIN_H__ 20 #define __FRW_MAIN_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "oal_ext_if.h" 26 27 #ifdef __cplusplus 28 #if __cplusplus 29 extern "C" { 30 #endif 31 #endif 32 /* **************************************************************************** 33 2 宏定义 34 **************************************************************************** */ 35 #define FRW_TASK_SIZE 0x2000 /* 驱动task栈大小,默认3k,可初始化配置 */ 36 /* **************************************************************************** 37 3 枚举定义 38 **************************************************************************** */ 39 /* 此枚举用于定义从FRW模块以上各模块的初始化状态 */ 40 typedef enum { 41 FRW_INIT_STATE_START, /* 表示初始化刚启动,即FRW初始化开始 */ 42 FRW_INIT_STATE_FRW_SUCC, /* 表示FRW模块初始化成功 */ 43 FRW_INIT_STATE_HAL_SUCC, /* 表示HAL模块初始化成功 */ 44 /* 表示DMAC模块启动初始化成功,配置VAP已正常;如果在此状态之后再初始化,即为业务VAP的初始化 */ 45 FRW_INIT_STATE_DMAC_CONFIG_VAP_SUCC, 46 /* 表示HMAC模块启动初始化成功,配置VAP已正常;如果在此状态之后再初始化,即为业务VAP的初始化 */ 47 FRW_INIT_STATE_HMAC_CONFIG_VAP_SUCC, 48 FRW_INIT_STATE_ALL_SUCC, /* 此状态表示HMAC以上模块均已初始化成功 */ 49 50 FRW_INIT_STATE_BUTT 51 } frw_init_enum; 52 typedef hi_u8 frw_init_enum_uint8; 53 54 /* **************************************************************************** 55 枚举说明: FRW模块ROM化预留回调接口类型定义 56 **************************************************************************** */ 57 typedef enum { 58 FRW_ROM_RESV_FUNC_QUEUE_INIT, 59 FRW_ROM_RESV_FUNC_BUTT, 60 } frw_rom_resv_func_enum; 61 typedef hi_u8 frw_rom_resv_func_enum_uint8; 62 63 /* **************************************************************************** 64 4 全局变量声明 65 **************************************************************************** */ 66 /* **************************************************************************** 67 5 消息头定义 68 **************************************************************************** */ 69 /* **************************************************************************** 70 6 消息定义 71 **************************************************************************** */ 72 /* **************************************************************************** 73 7 STRUCT定义 74 **************************************************************************** */ 75 /* **************************************************************************** 76 8 UNION定义 77 **************************************************************************** */ 78 /* **************************************************************************** 79 9 OTHERS定义 80 **************************************************************************** */ 81 /* **************************************************************************** 82 10 函数声明 83 **************************************************************************** */ 84 hi_u32 frw_main_init(hi_bool mode, hi_u32 task_size); 85 hi_void frw_main_exit(hi_void); 86 hi_bool frw_get_offload_mode(hi_void); 87 hi_void frw_set_init_state(frw_init_enum_uint8 init_state); 88 frw_init_enum_uint8 frw_get_init_state(hi_void); 89 hi_void frw_set_rom_resv_func(frw_rom_resv_func_enum_uint8 func_id, hi_void *func); 90 hi_void *frw_get_rom_resv_func(frw_rom_resv_func_enum_uint8 func_id); 91 92 #ifdef __cplusplus 93 #if __cplusplus 94 } 95 #endif 96 #endif 97 98 #endif /* end of frw_main */ 99