WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
mac_resource_ext.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2023. All rights reserved.
3 * Description: Header file of mac_regdomain_rom.c.
4 * Create: 2020-7-8
5 */
6#ifndef __MAC_RESOURCE_EXT_H__
7#define __MAC_RESOURCE_EXT_H__
8
9/* 文件合一后去掉HMAC、DMAC两个宏 */
10#include "oal_ext_if.h"
11#include "mac_device_ext.h"
13
14#undef THIS_FILE_ID
15#define THIS_FILE_ID OAM_FILE_ID_MAC_RESOURCE_H
16
17#ifdef __cplusplus
18#if __cplusplus
19extern "C" {
20#endif
21#endif
22
23/*****************************************************************************
24 宏定义
25*****************************************************************************/
26/* 最大dev数量 */
27#define MAC_RES_MAX_DEV_NUM WLAN_SERVICE_DEVICE_SUPPORT_MAX_NUM_SPEC
28
29/* board最大关联用户数 = 1个CHIP支持的最大关联用户数 * board上面的CHIP数目 */
30#define MAC_RES_MAX_ASOC_USER_NUM (WLAN_ASSOC_USER_MAX_NUM * WLAN_CHIP_MAX_NUM_PER_BOARD)
31/* board最大组播用户数 = 整board支持的业务vap个数(每个业务vap一个组播用户) */
32#define MAC_RES_MAX_BCAST_USER_NUM (WLAN_MULTI_USER_MAX_NUM_LIMIT)
33/* board资源最大用户数 = 最大关联用户数 + 组播用户个数 */
34#define MAC_RES_MAX_USER_LIMIT (MAC_RES_MAX_ASOC_USER_NUM + MAC_RES_MAX_BCAST_USER_NUM)
35
43osal_u32 mac_get_hal_vap_id(osal_u8 p2p_mode, osal_u8 vap_mode, osal_u8 *hal_vap_id);
44
45/*****************************************************************************
46 STRUCT定义
47*****************************************************************************/
54
62
69
75
76/* 存储hmac device结构的资源结构体 */
77typedef struct {
82#ifdef _PRE_WLAN_FEATURE_DOUBLE_CHIP
83 osal_u8 auc_resv[2]; /* 单芯片下MAC_RES_MAX_DEV_NUM是1,双芯片下MAC_RES_MAX_DEV_NUM是2 */
84#else
85 osal_u8 auc_resv[3];
86#endif
88
89/* 存储hmac res资源结构体 */
93
94/*****************************************************************************
95 全局变量声明
96*****************************************************************************/
97/*****************************************************************************
98 函数声明
99*****************************************************************************/
102/*****************************************************************************
103 功能描述 : 分配HMAC层的VAP资源
104*****************************************************************************/
106
107static INLINE__ osal_u32 mac_res_alloc_hmac_vap(osal_u8 *idx)
108{
109 osal_ulong idx_temp;
110 mac_res_stru *mac_res = OSAL_NULL;
111
112 if (OAL_UNLIKELY(idx == OAL_PTR_NULL))
113 {
114 return OAL_FAIL;
115 }
116 mac_res = mac_get_pst_mac_res();
117 idx_temp = (osal_ulong)oal_queue_dequeue(&(mac_res->vap_res.queue));
118
119 /* 0为无效值 */
120 if (idx_temp == 0)
121 {
122 return OAL_FAIL;
123 }
124
125 *idx = (osal_u8)(idx_temp - 1);
126
127 (mac_res->vap_res.auc_user_cnt[idx_temp - 1])++;
128
129 return OAL_SUCC;
130}
131
132static INLINE__ osal_u32 mac_res_alloc_hmac_user(osal_u16 *pus_idx)
133{
134 osal_ulong idx_temp;
135 mac_res_stru *mac_res = OSAL_NULL;
136
137 if (OAL_UNLIKELY(pus_idx == OAL_PTR_NULL))
138 {
139 return OAL_FAIL;
140 }
141 mac_res = mac_get_pst_mac_res();
142 idx_temp = (osal_ulong)oal_queue_dequeue_8user(&(mac_res->user_res.queue));
143
144 /* 0为无效值 */
145 if (idx_temp == 0)
146 {
147 return OAL_FAIL;
148 }
149
150 *pus_idx = (osal_u16)(idx_temp - 1);
151
152 (mac_res->user_res.user_cnt[idx_temp - 1])++;
153
154 return OAL_SUCC;
155}
156
157/*****************************************************************************
158 函数声明
159*****************************************************************************/
167
168/*****************************************************************************
169 2 宏定义
170*****************************************************************************/
171
172/*****************************************************************************
173 3 枚举定义
174*****************************************************************************/
175
176
177/*****************************************************************************
178 4 全局变量声明
179*****************************************************************************/
180
181
182/*****************************************************************************
183 5 消息头定义
184*****************************************************************************/
185
186
187/*****************************************************************************
188 6 消息定义
189*****************************************************************************/
190
191
192/*****************************************************************************
193 7 STRUCT定义
194*****************************************************************************/
195
196
197/*****************************************************************************
198 8 UNION定义
199*****************************************************************************/
200
201
202/*****************************************************************************
203 9 OTHERS定义
204*****************************************************************************/
205
206
207/*****************************************************************************
208 10 函数声明
209*****************************************************************************/
216
217#ifdef __cplusplus
218#if __cplusplus
219 }
220#endif
221#endif
222
223#endif
@ OAL_FAIL
Definition common_error_code_rom.h:570
@ OAL_SUCC
Definition common_error_code_rom.h:18
void * _mac_res_get_hmac_user(osal_u16 idx)
#define MAC_RES_MAX_DEV_NUM
Definition mac_resource_ext.h:27
osal_u32 mac_res_init_etc(void)
osal_u32 hmac_res_free_mac_dev_etc(osal_u32 dev_idx)
osal_u32 hmac_res_free_mac_user_etc(osal_u16 idx)
mac_chip_stru * mac_res_get_mac_chip(osal_u32 chip_idx)
#define MAC_RES_MAX_USER_LIMIT
Definition mac_resource_ext.h:34
osal_u32 hmac_res_alloc_mac_dev_etc(osal_u32 dev_idx)
hmac_device_stru * hmac_res_get_mac_dev_etc(osal_u32 dev_idx)
osal_u32 hmac_res_init_etc(osal_void)
osal_u32 mac_get_hal_vap_id(osal_u8 p2p_mode, osal_u8 vap_mode, osal_u8 *hal_vap_id)
osal_u32 hmac_res_free_mac_vap_etc(osal_u32 idx)
mac_chip_stru * hmac_res_get_mac_chip(osal_u32 chip_idx)
osal_u16 hmac_board_get_max_user(void)
osal_u16 mac_chip_get_max_asoc_user(osal_u8 chip_id)
osal_u32 mac_res_free_dev_etc(osal_u32 dev_idx)
void * _mac_res_alloc_hmac_user(osal_u16 idx)
mac_res_stru * mac_get_pst_mac_res(osal_void)
osal_u32 hmac_res_exit_etc(mac_board_stru *hmac_board)
void _mac_res_free_hmac_user(osal_u16 idx)
osal_u32 mac_res_alloc_hmac_dev_etc(osal_u8 *dev_idx)
hmac_res_stru * mac_pst_hmac_res_etc(osal_void)
osal_u32 hmac_res_exit(void)
void * mac_res_get_hmac_vap(osal_u8 idx)
#define OAL_UNLIKELY(_expr)
Definition oal_plat_type.h:43
#define OAL_PTR_NULL
Definition oal_types_device_rom.h:30
#define INLINE__
Definition osal_list.h:25
unsigned char osal_u8
Definition osal_types.h:11
#define OSAL_NULL
Definition osal_types.h:65
void osal_void
Definition osal_types.h:29
unsigned int osal_u32
Definition osal_types.h:13
unsigned short osal_u16
Definition osal_types.h:12
unsigned long osal_ulong
Definition osal_types.h:15
Definition mac_device_ext.h:856
Definition mac_resource_ext.h:77
oal_queue_stru queue
Definition mac_resource_ext.h:79
Definition mac_resource_ext.h:90
hmac_res_device_stru hmac_dev_res
Definition mac_resource_ext.h:91
Definition mac_device_ext.h:330
Definition mac_device_ext.h:314
Definition mac_resource_ext.h:48
oal_queue_stru queue
Definition mac_resource_ext.h:49
Definition mac_resource_ext.h:70
mac_res_device_stru dev_res
Definition mac_resource_ext.h:71
mac_res_user_stru user_res
Definition mac_resource_ext.h:73
mac_res_vap_stru vap_res
Definition mac_resource_ext.h:72
Definition mac_resource_ext.h:63
oal_queue_stru_16 queue
Definition mac_resource_ext.h:65
osal_u8 * user_cnt
Definition mac_resource_ext.h:67
osal_ulong * pul_idx
Definition mac_resource_ext.h:66
Definition mac_resource_ext.h:55
osal_u8 auc_user_cnt[WLAN_VAP_SUPPORT_MAX_NUM_LIMIT]
Definition mac_resource_ext.h:59
oal_queue_stru queue
Definition mac_resource_ext.h:57
Definition oal_queue.h:34
Definition oal_queue.h:26
#define WLAN_VAP_SUPPORT_MAX_NUM_LIMIT
Definition wlan_spec_rom.h:74