macCellCfg
[o-du/l2.git] / src / cm / du_app_mac_inf.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 __MACINT_H__
21 #define __MACINT_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 #define NUM_SSB         1       /* max value is 64 */
28 #define SSB_MASK_SIZE   1       /* SSB mask size is 32bit for sub6 */
29
30
31 /* Event IDs */
32 #define EVENT_MAC_CELL_CONFIG_REQ    200
33 #define EVENT_MAC_CELL_CONFIG_CFM    201
34
35 typedef enum
36 {
37    DUP_MODE_FDD,
38    DUP_MODE_TDD
39 }DuplexMode;
40
41 typedef enum
42 {
43    MAC_GEN_FULL_PBCH_PAYLD,   /* MAC generated the full PBCH Payload */
44    PHY_GEN_TIMING_PBCH_BIT,   /* PHY generates the timing PBCH bits */
45    PHY_GEN_FULL_PBCH_PAYLD    /* PHY generates full PBCH payload */
46 }BchPduOpt;
47
48 typedef enum
49 {
50    LONG_SEQUENCE,
51    SHORT_SEQUENCE
52 }PrachSeqLen;
53
54 typedef enum
55 {
56    UNRESTRICTED,
57    RESTRICTED_SET_TYPE_A,
58    RESTRICTED_SET_TYPE_B
59 }RstSetCfg;
60
61 typedef enum
62 {
63    DONT_REPORT_RSSI,
64    RSSI_UNIT_DBM,
65    RSSI_UNIT_DBFS
66 }RSSIMeasUnit;
67
68 typedef enum
69 {
70    DL_SLOT,
71    UL_SLOT,
72    GUARD_SLOT
73 }SlotConfig;
74
75 typedef enum
76 {
77    TX_PRDCTY_MS_0P5,
78    TX_PRDCTY_MS_0P625,
79    TX_PRDCTY_MS_1,
80    TX_PRDCTY_MS_1P25,
81    TX_PRDCTY_MS_2,
82    TX_PRDCTY_MS_2P5,
83    TX_PRDCTY_MS_5,
84    TX_PRDCTY_MS_10
85 }DlUlTxPeriodicity;
86
87 typedef enum
88 {
89    BETA_PSS_0DB,
90    BETA_PSS_1DB
91 }BetaPss;
92
93 typedef enum 
94 {
95    SSB_PRDCTY_MS_5,
96    SSB_PRDCTY_MS_10,
97    SSB_PRDCTY_MS_20,
98    SSB_PRDCTY_MS_40,
99    SSB_PRDCTY_MS_80,
100    SSB_PRDCTY_MS_160
101 }SSBPeriod;
102
103 typedef struct carrierCfg
104 {
105    Bool  pres;
106    U16   bw;             /* DL/UL bandwidth */
107    U32   freq;           /* Absolute frequency of DL/UL point A in KHz */
108    U16   k0[NUM_NUMEROLOGY];          /* K0 for DL/UL */
109    U16   gridSize[NUM_NUMEROLOGY];    /* DL/UL Grid size for each numerologies */
110    U16   numAnt;         /* Number of Tx/Rx antennas */
111 }CarrierCfg;
112
113 typedef struct ssbCfg
114 {
115    U32         ssbPbchPwr;       /* SSB block power */
116    BchPduOpt   bchPayloadOption;       /* Options for generation of payload */
117    U8          scsCmn;           /* subcarrier spacing for common */
118    U16         ssbPrbOffset;     /* SSB PRB offset from point A */
119    BetaPss     betaPss;
120    SSBPeriod   ssbPeriod;        /* SSB Periodicity in msec */
121    U8          ssbSubcOffset;    /* Subcarrier Offset */
122    U32         mibPdu;           /* MIB payload */
123    U32         nSSBMask[SSB_MASK_SIZE];      /* Bitmap for actually transmitted SSB. */
124    U8          beamId[NUM_SSB];
125    Bool        multCarrBand;     /* Multiple carriers in a band */
126    Bool        multCellCarr;     /* Multiple cells in single carrier */
127 }SsbCfg;
128
129 typedef struct fdmInfo
130 {
131    U16   rootSeqIdx;        /* Root sequence index */
132    U8    numRootSeq;        /* Number of root sequences required for FD */
133    U16   k1;                /* Frequency Offset for each FD */
134    U8    zeroCorrZoneCfg;   /* Zero correlation zone cofig */
135    U8    numUnusedRootSeq;  /* Number of unused root sequence */
136    U8    *unsuedRootSeq;     /* Unused root sequence per FD */
137 }FdmInfo;
138
139 typedef struct prachCfg
140 {
141    Bool          pres;
142    PrachSeqLen   prachSeqLen;         /* RACH Sequence length: Long/short */
143    U8            prachSubcSpacing;    /* Subcarrier spacing of RACH */
144    RstSetCfg     prachRstSetCfg;      /* PRACH restricted set config */
145    U8            prachFdm;            /* PRACH FDM (1,2,4,8) */
146    FdmInfo       fdm[8];
147    U8            ssbPerRach;          /* SSB per RACH occassion */
148    Bool          prachMultCarrBand;    /* Multiple carriers in Band */
149 }PrachCfg;
150
151 typedef struct tddCfg
152 {
153    Bool               pres;
154    DlUlTxPeriodicity  tddPeriod;      /* DL UL Transmission periodicity */
155    SlotConfig         slotCfg[MAXIMUM_TDD_PERIODICITY][MAX_SYMB_PER_SLOT]; 
156 }TDDCfg;
157
158 typedef struct macCellCfg
159 {
160    U16            transId;
161    U16            cellId;     /* Cell Id */
162    U8             numTlv;     /* Number of configuration TLVs */
163    U8             carrierId;  /* Carrired Index */
164    U16            phyCellId;  /* Physical cell id */
165    DuplexMode     dupType;    /* Duplex type: TDD/FDD */
166    CarrierCfg     dlCarrCfg;  /* DL Carrier configuration */
167    CarrierCfg     ulCarrCfg;  /* UL Carrier configuration */
168    Bool           freqShft;   /* Indicates presence of 7.5kHz frequency shift */
169    SsbCfg         ssbCfg;     /* SSB configuration */          
170    PrachCfg       prachCfg;   /* PRACH Configuration */
171    TDDCfg         tddCfg;     /* TDD periodicity and slot configuration */
172    RSSIMeasUnit   rssiUnit;   /* RSSI measurement unit */
173 }MacCellCfg;
174
175 typedef struct macCellCfgCfm
176 {
177    U16            transId;
178 }MacCellCfgCfm;
179
180 /* function pointers for packing macCellCfg Request */
181 typedef S16 (*packMacCellCfgReq) ARGS((
182    Pst           *pst,
183    MacCellCfg    *macCellCfg
184 ));
185
186 typedef S16 (*packMacCellCfgCfm) ARGS((
187    Pst              *pst,
188    MacCellCfgCfm    *macCellCfgCfm
189 ));
190
191 typedef S16 (*DuMacCellCfgReq)     ARGS((
192         Pst        *pst,               /* Post Structure */
193         MacCellCfg *macCellCfg         /* Config Structure */
194      ));
195
196 typedef S16 (*DuMacCellCfgCfm)     ARGS((
197         MacCellCfgCfm *macCellCfgCfm         /* Config Structure */
198      ));
199
200 S16 packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
201
202 EXTERN S16 MacHdlCellCfgReq
203 (
204  Pst           *pst,
205  MacCellCfg    *macCellCfg
206 );
207
208 void cmUnpackLwLcMacCellCfg(
209    DuMacCellCfgReq func,
210    Pst *pst,
211    Buffer *mBuf);
212
213 S16 unpackMacCellCfgCfm(
214    DuMacCellCfgCfm func,
215    Pst *pst,
216    Buffer *mBuf);
217
218 EXTERN S16 duHandleMacCellCfgCfm
219 (
220  MacCellCfgCfm    *macCellCfgCfm
221 );
222
223 #endif
224
225 /**********************************************************************
226          End of file
227 **********************************************************************/