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