dc6429ada1a1b873bdc0c03a3996694567282563
[o-du/l2.git] / src / 5gnrmac / lwr_mac.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /* Contains definitions for MAC CL modules */
20 #ifndef __LWR_MAC_H__
21 #define __LWR_MAC_H__
22
23 #define MAX_NUM_CELL_SUPP 1
24
25 #include "envdep.h"
26 #include "gen.h"
27 #include "ssi.h"
28 #include "cm_hash.h"
29
30 #include "gen.x"
31 #include "ssi.x"
32 #include "cm_hash.x"
33 #include "cm_lib.x"
34 #include "du_app_mac_inf.h"
35
36 typedef enum
37 {
38    PHY_STATE_IDLE,
39    PHY_STATE_CONFIGURED,
40    PHY_STATE_RUNNING,
41    MAX_STATE   
42 }PhyState;
43
44 /* Events in Lower Mac */
45 typedef enum{
46   FAPI_PARAM_REQUEST,
47   FAPI_PARAM_RESPONSE,
48   FAPI_CONFIG_REQUEST,
49   FAPI_CONFIG_RESPONSE,
50   FAPI_START_REQUEST,
51   MAX_EVENT
52 }EventState;
53
54 typedef struct clCb
55 {
56    Region          region;
57    Pool            pool;
58    Bool            clCfgDone;   /* CL configuration done */
59    CmHashListCp    cellCbLst;   /* List of Cells configured */
60    U8              numOfCells;  /* Number of Cells configured */
61    PhyState        phyState;    /* State of PHY */
62    EventState      event;       /* State of Event */
63 }ClCb;
64
65 typedef struct cellCb
66 {
67    U16         cellId;
68    MacCellCfg   cellCfg;
69    PhyState    phyState;
70 }ClCellCb;
71
72 typedef enum
73 {
74    RELEASE_15
75 }ReleaseCapab;
76
77 typedef enum
78 {
79    NOT_SUPPORTED,
80    SUPPORTED
81 }ParamSupport;
82
83 typedef enum
84 {
85    NORMAL_CYCLIC_PREFIX_MASK,
86    EXTENDED_CYCLIC_PREFIX_MASK
87 }CyclicPrefix;
88
89 typedef enum 
90 {
91    SPACING_15_KHZ,
92    SPACING_30_KHZ,
93    SPACING_60_KHZ,
94    SPACING_120_KHZ
95 }SubCarrierSpacing;
96
97 typedef enum 
98 {
99    BW_5MHZ,
100    BW_10MHZ,
101    BW_15MHZ,
102    BW_20MHZ,
103    BW_40MHZ,
104    BW_50MHZ,
105    BW_60MHZ,
106    BW_70MHZ,
107    BW_80MHZ,
108    BW_90MHZ,
109    BW_100MHZ,
110    BW_200MHZ,
111    BW_400MHZ
112 }SupportedBandwidth;
113
114 typedef enum
115 {
116    CCE_MAPPING_INTERLEAVED_MASK,
117    CCE_MAPPING_NONINTERLVD_MASK
118 }CCEMappingType;
119
120 typedef enum
121 {
122    FORMAT_0,
123    FORMAT_1,
124    FORMAT_2,
125    FORMAT_3,
126    FORMAT_4
127 }Formats;
128
129 typedef enum
130 {
131    MAPPING_TYPE_A,        
132    MAPPING_TYPE_B,
133 }MappingType;
134
135 typedef enum
136 {
137    ALLOCATION_TYPE_0,            
138    ALLOCATION_TYPE_1,
139 }AllocationType;
140
141 typedef enum
142 {
143    VRB_TO_PRB_MAP_NON_INTLV,
144    VRB_TO_PRB_MAP_INTLVD
145 }VrbToPrbMap;
146
147 typedef enum
148 {  
149    DMRS_CONFIG_TYPE_1,     
150    DMRS_CONFIG_TYPE_2
151 }DmrsConfigType;
152
153 typedef enum
154 {  
155    DMRS_MAX_LENGTH_1,     
156    DMRS_MAX_LENGTH_2
157 }DmrMaxLen;
158
159 typedef enum
160 {
161    DMRS_ADDITIONAL_POS_0,         
162    DMRS_ADDITIONAL_POS_1,         
163    DMRS_ADDITIONAL_POS_2,         
164    DMRS_ADDITIONAL_POS_3        
165 }DmrsPos;
166
167 typedef enum
168 {
169    MOD_QPSK,
170    MOD_16QAM,
171    MOD_64QAM,
172    MOD_256QAM
173 }ModulationOrder;
174
175 typedef enum 
176 {
177    AGG_FACTOR_1,
178    AGG_FACTOR_2,
179    AGG_FACTOR_4,
180    AGG_FACTOR_8
181 }AggregationFactor;
182
183 typedef enum
184 {
185    SF_FORMAT_A1,
186    SF_FORMAT_A2,
187    SF_FORMAT_A3,
188    SF_FORMAT_B1,
189    SF_FORMAT_B2,
190    SF_FORMAT_B3,
191    SF_FORMAT_B4,
192    SF_FORMAT_C0,
193    SF_FORMAT_C2
194 }ShortFormat;
195
196 typedef enum 
197 {
198    PRACH_FD_OCC_IN_A_SLOT_1   = 1,
199    PRACH_FD_OCC_IN_A_SLOT_2   = 2,
200    PRACH_FD_OCC_IN_A_SLOT_4   = 4,
201    PRACH_FD_OCC_IN_A_SLOT_8   = 8
202 }FdOccPerSlot;
203
204 typedef enum
205 {
206    RSSI_REPORT_DBM,
207    RSSI_REPORT_DBFS
208 }RssiMeasurement;
209
210 typedef struct clCellParam
211 {   
212    ReleaseCapab          releaseCapability;                    /* Release Capability */  
213    PhyState              ParamPhystate;
214    ParamSupport          skipBlankDlConfig;
215    ParamSupport          skipBlankUlConfig;
216    ParamSupport          numTlvsToReport;
217    CyclicPrefix          cyclicPrefix;                
218    SubCarrierSpacing     supportedSubcarrierSpacingDl;
219    SupportedBandwidth    supportedBandwidthDl;         
220    SubCarrierSpacing     supportedSubcarrierSpacingsUl;
221    SupportedBandwidth    supportedBandwidthUl;
222    CCEMappingType        cceMappingType;
223    ParamSupport          coresetOutsideFirst3OfdmSymsOfSlot;
224    ParamSupport          precoderGranularityCoreset;
225    ParamSupport          pdcchMuMimo;
226    ParamSupport          pdcchPrecoderCycling;
227    U8                    maxPdcchsPerSlot;
228    Formats               pucchFormats;
229    U8                    maxPucchsPerSlot;   
230    MappingType           pdschMappingType;
231    AllocationType        pdschAllocationTypes;
232    VrbToPrbMap           pdschVrbToPrbMapping;
233    ParamSupport          pdschCbg;
234    DmrsConfigType        pdschDmrsConfigTypes;
235    DmrMaxLen             pdschDmrsMaxLength;
236    DmrsPos               pdschDmrsAdditionalPos;
237    U8                    maxPdschsTBsPerSlot;
238    U8                    maxNumberMimoLayersPdsch;
239    ModulationOrder       supportedMaxModulationOrderDl;
240    U8                    maxMuMimoUsersDl;
241    ParamSupport          pdschDataInDmrsSymbols;
242    ParamSupport          premptionSupport;
243    ParamSupport          pdschNonSlotSupport;
244    ParamSupport          uciMuxUlschInPusch;
245    ParamSupport          uciOnlyPusch;
246    ParamSupport          puschFrequencyHopping;
247    DmrsConfigType        puschDmrsConfigTypes;
248    DmrMaxLen             puschDmrsMaxLength;
249    DmrsPos               puschDmrsAdditionalPos;
250    ParamSupport          puschCbg;
251    MappingType           puschMappingType;
252    AllocationType        puschAllocationTypes;
253    VrbToPrbMap           puschVrbToPrbMapping;
254    U8                    puschMaxPtrsPorts;
255    U8                    maxPduschsTBsPerSlot;
256    U8                    maxNumberMimoLayersNonCbPusch;
257    ModulationOrder       supportedModulationOrderUl;
258    U8                    maxMuMimoUsersUl;
259    ParamSupport          dftsOfdmSupport;
260    AggregationFactor     puschAggregationFactor;
261    Formats                prachLongFormats;
262    ShortFormat           prachShortFormats;
263    ParamSupport          prachRestrictedSets;
264    FdOccPerSlot          maxPrachFdOccasionsInASlot;
265    RssiMeasurement       rssiMeasurementSupport;
266 }ClCellParam;
267
268 EXTERN ClCb clGlobalCp; 
269 EXTERN ClCellCb * rgClUtlGetCellCb ARGS((U16 cellId));
270
271 #endif
272
273 /**********************************************************************
274          End of file
275 **********************************************************************/