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 __MAC_RESOURCE_H__ 20 #define __MAC_RESOURCE_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "oal_ext_if.h" 26 #include "oal_queue.h" 27 #include "mac_device.h" 28 29 #ifdef __cplusplus 30 #if __cplusplus 31 extern "C" { 32 #endif 33 #endif 34 35 /* **************************************************************************** 36 2 宏定义 37 **************************************************************************** */ 38 #define MAC_RES_VAP_SIZE 3000 39 #ifdef _PRE_WLAN_FEATURE_TX_CLASSIFY_LAN_TO_WLAN 40 /* 增加业务识别功能后,hmac_user_stru结构体中增加用户业务信息,扩充规格为1700 */ 41 #define FEATURE_TX_CLASSIFY_LAN_TO_WLAN_RES_SIZE 1700 42 #else 43 #define FEATURE_TX_CLASSIFY_LAN_TO_WLAN_RES_SIZE 0 44 #endif /* end of _PRE_WLAN_FEATURE_TX_CLASSIFY_LAN_TO_WLAN */ 45 #define MAC_RES_USER_SIZE (4000 + FEATURE_TX_CLASSIFY_LAN_TO_WLAN_RES_SIZE) 46 47 /* **************************************************************************** 48 STRUCT定义 49 **************************************************************************** */ 50 typedef struct { 51 hi_list entry; 52 hi_u8 user_idx; /* 记录对应的USER的索引值 */ 53 hi_u8 uc_resv; 54 hi_u16 us_hash_res_idx; /* 记录对应的HASH资源池的索引值 */ 55 }mac_res_user_hash_stru; 56 57 typedef struct { 58 mac_res_user_hash_stru *user_hash_info; 59 oal_queue_stru queue; 60 hi_u32 *pul_idx; 61 hi_u8 *puc_user_cnt; 62 }mac_res_hash_stru; 63 64 /* **************************************************************************** 65 10 函数声明 66 **************************************************************************** */ 67 hi_void mac_res_exit(hi_void); 68 hi_u32 mac_res_init(hi_void); 69 hi_u32 mac_res_free_hash(hi_u32 hash_idx); 70 hi_u32 mac_res_alloc_hash(hi_u8 *puc_hash_idx); 71 mac_res_user_hash_stru *mac_res_get_hash(hi_u8 dev_idx); 72 73 #ifdef __cplusplus 74 #if __cplusplus 75 } 76 #endif 77 #endif 78 #endif /* __MAC_RESOURCE_H__ */ 79