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 uint32_t sduId; /*!< SDU ID */
53 CmLteLcType lcType; /*!<Logical Channel Type */
55 uint8_t emtcDiReason; /* !< DI reason */
56 uint8_t 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 uint32_t numSduIds; /*!< Number of Id's in the sudIds array */
82 uint32_t 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 uint32_t numSdu; /*!< Number of SDUs */
93 uint32_t 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 uint32_t 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, uint8_t status));
126 typedef S16 (*KwuUbndReq) ARGS((Pst *pst, SuId suId, Reason reason));
128 typedef S16 (*KwuDatReq) ARGS((Pst *pst, RlcDatReqInfo* datReq, Buffer *mBuf));
129 typedef uint8_t (*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 RlcUiKwuBndCfm 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 S16 RlcUiKwuBndReq ARGS((Pst *pst,
164 * @details RLC invokes the bind confirm primitive to acknowledge the receipt
165 * of the RlcUiKwuBndReq 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 S16 RlcUiKwuBndCfm 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 S16 RlcUiKwuUbndReq ARGS((Pst *pst,
204 *@details This primitive is used by RLC to transfer the SDU data to the service
205 user (RRC/PDCP) recieved from the peer RLC. RLC will send the data to service
206 user (RRC/PDCP) by reassembling the PDUs recieved from the peer RLC.
208 * @param pst - Pointer to the pst structure
209 * @param suId - Service user ID
210 * @param datInd - Data indication parameter
211 * @param buf - RLC SDU
216 S16 rlcSendUlDataToDu ARGS((Pst *pst,
217 KwuDatIndInfo* datInd,
221 *@details This primitive is used by RLC as the confirmation for the RlcProcDlData
222 to the service user (RLC/PDCP). It is used only in AM mode data transfers for
225 * @param[in] pst - Pointer to the pst structure
226 * @param[in] suId - Service user ID
227 * @param[in] datCfm - Data confirmation parameter
232 S16 RlcUiKwuDatCfm ARGS((Pst *pst,
234 KwuDatCfmInfo* datCfm));
237 *@details This primitive is used by PDCP to discard the particular SDU to RLC.
238 It is used only in AM mode data transfers for RLC. RLC discards this SDU
239 if no segment of the RLC SDU has been mapped to a RLC data PDU yet.
241 * @param[in] pst - Pointer to the pst structure
242 * @param[in] spId - Service provider ID
243 * @param[in] discSdu - Discard SDU parameter
248 S16 RlcUiKwuDiscSduReq ARGS((Pst *pst,
250 KwuDiscSduInfo* discSdu));
253 *@details This primitive is used by RRC to discard the particular SDU to RLC.
254 It is used only in AM mode data transfers for RLC. RLC discards this SDU
255 if no segment of the RLC SDU has been mapped to a RLC data PDU yet.
257 * @param[in] pst - Pointer to the pst structure
258 * @param[in] suId - Service provider ID
259 * @param[in] rlcId - RLC ID
264 S16 RlcUiKwuStaInd ARGS((Pst *pst,
266 KwuStaIndInfo* staInd));
268 /* kwu_x_001.main_3 Added support for L2 Measurement */
270 *@details This primitive is used by RLC to confirm the positive discard
271 of a particular SDU to PDCP.
273 * @param[in] pst - Pointer to the pst structure
274 * @param[in] spId - Service provider ID
275 * @param[in] discCfmSdu - Discard Cfm SDU parameter
280 S16 RlcUiKwuDiscSduCfm ARGS((Pst *pst,
282 KwuDiscSduInfo* discCfmSdu));
285 *@details This primitive is used by RLC to indicate to PDCP if packets
286 * need to be dropped/restarted for a particular RB
288 * @param[in] pst - Pointer to the pst structure
289 * @param[in] suId - Service user ID
290 * @param[in] flowCntrlIndInfo - Flow control information
295 S16 RlcUiKwuFlowCntrlInd ARGS((Pst *pst,
297 KwuFlowCntrlIndInfo* flowCntrlIndInfo));
300 *@details This primitive is used by RLC to inform PDCP of the sucessful
301 reception of a particular data message at the peer side. This confirms
302 only positive acknowlegements at the peer side .
304 * @param[in] pst - Pointer to the pst structure
305 * @param[in] suId - Service provider ID
306 * @param[in] ackInd - Data Ack Indication parameter
311 S16 RlcUiKwuDatAckInd ARGS((Pst *pst,
313 KwuDatAckInfo* ackInd));
314 #endif /* LTE_L2_MEAS */
316 S16 RlcUiKwuReEstCmpInd ARGS((Pst *pst,
321 /* RRC Extern Declarations */
323 S16 NhLiKwuBndReq ARGS((Pst *pst,
327 S16 NhLiKwuBndCfm ARGS((Pst *pst,
331 S16 NhLiKwuUbndReq ARGS((Pst *pst,
335 S16 NhLiKwuDatReq ARGS((Pst *pst,
337 RlcDatReqInfo* datReq,
340 S16 NhLiKwuDatInd ARGS((Pst *pst,
341 KwuDatIndInfo* datInd,
345 /* Dummy RRC Interface primitives */
347 S16 DmUiKwuBndReq ARGS((Pst *pst,
351 S16 DmUiKwuBndCfm ARGS((Pst *pst,
355 S16 DmUiKwuUbndReq ARGS((Pst *pst,
359 S16 DmUiKwuDatReq ARGS((Pst *pst,
361 RlcDatReqInfo* datReq,
364 S16 DmUiKwuDatInd ARGS((Pst *pst,
366 KwuDatIndInfo* datInd,
369 S16 DmUiKwuReEstCmpInd ARGS((Pst *pst,
370 SuId suId, CmLteRlcId rlcId));
374 /* PDCP Extern Declarations */
376 S16 PjLiKwuBndReq ARGS((Pst *pst,
380 S16 PjLiKwuBndCfm ARGS((Pst *pst,
384 S16 PjLiKwuUbndReq ARGS((Pst *pst,
388 S16 PjLiKwuDatReq ARGS((Pst *pst,
390 RlcDatReqInfo* datReq,
393 S16 PjLiKwuDatInd ARGS((Pst *pst,
394 KwuDatIndInfo* datInd,
397 S16 PjLiKwuDatCfm ARGS((Pst *pst,
399 KwuDatCfmInfo* datCfm));
401 S16 PjLiKwuStaInd ARGS((Pst *pst,
403 KwuStaIndInfo* staInd));
405 S16 PjLiKwuDiscSduReq ARGS((Pst *pst,
407 KwuDiscSduInfo* discSdu));
410 S16 PjLiKwuReEstCmpInd ARGS((Pst *pst,
411 SuId suId, CmLteRlcId rlcId));
413 /* kwu_x_001.main_3 Added support for L2 Measurement */
414 S16 PjLiKwuDiscSduCfm ARGS((Pst *pst,
416 KwuDiscSduInfo* discCfmSdu));
417 S16 PjLiKwuFlowCntrlInd ARGS((Pst *pst,
419 KwuFlowCntrlIndInfo *flowCntrlInfo));
421 S16 PjLiKwuDatAckInd ARGS((Pst *pst,
423 KwuDatAckInfo* ackInd));
424 #endif /* LTE_L2_MEAS */
427 #ifdef MAC_RLC_UL_RBUF
428 S16 rlcUlBatchProc ARGS((Void));
430 /*****************************************************************************
431 * PACK/UNPACK FUNCTIONS
432 ****************************************************************************/
434 /* Packing Functions */
435 uint8_t cmPkRlcDatReqInfo ARGS ((
436 RlcDatReqInfo *param,
440 uint8_t cmPkKwuDatIndInfo ARGS ((
441 KwuDatIndInfo *param,
445 S16 cmPkKwuDatCfmInfo ARGS ((
446 KwuDatCfmInfo *param,
450 S16 cmPkKwuStaIndInfo ARGS ((
451 KwuStaIndInfo *param,
455 S16 cmPkKwuBndReq ARGS ((
461 S16 cmPkKwuUbndReq ARGS ((
467 S16 cmPkKwuBndCfm ARGS ((
473 uint8_t cmPkRlcDatReq ARGS ((
475 RlcDatReqInfo* datReq,
479 uint8_t cmPkKwuDatInd ARGS ((
481 KwuDatIndInfo* datInd,
485 S16 cmPkKwuDatCfm ARGS ((
488 KwuDatCfmInfo* datCfm
491 S16 cmPkKwuStaInd ARGS ((
494 KwuStaIndInfo* staInd
497 S16 cmPkKwuReEstCmpInd ARGS ((
503 S16 cmPkKwuDiscSduReq ARGS ((
506 KwuDiscSduInfo* discSdu
509 /* kwu_x_001.main_3 Added support for L2 Measurement */
511 S16 cmPkKwuDatAckInfo ARGS ((
512 KwuDatAckInfo* datAckInd,
516 S16 cmPkKwuDatAckInd ARGS ((
519 KwuDatAckInfo* ackInfo
521 #endif /* LTE_L2_MEAS */
523 S16 cmPkKwuDiscSduCfm ARGS ((
526 KwuDiscSduInfo* cfmSdu
529 S16 cmPkKwuFlowCntrlInd ARGS ((
532 KwuFlowCntrlIndInfo *flowCntrlIndInfo
535 /* Unpacking Functions */
536 S16 cmUnpkRlcDatReqInfo ARGS ((
537 RlcDatReqInfo *param,
541 uint8_t cmUnpkKwuDatIndInfo ARGS ((
542 KwuDatIndInfo *param,
546 S16 cmUnpkKwuDatCfmInfo ARGS ((
547 KwuDatCfmInfo *param,
551 S16 cmUnpkKwuStaIndInfo ARGS ((
552 KwuStaIndInfo *param,
556 S16 cmUnpkKwuBndReq ARGS ((
562 S16 cmUnpkKwuUbndReq ARGS ((
568 S16 cmUnpkKwuBndCfm ARGS ((
574 S16 cmUnpkKwuDatReq ARGS ((
580 uint8_t cmUnpkKwuDatInd ARGS ((
586 S16 cmUnpkKwuDatCfm ARGS ((
592 S16 cmUnpkKwuStaInd ARGS ((
598 S16 cmUnpkKwuReEstCmpInd ARGS ((
603 S16 cmUnpkKwuDiscSduReq ARGS ((
609 S16 cmUnpkKwuFlowCntrlInd ARGS ((
610 KwuFlowCntrlInd func,
615 /* kwu_x_001.main_3 Added support for L2 Measurement */
617 S16 cmUnpkKwuDatAckInfo ARGS ((
618 KwuDatAckInfo *param,
622 S16 cmUnpkKwuDatAckInd ARGS ((
627 #endif /* LTE_L2_MEAS */
629 S16 cmUnpkKwuDiscSduCfm ARGS ((
635 S16 cmPkKwuFlowCntrlIndInfo ARGS((
636 KwuFlowCntrlIndInfo *param,
640 S16 cmUnpkKwuFlowCntrlIndInfo ARGS((
641 KwuFlowCntrlIndInfo *param,
649 #endif /* __cplusplus */
650 #endif /* __KWU_X__ */
653 /********************************************************************30**
655 **********************************************************************/