Update build system, documentation and delete temp files
[wave300.git] / wireless / shared_mbss_mac / shram.h
blob3b217c2d72345be0a52d41d75e069ce0df99530a
1 /******************************************************************************
3 Copyright (c) 2012
4 Lantiq Deutschland GmbH
6 For licensing information, see the file 'LICENSE' in the root folder of
7 this software module.
9 ******************************************************************************/
10 /***************************************************************************
11 ****************************************************************************
13 ** COMPONENT: Shared RAM Allocation
15 ** MODULE: $File: //bwp/enet/demo153_sw/develop/src/common/shram.h $
17 ** VERSION: $Revision: #7 $
19 ** DATED: $Date: 2004/03/10 $
21 ** AUTHOR: LDE
23 ** DESCRIPTION: Shared RAM Allocation Header
25 ** CHANGE HISTORY:
27 ** $Log: shram.h $
28 ** Revision 1.3 2003/02/21 15:50:30Z prh
29 ** Combine host and test_mc code to avoid duplication.
30 ** Revision 1.2 2003/02/18 15:01:23Z wrh
31 ** Removed unused definition
32 ** Revision 1.1 2003/02/11 16:29:12Z wrh
33 ** Initial revision
34 ** Revision 1.34 2002/07/31 11:41:14Z jcm
35 ** CF poll list
36 ** Revision 1.33.1.1 2002/08/16 10:46:58Z ifo
37 ** Reduced FSDU usage in FPGA to fit in new FPGA build
38 ** Revision 1.33 2002/04/29 13:54:22Z ifo
39 ** Moved typedefs to umi.h to allow usage of this file in lower MAC
40 ** builds without requiring UMAC files.
41 ** Revision 1.32 2002/04/04 12:16:34Z prh
42 ** Increase RX buffers size (except for COSIM).
43 ** Revision 1.31 2002/04/04 11:09:21Z mrg
44 ** Modified number of TX FSDUs for cosim.
45 ** Revision 1.30 2002/03/08 16:52:28Z lde
46 ** Suprising that HIM/Cardbus tests worked.
47 ** Revision 1.29 2002/03/04 15:07:58Z ifo
48 ** Renames test loopback mac to use different macro.
49 ** Revision 1.28 2002/02/05 08:44:45Z ifo
50 ** Made Rx buffer size same as LM (LM needs now to use this value).
51 ** Revision 1.27.1.1 2002/02/01 14:29:40Z jag1
52 ** Revision 1.27 2002/01/08 08:07:43Z ifo
53 ** Defined RX circular buffer size in powers of two so
54 ** the macro may be used by the Lower MAC.
55 ** Revision 1.26 2001/12/04 15:53:24Z prh
56 ** Change for C100.
57 ** Revision 1.25 2001/12/04 15:18:31Z prh
58 ** Compile errors.
59 ** Revision 1.24 2001/12/04 14:16:46Z prh
60 ** Optimize memory usage.
61 ** Revision 1.23 2001/10/24 14:12:42Z ifo
62 ** Chnaged macro to include defines for test umac.
63 ** Revision 1.22 2001/10/05 10:13:13Z lde
64 ** Restored HIM message buffer allocation.
65 ** Revision 1.21 2001/09/04 07:31:23Z ifo
66 ** Removed unused or revised parameters.
67 ** Revision 1.20 2001/08/24 17:22:10Z ifo
68 ** Removed obsolete SRAM struct.
69 ** Revision 1.19 2001/08/24 16:19:16Z ifo
70 ** Added some HIM definitions.
71 ** Removed SRAM defn as obsolete.
72 ** Revision 1.18 2001/08/10 11:33:10Z prh
73 ** Allow module test UMI buffer allocation to be smaller.
74 ** Revision 1.17 2001/07/25 07:27:09Z ifo
75 ** Added comment.
76 ** Revision 1.16 2001/07/18 07:44:24Z ifo
77 ** Removed unused macros and eleements.
78 ** Still needs more tidy.
79 ** Revision 1.15 2001/07/09 12:58:02Z prh
80 ** Changes for BSS module testing.
81 ** Revision 1.14 2001/07/06 14:12:30Z prh
82 ** Sort out FSDU/SHRAM allocation.
83 ** Revision 1.13 2001/07/06 08:49:10Z prh
84 ** Temp change for PROBE_FSDU.
85 ** Revision 1.12 2001/06/27 14:21:10Z prh
86 ** Add variable payload refernce to some management packet types.
87 ** Revision 1.11 2001/06/22 14:30:03Z ifo
88 ** bug fix
89 ** Revision 1.10 2001/06/22 10:07:46Z prh
90 ** Add resource for Auth TX packet.
91 ** Revision 1.9 2001/06/18 07:21:21Z ifo
92 ** Added definition of Tx FSDU/MSDU storage.
93 ** Revision 1.8 2001/06/14 16:51:12Z ses
94 ** Add FSDUbeacon.
95 ** Revision 1.7 2001/06/12 13:26:26Z ifo
96 ** Chnaged macro name.
97 ** Revision 1.6 2001/06/07 09:22:50Z ses
98 ** Add probe allocation.
99 ** Revision 1.5 2001/06/04 15:44:12Z ses
100 ** Move shared RAM structures.
101 ** Revision 1.4 2001/04/30 08:55:08Z lde
102 ** In PC land, the shared RAM is now just a block of memory.
103 ** Revision 1.3 2001/04/20 16:19:08Z lde
104 ** Now includes um_sdu.h and database.h for constants.
105 ** Revision 1.2 2001/04/04 15:22:02Z lde
106 ** Now compiles
107 ** Revision 1.1 2001/04/04 14:02:25Z lde
108 ** Initial revision
110 ** LAST MODIFIED BY: $Author: prh $
111 ** $Modtime:$
113 ****************************************************************************
119 ****************************************************************************/
121 #ifndef SHRAM_INCLUDED_H
122 #define SHRAM_INCLUDED_H
124 #define MTLK_PACK_ON
125 #include "mtlkpack.h"
127 /***************************************************************************/
128 /*** Build Specific Defines that override the default ***/
129 /***************************************************************************/
131 /***************************************************************************/
132 /*** Default memory sizes (overridable on a build by build basis ***/
133 /***************************************************************************/
135 #define FSDU_SECTION_SIZE (2304*7*4)
137 #if !defined(NO_TX_FSDUS) // there are 7 if MSDU_MAX_LENGTH=2304 and 10 if MSDU_MAX_LENGTH=1600
138 #define NO_TX_FSDUS 8//9 /* Used for allocating FSDU memory pool in shram_fsdu.c */
139 //#ifdef WAVE400_SINGLE_CPU
140 // #define NO_TX_FSDUS_AC_BK 2
141 //#else
142 #define NO_TX_FSDUS_AC_BK 1
143 //#endif /* WAVE400_SINGLE_CPU */
145 #define NO_TX_FSDUS_AC_BE 24//20//<y.s> 10
146 #define NO_TX_FSDUS_AC_VI 4
147 #define NO_TX_FSDUS_AC_VO 2// <y.s> 10
148 #define TOTAL_TX_FSDUS (NO_TX_FSDUS_AC_BK + NO_TX_FSDUS_AC_BE +NO_TX_FSDUS_AC_VI +NO_TX_FSDUS_AC_VO)
150 #define NO_MAX_PACKETS_AGG_SUPPORTED_BK 1
151 #define NO_MAX_PACKETS_AGG_SUPPORTED_BE 12
152 #define NO_MAX_PACKETS_AGG_SUPPORTED_VI 4
153 #define NO_MAX_PACKETS_AGG_SUPPORTED_VO 2
154 #endif
156 #if !defined(NO_CF_POLLABLE) && defined (ENET_INC_PCF)
157 #define NO_CF_POLLABLE 4
158 #endif
160 #if !defined(BSS_IND_COUNT)
161 #define BSS_IND_COUNT 6
162 #endif
164 #if !defined(STA_IND_COUNT)
165 #define STA_IND_COUNT 6
166 #endif
168 #if !defined(RSN_IND_COUNT)
169 #define RSN_IND_COUNT 1
170 #endif
173 #if !defined(UMI_IND_COUNT)
174 #define UMI_IND_COUNT 1
175 #endif
177 /* Note: module test t1616 and subsystem tests 2301, 2302, 2401 and 2731 depend on the following fixed values */
178 #if !defined (NUM_STATION_DBASE_ENTRIES)
179 #if defined(ENET_CFG_AP)
180 #ifdef WAVE400_SINGLE_CPU
181 #define NUM_STATION_DBASE_ENTRIES 64
182 #else
183 #define NUM_STATION_DBASE_ENTRIES 32
184 #endif
186 #define NUM_OF_TS 20
187 #else
188 #define NUM_STATION_DBASE_ENTRIES 2
189 #define NUM_OF_TS 20
190 #endif
191 #endif
194 #if !defined (DEBUG_BUFFER_SIZE)
195 #if defined(ENET_CFG_RSN_MODULE_TEST)
196 #define DEBUG_BUFFER_SIZE (MAX_DEBUG_OUTPUT*80) /* Stop build overflowing */
197 #else
198 #define DEBUG_BUFFER_SIZE (MAX_DEBUG_OUTPUT*100) /* Large buffers prevent debug overflow */
199 #endif
200 #endif
204 /***************************************************************************/
205 /*** HIM buffers ***/
206 /***************************************************************************/
208 * These define the number of Management, Data and Debug message buffers
209 * allocated by the HIM. Note that there are no Memory message buffers used
210 * between the Host and the MAC.
213 #if !defined(NUM_MAN_REQS)
214 #define NUM_MAN_REQS 2
215 #endif
217 #if !defined(NUM_DAT_REQS)
218 #if defined( ENET_CFG_TLM_SUBSYS )
219 #define NUM_DAT_REQS 16 /* formerly TX_MSDU_COUNT but C100 does not like it */
220 #else
221 #define NUM_DAT_REQS 200 /* formerly TX_MSDU_COUNT but C100 does not like it */
222 #endif
223 #endif
225 // Due to a bug in the driver - MAC created a workaround and reduced dbg req & ind to 1
226 #define NUM_DBG_REQ_OR_IND_WORKAROUND 1
229 #if !defined(NUM_DBG_REQS)
230 #define NUM_DBG_REQS NUM_DBG_REQ_OR_IND_WORKAROUND /* Buffers for HOST to send DBG messages to MAC with. Must cope with max number of consecutive SENDS from C100 without reply i.e. */
231 #endif
233 #if !defined(NUM_MEM_REQS)
234 #define NUM_MEM_REQS 0
235 #endif
237 #if !defined(NUM_DAT_INDS)
238 #define NUM_DAT_INDS 160 /* */
239 #endif
241 #if !defined(NUM_DBG_INDS)
242 #define NUM_DBG_INDS NUM_DBG_REQ_OR_IND_WORKAROUND /* 1 for each HIM 'serial' port */
243 #endif
245 #if !defined(NUM_MAN_INDS)
246 #define NUM_MAN_INDS (BSS_IND_COUNT + STA_IND_COUNT + RSN_IND_COUNT + UMI_IND_COUNT)
247 #endif
249 #if !defined(NUM_MEM_INDS)
250 #define NUM_MEM_INDS 0
251 #endif
253 #if !defined(MAX_RX_DATA_QUEUES)
254 #define MAX_RX_DATA_QUEUES 8
255 #define MAX_CALIBR_CACHE_DATA_SIZE 8
256 #endif
259 /* If we are using the forwarding pool it must be have at lease one buffer */
260 #if !defined (ENET_AP_FORWARD_POOL_SIZE) && defined (ENET_CFG_ALLOC_SEPARATE_FORWARD_POOL)
261 #define ENET_AP_FORWARD_POOL_SIZE 3
262 #endif
265 * The size of the Circular Buffer in the Lower MAC used for received MPDUs.
266 * It must be a power of two bytes.
267 * Note that the receive buffer size is in powers of 2 above 4K.
268 * Thus a value of 12 => 4K, 13 => 8K, 14 => 16K, etc.
270 #if !defined(ENET_CFG_SIZE_RX_CIRC_BUF_LOG_2)
272 #define ENET_CFG_SIZE_RX_CIRC_BUF_LOG_2 14
274 // #define ENET_CFG_SIZE_RX_CIRC_BUF_LOG_2 12
275 #endif
277 #define ENET_CFG_SIZE_RX_CIRC_BUF (1 << ENET_CFG_SIZE_RX_CIRC_BUF_LOG_2)
278 #define ENET_RX_CIRC_BUF_SHADOW ENET_CFG_SIZE_RX_CIRC_BUF*2
280 /* Number of message that can be placed on message queues between host and HIM */
281 #define HIM_CHI_N (NUM_MAN_REQS + NUM_DAT_REQS + NUM_DBG_REQS + NUM_MEM_REQS +\
282 NUM_MAN_INDS + NUM_DAT_INDS + NUM_DBG_INDS + NUM_MEM_INDS)
284 typedef struct
286 uint32 u32IndStartOffset;
287 uint32 u32IndNumOfElements;
288 uint32 u32ReqStartOffset;
289 uint32 u32ReqNumOfElements;
290 } __MTLK_PACKED CHI_MEM_AREA_DESC;
292 typedef struct
294 CHI_MEM_AREA_DESC sFifoQ;
295 CHI_MEM_AREA_DESC sDAT;
296 CHI_MEM_AREA_DESC sMAN;
297 CHI_MEM_AREA_DESC sDBG;
298 uint32 u32Magic; /* must be written last!!! */
299 } __MTLK_PACKED VECTOR_AREA_BASIC;
301 /* <O.H> - Indication/Request Buffer Descriptor (new Fifo element) */
302 typedef struct
304 uint8 u8Type;
305 uint8 u8Index;
306 uint16 u16Info;
307 } __MTLK_PACKED IND_REQ_BUF_DESC_ELEM;
309 typedef struct
311 uint16 u16QueueSize;
312 uint16 u16BufferSize;
313 } __MTLK_PACKED BD_QUEUE_PARAMS;
315 typedef struct
317 BD_QUEUE_PARAMS asQueueParams[MAX_RX_DATA_QUEUES];
318 uint32 FWinterface;
319 } __MTLK_PACKED READY_REQ;
322 #define HOST_EXTENSION_MAGIC 0xBEADFEED
324 #define VECTOR_AREA_CALIBR_EXTENSION_ID 1
325 #define VECTOR_AREA_MIPS_CONTROL_EXTENSION_ID 2
326 #define VECTOR_AREA_LOGGER_EXTENSION_ID 3
327 #define VECTOR_AREA_FW_CAPABILITIES_NUM_OF_STATIONS_EXTENSION_ID 4
328 #define VECTOR_AREA_FW_CAPABILITIES_NUM_OF_VAPS_EXTENSION_ID 5
329 #define VECTOR_AREA_LOGGER_BUF_INFO_EXTENSION_ID 6
332 typedef struct _VECTOR_AREA_EXTENSION_HEADER
334 uint32 u32ExtensionMagic;
335 uint32 u32ExtensionID;
336 uint32 u32ExtensionDataSize;
337 } __MTLK_PACKED VECTOR_AREA_EXTENSION_HEADER;
340 typedef struct _VECTOR_AREA_CALIBR_EXTENSION_DATA
342 uint32 u32DescriptorLocation; /* PAS offset to set Calibration Cache Descriptor */
343 uint32 u32BufferRequestedSize; /* Requested Calibration Cache Buffer Size */
345 }__MTLK_PACKED VECTOR_AREA_CALIBR_EXTENSION_DATA;
348 typedef struct
350 VECTOR_AREA_EXTENSION_HEADER sHeader;
351 VECTOR_AREA_CALIBR_EXTENSION_DATA sData;
352 }__MTLK_PACKED VECTOR_AREA_CALIBR_EXTENSION;
354 typedef struct _VECTOR_AREA_MIPS_CONTROL_EXTENSION_DATA
356 uint32 u32DescriptorLocation; /* PAS offset to set mips control Descriptor (MIPS_CONTROL_DESCRIPTOR) */
357 }__MTLK_PACKED VECTOR_AREA_MIPS_CONTROL_EXTENSION_DATA;
360 typedef struct
362 VECTOR_AREA_EXTENSION_HEADER sHeader;
363 VECTOR_AREA_MIPS_CONTROL_EXTENSION_DATA sData;
364 }__MTLK_PACKED VECTOR_AREA_MIPS_CONTROL;
366 #define LMIPS 0
367 #define UMIPS 1
368 #define NUM_OF_MIPS 2
370 typedef struct
372 uint32 u32MIPSctrl[NUM_OF_MIPS];
373 } __MTLK_PACKED MIPS_CONTROL_DESCRIPTOR;
375 #define MIPS_CTRL_DO_ASSERT MTLK_BFIELD_INFO(0, 1) /* 1 bit starting bit0 */
377 typedef struct
379 uint32 u32BufferDescriptorsLocation; /* PAS offset to set Logger buffers Descriptor */
380 uint32 u32NumOfBufferDescriptors; /* number of BD in Logger BD table */
381 } __MTLK_PACKED VECTOR_AREA_LOGGER_EXTENSION_DATA;
383 typedef struct
385 VECTOR_AREA_EXTENSION_HEADER sHeader;
386 VECTOR_AREA_LOGGER_EXTENSION_DATA sData;
387 } __MTLK_PACKED VECTOR_AREA_LOGGER_EXTENSION;
389 typedef struct
391 uint32 u32NumOfStations; /* number of stas supported */
392 } __MTLK_PACKED VECTOR_AREA_FW_CAPABILITIES_NUM_OF_STATIONS_EXTENSION_DATA;
394 typedef struct
396 VECTOR_AREA_EXTENSION_HEADER sHeader;
397 VECTOR_AREA_FW_CAPABILITIES_NUM_OF_STATIONS_EXTENSION_DATA sData;
398 } __MTLK_PACKED VECTOR_AREA_FW_CAPABILITIES_NUM_OF_STATIONS_EXTENSION;
400 typedef struct
402 uint32 u32NumOfVaps; /* number of vaps supported */
403 } __MTLK_PACKED VECTOR_AREA_FW_CAPABILITIES_NUM_OF_VAPS_EXTENSION_DATA;
405 typedef struct
407 VECTOR_AREA_EXTENSION_HEADER sHeader;
408 VECTOR_AREA_FW_CAPABILITIES_NUM_OF_VAPS_EXTENSION_DATA sData;
409 } __MTLK_PACKED VECTOR_AREA_FW_CAPABILITIES_NUM_OF_VAPS_EXTENSION;
411 typedef struct
413 uint16 u16Size;
414 uint16 u16NumberOfBuffers;
415 uint32 u32BufferPoolAddress;
416 } __MTLK_PACKED VECTOR_AREA_LOGGER_BUF_INFO;
419 typedef struct
421 VECTOR_AREA_LOGGER_BUF_INFO lmBufferInfo;
422 VECTOR_AREA_LOGGER_BUF_INFO umBufferInfo;
423 } __MTLK_PACKED VECTOR_AREA_LOGGER_BUF_INFO_EXTENSION_DATA;
425 typedef struct
427 VECTOR_AREA_EXTENSION_HEADER sHeader;
428 VECTOR_AREA_LOGGER_BUF_INFO_EXTENSION_DATA sData;
429 } __MTLK_PACKED VECTOR_AREA_LOGGER_BUF_INFO_EXTENSION;
431 typedef struct
433 VECTOR_AREA_BASIC sBasic;
434 VECTOR_AREA_CALIBR_EXTENSION sCalibr;
435 VECTOR_AREA_MIPS_CONTROL sMipsControl;
436 VECTOR_AREA_LOGGER_EXTENSION sLoggerExt;
437 VECTOR_AREA_FW_CAPABILITIES_NUM_OF_STATIONS_EXTENSION sFwCapabilitiesNumOfStationsExt;
438 VECTOR_AREA_FW_CAPABILITIES_NUM_OF_VAPS_EXTENSION sFwCapabilitiesNumOfVapsExt;
439 VECTOR_AREA_LOGGER_BUF_INFO_EXTENSION sLoggerBufInfoExt;
440 }__MTLK_PACKED VECTOR_AREA;
442 // this struct contains data which is passed from Host to FW.
443 // location of this struct overlaps location of VECTOR_AREA.
444 // it will be override by VECTOR_AREA once the data is being read.
445 // note that even macro SET_DEBUG_CHI() will override it
446 typedef struct
448 uint32 mipsWorkingFreq;
449 }__MTLK_PACKED VECTOR_AREA_INIT_DATA;
451 /***************************************************************************
453 ** NAME RXMETRICS_HEADER
455 ** PARAMETERS
459 ** DESCRIPTION Sounding packet metric header
461 ****************************************************************************/
462 typedef struct _MTLK_RXMETRICS_HEADER
464 uint32 rank; /* The number of spatial streams of received sounding packet */
465 uint32 isCB;
466 /* put here all the metrics-related stuff you need - padded to 32bit */
467 } __MTLK_PACKED MTLK_RXMETRICS_HEADER;
469 /*********************************************************************************************
470 * G2 Metrics
471 *********************************************************************************************/
473 /***************************************************************************
475 ** NAME ASL_SHRAM_METRIC_T
477 ** DESCRIPTION Sounding packet metric struct
479 ****************************************************************************/
480 #define MAX_SCALE_FACTOR_LENGTH 27
481 #define MAX_MEASURED_SPATIAL_STREAMS 2
482 #define MAX_NUM_OF_MEASURED_BINS 108
485 typedef struct ASL_SHRAM_METRIC_T
488 MTLK_RXMETRICS_HEADER sMtlkHeader;
490 uint32 au32metric[MAX_MEASURED_SPATIAL_STREAMS][MAX_NUM_OF_MEASURED_BINS];
491 uint32 au32scaleFactor[MAX_SCALE_FACTOR_LENGTH];
492 uint32 u32NoiseFunction; //represents different values for different Antenna Selection methods
494 }__MTLK_PACKED ASL_SHRAM_METRIC_T;
495 /*********************************************************************************************/
497 /*********************************************************************************************
498 * G3 Metrics
499 *********************************************************************************************/
500 #define PHY_ESNR_VAL MTLK_BFIELD_INFO(0, 13) /* 13 bits starting BIT0 in effectiveSNR field */
501 #define PHY_MCSF_VAL MTLK_BFIELD_INFO(13, 4) /* 4 bits starting BIT13 in effectiveSNR field */
503 typedef struct RFM_SHRAM_METRIC_T
505 uint32 effectiveSNR;
506 }__MTLK_PACKED RFM_SHRAM_METRIC_T;
507 /*********************************************************************************************/
509 #define MTLK_PACK_OFF
510 #include "mtlkpack.h"
511 #endif /* !SHRAM_INCLUDED_H */