Initial commit for Bronze release
[o-du/l2.git] / src / cm / lcl.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 /* Defines APIs exchanged between du_app and cl module of MAC */
20 #ifndef __LCL_H__
21 #define __LCL_H__
22
23 #define NUM_NUMEROLOGY 5  /* Number of numerology */
24 #define MAXIMUM_TDD_PERIODICITY 5
25 #define MAX_SYMB_PER_SLOT 14 
26
27 typedef enum
28 {
29    DUP_MODE_FDD,
30    DUP_MODE_TDD
31 }DuplexMode;
32
33 typedef enum
34 {
35    MAC_GEN_FULL_PBCH_PAYLD,   /* MAC generated the full PBCH Payload */
36    PHY_GEN_TIMING_PBCH_BIT,   /* PHY generates the timing PBCH bits */
37    PHY_GEN_FULL_PBCH_PAYLD    /* PHY generates full PBCH payload */
38 }BchPduOpt;
39
40 typedef enum
41 {
42    LONG_SEQUENCE,
43    SHORT_SEQUENCE
44 }PrachSeqLen;
45
46 typedef enum
47 {
48    UNRESTRICTED,
49    RESTRICTED_SET_TYPE_A,
50    RESTRICTED_SET_TYPE_B
51 }RstSetCfg;
52
53 typedef enum
54 {
55    DONT_REPORT_RSSI,
56    RSSI_UNIT_DBM,
57    RSSI_UNIT_DBFS
58 }RSSIMeasUnit;
59
60 typedef enum
61 {
62    DL_SLOT,
63    UL_SLOT,
64    GUARD_SLOT
65 }SlotConfig;
66
67 typedef enum
68 {
69    TX_PRDCTY_MS_0P5,
70    TX_PRDCTY_MS_0P625,
71    TX_PRDCTY_MS_1,
72    TX_PRDCTY_MS_1P25,
73    TX_PRDCTY_MS_2,
74    TX_PRDCTY_MS_2P5,
75    TX_PRDCTY_MS_5,
76    TX_PRDCTY_MS_10
77 }DlUlTxPeriodicity;
78
79 typedef enum
80 {
81    BETA_PSS_0DB,
82    BETA_PSS_1DB
83 }BetaPss;
84
85 typedef enum 
86 {
87    SSB_PRDCTY_MS_5,
88    SSB_PRDCTY_MS_10,
89    SSB_PRDCTY_MS_20,
90    SSB_PRDCTY_MS_40,
91    SSB_PRDCTY_MS_80,
92    SSB_PRDCTY_MS_160
93 }SSBPeriod;
94
95 typedef struct carrierCfg
96 {
97    Bool  pres;
98    U16   bw;             /* DL/UL bandwidth */
99    U32   freq;           /* Absolute frequency of DL/UL point A in KHz */
100    U16   k0[NUM_NUMEROLOGY];          /* K0 for DL/UL */
101    U16   gridSize[NUM_NUMEROLOGY];    /* DL/UL Grid size for each numerologies */
102    U16   numAnt;         /* Number of Tx/Rx antennas */
103 }CarrierCfg;
104
105 typedef struct ssbCfg
106 {
107    U32         ssbPbchPwr;       /* SSB block power */
108    BchPduOpt   bchPayload;       /* Options for generation of payload */
109    U8          scsCmn;           /* subcarrier spacing for common */
110    U16         ssbPrbOffset;     /* SSB PRB offset from point A */
111    BetaPss     betaPss;
112    SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
113    U8          ssbSubcOffset;    /* Subcarrier Offset */
114    U32         mibPdu;           /* MIB payload */
115    U32         nSSBMask[2];      /* Bitmap for actually transmitted SSB. */
116    Bool        multCarrBand;     /* Multiple carriers in a band */
117    Bool        multCellCarr;     /* Multiple cells in single carrier */
118 }SsbCfg;
119
120 typedef struct fdmInfo
121 {
122    U16   rootSeqIdx;        /* Root sequence index */
123    U8    numRootSeq;        /* Number of root sequences required for FD */
124    U16   k1;                /* Frequency Offset for each FD */
125    U8    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
126    U8    numUnusedRootSeq;  /* Number of unused root sequence */
127    U8    *unsuedRootSeq;     /* Unused root sequence per FD */
128 }FdmInfo;
129
130 typedef struct prachCfg
131 {
132    Bool          pres;
133    PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
134    U8            prachSubcSpacing;    /* Subcarrier spacing of RACH */
135    RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
136    U8            prachFdm;            /* PRACH FDM (1,2,4,8) */
137    FdmInfo       fdm[8];
138    U8            ssbPerRach;          /* SSB per RACH occassion */
139    Bool          prachMultCarrBand;    /* Multiple carriers in Band */
140 }PrachCfg;
141
142 typedef struct tddCfg
143 {
144    Bool               pres;
145    DlUlTxPeriodicity  tddPeriod;      /* DL UL Transmission periodicity */
146    SlotConfig         slotCfg[MAXIMUM_TDD_PERIODICITY][MAX_SYMB_PER_SLOT]; 
147 }TDDCfg;
148
149 typedef struct clCellCfg
150 {
151    U8             numTlv;     /* Number of configuration TLVs */
152    U8             carrierId;  /* Carrired Index */
153    U16            cellId;     /* Cell Id */
154    U16            phyCellId;  /* Physical cell id */
155    DuplexMode     dupType;    /* Duplex type: TDD/FDD */
156    CarrierCfg     dlCarrCfg;  /* DL Carrier configuration */
157    CarrierCfg     ulCarrCfg;  /* UL Carrier configuration */
158    Bool           freqShft;   /* Indicates presence of 7.5kHz frequency shift */
159    SsbCfg         ssbCfg;     /* SSB configuration */          
160    PrachCfg       prachCfg;   /* PRACH Configuration */
161    TDDCfg         tddCfg;     /* TDD periodicity and slot configuration */
162    RSSIMeasUnit   rssiUnit;   /* RSSI measurement unit */
163 }ClCellCfg;
164
165 #endif
166
167 /**********************************************************************
168          End of file
169 **********************************************************************/