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 __WAL_REGDB_H__ 20 #define __WAL_REGDB_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 /* **************************************************************************** 34 2 宏定义 35 **************************************************************************** */ 36 #ifndef array_size 37 #define array_size(array) (sizeof(array) / sizeof((array)[0])) 38 #endif 39 40 /* **************************************************************************** 41 3 全局变量声明 42 **************************************************************************** */ 43 extern const oal_ieee80211_regdomain_stru g_default_regdom; 44 45 /* **************************************************************************** 46 4 函数声明 47 **************************************************************************** */ 48 const oal_ieee80211_regdomain_stru *wal_regdb_find_db(const hi_char *pc_str); 49 hi_void wal_set_cfg_regdb(const oal_ieee80211_regdomain_stru *regdom); 50 const oal_ieee80211_regdomain_stru *wal_get_cfg_regdb(hi_void); 51 52 #if (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION) 53 struct callback_head { 54 struct callback_head *next; 55 hi_void (*func)(struct callback_head *head); 56 }; 57 #endif 58 59 #if (_PRE_OS_VERSION_LITEOS == _PRE_OS_VERSION) || defined(_PRE_HDF_LINUX) 60 #define RCU_HEAD callback_head 61 62 struct ieee80211_regdomain { 63 struct RCU_HEAD RCU_HEAD; 64 hi_u32 n_reg_rules; 65 hi_char alpha2[2]; /* 元素个数为2 */ 66 hi_u8 dfs_region; 67 struct ieee80211_reg_rule reg_rules[]; 68 }; 69 70 #ifndef ARRAY_SIZE 71 #define array_size(array) (sizeof(array) / sizeof((array)[0])) 72 #endif 73 #endif 74 75 #ifdef __cplusplus 76 #if __cplusplus 77 } 78 #endif 79 #endif 80 81 #endif /* end of wal_regdb.h */ 82