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 __OAL_EXT_IF_H__ 20 #define __OAL_EXT_IF_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "hi_types.h" 26 #if (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION) 27 #include "oal_time.h" 28 #include "oal_netbuf.h" 29 #include "oal_thread.h" 30 #include "oal_workqueue.h" 31 #include "oal_channel_host_if.h" 32 #elif (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION) 33 #include "oal_workqueue.h" 34 #include "oal_wait.h" 35 #include "oal_time.h" 36 #include "oal_timer.h" 37 #include "oal_netbuf.h" 38 #include "oal_cfg80211.h" 39 #include "oal_thread.h" 40 #include "oal_spinlock.h" 41 #include "oal_semaphore.h" 42 #include "oal_completion.h" 43 #include "oal_sdio_comm.h" 44 #include "oal_sdio_host_if.h" 45 #include "oal_wakelock.h" 46 #include "oal_mutex.h" 47 #include "oal_channel_host_if.h" 48 #include "oal_atomic.h" 49 #endif 50 51 #include "hi_list.h" 52 #include "hi_task.h" 53 #include "hi_time.h" 54 #include "oal_net.h" 55 #include "oal_err_wifi.h" 56 #include "oal_util.h" 57 #include "oal_queue.h" 58 #include "oal_mem.h" 59 #include "wlan_types.h" 60 #include "wlan_spec.h" 61 62 #ifdef __cplusplus 63 #if __cplusplus 64 extern "C" { 65 #endif 66 #endif 67 68 /* **************************************************************************** 69 2 宏定义 70 **************************************************************************** */ 71 /* CSI特性中上报CSI数据的BUFF块数和白名单中最大MAC地址的宏 */ 72 #define OAL_CSI_DATA_BUFF_NUM 6 73 #define OAL_CSI_MAX_MAC_NUM 6 /* 白名单中最多6个MAC地址 */ 74 #ifdef _PRE_WLAN_FEATURE_CSI 75 #define OAL_CSI_DATA_REPORT_PERIOD 50 76 #define OAL_CSI_DATA_BUFF_SIZE 184 /* 上报的csi数据大小 */ 77 #define OAL_CSI_TSF_SIZE 4 /* TSF时间戳大小 */ 78 #define OAL_MEM_CSI_DATA_SIZE (OAL_CSI_DATA_BUFF_SIZE * OAL_CSI_DATA_BUFF_NUM) 79 #endif 80 #ifdef _PRE_WLAN_FEATURE_P2P 81 #define OAL_P2P_CTWINDOW_MAX 127 82 #endif 83 84 /* 用于查询产测校准参数和MAC地址 */ 85 #define AT_RSP_ATE_PARAS 1 86 #define AT_RSP_ATE_MAC 2 87 88 #define AT_RSP_OK 0 /* AT命令执行成功标志 */ 89 #define AT_ATE_MAC_SIZE 8 /* MAC地址占字节数(含填充字节) */ 90 #define oal_get_at_rsp_size(at_rsp) (((at_rsp)->data_num + 1) << 2) /* 2:左移2位,word转字节数 */ 91 /* **************************************************************************** 92 2 结构体定义 93 **************************************************************************** */ 94 typedef struct { 95 hi_s8 result; /* 0:执行成功,1:执行失败 */ 96 hi_u8 data_num; /* 数据个数,每个4字节 */ 97 hi_u16 num; /* 结果模式序号 */ 98 } oal_at_rsp_stru; 99 /* **************************************************************************** 100 3 枚举定义 101 **************************************************************************** */ 102 typedef enum { 103 OAL_TRACE_ENTER_FUNC, 104 OAL_TRACE_EXIT_FUNC, 105 106 OAL_TRACE_DIRECT_BUTT 107 } oal_trace_direction_enum; 108 typedef hi_u8 oal_trace_direction_enum_uint8; 109 110 typedef enum { 111 OAL_AT_ATE_PARAS_USED_CNT = 0, 112 OAL_AT_ATE_PARAS_FREQ_OFFSET, 113 OAL_AT_ATE_PARAS_BPWR_OFFSET_0, 114 OAL_AT_ATE_PARAS_BPWR_OFFSET_1, 115 OAL_AT_ATE_PARAS_BPWR_OFFSET_2, 116 OAL_AT_ATE_PARAS_DBB_OFFSET_11N, 117 OAL_AT_ATE_PARAS_DBB_OFFSET_11G, 118 OAL_AT_ATE_PARAS_DBB_OFFSET_11B = 7, 119 OAL_AT_ATE_PARAS_DBB_SCALE_0, 120 OAL_AT_ATE_PARAS_DBB_SCALE_1, 121 OAL_AT_ATE_PARAS_DBB_SCALE_2, 122 OAL_AT_ATE_PARAS_DBB_SCALE_3, 123 OAL_AT_ATE_PARAS_DBB_SCALE_4 = 12, 124 OAL_AT_ATE_PARAS_HYBRID_DATA, 125 126 OAL_AT_ATE_PARAS_BUTT 127 } oal_at_ate_paras_enum; 128 typedef hi_u8 oal_at_ate_paras_enum_uint8; 129 130 typedef enum { 131 OAL_AT_ATE_MAC_ADDR = 0, 132 OAL_AT_ATE_MAC_TIME_LEFT = 2, 133 134 OAL_AT_ATE_MAC_BUTT 135 } oal_at_ate_mac_enum; 136 typedef hi_u8 oal_at_ate_mac_enum_uint8; 137 138 /* **************************************************************************** 139 10 函数声明 140 **************************************************************************** */ 141 hi_u32 oal_main_init(const hi_u8 vap_num, const hi_u8 user_num); 142 hi_void oal_main_exit(hi_void); 143 144 #ifdef __cplusplus 145 #if __cplusplus 146 } 147 #endif 148 #endif 149 150 #endif /* end of oal_ext_if.h */ 151