SLice Mapping to RLC DB [ Jira Id - ODUHIGH-371 ]
[o-du/l2.git] / src / cm / ckw.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**
20   
21         Name:    CKW RRC Control Interface
22     
23         Type:    C include file
24   
25         Desc:    This file Contains the Data structures for and prototypes
26                   CKW Interface
27  
28         File:    ckw.x
29   
30 *********************************************************************21*/
31
32 #ifndef __CKW_X__
33 #define __CKW_X__
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif  /*for extern "C"*/
38
39 /** @file ckw.x
40     @brief CKW Interface File (ckw.x)
41 */
42  
43 /***********************************************************************
44                           CKW typedefs and data structures
45  ***********************************************************************/
46
47 /** @brief
48    Logical Channel Information */
49 typedef struct ckwLChInfo
50 {
51    uint8_t                   lChId;               /*!< Logical Channel ID.
52                                                   The allowed values are [1..10] */
53    uint8_t                   type;                /*!< Logical Channel Type - 
54                                                   BCCH/PCCH/CCCH/DTCH/DCCH */
55 }CkwLChInfo;
56
57 /** @brief
58    Un-acknowledge Mode Information */
59 typedef struct rlcUmInfo
60 {
61    struct   _umDl
62    {
63       uint8_t                snLen;          /*!< Sequence Number length in bits. Allowed values are 6 and 12*/
64    }dl;                                      /*!< Downlink */
65    struct   _umUl
66    {
67       uint8_t                snLen;          /*!< Sequence Number length in bits.*/
68                                              /*!< Allowed values are 6 and 12*/
69       uint8_t                reAsmblTmr;     /*!< T_reassembly Timer in msec */
70    }ul;                                      /*!< Uplink */
71 }RlcUmInfo;
72
73 /** @brief
74    Acknowledge Mode Information */
75 typedef struct rlcAmInfo
76 {
77    struct   _amDl
78    {
79       uint8_t                snLen;               /*!< Sequence Number length in
80                                                bits. Allowed values are 12 and 18 */
81       uint16_t               pollRetxTmr;         /*!< T_poll_retransmit Timer in msec */
82       S16               pollPdu;             /*!< Used to trigger a poll for every pollPdu.*/
83                                              /*!< This field indicates the number of PDUs */
84       /* Patch ckw_x_001.main_5 */
85                                              /* !<For Infinite, RLC expects value 0xFFFF */
86       S32               pollByte;            /*!< Poll_Byte in bytes. */
87                                              /*!<For Infinite RLC expects value 0xFFFFFFFF */
88       uint8_t                maxRetx;             /*!< Max_Retx_Threshold */
89    }dl;                                      /*!< Down link */
90    struct   _amUl
91    {
92       uint8_t                snLen;               /*!< Sequence Number length in
93                                                bits. Allowed values are 12 and 18 */
94       uint16_t               staProhTmr;          /*!< T_status_prohibit Timer in msec*/
95       uint8_t                reAsmblTmr;            /*!< T_reordering Timer in msec*/
96    }ul;                                      /*!< Up link */
97 }RlcAmInfo;
98
99 /** @brief
100    Transparent Mode Information */
101 typedef union rlcTmInfo
102 {
103    struct   _tmDl
104    {
105       uint32_t               buffSize;            /*!< Buffer Size in bytes */
106    }dl;                                      /*!< Down link */
107 }RlcTmInfo;
108
109 /** @brief
110    Entity Configuration Information */
111 typedef struct rlcEntCfgInfo
112 {
113    uint8_t                   cfgType;             /*!< Type of Configuration - 
114                                                   ADD/MODIFY/DELETE/RE-ESTABLISH/
115                                                   DELTEUE */
116    uint8_t                   rbId;                /* RB ID. The allowed
117                                                   Values are [0..255] */
118    uint8_t                   rbType;              /* Type of the RB - can be SRB or DRB */
119    uint8_t                   qci;                 /*!< qCI value Associated with that RB */
120    Snssai                    *snssai;              /* Snssai Associated with logical channel */
121    CkwLChInfo                lCh[CM_LTE_MAX_LOGCH_PER_RB];  /*!< Logical channel
122                                                         information
123                                                 In case of AM mode: 
124                                                 idx = 0 implies DL and
125                                                 idx = 1 implies UL
126                                                 In case of TM/UM idx 0 is only
127                                                 applicable */
128    CmLteRlcMode              entMode;             /*!< Entity mode: AM, UM or TM */
129    uint8_t                   dir;                 /*!< Direction: It can be either
130                                                UL / DL for TM mode 
131                                                UL / DL or BOTH for UM mode 
132                                                and for AM its always for both UL 
133                                                and DL. */
134    /* Supported by SPLIT Architecture */
135    S16            discardTmr;  /*!< Discard timer. @n The value for this parameter is 
136                                 expected in milli seconds. @n Value of infinity is also
137                                 allowed and -1 must be passed for the same.  */
138    SpId                 rguSapId;
139    /* Supported by SPLIT Architecture ends */
140    union
141    {
142       RlcUmInfo         umInfo;              /*!< Un-acknowledged Mode Information */
143       RlcAmInfo         amInfo;              /*!< Acknowledged Mode Information */
144       RlcTmInfo         tmInfo;              /*!< Transparent Mode Information */
145    }m;
146 }RlcEntCfgInfo;
147
148 /** @brief
149    Configuration Information from RRC to RLC */
150 typedef struct rlcCfgInfo
151 {
152    uint32_t             transId;             /*!< Transaction Id */
153    CmLteRnti            ueId;                /*!< UE ID */
154    CmLteCellId          cellId;              /*!< Cell ID */
155    uint8_t              numEnt;              /*!< Number of entities to configure */
156    RlcEntCfgInfo        entCfg[CKW_MAX_ENT_CFG];  /*!< Array of Entities to be configure */
157 }RlcCfgInfo;
158
159 /** @brief
160    Entity Configuration Confirmation Information */
161 typedef struct rlcEntCfgCfmInfo
162 {
163    uint8_t              rbId;                /*!< rb ID */
164    uint8_t              rbType;              /*!< RB type - can be SRB or DRB */
165    CmStatus             status;              /*!< Status of the confirmation */
166 }RlcEntCfgCfmInfo;
167
168 /** @brief
169    Configuration Confirmation Informatin RLC to RRC */
170 typedef struct rlcCfgCfmInfo
171 {
172    uint32_t             transId;             /*!< Transaction Id */
173    CmLteRnti            ueId;                /*!< UE ID */
174    CmLteCellId          cellId;              /*!< Cell ID */
175    uint8_t              numEnt;              /*!< Number of entities configured */
176    RlcEntCfgCfmInfo     entCfgCfm[CKW_MAX_ENT_CFG];   /*!< Array of Entity cfg
177                                                          confiramations */
178 }RlcCfgCfmInfo;
179
180 /** @brief
181      UE Id Information */
182 typedef struct ckwUeInfo
183 {
184    CmLteRnti            ueId;               /*!< UE ID */
185    CmLteCellId          cellId;             /*!< Cell ID */
186 }CkwUeInfo;
187 /* Control primitives towards LTE RRC */
188
189 /* Pointer functiones for Pack/Unpack */
190 typedef S16 (*RlcCfgReq)     ARGS((Pst *pst, RlcCfgInfo *cfgInfo));
191 typedef S16 (*RlcCfgCfm)     ARGS((Pst *pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
192
193 typedef S16 (*CkwUeIdChgReq) ARGS((Pst *pst, SpId spId, uint32_t transId, 
194                                    CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
195 typedef S16 (*CkwUeIdChgCfm) ARGS((Pst *pst, SuId suId, uint32_t transId, 
196                                    CkwUeInfo *ueInfo, CmStatus status));
197
198 typedef S16 (*CkwBndReq)     ARGS((Pst *pst, SuId suId, SpId spId));
199 typedef S16 (*CkwBndCfm)     ARGS((Pst *pst, SuId suId, uint8_t status));
200 typedef S16 (*CkwUbndReq)    ARGS((Pst *pst, SpId spId, Reason reason));
201
202 /** 
203  * @details The primitive binds the RLC service user entity to the RLC product.
204  * The RLC service user must bind each CKW SAP individually before sending any
205  * other request. RLC acknowledges the receipt of the bind request by sending
206  * a RlcUiCkwBndCfm primitive.
207
208  * @param[in] pst       -  For the bind request, the event field in the Pst
209  *                         structure is set to EVTCKWBNDREQ
210  * @param[in] suId      -  The ID of the service user SAP associated with the
211  *                         SAP in the RLC layer. The SSAP in the RLC layer is
212  *                         specified by the spId parameter.\n
213  *                         Allowable values: 0 to 32767.
214  * @param[in] spId      -  The ID of the service provider SAP in the RLC layer.\n
215  *                         Allowable values: 0 to 32767.
216  * @return ROK
217  */
218 S16 RlcUiCkwBndReq ARGS((Pst *pst, SuId suId, SpId spId));
219
220 /** 
221  * @details RLC invokes the bind confirm primitive to acknowledge the receipt
222  * of the RlcUiCkwBndReq primitive from the service user. The status field
223  * indicates whether the bind request succeeded or failed. The bind request
224  * may fail due to invalid parameters in the bind request from the
225  * service user (for example, an invalid spId).
226
227  * @param[in] pst       -  For the bind confirm, the event field in the Pst
228  *                         structure is set to EVTCKWBNDCFM
229  * @param[in] suId      -  The ID of the service user SAP specified in the
230  *                         bind request. Allowable
231 values: 0 to 32767.
232  * @param[in] status    -  Indicates the status of the bind request.\n
233 CM_BND_OK: Bind request succeeded\n
234 CM_BND_NOK: Error encountered during the processing of the bind request.
235  * @return ROK
236  */
237 S16 RlcUiCkwBndCfm ARGS((Pst *pst, SuId suId, uint8_t status));
238
239 /** 
240  * @details The RLC service user initiates this primitive for performing
241  * an unbind operation.This primitive brings the link down if it is already up,
242  * and releases all the resources associated for this SAP at RLC.
243
244  * @param[in] pst          -  For the unbind request, the event field in the Pst
245  *                            structure is set to EVTCKWUBNDREQ
246  * @param[in] spId         -  The ID of the service provider SAP in the RLC layer
247  *                            that is to be disassociated from its service
248  *                            user SAP.\n
249  *                            Allowable values: 0 to 32767.
250  * @param[in] reason       -  Reason for the unbind.\n
251  *                            Allowable value: CKW_UBND_REQ.
252  * @return ROK
253  */
254 S16 RlcUiCkwUbndReq ARGS((Pst *pst, SpId spId, Reason reason));
255
256 /* Layer interface Control Primitives */
257 /**
258  *@details This primitive is used by RRC to configure the multiple RLC entities. RRC
259  sends this primitive for the control of the RLC entity.
260
261  * The different configuration allowed by RRC to RLC are:\n
262    CKW_CFG_ADD          -  Configures the new RLC entity\n
263    CKW_CFG_MODIFY       -  Modifies the RLC entity\n
264    CKW_CFG_DELETE       -  Deletes the RLC entity\n
265    CKW_CFG_REESTABLISH  -  Re-establilsh the RLC entity\n
266    CKW_CFG_DELETE_UE    -  Deletes the RLC entities per UE\n
267
268
269  * @param[in] pst       -  Point to the pst structure
270  * @param[in] transId   -  Transaction ID. This field will uniquily identifies
271  *                         transaction between RRC and RLC.
272  * @param[in] cfgInfo   -  This structure contains the configuration information
273  * @return ROK
274  */
275 S16 RlcProcCfgReq ARGS((Pst *pst, RlcCfgInfo *cfgInfo));
276
277 /**
278  *@details This primitive is used by RLC to confirm the configuration requested
279  by RRC.
280
281  * The different values for status are:\n
282  * CKW_CFG_CFM_OK    -  Success\n
283  * CKW_CFG_CFM_NOK   -  Failure\n
284
285  * The different reasons for the failure are:\n
286  * CKW_CFG_REAS_TYPE_MIS      -  Logical channel type mismatch with mode\n
287  * CKW_CFG_REAS_ENT_UNKWN     -  Reconfigure request for an unknown RLC entity\n
288
289  * @param[in] pst       -  Point to the pst structure.
290  * @param[in] transId   -  Transaction ID. This field will uniquily identifies
291  * transaction between RRC and RLC.
292  * @param[in] cfmInfo   -  This structure contains the configuration confirm
293  * information.
294  * @return ROK
295  */
296 S16 RlcUiRlcCfgCfm ARGS((Pst *pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
297
298 /**
299  *@details This primitive is used by RRC to change the UeId for the existing UE
300            context.
301
302  * @param[in] pst       -  Point to the pst structure
303  * @param[in] spId      -  The ID of the service provider SAP in the RLC layer. 
304  * @param[in] transId   -  Transaction ID. This field uniquily identifies
305  *                         transaction between RRC and RLC.
306  * @param[in] ueInfo    -  Old UE Id Info for which the change request has come. 
307  * @param[in] newUeInfo -  New UE Id Info for existing UE context. 
308  * @return ROK
309  */
310 S16 RlcUiCkwUeIdChgReq ARGS((Pst *pst, SpId spId, uint32_t transId,
311                                    CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
312
313 /**
314  *@details This primitive is used by RLC to confirm the UeId change requested
315  by RRC.
316
317  * The different values for status are:\n
318  * CKW_CFG_CFM_OK    -  Success\n
319  * CKW_CFG_CFM_NOK   -  Failure\n
320
321  * The different reasons for the failure are:\n
322  * CKW_CFG_REAS_UE_CREAT_FAIL -  UE Cb update failure \n
323  * CKW_CFG_REAS_UE_UNKWN      -  Request received for an unknown UE Id 
324
325  * @param[in] pst       -  Point to the pst structure.
326  * @param[in] suId      -  The ID of the service user SAP associated with RLC
327  * @param[in] transId   -  Transaction ID. This field uniquily identifies
328  *                         transaction between RRC and RLC.
329  * @param[in] ueInfo    -  UE Identity which is changed with the new Id for the same
330  *                         context.
331  * @param[in] CmStatus  -  Confirmation status with appropriate reason.
332  * information.
333  * @return ROK
334  */
335 S16 RlcUiCkwUeIdChgCfm  ARGS((Pst *pst, SuId suId, uint32_t transId, 
336                                    CkwUeInfo *ueInfo, CmStatus status));
337
338 /* RRC Extern declarations */
339 #ifdef NH
340 S16 NhLiCkwBndReq ARGS((
341          Pst *pst,
342          SuId suId,
343          SpId spId));
344
345 S16 NhLiCkwUbndReq ARGS((
346          Pst *pst,
347          SpId spId,
348          Reason reason));
349
350 S16 NhLiCkwBndCfm ARGS((Pst *pst,
351          SuId suId,
352          uint8_t status));
353
354 S16 NhLiRlcCfgReq ARGS((
355          Pst *pst,
356          SpId spId,
357          RlcCfgInfo *cfgInfo));
358
359 S16 NhLiRlcCfgCfm ARGS((Pst *pst,
360          SuId suId,
361          RlcCfgCfmInfo* cfmInfo));
362
363 S16 NhLiCkwUeIdChgReq ARGS((Pst *pst, 
364          SpId spId, uint32_t transId,
365          CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
366
367 S16 NhLiCkwUeIdChgCfm  ARGS((Pst *pst, 
368          SuId suId, uint32_t transId, 
369          CkwUeInfo *ueInfo, CmStatus status));
370
371 #endif /* NH */
372
373 /* Dummy RRC Interface primitives */
374 #ifdef DM
375 S16 DmUiCkwBndReq ARGS((
376          Pst *pst,
377          SuId suId,
378          SpId spId));
379
380 S16 DmUiCkwUbndReq ARGS((
381          Pst *pst,
382          SpId spId,
383          Reason reason));
384
385 S16 DmUiCkwBndCfm ARGS((Pst *pst,
386          SuId suId,
387          uint8_t status));
388
389 S16 DmUiRlcCfgReq ARGS((
390          Pst *pst,
391          SpId spId,
392          RlcCfgInfo *cfgInfo));
393
394 S16 DmUiRlcCfgCfm ARGS((Pst *pst,
395          SuId suId,
396          RlcCfgCfmInfo* cfmInfo));
397
398 S16 DmUiCkwUeIdChgReq ARGS((Pst *pst, 
399          SpId spId, uint32_t transId,
400          CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
401
402 S16 DmUiCkwUeIdChgCfm  ARGS((Pst *pst, 
403          SuId suId, uint32_t transId, 
404          CkwUeInfo *ueInfo, CmStatus status));
405
406 #endif /* DM */
407
408 /*****************************************************************************
409  *                      PACK/UNPACK FUNCTIONS
410  ****************************************************************************/
411 #ifdef LCCKW
412 /* Packing functions */
413 S16 cmPkRlcTmInfo ARGS ((
414 RlcTmInfo      *param,
415 Buffer         *mBuf
416 ));
417
418 S16 cmPkRlcUmInfo ARGS ((
419 RlcEntCfgInfo  *param,
420 Buffer         *mBuf
421 ));
422
423 S16 cmPkRlcAmInfo ARGS ((
424 RlcAmInfo      *param,
425 Buffer         *mBuf
426 ));
427
428 S16 cmPkCkwLChInfo ARGS ((
429 CkwLChInfo     *param,
430 Buffer         *mBuf
431 ));
432
433 S16 cmPkRlcEntCfgInfo ARGS ((
434 RlcEntCfgInfo  *param,
435 Buffer         *mBuf
436 ));
437
438 S16 cmPkRlcCfgInfo ARGS ((
439 RlcCfgInfo     *param,
440 Pst            *pst,
441 Buffer         *mBuf
442 ));
443
444 S16 cmPkRlcEntCfgCfmInfo ARGS ((
445 RlcEntCfgCfmInfo  *param,
446 Buffer            *mBuf
447 ));
448
449 S16 cmPkRlcCfgCfmInfo ARGS ((
450 RlcCfgCfmInfo  *param,
451 Pst            *pst,
452 Buffer         *mBuf
453 ));
454
455 S16 cmPkCkwUeInfo ARGS ((
456 CkwUeInfo *param,
457 Buffer    *mBuf
458 ));
459
460 S16 cmPkCkwBndReq ARGS ((
461 Pst *pst,
462 SuId suId,
463 SpId spId
464 ));
465
466 S16 cmPkCkwUbndReq ARGS ((
467 Pst *pst,
468 SpId spId,
469 Reason reason
470 ));
471
472 S16 cmPkCkwBndCfm ARGS ((
473 Pst *pst,
474 SuId suId,
475 uint8_t status
476 ));
477
478 S16 packUeCreateReq ARGS ((
479 Pst               *pst,
480 RlcCfgInfo        *cfgInfo
481 ));
482
483 S16 cmPkRlcCfgCfm ARGS ((
484 Pst               *pst,
485 SuId              suId,
486 RlcCfgCfmInfo     *cfgCfmInfo
487 ));
488
489 S16 cmPkCkwUeIdChgReq ARGS ((
490 Pst                *pst, 
491 SpId               spId, 
492 uint32_t                transId,
493 CkwUeInfo          *ueInfo,
494 CkwUeInfo          *newUeInfo
495 ));
496
497 S16 cmPkCkwUeIdChgCfm  ARGS ((
498 Pst                *pst, 
499 SuId               suId, 
500 uint32_t                transId, 
501 CkwUeInfo          *ueInfo, 
502 CmStatus           status
503 ));
504
505 /* Unpacking functions */
506 S16 cmUnpkRlcTmInfo ARGS ((
507 RlcTmInfo      *param,
508 Buffer         *mBuf
509 ));
510
511 S16 cmUnpkRlcUmInfo ARGS ((
512 RlcEntCfgInfo  *param,
513 Buffer         *mBuf
514 ));
515
516 S16 cmUnpkRlcAmInfo ARGS ((
517 RlcAmInfo      *param,
518 Buffer         *mBuf
519 ));
520
521 S16 cmUnpkCkwLInfo ARGS ((
522 CkwLChInfo     *param,
523 Buffer         *mBuf
524 ));
525
526 S16 cmUnpkRlcCfgCfmInfo ARGS ((
527 RlcCfgCfmInfo  *param,
528 Pst            *pst,
529 Buffer         *mBuf
530 ));
531
532 S16 cmUnpkCkwBndReq ARGS ((
533 CkwBndReq      func,
534 Pst            *pst,
535 Buffer         *mBuf
536 ));
537
538 S16 cmUnpkCkwLChInfo ARGS ((
539 CkwLChInfo     *param,
540 Buffer         *mBuf
541 ));
542
543 S16 cmUnpkRlcEntCfgInfo ARGS ((
544 RlcEntCfgInfo  *param,
545 Buffer         *mBuf
546 ));
547
548 S16 cmUnpkRlcCfgInfo ARGS ((
549 RlcCfgInfo     *param,
550 Pst            *pst,
551 Buffer         *mBuf
552 ));
553
554 S16 cmUnpkCkwUeInfo ARGS ((
555 CkwUeInfo      *param,
556 Buffer         *mBuf
557 ));
558
559 S16 cmUnpkRlcCfgCfm ARGS ((
560 RlcCfgCfm         func,
561 Pst               *pst,
562 Buffer            *mBuf
563 ));
564
565 S16 cmUnpkCkwUbndReq ARGS ((
566 CkwUbndReq     func,
567 Pst            *pst,
568 Buffer         *mBuf
569 ));
570
571 S16 cmUnpkCkwBndCfm ARGS ((
572 CkwBndCfm      func,
573 Pst            *pst,
574 Buffer         *mBuf
575 ));
576
577 S16 unpackUeCreateReq ARGS ((
578 RlcCfgReq         func,
579 Pst               *pst,
580 Buffer            *mBuf
581 ));
582
583 S16 cmUnpkRlcEntCfgCfmInfo ARGS ((
584 RlcEntCfgCfmInfo  *param,
585 Buffer            *mBuf
586 ));
587
588 S16 cmUnpkCkwUeIdChgReq ARGS ((
589 CkwUeIdChgReq      func,
590 Pst                *pst, 
591 Buffer             *mBuf
592 ));
593
594 S16 cmUnpkCkwUeIdChgCfm  ARGS ((
595 CkwUeIdChgCfm      func,
596 Pst                *pst, 
597 Buffer             *mBuf
598 ));
599 #endif /* LCCKW */
600 #ifdef __cplusplus
601 }
602 #endif /* __cplusplus */
603 #endif /* __CKW_X__ */
604
605
606 \f  
607 /********************************************************************30**
608          End of file
609 **********************************************************************/