X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Cu%2FCuUp%2FPdcp%2FPdcpUp%2FSrc%2FpdcpuCore.c;fp=Cu%2FCuUp%2FPdcp%2FPdcpUp%2FSrc%2FpdcpuCore.c;h=1499d32f3b7f07bbe38350127f233cbbf43b751e;hb=e93798699eccb72af04938fc9b0d7a836e284488;hp=ecb665675e9004a1c9316c7c93a3372ddac560b9;hpb=94f13ab3e8da393eb27ccc561d31b447b1367c56;p=scp%2Focu%2F5gnr.git diff --git a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c index ecb6656..1499d32 100644 --- a/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c +++ b/Cu/CuUp/Pdcp/PdcpUp/Src/pdcpuCore.c @@ -1,9 +1,21 @@ /****************************************************************************** -############################################################################### -# Copyright (c) [2017-2020] [ICT/CAS] # -# Licensed under the ORAN Software License v1.0 (License) # -############################################################################### -******************************************************************************/ +* +* Copyright (c) 2020 ICT/CAS. +* +* Licensed under the O-RAN Software License, Version 1.0 (the "Software License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.o-ran.org/software +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*******************************************************************************/ + #include "vos_types.h" #include "vos_string.h" #include "vos_linklist.h" @@ -20,9 +32,9 @@ extern ULONG gPdcpuModuleId; /* not used at the moment */ /*void pdcpuSetLessCountFun(const void* cpv_first, const void* cpv_second, void* pv_output) -{ +{ assert(cpv_first != NULL && cpv_second != NULL && pv_output != NULL); - + *(bool_t*)pv_output = (((PdcpuDataBuffNode_t *)cpv_first)->count) < (((PdcpuDataBuffNode_t *)cpv_second)->count) ? true : false; }*/ @@ -44,12 +56,12 @@ VOID pdcpuFreeDataBuffNode(VOID *p) } VOS_Free(p); p = NULL; - + return ; } /******************************************************************************* - * discard all stored PDCP PDUs in the transmitting buffer + * discard all stored PDCP PDUs in the transmitting buffer * INPUT: * pTxPduList: transmitting buffer list * OUTPUT: @@ -62,7 +74,7 @@ INT32 pdcpuDiscardTransmitBuff(plist pTxPduList) } /******************************************************************************* - * transmit or retransmit all stored PDCP PDUs in the transmitting buffer + * transmit or retransmit all stored PDCP PDUs in the transmitting buffer * INPUT: * pTxPduList: transmitting buffer list * OUTPUT: @@ -75,8 +87,8 @@ INT32 pdcpuDeliverTransmitBuff(PdcpDrbEntity_t *pPdcpuEntity) } /******************************************************************************* - * deliver the PDCP SDUs stored in the receiving buffer to upper layers - * in ascending order of associated COUNT values + * deliver the PDCP SDUs stored in the receiving buffer to upper layers + * in ascending order of associated COUNT values * INPUT: * pTxPduList: transmitting buffer list * OUTPUT: @@ -90,7 +102,7 @@ INT32 pdcpuDeliverRecvBuff(PdcpDrbEntity_t *pPdcpuEntity) /******************************************************************************* - * To construct and send a PDCP status report + * To construct and send a PDCP status report * INPUT: * pPdcpuEntity: pdcpu entity * OUTPUT: @@ -103,7 +115,7 @@ INT32 pdcpuConstructStatusReport(PdcpDrbEntity_t *pPdcpuEntity) } /******************************************************************************* - * To perform PDCP data recovery + * To perform PDCP data recovery * INPUT: * ueE1apId: UE E1AP ID * drbId : DRB ID @@ -128,17 +140,17 @@ INT32 pdcpuSetSn(PdcpSnSize_e *pSn, PdcpSNSize_e snCfg) if(PDCP_SN_SIZE_S12 == snCfg) { *pSn = LEN12BITS; - + }else if(PDCP_SN_SIZE_S18 == snCfg) { *pSn = LEN18BITS; - + }else { pdcpuLog(LOG_ERR,"[PDCPU] input sn size is wrong!\n"); return VOS_ERROR; } - + return VOS_OK; } @@ -149,7 +161,7 @@ INT32 pdcpuSetRlcMode(PdcpRlcMode_e *pRlcMode, CuRlcMode_e rlcCfg) case RLCMODE_TM: pdcpuLog(LOG_ERR,"[PDCPU] input-TM MODE is wrong!\n"); return VOS_ERROR; - + case RLCMODE_AM: *pRlcMode = AM_MODE; return VOS_OK; @@ -167,10 +179,10 @@ INT32 pdcpuSetRlcMode(PdcpRlcMode_e *pRlcMode, CuRlcMode_e rlcCfg) } /******************************************************************************* - * To get SDAP DATA PDU header length configuration + * To get SDAP DATA PDU header length configuration * INPUT: - * sdapHeadInd : - * sdapHeadLen : + * sdapHeadInd : + * sdapHeadLen : * OUTPUT: * none *******************************************************************************/ @@ -179,23 +191,23 @@ INT32 pdcpuGetSdapHeadLen(SdapHeader_e sdapHeadInd, UINT8 *sdapHeadLen) if(SDAP_HEADER_PRESENT == sdapHeadInd) { *sdapHeadLen = 1; /*Data PDU with SDAP header*/ - + }else if(SDAP_HEADER_ABSENT == sdapHeadInd) { *sdapHeadLen = 0; /*Data PDU without SDAP header*/ - + }else - { + { pdcpuLog(LOG_ERR,"[PDCPU] sdap head cfg is wrong\n"); return VOS_ERROR; } - + return VOS_OK; } /******************************************************************************* - * To create PDCP-U entity + * To create PDCP-U entity * INPUT: * ueE1apId: UE E1AP ID * pDrbItem : DRB to setup item @@ -204,38 +216,38 @@ INT32 pdcpuGetSdapHeadLen(SdapHeader_e sdapHeadInd, UINT8 *sdapHeadLen) * -1:failed *******************************************************************************/ INT32 pdcpuCreateEntity(UINT64 ueE1apId, UINT16 ueIdx, UINT16 pduSessionId, upcTempDrbInfo_t *pDrbItem) -{ - UINT8 drbId = pDrbItem->drbId; +{ + UINT8 drbId = pDrbItem->drbId; PdcpuUeInfo_t *pPdcpUeInfo = NULL; PdcpDrbEntity_t *pPdcpuEntity = NULL; INT8 ret = 0; pdcpuCheckUeIdx(ueIdx); pdcpuCheckDrbId(drbId); - - /* examine ue info */ + + /* examine ue info */ if(NULL == gPdcpuUeInfo[ueIdx]) { pPdcpUeInfo = VOS_Malloc(sizeof(PdcpuUeInfo_t), gPdcpuModuleId); pdcpuNullCheck(pPdcpUeInfo); VOS_MemZero(pPdcpUeInfo, sizeof(PdcpuUeInfo_t)); - gPdcpuUeInfo[ueIdx] = pPdcpUeInfo; + gPdcpuUeInfo[ueIdx] = pPdcpUeInfo; }else { pPdcpUeInfo = gPdcpuUeInfo[ueIdx]; } - + /* examine drb info */ if(NULL != pPdcpUeInfo->pdcpDrbEntity[drbId]) { pPdcpuEntity = pPdcpUeInfo->pdcpDrbEntity[drbId]; - } - pPdcpuEntity = VOS_Malloc(sizeof(PdcpDrbEntity_t), gPdcpuModuleId); + } + pPdcpuEntity = VOS_Malloc(sizeof(PdcpDrbEntity_t), gPdcpuModuleId); pdcpuNullCheck(pPdcpuEntity); VOS_MemZero(pPdcpuEntity, sizeof(PdcpDrbEntity_t)); pPdcpUeInfo->pdcpDrbEntity[drbId] = pPdcpuEntity; - + PDCPConfiguration_t *pPdcpCfg = &(pDrbItem->pdcpConfig); pPdcpuEntity->ueE1apId = ueE1apId; pPdcpuEntity->ueIdx = ueIdx; @@ -266,13 +278,13 @@ INT32 pdcpuCreateEntity(UINT64 ueE1apId, UINT16 ueIdx, UINT16 pduSessionId, upcT pdcpuLog(LOG_ERR,"[PDCPU] input parameter is wrong\n"); VOS_Free(pPdcpuEntity); pPdcpUeInfo->pdcpDrbEntity[drbId] = NULL; - return VOS_ERROR; + return VOS_ERROR; } - + /* set security enable information */ PdcpuSecEnableInfo_t *pEnableInfo = gPdcpuUeInfo[ueIdx]->secEnableInfo[pduSessionId]; - pdcpuNullCheck(pEnableInfo); + pdcpuNullCheck(pEnableInfo); pPdcpuEntity->integrityProtection = pEnableInfo->integrityEnableFlag; pPdcpuEntity->ciperingEnabled = pEnableInfo->cipherEnableFlag; @@ -294,4 +306,3 @@ INT32 pdcpuCreateEntity(UINT64 ueE1apId, UINT16 ueIdx, UINT16 pduSessionId, upcT return VOS_OK; } -