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, SpId spId, KwuDatReqInfo* datReq,
130 typedef S16 (*KwuDatInd) ARGS((Pst *pst, SuId suId, KwuDatIndInfo* datInd,
132 typedef S16 (*KwuDatCfm) ARGS((Pst *pst, SuId suId, KwuDatCfmInfo* datCfm));
133 typedef S16 (*KwuDiscSduReq) ARGS((Pst *pst, SpId spId, KwuDiscSduInfo* discSdu));
134 typedef S16 (*KwuStaInd) ARGS((Pst *pst, SuId suId, KwuStaIndInfo* staInd));
135 typedef S16 (*KwuFlowCntrlInd)ARGS((Pst *pst, SuId suId, KwuFlowCntrlIndInfo* flowCntrlInd));
136 typedef S16 (*KwuReEstCmpInd) ARGS((Pst *pst, SuId suId, CmLteRlcId rlcId));
138 /* kwu_x_001.main_3 Added support for L2 Measurement */
140 typedef S16 (*KwuDatAckInd) ARGS((Pst *pst, SuId suId, KwuDatAckInfo *ackInfo));
141 #endif /* LTE_L2_MEAS */
142 typedef S16 (*KwuDiscSduCfm) ARGS((Pst *pst, SuId suId, KwuDiscSduInfo *discCfmInfo));
145 * @details This primitive binds the RLC service user entity to the RLC product.
146 * The RLC service user must bind each KWU SAP individually before sending any
147 * other request. RLC acknowledges the receipt of the bind request by sending
148 * a KwUiKwuBndCfm primitive.
150 * @param[in] pst - For the bind request, the event field in the Pst structure is set to
152 * @param[in] suId - The ID of the service user SAP associated with the SAP in the RLC
153 layer. The SSAP in the RLC layer is specified by the spId parameter.
154 Allowable values: 0 to 32767.
155 * @param[in] spId - The ID of the service provider SAP in the RLC layer. Allowable values: 0 to 32767.
160 EXTERN S16 KwUiKwuBndReq ARGS((Pst *pst,
165 * @details RLC invokes the bind confirm primitive to acknowledge the receipt
166 * of the KwUiKwuBndReq primitive from the service user. The status field
167 * indicates whether the bind request succeeded or failed. The bind request
168 * may fail due to invalid parameters in the bind request from the
169 * service user (for example, an invalid spId).
171 * @param[in] pst - For the bind confirm, the event field in the Pst structure is set to
173 * @param[in] suId - The ID of the service user SAP specified in the bind request. Allowable
175 * @param[in] status - Indicates the status of the bind request.\n
176 CM_BND_OK: Bind request succeeded\n
177 CM_BND_NOK: Error encountered during the processing of the bind request.
182 EXTERN S16 KwUiKwuBndCfm ARGS((Pst *pst,
187 * @details The RLC service user initiates this primitive for performing
188 * an unbind operation.This primitive brings the link down if it is already up,
189 * and releases all the resources associated for this SAP at RLC.
191 * @param[in] pst - For the unbind request, the event field in the Pst structure is set to
193 * @param[in] spId - The ID of the service provider SAP in the RLC layer that is to be
194 disassociated from its service user SAP. Allowable values: 0 to 32767.
195 * @param[in] reason - Reason for the unbind. Allowable value: KWU_UBND_REQ.
200 EXTERN S16 KwUiKwuUbndReq ARGS((Pst *pst,
205 *@details This primitive is used by RRC to transfer the SDU data to the RLC.
206 RLC will send the data to logical channels in the form of PDUs by assembling
207 [concatenating/segmenting/retransmission (in case of AM), concatenating if
208 required (in case of UM)] SDUs received from the service user (RRC/PDCP).
210 * @param[in] pst - Pointer to the pst structure
211 * @param[in] spId - Service provider ID
212 * @param[in] datReq - Data request parameter
213 * @param[in] buf - RLC SDU
218 EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst,
220 KwuDatReqInfo* datReq,
224 *@details This primitive is used by RLC to transfer the SDU data to the service
225 user (RRC/PDCP) recieved from the peer RLC. RLC will send the data to service
226 user (RRC/PDCP) by reassembling the PDUs recieved from the peer RLC.
228 * @param pst - Pointer to the pst structure
229 * @param suId - Service user ID
230 * @param datInd - Data indication parameter
231 * @param buf - RLC SDU
236 EXTERN S16 KwUiKwuDatInd ARGS((Pst *pst,
238 KwuDatIndInfo* datInd,
242 *@details This primitive is used by RLC as the confirmation for the KwUiKwuDatReq
243 to the service user (RLC/PDCP). It is used only in AM mode data transfers for
246 * @param[in] pst - Pointer to the pst structure
247 * @param[in] suId - Service user ID
248 * @param[in] datCfm - Data confirmation parameter
253 EXTERN S16 KwUiKwuDatCfm ARGS((Pst *pst,
255 KwuDatCfmInfo* datCfm));
258 *@details This primitive is used by PDCP to discard the particular SDU to RLC.
259 It is used only in AM mode data transfers for RLC. RLC discards this SDU
260 if no segment of the RLC SDU has been mapped to a RLC data PDU yet.
262 * @param[in] pst - Pointer to the pst structure
263 * @param[in] spId - Service provider ID
264 * @param[in] discSdu - Discard SDU parameter
269 EXTERN S16 KwUiKwuDiscSduReq ARGS((Pst *pst,
271 KwuDiscSduInfo* discSdu));
274 *@details This primitive is used by RRC to discard the particular SDU to RLC.
275 It is used only in AM mode data transfers for RLC. RLC discards this SDU
276 if no segment of the RLC SDU has been mapped to a RLC data PDU yet.
278 * @param[in] pst - Pointer to the pst structure
279 * @param[in] suId - Service provider ID
280 * @param[in] rlcId - RLC ID
285 EXTERN S16 KwUiKwuStaInd ARGS((Pst *pst,
287 KwuStaIndInfo* staInd));
289 /* kwu_x_001.main_3 Added support for L2 Measurement */
291 *@details This primitive is used by RLC to confirm the positive discard
292 of a particular SDU to PDCP.
294 * @param[in] pst - Pointer to the pst structure
295 * @param[in] spId - Service provider ID
296 * @param[in] discCfmSdu - Discard Cfm SDU parameter
301 EXTERN S16 KwUiKwuDiscSduCfm ARGS((Pst *pst,
303 KwuDiscSduInfo* discCfmSdu));
306 *@details This primitive is used by RLC to indicate to PDCP if packets
307 * need to be dropped/restarted for a particular RB
309 * @param[in] pst - Pointer to the pst structure
310 * @param[in] suId - Service user ID
311 * @param[in] flowCntrlIndInfo - Flow control information
316 EXTERN S16 KwUiKwuFlowCntrlInd ARGS((Pst *pst,
318 KwuFlowCntrlIndInfo* flowCntrlIndInfo));
321 *@details This primitive is used by RLC to inform PDCP of the sucessful
322 reception of a particular data message at the peer side. This confirms
323 only positive acknowlegements at the peer side .
325 * @param[in] pst - Pointer to the pst structure
326 * @param[in] suId - Service provider ID
327 * @param[in] ackInd - Data Ack Indication parameter
332 EXTERN S16 KwUiKwuDatAckInd ARGS((Pst *pst,
334 KwuDatAckInfo* ackInd));
335 #endif /* LTE_L2_MEAS */
337 EXTERN S16 KwUiKwuReEstCmpInd ARGS((Pst *pst,
342 /* RRC Extern Declarations */
344 EXTERN S16 NhLiKwuBndReq ARGS((Pst *pst,
348 EXTERN S16 NhLiKwuBndCfm ARGS((Pst *pst,
352 EXTERN S16 NhLiKwuUbndReq ARGS((Pst *pst,
356 EXTERN S16 NhLiKwuDatReq ARGS((Pst *pst,
358 KwuDatReqInfo* datReq,
361 EXTERN S16 NhLiKwuDatInd ARGS((Pst *pst,
363 KwuDatIndInfo* datInd,
367 /* Dummy RRC Interface primitives */
369 EXTERN S16 DmUiKwuBndReq ARGS((Pst *pst,
373 EXTERN S16 DmUiKwuBndCfm ARGS((Pst *pst,
377 EXTERN S16 DmUiKwuUbndReq ARGS((Pst *pst,
381 EXTERN S16 DmUiKwuDatReq ARGS((Pst *pst,
383 KwuDatReqInfo* datReq,
386 EXTERN S16 DmUiKwuDatInd ARGS((Pst *pst,
388 KwuDatIndInfo* datInd,
391 EXTERN S16 DmUiKwuReEstCmpInd ARGS((Pst *pst,
392 SuId suId, CmLteRlcId rlcId));
396 /* PDCP Extern Declarations */
398 EXTERN S16 PjLiKwuBndReq ARGS((Pst *pst,
402 EXTERN S16 PjLiKwuBndCfm ARGS((Pst *pst,
406 EXTERN S16 PjLiKwuUbndReq ARGS((Pst *pst,
410 EXTERN S16 PjLiKwuDatReq ARGS((Pst *pst,
412 KwuDatReqInfo* datReq,
415 EXTERN S16 PjLiKwuDatInd ARGS((Pst *pst,
417 KwuDatIndInfo* datInd,
420 EXTERN S16 PjLiKwuDatCfm ARGS((Pst *pst,
422 KwuDatCfmInfo* datCfm));
424 EXTERN S16 PjLiKwuStaInd ARGS((Pst *pst,
426 KwuStaIndInfo* staInd));
428 EXTERN S16 PjLiKwuDiscSduReq ARGS((Pst *pst,
430 KwuDiscSduInfo* discSdu));
433 EXTERN S16 PjLiKwuReEstCmpInd ARGS((Pst *pst,
434 SuId suId, CmLteRlcId rlcId));
436 /* kwu_x_001.main_3 Added support for L2 Measurement */
437 EXTERN S16 PjLiKwuDiscSduCfm ARGS((Pst *pst,
439 KwuDiscSduInfo* discCfmSdu));
440 EXTERN S16 PjLiKwuFlowCntrlInd ARGS((Pst *pst,
442 KwuFlowCntrlIndInfo *flowCntrlInfo));
444 EXTERN S16 PjLiKwuDatAckInd ARGS((Pst *pst,
446 KwuDatAckInfo* ackInd));
447 #endif /* LTE_L2_MEAS */
450 #ifdef MAC_RLC_UL_RBUF
451 EXTERN S16 kwUlBatchProc ARGS((Void));
453 /*****************************************************************************
454 * PACK/UNPACK FUNCTIONS
455 ****************************************************************************/
457 /* Packing Functions */
458 EXTERN S16 cmPkKwuDatReqInfo ARGS ((
459 KwuDatReqInfo *param,
463 EXTERN S16 cmPkKwuDatIndInfo ARGS ((
464 KwuDatIndInfo *param,
468 EXTERN S16 cmPkKwuDatCfmInfo ARGS ((
469 KwuDatCfmInfo *param,
473 EXTERN S16 cmPkKwuStaIndInfo ARGS ((
474 KwuStaIndInfo *param,
478 EXTERN S16 cmPkKwuBndReq ARGS ((
484 EXTERN S16 cmPkKwuUbndReq ARGS ((
490 EXTERN S16 cmPkKwuBndCfm ARGS ((
496 EXTERN S16 cmPkKwuDatReq ARGS ((
499 KwuDatReqInfo* datReq,
503 EXTERN S16 cmPkKwuDatInd ARGS ((
506 KwuDatIndInfo* datInd,
510 EXTERN S16 cmPkKwuDatCfm ARGS ((
513 KwuDatCfmInfo* datCfm
516 EXTERN S16 cmPkKwuStaInd ARGS ((
519 KwuStaIndInfo* staInd
522 EXTERN S16 cmPkKwuReEstCmpInd ARGS ((
528 EXTERN S16 cmPkKwuDiscSduReq ARGS ((
531 KwuDiscSduInfo* discSdu
534 /* kwu_x_001.main_3 Added support for L2 Measurement */
536 EXTERN S16 cmPkKwuDatAckInfo ARGS ((
537 KwuDatAckInfo* datAckInd,
541 EXTERN S16 cmPkKwuDatAckInd ARGS ((
544 KwuDatAckInfo* ackInfo
546 #endif /* LTE_L2_MEAS */
548 EXTERN S16 cmPkKwuDiscSduCfm ARGS ((
551 KwuDiscSduInfo* cfmSdu
554 EXTERN S16 cmPkKwuFlowCntrlInd ARGS ((
557 KwuFlowCntrlIndInfo *flowCntrlIndInfo
560 /* Unpacking Functions */
561 EXTERN S16 cmUnpkKwuDatReqInfo ARGS ((
562 KwuDatReqInfo *param,
566 EXTERN S16 cmUnpkKwuDatIndInfo ARGS ((
567 KwuDatIndInfo *param,
571 EXTERN S16 cmUnpkKwuDatCfmInfo ARGS ((
572 KwuDatCfmInfo *param,
576 EXTERN S16 cmUnpkKwuStaIndInfo ARGS ((
577 KwuStaIndInfo *param,
581 EXTERN S16 cmUnpkKwuBndReq ARGS ((
587 EXTERN S16 cmUnpkKwuUbndReq ARGS ((
593 EXTERN S16 cmUnpkKwuBndCfm ARGS ((
599 EXTERN S16 cmUnpkKwuDatReq ARGS ((
605 EXTERN S16 cmUnpkKwuDatInd ARGS ((
611 EXTERN S16 cmUnpkKwuDatCfm ARGS ((
617 EXTERN S16 cmUnpkKwuStaInd ARGS ((
623 EXTERN S16 cmUnpkKwuReEstCmpInd ARGS ((
628 EXTERN S16 cmUnpkKwuDiscSduReq ARGS ((
634 EXTERN S16 cmUnpkKwuFlowCntrlInd ARGS ((
635 KwuFlowCntrlInd func,
640 /* kwu_x_001.main_3 Added support for L2 Measurement */
642 EXTERN S16 cmUnpkKwuDatAckInfo ARGS ((
643 KwuDatAckInfo *param,
647 EXTERN S16 cmUnpkKwuDatAckInd ARGS ((
652 #endif /* LTE_L2_MEAS */
654 EXTERN S16 cmUnpkKwuDiscSduCfm ARGS ((
660 EXTERN S16 cmPkKwuFlowCntrlIndInfo ARGS((
661 KwuFlowCntrlIndInfo *param,
665 EXTERN S16 cmUnpkKwuFlowCntrlIndInfo ARGS((
666 KwuFlowCntrlIndInfo *param,
674 #endif /* __cplusplus */
675 #endif /* __KWU_X__ */
678 /********************************************************************30**
680 **********************************************************************/