Adding new commiter to ODU-High repo
[o-du/l2.git] / src / 5gnrmac / rg_prg.x
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 /**********************************************************************
20
21   Name:     LTE-MAC layer 
22   
23   Type:     C Include File 
24   
25   Desc:     Structures, variables, and typedefs required by the interface between
26             Two MAC instances(PRG = MAC to MAC).
27
28   File:     rg_prg.x 
29
30 **********************************************************************/
31 /** 
32   @file rg_Prg.x 
33   @brief Structure declarations and definitions for MAC-MAC (PRG) interface.
34   */
35
36 #ifndef __RGPRG_X__ 
37 #define __RGPRG_X__
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #ifdef L2_OPTMZ
44 typedef TfuDatReqTbInfo    RgPrgDatReqTbInfo;
45 #endif
46
47 /** 
48   * @brief Typedef for uplink Dedicated Logical channel group Id.
49   */
50 typedef uint8_t                 RgPrgLteLcgId;
51
52 /** 
53   * @brief Structure to hold uplink Dedicated Logical channel info.
54   *
55   * @details
56   *    - lcId      : Logical channel ID at MAC
57   *    - lcgId     : Logical channel group ID at MAC
58   *    - qci       : QCI for this logical channel control block
59   *    - measOn    : TRUE if Timing Info needs to be fetched for scheduled UL
60   *                  IP throughput else FALSE
61   */
62 typedef struct rgPrgUlLcInfo
63 {
64    CmLteLcId     lcId;    /*!< Logical channel ID */
65    RgPrgLteLcgId lcgId;    /*!< Logical channel group */
66 #ifdef LTE_L2_MEAS
67    uint8_t       qci;     /*!< QCI for this logical channel control block */
68
69    Bool          measOn;   /*!< TRUE if Timing Info needs to be fetched for
70                              Scheduled UL IP throughput else FALSE */
71
72 #endif
73 }RgPrgUlLcInfo;
74
75 /** 
76   * @brief Structure to hold logical channel group information
77   *
78   * @Details
79   *    - lcgId   : Logical channel group ID at MAC
80   *    - lcCount : Logical channel count
81   *    - isGbr   : Indicate if LCG is GBR LCG
82   */
83 typedef struct rgPrgLcgInfo
84 {
85    /* Right now not keeping associated logical channels, searching for
86     * associated channels needed only during config */
87    RgPrgLteLcgId    lcgId;   /*!< Group ID */
88    uint8_t          lcCount; /*!< Lc count */
89    Bool             isGbr;   /*!< Indicate if LCG is GBR LCG */
90 }RgPrgLcgInfo;
91
92 /** 
93   * @brief Structure to hold downlink Dedicated Logical channel info.
94   * 
95   * @Details
96   *   - lcId   : Logical channel ID at MAC
97   */
98 typedef struct rgPrgDlLcInfo
99 {
100    CmLteLcId            lcId;    /*!< Logical channel ID */
101 }RgPrgDlLcInfo;
102
103 #ifdef LTE_ADV
104 /** 
105   * @brief Structure to hold Config req from PMAC to SMAC.
106   * 
107   * @details
108   *   - ueId        : UE identifier
109   *   - cellId      : Cell ID
110   *   - maxUlHqRetx : Maximum number of harq retx
111   *   - ulLcInfo    : Dedicated Uplink logical channel info
112   *   - lcgInfo     :  Logical channel groups
113   *   - dlLcInfo    : Dedicated Downlink logical channels in UE
114   *   - txMode      : UE Transmission mode Cfg
115   *   - rguDlSapId  : Sap id for associated with RLC DL
116   *   - rguUlSapId  : Sap id for associated with RLC UL
117   */
118 typedef struct rgPrgUeSCellCfgInfo
119 {
120    CmLteRnti            ueId;            /*!< UE identifier */
121    CmLteCellId          cellId;          /*!< Cell ID */
122
123    uint8_t              maxUlHqRetx;     /*!< Maximum number of harq
124                                           * re-transmissions */ 
125    RgPrgUlLcInfo        ulLcInfo[RG_MAX_LC_PER_UE];  /*!< Dedicated Uplink 
126                                                 logical channel information */
127    RgPrgLcgInfo         lcgInfo[RG_MAX_LCG_PER_UE]; /*!< Logical channel 
128                                                  groups */
129    RgPrgDlLcInfo        dlLcInfo[RG_MAX_LC_PER_UE];  /*!< Dedicated Downlink 
130                                                  logical channels in UE */
131
132    CrgTxMode            txMode;          /*!< UE Transmission mode Cfg */
133
134    SuId                 rguDlSapId;      /* !< Sap id for associated 
135                                      with RLC DL */
136    SuId                 rguUlSapId;      /* !< Sap id for associated 
137                                       with RLC UL */
138 }RgPrgUeSCellCfgInfo;
139
140 /** 
141   * @brief Structure to hold config confirm info from PMAC to SMAC.
142   * 
143   * @details
144   *   - ueId    : UE identifier
145   *   - sCellId : SCell ID
146   *   - status  : status (OK/NOK)
147   */
148 typedef struct rgPrgCfgCfmInfo
149 {
150    CmLteRnti       ueId;    /*!< UE identifier */
151    CmLteCellId     sCellId;  /*!< SCell ID */
152    uint8_t         status;  /*!< Status: OK/NOK */
153    uint8_t         event;   /*!< type of event */ 
154 }RgPrgCfgCfmInfo;
155
156 /** 
157   * @brief  Structure to hold Ue delete Req/Ue Id change Info from PMAC to SMAC.
158   *
159   * @details
160   *    - ueId     : UE identifier
161   *    - sCellId  : sCell ID
162   *    - newRnti  : new RNTI changed as part of reestablishment
163   **/
164 typedef struct rgPrgUeSCellDelInfo
165 {
166    CmLteRnti       ueId;     /*!< UE identifier */
167    CmLteCellId     sCellId;  /*!< sCell ID */
168    CmLteRnti       newRnti;  /*!< new RNTI changed as part of reestablishment */
169 }RgPrgUeSCellDelInfo;
170
171 /** 
172   * @brief Structure to hold LC Config req from PMAC to SMAC.
173   * 
174   * @details
175   *   - cellId      : Cell ID
176   *   - crnti       : CRNTI for DTCH and DCCH
177   *   - lcId        : Logical Channel Id
178   *   - lcgId       : Logical channel group Id
179   */
180 typedef struct rgPrgUeSCellLchModInfo
181 {
182    CmLteCellId cellId;       /*!< Cell ID */
183    CmLteRnti   crnti;        /*!< CRNTI for DTCH and DCCH */
184    CmLteLcId   lcId;         /*!< Logical channel ID */
185
186    struct ulLchRecfgS
187    {
188       uint8_t  lcgId;  /*!< Logical channel group ID */
189    } ulLchRecfg;                /*!< Uplink logical channel reconfiguration
190                                information */
191 }RgPrgUeSCellLchModInfo;
192
193 /** 
194   * @brief Structure to hold LC Config req for deletion from PMAC to SMAC.
195   * 
196   * @details
197   *   - cellId      : Cell ID
198   *   - crnti       : CRNTI for DTCH and DCCH
199   *   - lcId        : Logical Channel Id
200   *   - dir         : Indicates Direction
201   */
202 typedef struct rgPrgUeSCellLchDelInfo
203 {
204    CmLteCellId cellId;       /*!< Cell ID */
205    CmLteRnti   crnti;        /*!< CRNTI for DTCH and DCCH */
206    CmLteLcId   lcId;         /*!< Logical channel ID */
207    uint8_t     dir;          /*!< Indicates Direction. Direction can take following
208                             values:<br>
209                             PRG_DIR_TX<br>
210                             PRG_DIR_RX<br>
211                             PRG_DIR_TX_RX
212                             */
213 }RgPrgUeSCellLchDelInfo;
214
215 /** 
216   * @brief Logical channel configuration information for uplink logical channels. 
217   *
218   * @details
219   *    -ulTrchType      : Indicates type of UL transport channel:
220                                   Validated only for BCCH at MAC. 
221                                   UL Transport channel type can take following values:<br>
222                                    CM_LTE_TRCH_RACH<br>
223                                    CM_LTE_TRCH_UL_SCH   
224    *   -lcgId;          :  Logical channel group ID 
225    */
226 typedef struct rgPrgUlLchCfg
227 {
228    uint8_t             ulTrchType; /*!< Indicates type of UL transport channel:
229                                    Validated only for BCCH at MAC. 
230                                    UL Transport channel type can take following values:<br>
231                                    CM_LTE_TRCH_RACH<br>
232                                    CM_LTE_TRCH_UL_SCH */  
233    uint8_t             lcgId;      /*!< Logical channel group ID */
234 } RgPrgUlLchCfg;
235
236
237 /** 
238    *  @brief Logical channel configuration information for downlink logical channels. 
239    *
240    *  @details             
241    *     -dlTrchType    :  Indicates type of DL transport channel:
242                                    Validated only for BCCH at MAC. DL Transport
243                                    channel type can take following values:<br>
244                                    CM_LTE_TRCH_BCH<br> 
245                                    CM_LTE_TRCH_PCH<br>
246                                    CM_LTE_TRCH_DL_SCH  
247 */
248 typedef struct rgPrgDlLchCfg 
249 {
250    uint8_t             dlTrchType; /*!< Indicates type of DL transport channel:
251                                    Validated only for BCCH at MAC. DL Transport
252                                    channel type can take following values:<br>
253                                    CM_LTE_TRCH_BCH<br> 
254                                    CM_LTE_TRCH_PCH<br>
255                                    CM_LTE_TRCH_DL_SCH  */
256 } RgPrgDlLchCfg;
257   /**  @brief Logical channel configuration information for common and dedicated channels. 
258    *
259    *   @details
260    *       cellId      :  Cell ID 
261    *       crnti       :  CRNTI for DTCH and DCCH 
262    *       lcId        :  Logical channel ID 
263    *       lcType      :  Identifies the Logical channel type. lcType can take the following values:<br>                                            
264                                       CM_LTE_LCH_BCCH<br>
265                                       CM_LTE_LCH_PCCH<br>
266                                       CM_LTE_LCH_CCCH<br>
267                                       CM_LTE_LCH_DCCH<br>
268                                       CM_LTE_LCH_DTCH   
269                             
270     *      dir         :  Indicates Direction. Direction can take following 
271                                   values:<br>
272                                   PRG_DIR_TX<br>
273                                   PRG_DIR_RX<br>
274                                   PRG_DIR_TX_RX 
275
276     *      dlInfo      :   Downlink logical channel configuration info 
277     *      ulInfo      :   Uplink logical channel configuration info 
278
279     *      qci;        :            QCI for the logical channel.
280                                   Valid Range:[0-255] (Actual QCI - 1). 
281 */
282 typedef struct rgPrgUeSCellLchAddInfo
283 {
284    CmLteCellId   cellId;     /*!< Cell ID */
285    CmLteRnti     crnti;      /*!< CRNTI for DTCH and DCCH */
286    CmLteLcId     lcId;       /*!< Logical channel ID */
287    CmLteLcType   lcType;     /*!< Identifies the Logical channel type. lcType can take the following values:<br>                                            
288                                       CM_LTE_LCH_BCCH<br>
289                                       CM_LTE_LCH_PCCH<br>
290                                       CM_LTE_LCH_CCCH<br>
291                                       CM_LTE_LCH_DCCH<br>
292                                       CM_LTE_LCH_DTCH */  
293                             
294    uint8_t        dir;        /*!< Indicates Direction. Direction can take following 
295                                   values:<br>
296                                   PRG_DIR_TX<br>
297                                   PRG_DIR_RX<br>
298                                   PRG_DIR_TX_RX */  
299
300    RgPrgDlLchCfg   dlInfo;     /*!< Downlink logical channel configuration info */
301    RgPrgUlLchCfg   ulInfo;     /*!< Uplink logical channel configuration info */
302 #ifdef LTE_L2_MEAS
303    uint8_t qci;                   /*!< QCI for the logical channel.
304                                   Valid Range:[0-255] (Actual QCI - 1). */
305
306 #endif /* LTE_L2_MEAS */
307 } RgPrgUeSCellLchAddInfo;
308
309
310 /* 
311    Function Prototypes 
312  */
313 /** @brief Request from PMAC to SMAC to add Ue Scell config. */
314 S16 RgPrgPMacSMacUeSCellCfg ARGS
315    ((
316      Pst         *pst,    
317      RgPrgUeSCellCfgInfo *ueSCellCb
318     ));
319
320 /** @brief Request from PMAC to SMAC to add Ue Scell config. */
321 S16 RgPrgPMacSMacUeSCellCfgReq ARGS
322 ((
323  Pst         *pst,
324  RgPrgUeSCellCfgInfo *ueSCellCb
325 ));
326
327 /** @brief Function ptr for Request from PMAC to SMAC to add Ue Scell config.*/
328 typedef S16 (*RgPrgUeSCellCfgReq) ARGS ((
329          Pst*                 pst,
330          RgPrgUeSCellCfgInfo          *ueSCellCb
331          ));
332
333 /** @brief Config confirm of Ue SCell config Req from SMAC to PMAC */
334 S16 RgPrgSMacPMacCfg ARGS ((
335          Pst              *pst,
336          RgPrgCfgCfmInfo  *cfgCfm
337          ));
338
339 /** @brief Config confirm from SMAC to PMAC */
340 S16 RgPrgSMacPMacCfgCfm ARGS ((
341          Pst             *pst,    
342          RgPrgCfgCfmInfo *cfgCfm
343          ));
344
345 /** @brief Function ptr for Config confirm from SMAC to PMAC */
346 typedef S16 (*RgSMacPMacCfgCfm) ARGS((
347          Pst*                 pst,
348          RgPrgCfgCfmInfo      *cfgCfm
349          ));
350
351 /** 
352  * @brief Ue SCell cfg delete Req from PMac to SMac*/
353 S16 RgPrgPMacSMacUeSCellDel ARGS ((
354          Pst                  *pst,
355          RgPrgUeSCellDelInfo  *sCellUedelReq
356          ));
357
358 /** 
359  * @brief Ue SCell cfg delete Req from PMac to SMac*/
360 S16 RgPrgPMacSMacUeSCellDelReq ARGS ((
361          Pst                 *pst,    
362          RgPrgUeSCellDelInfo *sCellUedelReq
363          ));
364
365 /** 
366  * @brief Function ptr to Ue SCell cfg delete Req from PMac to SMac*/
367 typedef S16 (*RgUeSCellDelReq) ARGS((
368          Pst                   *pst,
369          RgPrgUeSCellDelInfo   *sCellUedelReq
370          ));
371
372 #ifdef LCPRG
373 /** 
374  * @brief Ue SCell Cfg Req from PMac to SMac.
375  * @details This primitive is used for light-weight loose coupling. 
376  */
377 S16 cmPkPrgPMacSMacUeSCellCfgReq ARGS ((
378          Pst                          *pst,    
379          RgPrgUeSCellCfgInfo          *ueSCellCb
380          ));
381
382 S16 cmUnpkPrgPMacSMacUeSCellCfgReq ARGS ((
383          RgPrgUeSCellCfgReq   func,
384          Pst                  *pst,
385          Buffer               *mBuf
386          ));
387
388 /** 
389  * @brief Ue SCell Add Cfg cfm from SMac to PMac.
390  * @details This primitive is used for light-weight loose coupling. 
391  */
392 S16 cmPkPrgSMacPMacCfgCfm ARGS((
393          Pst                  *pst,    
394          RgPrgCfgCfmInfo      *cfgCfm
395          ));
396
397
398 S16 cmUnpkPrgSMacPMacCfgCfm ARGS((
399          RgSMacPMacCfgCfm    func,
400          Pst                 *pst,
401          Buffer              *mBuf
402          ));
403 /** 
404  * @brief SCell Ue Delete Req from PMac to SMac.
405  * @details This primitive is used for light-weight loose coupling. 
406  */
407 S16 cmPkPrgPMacSMacUeSCellDelReq ARGS((
408          Pst                  *pst,    
409          RgPrgUeSCellDelInfo  *sCellUeDelInfo
410          ));
411
412
413 S16 cmUnpkPrgPMacSMacUeSCellDelReq ARGS((
414          RgUeSCellDelReq    func,
415          Pst                *pst,
416          Buffer             *mBuf
417          ));
418
419
420 /** 
421  * @brief Ue Lch recfg Req from PMac to SMac.
422  * @details This primitive is used for light-weight loose coupling. 
423  */
424 S16 cmPkPrgPMacSMacUeSCellLchModReq ARGS((
425          Pst                       *pst,    
426          RgPrgUeSCellLchModInfo    *lchCfgCb
427          ));
428
429 S16 cmUnpkPrgPMacSMacUeSCellLchModReq ARGS((
430          RgPrgUeScellModLchReq       func,
431          Pst                         *pst,
432          Buffer                      *mBuf
433          ));
434
435 /** 
436  * @brief SCell Ue Delete Req from PMac to SMac.
437  * @details This primitive is used for light-weight loose coupling. 
438  */
439 S16 cmPkPrgPMacSMacUeSCellLchDelReq ARGS((
440          Pst                          *pst,    
441          RgPrgUeSCellLchDelInfo       *delLcCb
442          ));
443
444
445 S16 cmUnpkPrgPMacSMacUeSCellLchDelReq ARGS((
446          RgPrgUeScellDelLchReq     func,
447          Pst                       *pst,
448          Buffer                    *mBuf
449          ));
450
451 /** 
452  * @brief Ue Lch cfg Req from PMac to SMac.
453  * @details This primitive is used for light-weight loose coupling. 
454  */
455 S16 cmPkPrgPMacSMacUeSCellLchAddReq ARGS ((
456          Pst                       *pst,    
457          RgPrgUeSCellLchAddInfo    *lchCfgCb
458          ));
459
460 S16 cmUnpkPrgPMacSMacUeSCellLchAddReq ARGS ((
461          RgPrgUeScellAddLchReq       func,
462          Pst                         *pst,
463          Buffer                      *mBuf
464          ));
465
466
467 #endif /* LCPRG */
468
469 /** @brief Request from PMAC to SMAC to add Lch Reconfig. */
470 S16 RgPrgPMacSMacUeScellLchMod ARGS
471    ((
472      Pst                      *pst,    
473      RgPrgUeSCellLchModInfo   *lchCfgCb
474     ));
475
476 /** @brief Request from PMAC to SMAC to add Lch Reconfig. */
477
478 /** @brief Function ptr for Request from PMAC to SMAC to add Lch Reconfig.*/
479 typedef S16 (*RgPrgUeScellModLchReq) ARGS((
480          Pst*                        pst,
481          RgPrgUeSCellLchModInfo      *lchCfgCb
482          ));
483
484 /** @brief Request from PMAC to SMAC to delete Lch . */
485 S16 RgPrgPMacSMacUeScellLchDel ARGS
486    ((
487      Pst                       *pst,    
488      RgPrgUeSCellLchDelInfo    *delLcCb
489     ));
490
491 /** @brief Request from PMAC to SMAC to delete Lch. */
492
493 /** @brief Function ptr for Request from PMAC to SMAC to delete Lch.*/
494 typedef S16 (*RgPrgUeScellDelLchReq) ARGS((
495          Pst*                      pst,
496          RgPrgUeSCellLchDelInfo    *delLcCb
497          ));
498
499
500 /** @brief Request from PMAC to SMAC to add Lch config. */
501 S16 RgPrgPMacSMacUeScellLchAdd ARGS
502    ((
503      Pst                      *pst,    
504      RgPrgUeSCellLchAddInfo   *lchCfgCb
505     ));
506
507 /** @brief Request from PMAC to SMAC to add Lch config. */
508
509 /** @brief Function ptr for Request from PMAC to SMAC to add Lch config.*/
510 typedef S16 (*RgPrgUeScellAddLchReq) ARGS
511          ((Pst                        *pst,
512          RgPrgUeSCellLchAddInfo      *lchCfgCb
513          ));
514 #endif /* LTE_ADV */
515 #ifdef __cplusplus
516 }
517 #endif
518 #endif /* __RGPRG_X__*/
519
520 /**********************************************************************
521   
522          End of file:     rg_prg.x
523 **********************************************************************/