6d695887d867989fdb55b504d0fec70deda0759a
[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    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    uint8_t                   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       RlcUmInfo         umInfo;              /*!< Un-acknowledged Mode Information */
142       RlcAmInfo         amInfo;              /*!< Acknowledged Mode Information */
143       RlcTmInfo         tmInfo;              /*!< Transparent Mode Information */
144    }m;
145 }RlcEntCfgInfo;
146
147 /** @brief
148    Configuration Information from RRC to RLC */
149 typedef struct rlcCfgInfo
150 {
151    uint32_t                  transId;             /*!< Transaction Id */
152    CmLteRnti            ueId;                /*!< UE ID */
153    CmLteCellId          cellId;              /*!< Cell ID */
154    uint8_t                   numEnt;              /*!< Number of entities to
155                                                configure */
156    RlcEntCfgInfo        entCfg[CKW_MAX_ENT_CFG];  /*!< Array of Entities to be
157                                               configure */
158 }RlcCfgInfo;
159
160 /** @brief
161    Entity Configuration Confirmation Information */
162 typedef struct rlcEntCfgCfmInfo
163 {
164    uint8_t                   rbId;                /*!< rb ID */
165    uint8_t                   rbType;              /*!< RB type - can be SRB or DRB */
166    CmStatus             status;              /*!< Status of the confirmation */
167 }RlcEntCfgCfmInfo;
168
169 /** @brief
170    Configuration Confirmation Informatin RLC to RRC */
171 typedef struct rlcCfgCfmInfo
172 {
173    uint32_t                  transId;             /*!< Transaction Id */
174    CmLteRnti            ueId;                /*!< UE ID */
175    CmLteCellId          cellId;              /*!< Cell ID */
176    uint8_t                   numEnt;              /*!< Number of entities configured */
177    RlcEntCfgCfmInfo     entCfgCfm[CKW_MAX_ENT_CFG];   /*!< Array of Entity cfg
178                                                          confiramations */
179 }RlcCfgCfmInfo;
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 (*RlcCfgReq)     ARGS((Pst *pst, RlcCfgInfo *cfgInfo));
192 typedef S16 (*RlcCfgCfm)     ARGS((Pst *pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
193
194 typedef S16 (*CkwUeIdChgReq) ARGS((Pst *pst, SpId spId, uint32_t transId, 
195                                    CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
196 typedef S16 (*CkwUeIdChgCfm) ARGS((Pst *pst, SuId suId, uint32_t transId, 
197                                    CkwUeInfo *ueInfo, CmStatus status));
198
199 typedef S16 (*CkwBndReq)     ARGS((Pst *pst, SuId suId, SpId spId));
200 typedef S16 (*CkwBndCfm)     ARGS((Pst *pst, SuId suId, uint8_t status));
201 typedef S16 (*CkwUbndReq)    ARGS((Pst *pst, SpId spId, Reason reason));
202
203 /** 
204  * @details The primitive binds the RLC service user entity to the RLC product.
205  * The RLC service user must bind each CKW SAP individually before sending any
206  * other request. RLC acknowledges the receipt of the bind request by sending
207  * a RlcUiCkwBndCfm primitive.
208
209  * @param[in] pst       -  For the bind request, the event field in the Pst
210  *                         structure is set to EVTCKWBNDREQ
211  * @param[in] suId      -  The ID of the service user SAP associated with the
212  *                         SAP in the RLC layer. The SSAP in the RLC layer is
213  *                         specified by the spId parameter.\n
214  *                         Allowable values: 0 to 32767.
215  * @param[in] spId      -  The ID of the service provider SAP in the RLC layer.\n
216  *                         Allowable values: 0 to 32767.
217  * @return ROK
218  */
219 S16 RlcUiCkwBndReq ARGS((Pst *pst, SuId suId, SpId spId));
220
221 /** 
222  * @details RLC invokes the bind confirm primitive to acknowledge the receipt
223  * of the RlcUiCkwBndReq primitive from the service user. The status field
224  * indicates whether the bind request succeeded or failed. The bind request
225  * may fail due to invalid parameters in the bind request from the
226  * service user (for example, an invalid spId).
227
228  * @param[in] pst       -  For the bind confirm, the event field in the Pst
229  *                         structure is set to EVTCKWBNDCFM
230  * @param[in] suId      -  The ID of the service user SAP specified in the
231  *                         bind request. Allowable
232 values: 0 to 32767.
233  * @param[in] status    -  Indicates the status of the bind request.\n
234 CM_BND_OK: Bind request succeeded\n
235 CM_BND_NOK: Error encountered during the processing of the bind request.
236  * @return ROK
237  */
238 S16 RlcUiCkwBndCfm ARGS((Pst *pst, SuId suId, uint8_t status));
239
240 /** 
241  * @details The RLC service user initiates this primitive for performing
242  * an unbind operation.This primitive brings the link down if it is already up,
243  * and releases all the resources associated for this SAP at RLC.
244
245  * @param[in] pst          -  For the unbind request, the event field in the Pst
246  *                            structure is set to EVTCKWUBNDREQ
247  * @param[in] spId         -  The ID of the service provider SAP in the RLC layer
248  *                            that is to be disassociated from its service
249  *                            user SAP.\n
250  *                            Allowable values: 0 to 32767.
251  * @param[in] reason       -  Reason for the unbind.\n
252  *                            Allowable value: CKW_UBND_REQ.
253  * @return ROK
254  */
255 S16 RlcUiCkwUbndReq ARGS((Pst *pst, SpId spId, Reason reason));
256
257 /* Layer interface Control Primitives */
258 /**
259  *@details This primitive is used by RRC to configure the multiple RLC entities. RRC
260  sends this primitive for the control of the RLC entity.
261
262  * The different configuration allowed by RRC to RLC are:\n
263    CKW_CFG_ADD          -  Configures the new RLC entity\n
264    CKW_CFG_MODIFY       -  Modifies the RLC entity\n
265    CKW_CFG_DELETE       -  Deletes the RLC entity\n
266    CKW_CFG_REESTABLISH  -  Re-establilsh the RLC entity\n
267    CKW_CFG_DELETE_UE    -  Deletes the RLC entities per UE\n
268
269
270  * @param[in] pst       -  Point to the pst structure
271  * @param[in] transId   -  Transaction ID. This field will uniquily identifies
272  *                         transaction between RRC and RLC.
273  * @param[in] cfgInfo   -  This structure contains the configuration information
274  * @return ROK
275  */
276 S16 RlcProcCfgReq ARGS((Pst *pst, RlcCfgInfo *cfgInfo));
277
278 /**
279  *@details This primitive is used by RLC to confirm the configuration requested
280  by RRC.
281
282  * The different values for status are:\n
283  * CKW_CFG_CFM_OK    -  Success\n
284  * CKW_CFG_CFM_NOK   -  Failure\n
285
286  * The different reasons for the failure are:\n
287  * CKW_CFG_REAS_TYPE_MIS      -  Logical channel type mismatch with mode\n
288  * CKW_CFG_REAS_ENT_UNKWN     -  Reconfigure request for an unknown RLC entity\n
289
290  * @param[in] pst       -  Point to the pst structure.
291  * @param[in] transId   -  Transaction ID. This field will uniquily identifies
292  * transaction between RRC and RLC.
293  * @param[in] cfmInfo   -  This structure contains the configuration confirm
294  * information.
295  * @return ROK
296  */
297 S16 RlcUiRlcCfgCfm ARGS((Pst *pst, SuId suId, RlcCfgCfmInfo *cfmInfo));
298
299 /**
300  *@details This primitive is used by RRC to change the UeId for the existing UE
301            context.
302
303  * @param[in] pst       -  Point to the pst structure
304  * @param[in] spId      -  The ID of the service provider SAP in the RLC layer. 
305  * @param[in] transId   -  Transaction ID. This field uniquily identifies
306  *                         transaction between RRC and RLC.
307  * @param[in] ueInfo    -  Old UE Id Info for which the change request has come. 
308  * @param[in] newUeInfo -  New UE Id Info for existing UE context. 
309  * @return ROK
310  */
311 S16 RlcUiCkwUeIdChgReq ARGS((Pst *pst, SpId spId, uint32_t transId,
312                                    CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
313
314 /**
315  *@details This primitive is used by RLC to confirm the UeId change requested
316  by RRC.
317
318  * The different values for status are:\n
319  * CKW_CFG_CFM_OK    -  Success\n
320  * CKW_CFG_CFM_NOK   -  Failure\n
321
322  * The different reasons for the failure are:\n
323  * CKW_CFG_REAS_UE_CREAT_FAIL -  UE Cb update failure \n
324  * CKW_CFG_REAS_UE_UNKWN      -  Request received for an unknown UE Id 
325
326  * @param[in] pst       -  Point to the pst structure.
327  * @param[in] suId      -  The ID of the service user SAP associated with RLC
328  * @param[in] transId   -  Transaction ID. This field uniquily identifies
329  *                         transaction between RRC and RLC.
330  * @param[in] ueInfo    -  UE Identity which is changed with the new Id for the same
331  *                         context.
332  * @param[in] CmStatus  -  Confirmation status with appropriate reason.
333  * information.
334  * @return ROK
335  */
336 S16 RlcUiCkwUeIdChgCfm  ARGS((Pst *pst, SuId suId, uint32_t transId, 
337                                    CkwUeInfo *ueInfo, CmStatus status));
338
339 /* RRC Extern declarations */
340 #ifdef NH
341 S16 NhLiCkwBndReq ARGS((
342          Pst *pst,
343          SuId suId,
344          SpId spId));
345
346 S16 NhLiCkwUbndReq ARGS((
347          Pst *pst,
348          SpId spId,
349          Reason reason));
350
351 S16 NhLiCkwBndCfm ARGS((Pst *pst,
352          SuId suId,
353          uint8_t status));
354
355 S16 NhLiRlcCfgReq ARGS((
356          Pst *pst,
357          SpId spId,
358          RlcCfgInfo *cfgInfo));
359
360 S16 NhLiRlcCfgCfm ARGS((Pst *pst,
361          SuId suId,
362          RlcCfgCfmInfo* cfmInfo));
363
364 S16 NhLiCkwUeIdChgReq ARGS((Pst *pst, 
365          SpId spId, uint32_t transId,
366          CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
367
368 S16 NhLiCkwUeIdChgCfm  ARGS((Pst *pst, 
369          SuId suId, uint32_t transId, 
370          CkwUeInfo *ueInfo, CmStatus status));
371
372 #endif /* NH */
373
374 /* Dummy RRC Interface primitives */
375 #ifdef DM
376 S16 DmUiCkwBndReq ARGS((
377          Pst *pst,
378          SuId suId,
379          SpId spId));
380
381 S16 DmUiCkwUbndReq ARGS((
382          Pst *pst,
383          SpId spId,
384          Reason reason));
385
386 S16 DmUiCkwBndCfm ARGS((Pst *pst,
387          SuId suId,
388          uint8_t status));
389
390 S16 DmUiRlcCfgReq ARGS((
391          Pst *pst,
392          SpId spId,
393          RlcCfgInfo *cfgInfo));
394
395 S16 DmUiRlcCfgCfm ARGS((Pst *pst,
396          SuId suId,
397          RlcCfgCfmInfo* cfmInfo));
398
399 S16 DmUiCkwUeIdChgReq ARGS((Pst *pst, 
400          SpId spId, uint32_t transId,
401          CkwUeInfo *ueInfo, CkwUeInfo *newUeInfo));
402
403 S16 DmUiCkwUeIdChgCfm  ARGS((Pst *pst, 
404          SuId suId, uint32_t transId, 
405          CkwUeInfo *ueInfo, CmStatus status));
406
407 #endif /* DM */
408
409 /*****************************************************************************
410  *                      PACK/UNPACK FUNCTIONS
411  ****************************************************************************/
412 #ifdef LCCKW
413 /* Packing functions */
414 S16 cmPkRlcTmInfo ARGS ((
415 RlcTmInfo      *param,
416 Buffer         *mBuf
417 ));
418
419 S16 cmPkRlcUmInfo ARGS ((
420 RlcEntCfgInfo  *param,
421 Buffer         *mBuf
422 ));
423
424 S16 cmPkRlcAmInfo ARGS ((
425 RlcAmInfo      *param,
426 Buffer         *mBuf
427 ));
428
429 S16 cmPkCkwLChInfo ARGS ((
430 CkwLChInfo     *param,
431 Buffer         *mBuf
432 ));
433
434 S16 cmPkRlcEntCfgInfo ARGS ((
435 RlcEntCfgInfo  *param,
436 Buffer         *mBuf
437 ));
438
439 S16 cmPkRlcCfgInfo ARGS ((
440 RlcCfgInfo     *param,
441 Pst            *pst,
442 Buffer         *mBuf
443 ));
444
445 S16 cmPkRlcEntCfgCfmInfo ARGS ((
446 RlcEntCfgCfmInfo  *param,
447 Buffer            *mBuf
448 ));
449
450 S16 cmPkRlcCfgCfmInfo ARGS ((
451 RlcCfgCfmInfo  *param,
452 Pst            *pst,
453 Buffer         *mBuf
454 ));
455
456 S16 cmPkCkwUeInfo ARGS ((
457 CkwUeInfo *param,
458 Buffer    *mBuf
459 ));
460
461 S16 cmPkCkwBndReq ARGS ((
462 Pst *pst,
463 SuId suId,
464 SpId spId
465 ));
466
467 S16 cmPkCkwUbndReq ARGS ((
468 Pst *pst,
469 SpId spId,
470 Reason reason
471 ));
472
473 S16 cmPkCkwBndCfm ARGS ((
474 Pst *pst,
475 SuId suId,
476 uint8_t status
477 ));
478
479 S16 packUeCreateReq ARGS ((
480 Pst               *pst,
481 RlcCfgInfo        *cfgInfo
482 ));
483
484 S16 cmPkRlcCfgCfm ARGS ((
485 Pst               *pst,
486 SuId              suId,
487 RlcCfgCfmInfo     *cfgCfmInfo
488 ));
489
490 S16 cmPkCkwUeIdChgReq ARGS ((
491 Pst                *pst, 
492 SpId               spId, 
493 uint32_t                transId,
494 CkwUeInfo          *ueInfo,
495 CkwUeInfo          *newUeInfo
496 ));
497
498 S16 cmPkCkwUeIdChgCfm  ARGS ((
499 Pst                *pst, 
500 SuId               suId, 
501 uint32_t                transId, 
502 CkwUeInfo          *ueInfo, 
503 CmStatus           status
504 ));
505
506 /* Unpacking functions */
507 S16 cmUnpkRlcTmInfo ARGS ((
508 RlcTmInfo      *param,
509 Buffer         *mBuf
510 ));
511
512 S16 cmUnpkRlcUmInfo ARGS ((
513 RlcEntCfgInfo  *param,
514 Buffer         *mBuf
515 ));
516
517 S16 cmUnpkRlcAmInfo ARGS ((
518 RlcAmInfo      *param,
519 Buffer         *mBuf
520 ));
521
522 S16 cmUnpkCkwLInfo ARGS ((
523 CkwLChInfo     *param,
524 Buffer         *mBuf
525 ));
526
527 S16 cmUnpkRlcCfgCfmInfo ARGS ((
528 RlcCfgCfmInfo  *param,
529 Pst            *pst,
530 Buffer         *mBuf
531 ));
532
533 S16 cmUnpkCkwBndReq ARGS ((
534 CkwBndReq      func,
535 Pst            *pst,
536 Buffer         *mBuf
537 ));
538
539 S16 cmUnpkCkwLChInfo ARGS ((
540 CkwLChInfo     *param,
541 Buffer         *mBuf
542 ));
543
544 S16 cmUnpkRlcEntCfgInfo ARGS ((
545 RlcEntCfgInfo  *param,
546 Buffer         *mBuf
547 ));
548
549 S16 cmUnpkRlcCfgInfo ARGS ((
550 RlcCfgInfo     *param,
551 Pst            *pst,
552 Buffer         *mBuf
553 ));
554
555 S16 cmUnpkCkwUeInfo ARGS ((
556 CkwUeInfo      *param,
557 Buffer         *mBuf
558 ));
559
560 S16 cmUnpkRlcCfgCfm ARGS ((
561 RlcCfgCfm         func,
562 Pst               *pst,
563 Buffer            *mBuf
564 ));
565
566 S16 cmUnpkCkwUbndReq ARGS ((
567 CkwUbndReq     func,
568 Pst            *pst,
569 Buffer         *mBuf
570 ));
571
572 S16 cmUnpkCkwBndCfm ARGS ((
573 CkwBndCfm      func,
574 Pst            *pst,
575 Buffer         *mBuf
576 ));
577
578 S16 unpackUeCreateReq ARGS ((
579 RlcCfgReq         func,
580 Pst               *pst,
581 Buffer            *mBuf
582 ));
583
584 S16 cmUnpkRlcEntCfgCfmInfo ARGS ((
585 RlcEntCfgCfmInfo  *param,
586 Buffer            *mBuf
587 ));
588
589 S16 cmUnpkCkwUeIdChgReq ARGS ((
590 CkwUeIdChgReq      func,
591 Pst                *pst, 
592 Buffer             *mBuf
593 ));
594
595 S16 cmUnpkCkwUeIdChgCfm  ARGS ((
596 CkwUeIdChgCfm      func,
597 Pst                *pst, 
598 Buffer             *mBuf
599 ));
600 #endif /* LCCKW */
601 #ifdef __cplusplus
602 }
603 #endif /* __cplusplus */
604 #endif /* __CKW_X__ */
605
606
607 \f  
608 /********************************************************************30**
609          End of file
610 **********************************************************************/