- RETVALUE(RFAILED);
- }
- SPutMsg(mBuf);
- RETVALUE((*func)(pst, suId, status));
-}
-
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on
- * dedicated channel for transmission
-*
-* @details
-*
-* Function : packDlData
-*
-* @param[in] Pst* pst
-* @param[in] SpId spId
-* @param[in] RguDDatReqInfo * datReq
-* @return S16
-* -# ROK
-**/
-PUBLIC uint16_t packDlData
-(
-Pst* pst,
-SpId spId,
-RlcMacData *dlData
-)
-{
- Buffer *mBuf = NULLP;
- TRC3(packDlData)
-
- if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU022, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)dlData, sizeof(RlcMacData));
- RETVALUE(RFAILED);
- }
-
- if (pst->selector == RGU_SEL_LWLC)
- {
- CMCHKPK(cmPkPtr,(PTR) dlData, mBuf);
- }
- else
- {
- /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
- if (packRlcMacDataInfo(pst, dlData, mBuf) != ROK)
-#else
- if (packRlcMacDataInfo(dlData, mBuf) != ROK)
-#endif
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)dlData,
- sizeof(RlcMacData));
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-
- if (SPutSBuf(pst->region, pst->pool,
- (Data *)dlData, sizeof(RlcMacData)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU025, (ErrVal)0, "Packing failed");
-#endif
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
- dlData = NULLP;
- }
- if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU024, (ErrVal)0, "Packing failed");
-#endif
- if (dlData != NULLP);
- {
- SPutSBuf(pst->region, pst->pool,
- (Data *)dlData, sizeof(RlcMacData));
- }
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
- pst->event = (Event) EVTRLCDLDAT;
- RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on
- * dedicated channel for transmission
-*
-* @details
-*
-* Function : unpackDlData
-*
-* @param[in] Pst* pst
-* @param[in] SpId spId
-* @param[in] RguDDatReqInfo * datReq
-* @return S16
-* -# ROK
-**/
-PUBLIC S16 unpackDlData
-(
-RlcMacDlData func,
-Pst *pst,
-Buffer *mBuf
-)
-{
- SpId spId;
- RlcMacData *dlData;
-
- TRC3(unpackDlData)
-
- if (SUnpkS16(&spId, mBuf) != ROK) {
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-
- if (pst->selector == RGU_SEL_LWLC)
- {
- CMCHKUNPK(cmUnpkPtr,(PTR *) &dlData, mBuf);
- }
- else
- {
- if ((SGetSBuf(pst->region, pst->pool,
- (Data **)&dlData, sizeof(RlcMacData))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU026, (ErrVal)0, "UnPacking failed");
-#endif
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
- cmMemset((U8*)dlData, (U8)0, sizeof(RlcMacData));
- /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
- if (unpackRlcMacDataInfo(pst,dlData, mBuf) != ROK)
-#else
- if (unpackRlcMacDataInfo(dlData, mBuf) != ROK)
-#endif
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
-#endif
- SPutMsg(mBuf);
- SPutSBuf(pst->region, pst->pool, (Data *)dlData,
- sizeof(RlcMacData));
- RETVALUE(RFAILED);
- }
- }
- SPutMsg(mBuf);
-
- /* TODO : change function call to send RlcMacData as below: */
- RETVALUE((*func)(pst, spId, dlData));
-
- //RETVALUE((*func)(pst, spId, datReq));
-}
-
-\f
-/**
-* @brief Data Indication from MAC to RLC to
- * forward the data received for dedicated channels
-*
-* @details
-*
-* Function : packRcvdUlData
-*
-* @param[in] Pst* pst
-* @param[in] SuId suId
-* @param[in] RlcMacData *ulData
-* @return S16
-* -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 packRcvdUlData
-(
-Pst* pst,
-SuId suId,
-RlcMacData *ulData
-)
-#else
-PUBLIC S16 packRcvdUlData(pst, suId, ulData)
-Pst* pst;
-SuId suId;
-RlcMacData *ulData;
-#endif
-{
- Buffer *mBuf = NULLP;
- TRC3(packRcvdUlData)
-
- if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU035, (ErrVal)0, "Packing failed");
-#endif
- SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
- RETVALUE(RFAILED);
- }
-
- if (pst->selector == RGU_SEL_LWLC)
- {
- CMCHKPK(cmPkPtr,(PTR)ulData, mBuf);
- }
- else
- {
- if (packRlcMacDataInfo(ulData, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU036, (ErrVal)0, "Packing failed");
-#endif
- SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-
- if (SPutStaticBuffer(pst->region, pst->pool,
- (Data *)ulData, sizeof(RlcMacData),0) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU038, (ErrVal)0, "Packing failed");
-#endif
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
- ulData = NULLP;
- }
- if (SPkS16(suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU037, (ErrVal)0, "Packing failed");
-#endif
- SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-
- pst->event = (Event) EVTRLCULDAT;
- RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Data Indication from MAC to RLC to
- * forward the data received for dedicated channels
-*
-* @details
-*
-* Function : unpackRcvdUlData
-*
-* @param[in] Pst* pst
-* @param[in] SuId suId
-* @param[in] RlcMacData *ulData
-* @return S16
-* -# ROK
-**/
-PUBLIC S16 unpackRcvdUlData
-(
-RlcMacUlData func,
-Pst *pst,
-Buffer *mBuf
-)
-{
- SuId suId;
- RlcMacData *ulData;
-
- TRC3(unpackRcvdUlData)
-
- if (SUnpkS16(&suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU039, (ErrVal)0, "UnPacking failed");
-#endif
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
-
- if (pst->selector == RGU_SEL_LWLC)
- {
- CMCHKUNPK(cmUnpkPtr,(PTR *) &ulData, mBuf);
- }
- else
- {
- if ((SGetStaticBuffer(pst->region, pst->pool,
- (Data **)&ulData, sizeof(RlcMacData),0)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU040, (ErrVal)0, "UnPacking failed");
-#endif
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
- }
- if (unpackRlcMacDataInfo(ulData, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
-#endif
- SPutMsg(mBuf);
- SPutStaticBuffer(pst->region, pst->pool,
- (Data *)ulData, sizeof(RlcMacData),0);
- RETVALUE(RFAILED);
- }