1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /********************************************************************20**
21 Name: KWU user interface
25 Desc: This file Contains the Data structures and prototypes
30 *********************************************************************21*/
37 #endif /*for extern "C"*/
40 @brief KWU Interface File (kwu.x)
43 /***********************************************************************
44 KWU typedefs and data structures
45 ***********************************************************************/
47 /** @brief Data Request Information from RRC or PDCP to RLC */
48 typedef struct kwuDatReqInfo
50 CmLteRlcId rlcId; /*!< RLC ID */
51 U32 sduId; /*!< SDU ID */
53 CmLteLcType lcType; /*!<Logical Channel Type */
55 U8 emtcDiReason; /* !< DI reason */
56 U8 pnb; /*!<paging narrowBand on which Ue perform Paging Reception*/
60 CmLteTimingInfo tmg; /*!< Timing for BCCH/PCCH */
61 CmLteRnti rnti; /*!< Temporary CRNTI:Applicable for CCCH. */
62 }tm; /*!< TM mode data */
66 /** @brief Data Indication Information from RLC to RRC or PDCP */
67 typedef struct kwuDatIndInfo
69 CmLteRlcId rlcId; /*!< RLC ID */
71 CmLteRnti tCrnti; /*!< Temporary C-RNTI for UL-CCCH */
73 Bool isOutOfSeq; /*!< To indicate whether this packet is in-sequence or not */
76 /** @brief Data Confirmation Information from RLC to PDCP
77 This primitive will be sent on successful sdu delivery */
78 typedef struct kwuDatCfmInfo
80 CmLteRlcId rlcId; /*!< RLC ID */
81 U32 numSduIds; /*!< Number of Id's in the sudIds array */
82 U32 sduIds[KWU_MAX_DAT_CFM]; /*!< SDU Ids */
85 /** @brief Discard SDU Request Information from PDCP to RLC */
86 typedef KwuDatCfmInfo KwuDiscSduInfo;
88 /** @brief SDU Retransmission Threshold reached from RLC to PDCP */
89 typedef struct kwuStaIndInfo
91 CmLteRlcId rlcId; /*!< RLC ID */
92 U32 numSdu; /*!< Number of SDUs */
93 U32 sduId[KWU_MAX_STA_IND_SDU]; /*!< SDU Id Array */
96 typedef struct kwuFlowCntrlIndInfo
100 }KwuFlowCntrlIndInfo;
101 /* kwu_x_001.main_3 Added support for L2 Measurement */
103 /** @brief Data ACK from RLC to PDCP */
104 typedef struct kwuDatAckInfo
106 CmLteRlcId rlcId; /*!< RLC ID */
107 U32 sduId; /*!< SDU Id Array */
109 #endif /* LTE_L2_MEAS */
111 #if defined(PDCP_RLC_DL_RBUF) || defined(SS_RBUF)
112 typedef struct kwuDatReqDetl
123 /* Control primitives towards LTE RRC */
124 typedef S16 (*KwuBndReq) ARGS((Pst *pst, SuId suId, SpId spId));
125 typedef S16 (*KwuBndCfm) ARGS((Pst *pst, SuId suId, U8 status));
126 typedef S16 (*KwuUbndReq) ARGS((Pst *pst, SuId suId, Reason reason));
128 typedef S16 (*KwuDatReq) ARGS((Pst *pst, KwuDatReqInfo* datReq, Buffer *mBuf));
129 typedef S16 (*KwuDatInd) ARGS((Pst *pst, KwuDatIndInfo* datInd,
131 typedef S16 (*KwuDatCfm) ARGS((Pst *pst, SuId suId, KwuDatCfmInfo* datCfm));
132 typedef S16 (*KwuDiscSduReq) ARGS((Pst *pst, SpId spId, KwuDiscSduInfo* discSdu));
133 typedef S16 (*KwuStaInd) ARGS((Pst *pst, SuId suId, KwuStaIndInfo* staInd));
134 typedef S16 (*KwuFlowCntrlInd)ARGS((Pst *pst, SuId suId, KwuFlowCntrlIndInfo* flowCntrlInd));
135 typedef S16 (*KwuReEstCmpInd) ARGS((Pst *pst, SuId suId, CmLteRlcId rlcId));
137 /* kwu_x_001.main_3 Added support for L2 Measurement */
139 typedef S16 (*KwuDatAckInd) ARGS((Pst *pst, SuId suId, KwuDatAckInfo *ackInfo));
140 #endif /* LTE_L2_MEAS */
141 typedef S16 (*KwuDiscSduCfm) ARGS((Pst *pst, SuId suId, KwuDiscSduInfo *discCfmInfo));
144 * @details This primitive binds the RLC service user entity to the RLC product.
145 * The RLC service user must bind each KWU SAP individually before sending any
146 * other request. RLC acknowledges the receipt of the bind request by sending
147 * a KwUiKwuBndCfm primitive.
149 * @param[in] pst - For the bind request, the event field in the Pst structure is set to
151 * @param[in] suId - The ID of the service user SAP associated with the SAP in the RLC
152 layer. The SSAP in the RLC layer is specified by the spId parameter.
153 Allowable values: 0 to 32767.
154 * @param[in] spId - The ID of the service provider SAP in the RLC layer. Allowable values: 0 to 32767.
159 EXTERN S16 KwUiKwuBndReq ARGS((Pst *pst,
164 * @details RLC invokes the bind confirm primitive to acknowledge the receipt
165 * of the KwUiKwuBndReq primitive from the service user. The status field
166 * indicates whether the bind request succeeded or failed. The bind request
167 * may fail due to invalid parameters in the bind request from the
168 * service user (for example, an invalid spId).
170 * @param[in] pst - For the bind confirm, the event field in the Pst structure is set to
172 * @param[in] suId - The ID of the service user SAP specified in the bind request. Allowable
174 * @param[in] status - Indicates the status of the bind request.\n
175 CM_BND_OK: Bind request succeeded\n
176 CM_BND_NOK: Error encountered during the processing of the bind request.
181 EXTERN S16 KwUiKwuBndCfm ARGS((Pst *pst,
186 * @details The RLC service user initiates this primitive for performing
187 * an unbind operation.This primitive brings the link down if it is already up,
188 * and releases all the resources associated for this SAP at RLC.
190 * @param[in] pst - For the unbind request, the event field in the Pst structure is set to
192 * @param[in] spId - The ID of the service provider SAP in the RLC layer that is to be
193 disassociated from its service user SAP. Allowable values: 0 to 32767.
194 * @param[in] reason - Reason for the unbind. Allowable value: KWU_UBND_REQ.
199 EXTERN S16 KwUiKwuUbndReq ARGS((Pst *pst,
204 *@details This primitive is used by RRC to transfer the SDU data to the RLC.
205 RLC will send the data to logical channels in the form of PDUs by assembling
206 [concatenating/segmenting/retransmission (in case of AM), concatenating if
207 required (in case of UM)] SDUs received from the service user (RRC/PDCP).
209 * @param[in] pst - Pointer to the pst structure
210 * @param[in] spId - Service provider ID
211 * @param[in] datReq - Data request parameter
212 * @param[in] buf - RLC SDU
217 EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst,
218 KwuDatReqInfo* datReq,
222 *@details This primitive is used by RLC to transfer the SDU data to the service
223 user (RRC/PDCP) recieved from the peer RLC. RLC will send the data to service
224 user (RRC/PDCP) by reassembling the PDUs recieved from the peer RLC.
226 * @param pst - Pointer to the pst structure
227 * @param suId - Service user ID
228 * @param datInd - Data indication parameter
229 * @param buf - RLC SDU
234 EXTERN S16 KwUiKwuDatInd ARGS((Pst *pst,
235 KwuDatIndInfo* datInd,
239 *@details This primitive is used by RLC as the confirmation for the KwUiKwuDatReq
240 to the service user (RLC/PDCP). It is used only in AM mode data transfers for
243 * @param[in] pst - Pointer to the pst structure
244 * @param[in] suId - Service user ID
245 * @param[in] datCfm - Data confirmation parameter
250 EXTERN S16 KwUiKwuDatCfm ARGS((Pst *pst,
252 KwuDatCfmInfo* datCfm));
255 *@details This primitive is used by PDCP to discard the particular SDU to RLC.
256 It is used only in AM mode data transfers for RLC. RLC discards this SDU
257 if no segment of the RLC SDU has been mapped to a RLC data PDU yet.
259 * @param[in] pst - Pointer to the pst structure
260 * @param[in] spId - Service provider ID
261 * @param[in] discSdu - Discard SDU parameter
266 EXTERN S16 KwUiKwuDiscSduReq ARGS((Pst *pst,
268 KwuDiscSduInfo* discSdu));
271 *@details This primitive is used by RRC to discard the particular SDU to RLC.
272 It is used only in AM mode data transfers for RLC. RLC discards this SDU
273 if no segment of the RLC SDU has been mapped to a RLC data PDU yet.
275 * @param[in] pst - Pointer to the pst structure
276 * @param[in] suId - Service provider ID
277 * @param[in] rlcId - RLC ID
282 EXTERN S16 KwUiKwuStaInd ARGS((Pst *pst,
284 KwuStaIndInfo* staInd));
286 /* kwu_x_001.main_3 Added support for L2 Measurement */
288 *@details This primitive is used by RLC to confirm the positive discard
289 of a particular SDU to PDCP.
291 * @param[in] pst - Pointer to the pst structure
292 * @param[in] spId - Service provider ID
293 * @param[in] discCfmSdu - Discard Cfm SDU parameter
298 EXTERN S16 KwUiKwuDiscSduCfm ARGS((Pst *pst,
300 KwuDiscSduInfo* discCfmSdu));
303 *@details This primitive is used by RLC to indicate to PDCP if packets
304 * need to be dropped/restarted for a particular RB
306 * @param[in] pst - Pointer to the pst structure
307 * @param[in] suId - Service user ID
308 * @param[in] flowCntrlIndInfo - Flow control information
313 EXTERN S16 KwUiKwuFlowCntrlInd ARGS((Pst *pst,
315 KwuFlowCntrlIndInfo* flowCntrlIndInfo));
318 *@details This primitive is used by RLC to inform PDCP of the sucessful
319 reception of a particular data message at the peer side. This confirms
320 only positive acknowlegements at the peer side .
322 * @param[in] pst - Pointer to the pst structure
323 * @param[in] suId - Service provider ID
324 * @param[in] ackInd - Data Ack Indication parameter
329 EXTERN S16 KwUiKwuDatAckInd ARGS((Pst *pst,
331 KwuDatAckInfo* ackInd));
332 #endif /* LTE_L2_MEAS */
334 EXTERN S16 KwUiKwuReEstCmpInd ARGS((Pst *pst,
339 /* RRC Extern Declarations */
341 EXTERN S16 NhLiKwuBndReq ARGS((Pst *pst,
345 EXTERN S16 NhLiKwuBndCfm ARGS((Pst *pst,
349 EXTERN S16 NhLiKwuUbndReq ARGS((Pst *pst,
353 EXTERN S16 NhLiKwuDatReq ARGS((Pst *pst,
355 KwuDatReqInfo* datReq,
358 EXTERN S16 NhLiKwuDatInd ARGS((Pst *pst,
359 KwuDatIndInfo* datInd,
363 /* Dummy RRC Interface primitives */
365 EXTERN S16 DmUiKwuBndReq ARGS((Pst *pst,
369 EXTERN S16 DmUiKwuBndCfm ARGS((Pst *pst,
373 EXTERN S16 DmUiKwuUbndReq ARGS((Pst *pst,
377 EXTERN S16 DmUiKwuDatReq ARGS((Pst *pst,
379 KwuDatReqInfo* datReq,
382 EXTERN S16 DmUiKwuDatInd ARGS((Pst *pst,
384 KwuDatIndInfo* datInd,
387 EXTERN S16 DmUiKwuReEstCmpInd ARGS((Pst *pst,
388 SuId suId, CmLteRlcId rlcId));
392 /* PDCP Extern Declarations */
394 EXTERN S16 PjLiKwuBndReq ARGS((Pst *pst,
398 EXTERN S16 PjLiKwuBndCfm ARGS((Pst *pst,
402 EXTERN S16 PjLiKwuUbndReq ARGS((Pst *pst,
406 EXTERN S16 PjLiKwuDatReq ARGS((Pst *pst,
408 KwuDatReqInfo* datReq,
411 EXTERN S16 PjLiKwuDatInd ARGS((Pst *pst,
412 KwuDatIndInfo* datInd,
415 EXTERN S16 PjLiKwuDatCfm ARGS((Pst *pst,
417 KwuDatCfmInfo* datCfm));
419 EXTERN S16 PjLiKwuStaInd ARGS((Pst *pst,
421 KwuStaIndInfo* staInd));
423 EXTERN S16 PjLiKwuDiscSduReq ARGS((Pst *pst,
425 KwuDiscSduInfo* discSdu));
428 EXTERN S16 PjLiKwuReEstCmpInd ARGS((Pst *pst,
429 SuId suId, CmLteRlcId rlcId));
431 /* kwu_x_001.main_3 Added support for L2 Measurement */
432 EXTERN S16 PjLiKwuDiscSduCfm ARGS((Pst *pst,
434 KwuDiscSduInfo* discCfmSdu));
435 EXTERN S16 PjLiKwuFlowCntrlInd ARGS((Pst *pst,
437 KwuFlowCntrlIndInfo *flowCntrlInfo));
439 EXTERN S16 PjLiKwuDatAckInd ARGS((Pst *pst,
441 KwuDatAckInfo* ackInd));
442 #endif /* LTE_L2_MEAS */
445 #ifdef MAC_RLC_UL_RBUF
446 EXTERN S16 kwUlBatchProc ARGS((Void));
448 /*****************************************************************************
449 * PACK/UNPACK FUNCTIONS
450 ****************************************************************************/
452 /* Packing Functions */
453 EXTERN S16 cmPkKwuDatReqInfo ARGS ((
454 KwuDatReqInfo *param,
458 EXTERN S16 cmPkKwuDatIndInfo ARGS ((
459 KwuDatIndInfo *param,
463 EXTERN S16 cmPkKwuDatCfmInfo ARGS ((
464 KwuDatCfmInfo *param,
468 EXTERN S16 cmPkKwuStaIndInfo ARGS ((
469 KwuStaIndInfo *param,
473 EXTERN S16 cmPkKwuBndReq ARGS ((
479 EXTERN S16 cmPkKwuUbndReq ARGS ((
485 EXTERN S16 cmPkKwuBndCfm ARGS ((
491 EXTERN S16 cmPkKwuDatReq ARGS ((
493 KwuDatReqInfo* datReq,
497 EXTERN S16 cmPkKwuDatInd ARGS ((
499 KwuDatIndInfo* datInd,
503 EXTERN S16 cmPkKwuDatCfm ARGS ((
506 KwuDatCfmInfo* datCfm
509 EXTERN S16 cmPkKwuStaInd ARGS ((
512 KwuStaIndInfo* staInd
515 EXTERN S16 cmPkKwuReEstCmpInd ARGS ((
521 EXTERN S16 cmPkKwuDiscSduReq ARGS ((
524 KwuDiscSduInfo* discSdu
527 /* kwu_x_001.main_3 Added support for L2 Measurement */
529 EXTERN S16 cmPkKwuDatAckInfo ARGS ((
530 KwuDatAckInfo* datAckInd,
534 EXTERN S16 cmPkKwuDatAckInd ARGS ((
537 KwuDatAckInfo* ackInfo
539 #endif /* LTE_L2_MEAS */
541 EXTERN S16 cmPkKwuDiscSduCfm ARGS ((
544 KwuDiscSduInfo* cfmSdu
547 EXTERN S16 cmPkKwuFlowCntrlInd ARGS ((
550 KwuFlowCntrlIndInfo *flowCntrlIndInfo
553 /* Unpacking Functions */
554 EXTERN S16 cmUnpkKwuDatReqInfo ARGS ((
555 KwuDatReqInfo *param,
559 EXTERN S16 cmUnpkKwuDatIndInfo ARGS ((
560 KwuDatIndInfo *param,
564 EXTERN S16 cmUnpkKwuDatCfmInfo ARGS ((
565 KwuDatCfmInfo *param,
569 EXTERN S16 cmUnpkKwuStaIndInfo ARGS ((
570 KwuStaIndInfo *param,
574 EXTERN S16 cmUnpkKwuBndReq ARGS ((
580 EXTERN S16 cmUnpkKwuUbndReq ARGS ((
586 EXTERN S16 cmUnpkKwuBndCfm ARGS ((
592 EXTERN S16 cmUnpkKwuDatReq ARGS ((
598 EXTERN S16 cmUnpkKwuDatInd ARGS ((
604 EXTERN S16 cmUnpkKwuDatCfm ARGS ((
610 EXTERN S16 cmUnpkKwuStaInd ARGS ((
616 EXTERN S16 cmUnpkKwuReEstCmpInd ARGS ((
621 EXTERN S16 cmUnpkKwuDiscSduReq ARGS ((
627 EXTERN S16 cmUnpkKwuFlowCntrlInd ARGS ((
628 KwuFlowCntrlInd func,
633 /* kwu_x_001.main_3 Added support for L2 Measurement */
635 EXTERN S16 cmUnpkKwuDatAckInfo ARGS ((
636 KwuDatAckInfo *param,
640 EXTERN S16 cmUnpkKwuDatAckInd ARGS ((
645 #endif /* LTE_L2_MEAS */
647 EXTERN S16 cmUnpkKwuDiscSduCfm ARGS ((
653 EXTERN S16 cmPkKwuFlowCntrlIndInfo ARGS((
654 KwuFlowCntrlIndInfo *param,
658 EXTERN S16 cmUnpkKwuFlowCntrlIndInfo ARGS((
659 KwuFlowCntrlIndInfo *param,
667 #endif /* __cplusplus */
668 #endif /* __KWU_X__ */
671 /********************************************************************30**
673 **********************************************************************/