uint8_t lcId; // logical Channel ID
uint8_t lcp; // logical Channel Prioritization
SchLcState lcState;
- uint16_t bo;
+ uint32_t bo;
}SchDlLcCtxt;
typedef struct schDlCb
uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst);
uint8_t schDlRsrcAllocMsg4(DlMsgAlloc *msg4Alloc, SchCellCb *cell, uint16_t slot);
-uint16_t schCalcTbSize(uint16_t payLoadSize);
+uint16_t schCalcTbSize(uint32_t payLoadSize);
uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
uint16_t schAllocPucchResource(SchCellCb *cell, uint16_t crnti, uint16_t slot);
uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst);
uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo puschInfo, DciInfo *dciInfo);
uint8_t schFillPuschAlloc(SchUeCb *ueCb, uint16_t pdcchSlot, uint32_t dataVol, SchPuschInfo *puschInfo);
uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
- uint16_t accumalatedSize, uint16_t slot);
+ uint32_t *accumalatedSize, uint16_t slot);
uint16_t schAccumalateLcBoSize(SchCellCb *cell, uint16_t ueIdx);
/**********************************************************************
*
* ****************************************************************/
uint8_t schDlRsrcAllocDlMsg(DlMsgAlloc *dlMsgAlloc, SchCellCb *cell, uint16_t crnti,
- uint16_t accumalatedSize, uint16_t slot)
+ uint32_t *accumalatedSize, uint16_t slot)
{
uint8_t ueIdx;
uint16_t tbSize = 0;
pdsch->codeword[cwCount].mcsIndex = ueCb.ueCfg.dlModInfo.mcsIndex;
pdsch->codeword[cwCount].mcsTable = ueCb.ueCfg.dlModInfo.mcsTable;
pdsch->codeword[cwCount].rvIndex = 0;
- tbSize = schCalcTbSize(accumalatedSize);
+ tbSize = schCalcTbSize(*accumalatedSize);
+ if(tbSize < *accumalatedSize)
+ *accumalatedSize = tbSize;
pdsch->codeword[cwCount].tbSize = tbSize;
}
pdsch->dataScramblingId = cell->cellCfg.phyCellId;
uint8_t ueIdx, lcIdx;
uint16_t slot;
uint16_t crnti = 0;
- uint16_t accumalatedSize = 0;
+ uint32_t accumalatedSize = 0;
SchUeCb *ueCb = NULLP;
while(cell->boIndBitMap)
}
/* pdcch and pdsch data is filled */
- schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, accumalatedSize, slot);
+ schDlRsrcAllocDlMsg(dlMsgAlloc, cell, crnti, &accumalatedSize, slot);
+ /* Calculated TB size could be less than the total size requested.
+ * Hence, updated the scheduled bytes report. Following is valid only for
+ * one LC.
+ * TODO : Update the scheduling byte report for multiple LC based on QCI
+ * and Priority */
+ dlMsgAlloc->lcSchInfo[dlMsgAlloc->numLc -1].schBytes = accumalatedSize;
/* PUCCH resource */
schAllocPucchResource(cell, dlMsgAlloc->crnti, slot);
* @param[in] payLoadSize - size of payload in bytes
* @return TBsize from the Table in bytes
**/
-uint16_t schCalcTbSize(uint16_t payLoadSize)
+uint16_t schCalcTbSize(uint32_t payLoadSize)
{
uint8_t tbsIndex = 0;
- payLoadSize = payLoadSize*8;
+ uint16_t maxTbSize;
+
+ maxTbSize = tbSizeTable[TOTAL_TBSIZE_VALUES -1]/8;
+ if(payLoadSize >= maxTbSize)
+ return maxTbSize;
+ payLoadSize = payLoadSize*8;
while(payLoadSize > tbSizeTable[tbsIndex])
{
tbsIndex++;
/* functions declarations */
void freqDomRscAllocType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDomain);
-uint16_t schCalcTbSize(uint16_t payLoadSize);
+uint16_t schCalcTbSize(uint32_t payLoadSize);
uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
uint16_t schCalcTbSizeFromNPrb(uint16_t numPrb, uint16_t mcs, uint8_t numSymbols);
SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti);
typedef struct lcSchInfo
{
uint8_t lcId;
- uint16_t schBytes; /* Number of scheduled bytes */
+ uint32_t schBytes; /* Number of scheduled bytes */
}LcSchInfo;
typedef struct dlMsgAlloc
uint16_t ueIdx; /*!< UE ID */
bool commCh; /*!< Common or Dedicated Channel */
uint8_t lcId; /*!< Logical channel ID */
- uint16_t bo; /*!< Buffer occupancy reported by RLC */
+ uint32_t bo; /*!< Buffer occupancy reported by RLC */
}RlcBoStatus;
/* Scheduled logical channel info */
{
bool commCh; /* Common or dedicated channel */
uint8_t lcId; /*!< Logical channel ID */
- uint16_t bufSize; /*!< Total buffer size in bytes scheduled by MAC */
+ uint32_t bufSize; /*!< Total buffer size in bytes scheduled by MAC */
}RlcLcSchInfo;
/* Schedule result report */
return RFAILED;
}
- for (tmp = 0 ; tmp < (byteSize-1); tmp++)
- {
- id->buf[tmp] = tmp;
- }
+ memset(id->buf, 0, byteSize-1);
id->buf[byteSize-1] = val;
id->bits_unused = unusedBits;
return ROK;
&recvBuf, (int16_t *)&bufLen, CM_INET_NO_FLAG);
if(ret == ROK && recvBuf != NULLP)
{
- DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
- ODU_PRINT_MSG(recvBuf, 0 ,0);
+ //DU_LOG("\nDEBUG --> EGTP : Received DL Message[%ld]\n", gDlDataRcvdCnt + 1);
+ //ODU_PRINT_MSG(recvBuf, 0 ,0);
egtpHdlRecvData(recvBuf);
gDlDataRcvdCnt++;
}
/* Extracting version fro 1st byte */
version = tmpByte[0] >> 5;
- DU_LOG("\nDEBUG --> EGTP : Version %d", version);
+ //DU_LOG("\nDEBUG --> EGTP : Version %d", version);
/* Decode message type */
ODU_REM_PRE_MSG((Data*)&(egtpMsg->msgHdr.msgType), mBuf);
- DU_LOG("\nDEBUG --> EGTP : msgType %d", egtpMsg->msgHdr.msgType);
+ //DU_LOG("\nDEBUG --> EGTP : msgType %d", egtpMsg->msgHdr.msgType);
/****************************************************************************
* Message length param is 2 bytes. So decode next 2 bytes from msg hdr and
ODU_REM_PRE_MSG(&tmpByte[1], mBuf);
ODU_REM_PRE_MSG(&tmpByte[2], mBuf);
msgLen = (tmpByte[1] << 8) | tmpByte[2];
- DU_LOG("\nDEBUG --> EGTP : msgLen %d", msgLen);
+ //DU_LOG("\nDEBUG --> EGTP : msgLen %d", msgLen);
/****************************************************************************
ODU_REM_PRE_MSG(&tmpByte[3], mBuf);
ODU_REM_PRE_MSG(&tmpByte[4], mBuf);
egtpMsg->msgHdr.teId = (tmpByte[1] << 24) | (tmpByte[2] << 16) | (tmpByte[3] << 8) | tmpByte[4];
- DU_LOG("\nDEBUG --> EGTP : teId %d",egtpMsg->msgHdr.teId);
+ //DU_LOG("\nDEBUG --> EGTP : teId %d",egtpMsg->msgHdr.teId);
/* If any one of S, E or PN flag is set, set extension present as true. */
egtpMsg->msg = mBuf;
- DU_LOG("\nDEBUG --> EGTP : DL Data Buffer after decoding header ");
- ODU_PRINT_MSG(mBuf, 0, 0);
+ //DU_LOG("\nDEBUG --> EGTP : DL Data Buffer after decoding header ");
+ //ODU_PRINT_MSG(mBuf, 0, 0);
/* Forward the data to duApp/RLC */
{
uint8_t unused = 4;
uint8_t byteSize = 3;
- uint8_t val = 1;
+ uint8_t val = 16;
if(ricId != NULLP)
{
ricId->pLMN_Identity.size = byteSize * sizeof(uint8_t);