* Spec 38.214 Sec 5.1.2.2.2
*/
coreset0Size= sib1PdcchInfo->coresetCfg.coreSetSize;
- rbStart = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb;
- rbLen = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb;
+ rbStart = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb;
+ rbLen = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb;
if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
{
}
/* Fetching DCI field values */
- timeDomResAssign = sib1PdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1;
- VRB2PRBMap = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
- modNCodScheme = sib1PdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
- redundancyVer = sib1PdcchInfo->dci.pdschCfg->codeword[0].rvIndex;
+ timeDomResAssign = sib1PdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex -1;
+ VRB2PRBMap = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping;
+ modNCodScheme = sib1PdcchInfo->dci.pdschCfg.codeword[0].mcsIndex;
+ redundancyVer = sib1PdcchInfo->dci.pdschCfg.codeword[0].rvIndex;
sysInfoInd = 0; /* 0 for SIB1; 1 for SI messages */
reserved = 0;
/* TODO: Fill values of coreset0Size, rbStart and rbLen */
coreset0Size= rarPdcchInfo->coresetCfg.coreSetSize;
- rbStart = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb;
- rbLen = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb;
+ rbStart = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb;
+ rbLen = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb;
if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
{
}
/* Fetching DCI field values */
- timeDomResAssign = rarPdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex;
- VRB2PRBMap = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
- modNCodScheme = rarPdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
+ timeDomResAssign = rarPdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex;
+ VRB2PRBMap = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping;
+ modNCodScheme = rarPdcchInfo->dci.pdschCfg.codeword[0].mcsIndex;
tbScaling = 0; /* configured to 0 scaling */
reserved = 0;
*
******************************************************************/
void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\
- DlMsgInfo *dlMsgInfo)
+ DlMsgSchInfo *dlMsgSchInfo)
{
if(dlDciPtr != NULLP)
{
* Spec 38.214 Sec 5.1.2.2.2
*/
coresetSize = pdcchInfo->coresetCfg.coreSetSize;
- rbStart = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb;
- rbLen = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb;
+ rbStart = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb;
+ rbLen = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb;
if((rbLen >=1) && (rbLen <= coresetSize - rbStart))
{
}
/* Fetching DCI field values */
- dciFormatId = dlMsgInfo->dciFormatId; /* Always set to 1 for DL */
- timeDomResAssign = pdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1;
- VRB2PRBMap = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping;
- modNCodScheme = pdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
- ndi = dlMsgInfo->ndi;
- redundancyVer = pdcchInfo->dci.pdschCfg->codeword[0].rvIndex;
- harqProcessNum = dlMsgInfo->harqProcNum;
- dlAssignmentIdx = dlMsgInfo->dlAssignIdx;
- pucchTpc = dlMsgInfo->pucchTpc;
- pucchResoInd = dlMsgInfo->pucchResInd;
- harqFeedbackInd = dlMsgInfo->harqFeedbackInd;
+ dciFormatId = dlMsgSchInfo->dciFormatId; /* Always set to 1 for DL */
+ timeDomResAssign = pdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex -1;
+ VRB2PRBMap = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping;
+ modNCodScheme = pdcchInfo->dci.pdschCfg.codeword[0].mcsIndex;
+ ndi = dlMsgSchInfo->transportBlock[0].ndi;
+ redundancyVer = pdcchInfo->dci.pdschCfg.codeword[0].rvIndex;
+ harqProcessNum = dlMsgSchInfo->harqProcNum;
+ dlAssignmentIdx = dlMsgSchInfo->dlAssignIdx;
+ pucchTpc = dlMsgSchInfo->pucchTpc;
+ pucchResoInd = dlMsgSchInfo->pucchResInd;
+ harqFeedbackInd = dlMsgSchInfo->harqFeedbackInd;
/* Reversing bits in each DCI field */
dciFormatId = reverseBits(dciFormatId, dciFormatIdSize);
memset(&dlTtiReqPdu->pdu.pdcch_pdu, 0, sizeof(fapi_dl_pdcch_pdu_t));
if(rntiType == SI_RNTI_TYPE)
{
- pdcchInfo = &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg;
+ pdcchInfo = dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg;
bwp = &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp;
fillSib1DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
}
else if(rntiType == RA_RNTI_TYPE)
{
- pdcchInfo = &dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg;
+ pdcchInfo = dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg;
bwp = &dlSlot->dlInfo.rarAlloc[ueIdx]->bwp;
fillRarDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
}
else if(rntiType == TC_RNTI_TYPE || rntiType == C_RNTI_TYPE)
{
- pdcchInfo = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgPdcchCfg;
- bwp = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].bwp;
+ pdcchInfo = dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg;
+ bwp = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp;
fillDlMsgDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\
- &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgInfo);
+ dlSlot->dlInfo.dlMsgAlloc[ueIdx]);
}
else
{
DU_LOG("\nERROR --> LWR_MAC: Failed filling PDCCH Pdu");
return RFAILED;
}
+
dlTtiReqPdu->pduType = PDCCH_PDU_TYPE;
dlTtiReqPdu->pdu.pdcch_pdu.bwpSize = bwp->freqAlloc.numPrb;
dlTtiReqPdu->pdu.pdcch_pdu.bwpStart = bwp->freqAlloc.startPrb;
if(dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP)
{
/* PDCCH and PDSCH PDU is filled */
- if(dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH)
+ if(dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg && dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg)
count += 2;
else
count += 1;
if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
{
- for(idx=0; idx<dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++)
- {
- /* PDCCH and PDSCH PDU is filled */
- if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH)
- count += 2;
- else if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres != NONE)
- count += 1;
- }
+ /* PDCCH and PDSCH PDU is filled */
+ if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg)
+ count += 1;
+ if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
+ count += 1;
}
}
return count;
* ********************************************************************/
uint8_t calcTxDataReqPduCount(MacDlSlot *dlSlot)
{
- uint8_t idx = 0, count = 0, ueIdx=0;
+ uint8_t count = 0, ueIdx=0;
if(dlSlot->dlInfo.isBroadcastPres && dlSlot->dlInfo.brdcstAlloc.sib1TransmissionMode)
{
for(ueIdx=0; ueIdx<MAX_NUM_UE; ueIdx++)
{
- if((dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) && \
- ((dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || (dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU)))
+ if((dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) && (dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg))
count++;
if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
{
- for(idx=0; idx<dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++)
- {
- if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH || \
- dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU)
- count++;
- }
+ if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
+ count++;
}
}
return count;
* @return ROK
*
* ********************************************************************/
-uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo *rarInfo, PdschCfg pdschCfg)
+uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo *rarInfo, PdschCfg *pdschCfg)
{
uint16_t payloadSize;
uint8_t *rarPayload = NULLP;
pduDesc[pduIndex].num_tlvs = 1;
/* fill the TLV */
- payloadSize = pdschCfg.codeword[0].tbSize;
+ payloadSize = pdschCfg->codeword[0].tbSize;
pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
pduDesc[pduIndex].tlvs[0].tl.length = payloadSize;
LWR_MAC_ALLOC(rarPayload, payloadSize);
* @return ROK
*
* ********************************************************************/
-uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsgInfo *dlMsgInfo, PdschCfg pdschCfg)
+uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsgSchInfo *dlMsgSchInfo, PdschCfg *pdschCfg)
{
uint16_t payloadSize;
uint8_t *dlMsgPayload = NULLP;
pduDesc[pduIndex].num_tlvs = 1;
/* fill the TLV */
- payloadSize = pdschCfg.codeword[0].tbSize;
+ payloadSize = pdschCfg->codeword[0].tbSize;
pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64;
pduDesc[pduIndex].tlvs[0].tl.length = payloadSize;
LWR_MAC_ALLOC(dlMsgPayload, payloadSize);
return RFAILED;
}
payloadElem = (fapi_api_queue_elem_t *)dlMsgPayload;
- FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, dlMsgInfo->dlMsgPduLen);
- memcpy(dlMsgPayload + TX_PAYLOAD_HDR_LEN, dlMsgInfo->dlMsgPdu, dlMsgInfo->dlMsgPduLen);
+ FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, dlMsgSchInfo->dlMsgPduLen);
+ memcpy(dlMsgPayload + TX_PAYLOAD_HDR_LEN, dlMsgSchInfo->dlMsgPdu, dlMsgSchInfo->dlMsgPduLen);
#ifdef INTEL_WLS_MEM
mtGetWlsHdl(&wlsHdlr);
/* PDSCH PDU */
fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
- currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg,
+ &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg->dci.pdschCfg,
currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp,
pduIndex);
dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex;
{
/* Filling RAR param */
rntiType = RA_RNTI_TYPE;
- if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \
- (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDCCH_PDU))
- {
+ if(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg)
+ {
fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
currDlSlot, -1, rntiType, CORESET_TYPE0, ueIdx);
numPduEncoded++;
- }
- if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \
- (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU))
+ MAC_FREE(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg, sizeof(PdcchCfg));
+ }
+ if(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg)
{
fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
- &currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg,
+ currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg,
currDlSlot->dlInfo.rarAlloc[ueIdx]->bwp,
pduIndex);
numPduEncoded++;
pduIndex++;
- DU_LOG("\033[1;32m");
+ DU_LOG("\033[1;32m");
DU_LOG("\nDEBUG --> LWR_MAC: RAR sent...");
DU_LOG("\033[0m");
}
if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
{
- for(idx=0; idx<currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++)
- {
- /* Filling Msg4 param */
- if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \
- (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDCCH_PDU))
- {
- if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu)
- {
- rntiType = TC_RNTI_TYPE;
- fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
- currDlSlot, idx, rntiType, CORESET_TYPE0, ueIdx);
- }
- else
- {
- /* Filling other DL msg params */
- rntiType = C_RNTI_TYPE;
- fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
- currDlSlot, idx, rntiType, CORESET_TYPE1, ueIdx);
- }
- numPduEncoded++;
- }
-
- if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.dlMsgPdu != NULLP)
- {
- if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \
- (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU))
- {
- fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \
- &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgPdschCfg,\
- currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].bwp, pduIndex);
- numPduEncoded++;
- pduIndex++;
-
- DU_LOG("\033[1;32m");
- if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu)
- {
- DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent...");
- }
- else
- {
- DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent...");
- }
- DU_LOG("\033[0m");
- }
-
- }
- /* else
- {
- MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc));
- currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP;
- }
- */
- }
+ if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg) \
+ {
+ rntiType = C_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded],
+ currDlSlot, idx, rntiType, currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg->coresetCfg.coreSetType, ueIdx);
+ numPduEncoded++;
+ }
+
+ if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu != NULLP)
+ {
+ if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
+ {
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg,\
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp, pduIndex);
+ numPduEncoded++;
+ pduIndex++;
+
+ DU_LOG("\033[1;32m");
+ if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status))
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent...");
+ MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status, sizeof(bool));
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent...");
+ }
+ DU_LOG("\033[0m");
+ }
+
+ }
+ MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg,sizeof(PdcchCfg));
+ /* else
+ {
+ MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc));
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP;
+ }
+ */
}
}
uint8_t nPdu = 0;
uint8_t ueIdx=0;
- uint8_t schInfoIdx = 0;
uint16_t cellIdx=0;
uint16_t pduIndex = 0;
fapi_tx_data_req_t *txDataReq =NULLP;
if(dlSlot->dlInfo.brdcstAlloc.sib1TransmissionMode)
{
fillSib1TxDataReq(txDataReq->pdu_desc, pduIndex, &macCb.macCell[cellIdx]->macCellCfg, \
- dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg);
+ &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg->dci.pdschCfg);
pduIndex++;
+ MAC_FREE(dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg,sizeof(PdcchCfg));
txDataReq->num_pdus++;
}
if(dlSlot->pageAllocInfo != NULLP)
{
if(dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP)
{
- if((dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || (dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU))
+ if((dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg))
{
fillRarTxDataReq(txDataReq->pdu_desc, pduIndex, &dlSlot->dlInfo.rarAlloc[ueIdx]->rarInfo,\
dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg);
pduIndex++;
txDataReq->num_pdus++;
+ MAC_FREE(dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, sizeof(PdschCfg));
}
MAC_FREE(dlSlot->dlInfo.rarAlloc[ueIdx],sizeof(RarAlloc));
}
if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP)
{
- for(schInfoIdx=0; schInfoIdx < dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+ if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
{
- if((dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH) || \
- (dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU))
- {
- fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \
- &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo, \
- dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg);
- pduIndex++;
- txDataReq->num_pdus++;
- }
- MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu, \
- dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen);
- dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = NULLP;
+ fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \
+ dlSlot->dlInfo.dlMsgAlloc[ueIdx], \
+ dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg);
+ pduIndex++;
+ txDataReq->num_pdus++;
+ MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg,sizeof(PdschCfg));
}
- MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc));
+ MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu, \
+ dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPduLen);
+ dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu = NULLP;
+ MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgSchInfo));
}
}
uint8_t *msg4Pdu; /* storing DL-CCCH Ind Pdu */
uint16_t msg4PduLen; /* storing DL-CCCH Ind Pdu Len */
DlHarqProcCb msg4HqInfo; /* HARQ process info for msg 4 */
+ bool *macMsg4Status;
}MacRaCbInfo;
typedef struct macCe
void fillMacCe(MacCeInfo *macCeData, uint8_t *msg3Pdu);
void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint16_t tbSize);
uint8_t unpackRxData(uint16_t cellId, SlotTimingInfo slotInfo, RxDataIndPdu *rxDataIndPdu);
-void fillMg4Pdu(DlMsgAlloc *msg4Alloc);
+void fillMg4Pdu(DlMsgSchInfo *msg4Alloc);
void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo);
uint8_t macProcUlCcchInd(uint16_t cellId, uint16_t crnti, uint16_t rrcContSize, uint8_t *rrcContainer);
uint8_t macProcShortBsr(uint16_t cellId, uint16_t crnti, uint8_t lcgId, uint32_t bufferSize);
* @return
* -# Void
**/
-void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo schedInfo)
+void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo *schedInfo)
{
uint8_t hqProcId = 0, tbIdx = 0, cwIdx = 0;
DlHarqEnt *dlHqEnt = NULLP;
DlHarqProcCb *hqProcCb = NULLP;
dlHqEnt = &ueCb->dlInfo.dlHarqEnt;
- hqProcId = schedInfo.dlMsgInfo.harqProcNum;
+ hqProcId = schedInfo->harqProcNum;
hqProcCb = &dlHqEnt->harqProcCb[hqProcId];
/* Check if harqProcId is already present in UE's DL HARQ Entity */
- if(hqProcCb->procId == schedInfo.dlMsgInfo.harqProcNum)
+ if(hqProcCb->procId == schedInfo->harqProcNum)
{
/* Expected Behaviour:
* If a HARQ proc is already present in DL HARQ entity, it means this HARQ proc
/* Fill HARQ Proc Cb */
hqProcCb->procId = hqProcId;
- for(cwIdx = 0; cwIdx < schedInfo.dlMsgPdschCfg.numCodewords; cwIdx++)
+ for(cwIdx = 0; cwIdx < schedInfo->dlMsgPdschCfg->numCodewords; cwIdx++)
{
memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlMsgTime, sizeof(SlotTimingInfo));
- hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo.dlMsgPdschCfg.codeword[cwIdx].tbSize;
+ hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo->dlMsgPdschCfg->codeword[cwIdx].tbSize;
hqProcCb->numTb++;
}
return;
################################################################################
*******************************************************************************/
-void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo schedInfo);
+void addDlHqProcInUe(SlotTimingInfo dlMsgTime, MacUeCb *ueCb, DlMsgSchInfo *schedInfo);
uint8_t updateNewTbInDlHqProcCb(SlotTimingInfo slotInfo, MacUeCb *ueCb, uint32_t tbSize, uint8_t *txPdu);
uint8_t* fetchTbfromDlHarqProc(SlotTimingInfo slotInfo, MacUeCb *ueCb, uint8_t hqProcId, uint32_t tbSize);
uint8_t MacSchReleaseDlHarqProc(Pst *pst, SchRlsHqInfo *rlsHqInfo);
uint8_t ueId = 0;
uint8_t lcIdx = 0;
uint8_t *txPdu = NULLP;
- uint8_t schInfoIdx = 0 ;
uint16_t cellIdx = 0, txPduLen = 0;
MacDlData macDlData;
MacDlSlot *currDlSlot = NULLP;
currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlData->slotInfo.slot];
if(currDlSlot->dlInfo.dlMsgAlloc[ueId-1])
{
- for(schInfoIdx=0; schInfoIdx<currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->numSchedInfo; schInfoIdx++)
+ if(currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdschCfg)
{
- if((currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
- (currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH))
- break;
- }
-
- txPduLen = currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[0].tbSize\
- - TX_PAYLOAD_HDR_LEN;
- MAC_ALLOC(txPdu, txPduLen);
- if(!txPdu)
- {
- DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
- return RFAILED;
+ txPduLen = currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdschCfg->codeword[0].tbSize\
+ - TX_PAYLOAD_HDR_LEN;
+ MAC_ALLOC(txPdu, txPduLen);
+ if(!txPdu)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
+ return RFAILED;
+ }
+ macMuxPdu(&macDlData, NULLP, txPdu, txPduLen);
+
+ currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPduLen = txPduLen;
+ currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdu = txPdu;
+ /* Add muxed TB to DL HARQ Proc CB. This will be used if retranmission of
+ * TB is requested in future. */
+ updateNewTbInDlHqProcCb(dlData->slotInfo, &macCb.macCell[cellIdx]->ueCb[ueId -1], \
+ currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgPdschCfg->codeword[0].tbSize, txPdu);
}
- macMuxPdu(&macDlData, NULLP, txPdu, txPduLen);
-
- currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen = txPduLen;
- currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = txPdu;
- /* Add muxed TB to DL HARQ Proc CB. This will be used if retranmission of
- * TB is requested in future. */
- updateNewTbInDlHqProcCb(dlData->slotInfo, &macCb.macCell[cellIdx]->ueCb[ueId -1], \
- currDlSlot->dlInfo.dlMsgAlloc[ueId-1]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[0].tbSize, txPdu);
}
for(lcIdx = 0; lcIdx < dlData->numLc; lcIdx++)
if(dlInfo.dlMsgAlloc[ueIdx])
{
schedRpt->rnti = dlInfo.dlMsgAlloc[ueIdx]->crnti;
- schedRpt->numLc = dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].numLc;
+ schedRpt->numLc = dlInfo.dlMsgAlloc[ueIdx]->transportBlock[0].numLc;
for(lcIdx = 0; lcIdx < schedRpt->numLc; lcIdx++)
{
- schedRpt->lcSch[lcIdx].lcId = dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].lcSchInfo[lcIdx].lcId;
- schedRpt->lcSch[lcIdx].bufSize = dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].lcSchInfo[lcIdx].schBytes;
+ schedRpt->lcSch[lcIdx].lcId = dlInfo.dlMsgAlloc[ueIdx]->transportBlock[0].lcSchInfo[lcIdx].lcId;
+ schedRpt->lcSch[lcIdx].bufSize = dlInfo.dlMsgAlloc[ueIdx]->transportBlock[0].lcSchInfo[lcIdx].schBytes;
}
}
uint8_t *retxTb = NULLP, *txPdu = NULLP;
uint16_t txPduLen = 0;
MacDlSlot *currDlSlot = NULLP;
- DlMsgSchInfo schedInfo;
+ DlMsgSchInfo *schedInfo;
DlHarqProcCb *hqProcCb = NULLP;
#ifdef CALL_FLOW_DEBUG_LOG
dlSlot[dlSchedInfo->schSlotValue.dlMsgTime.slot];
currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = dlSchedInfo->dlMsgAlloc[ueIdx]; /* copy msg4 alloc pointer in MAC slot info */
currDlSlot->dlInfo.cellId = dlSchedInfo->cellId;
+
+ if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg && dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg->coresetCfg.coreSetType == CORESET_TYPE0)
+ {
+ MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status, sizeof(bool));
+ }
/* Check if the downlink pdu is msg4 */
- for(schInfoIdx=0; schInfoIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+ if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status))
{
- if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu)
- {
- GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.crnti, ueId);
- ueIdx = ueId -1;
- schedInfo = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx];
- hqProcCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4HqInfo;
+ GET_UE_ID(dlSchedInfo->dlMsgAlloc[ueIdx]->crnti, ueId);
+ ueIdx = ueId -1;
+ schedInfo = dlSchedInfo->dlMsgAlloc[ueIdx];
+ hqProcCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4HqInfo;
- if(!dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].isRetx)
+ if(!dlSchedInfo->dlMsgAlloc[ueIdx]->transportBlock[0].ndi)
+ {
+ /* First transmission of MSG4 */
+ hqProcCb->procId = schedInfo->harqProcNum;
+ for(cwIdx = 0; cwIdx < schedInfo->dlMsgPdschCfg->numCodewords; cwIdx++)
{
- /* First transmission of MSG4 */
- hqProcCb->procId = schedInfo.dlMsgInfo.harqProcNum;
- for(cwIdx = 0; cwIdx < schedInfo.dlMsgPdschCfg.numCodewords; cwIdx++)
- {
- memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
- sizeof(SlotTimingInfo));
- hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo.dlMsgPdschCfg.codeword[cwIdx].tbSize;
- hqProcCb->numTb++;
- }
+ memcpy(&hqProcCb->tbInfo[hqProcCb->numTb].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
+ sizeof(SlotTimingInfo));
+ hqProcCb->tbInfo[hqProcCb->numTb].tbSize = schedInfo->dlMsgPdschCfg->codeword[cwIdx].tbSize;
+ hqProcCb->numTb++;
}
- else
+ }
+ else
+ {
+ /* MSG4 retransmission */
+ if(hqProcCb->procId == schedInfo->harqProcNum)
{
- /* MSG4 retransmission */
- if(hqProcCb->procId == schedInfo.dlMsgInfo.harqProcNum)
- {
- memcpy(&hqProcCb->tbInfo[0].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
- sizeof(SlotTimingInfo));
- }
+ memcpy(&hqProcCb->tbInfo[0].txTime, &dlSchedInfo->schSlotValue.dlMsgTime, \
+ sizeof(SlotTimingInfo));
}
}
- else
+ }
+ else
+ {
+ memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
+
+ if(!dlSchedInfo->dlMsgAlloc[ueIdx]->transportBlock[0].ndi)
{
- memcpy(&currDlSlot->dlInfo.schSlotValue, &dlSchedInfo->schSlotValue, sizeof(SchSlotValue));
-
- if(!dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].isRetx)
+ /* If new data transmission is scheduled, send schedule results to RLC */
+ if(dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg)
{
- /* If new data transmission is scheduled, send schedule results to RLC */
- if((dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
- (dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH))
- {
- sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime, ueIdx, schInfoIdx);
+ sendSchedRptToRlc(currDlSlot->dlInfo, dlSchedInfo->schSlotValue.dlMsgTime, ueIdx, schInfoIdx);
- /* Add HARQ Proc to DL HARQ Proc Entity in UE */
- addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
- dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx]);
- }
+ /* Add HARQ Proc to DL HARQ Proc Entity in UE */
+ addDlHqProcInUe(currDlSlot->dlInfo.schSlotValue.dlMsgTime, &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+ dlSchedInfo->dlMsgAlloc[ueIdx]);
}
- else
+ }
+ else
+ {
+ /* For retransmission, fetch PDU to be retransmitted from DL HARQ entity and schedule on corresponding slot */
+
+ /* As of now this loop will run only once for one TB.
+ * TODO : update handling of fetched TB appropriately when support for two TB is added
+ */
+ for(cwIdx = 0; cwIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg->numCodewords; cwIdx++)
{
- /* For retransmission, fetch PDU to be retransmitted from DL HARQ entity and schedule on corresponding slot */
-
- /* As of now this loop will run only once for one TB.
- * TODO : update handling of fetched TB appropriately when support for two TB is added
- */
- for(cwIdx = 0; \
- cwIdx < dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.numCodewords;\
- cwIdx++)
+ /* Fetch TB to be retransmitted */
+ txPduLen = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg->codeword[cwIdx].tbSize;
+ retxTb = fetchTbfromDlHarqProc(currDlSlot->dlInfo.schSlotValue.dlMsgTime, \
+ &macCb.macCell[cellIdx]->ueCb[ueIdx], \
+ dlSchedInfo->dlMsgAlloc[ueIdx]->harqProcNum, txPduLen);
+
+ /* Store PDU in corresponding DL slot */
+ MAC_ALLOC(txPdu, txPduLen);
+ if(!txPdu)
{
- /* Fetch TB to be retransmitted */
- txPduLen = dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg.codeword[cwIdx].tbSize;
- retxTb = fetchTbfromDlHarqProc(currDlSlot->dlInfo.schSlotValue.dlMsgTime, \
- &macCb.macCell[cellIdx]->ueCb[ueIdx], \
- dlSchedInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.harqProcNum, txPduLen);
-
- /* Store PDU in corresponding DL slot */
- MAC_ALLOC(txPdu, txPduLen);
- if(!txPdu)
- {
- DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcDlAlloc");
- return RFAILED;
- }
- memcpy(txPdu, retxTb, txPduLen);
-
- currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen = txPduLen;
- currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = txPdu;
- }
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcDlAlloc");
+ return RFAILED;
+ }
+ memcpy(txPdu, retxTb, txPduLen);
+
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPduLen = txPduLen;
+ currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu = txPdu;
}
}
}
memset(&msg4DlData, 0, sizeof(MacDlData));
memset(&macCeData, 0, sizeof(MacCeInfo));
- GET_UE_ID(msg4SchInfo->dlMsgInfo.crnti, ueId);
+ GET_UE_ID(msg4SchInfo->crnti, ueId);
ueIdx = ueId -1;
if(macCb.macCell[cellIdx] == NULLP)
/* storing msg4 Pdu in macDlSlot */
if(hqProcCb->tbInfo[0].tb)
{
- msg4SchInfo->dlMsgInfo.dlMsgPduLen = msg4TxPduLen;
- MAC_ALLOC(msg4SchInfo->dlMsgInfo.dlMsgPdu, msg4SchInfo->dlMsgInfo.dlMsgPduLen);
- if(msg4SchInfo->dlMsgInfo.dlMsgPdu != NULLP)
+ msg4SchInfo->dlMsgPduLen = msg4TxPduLen;
+ MAC_ALLOC(msg4SchInfo->dlMsgPdu, msg4SchInfo->dlMsgPduLen);
+ if(msg4SchInfo->dlMsgPdu != NULLP)
{
- memcpy(msg4SchInfo->dlMsgInfo.dlMsgPdu, hqProcCb->tbInfo[0].tb, \
- msg4SchInfo->dlMsgInfo.dlMsgPduLen);
+ memcpy(msg4SchInfo->dlMsgPdu, hqProcCb->tbInfo[0].tb, \
+ msg4SchInfo->dlMsgPduLen);
}
}
else
void buildAndSendMuxPdu(SlotTimingInfo currTimingInfo)
{
uint8_t ueIdx;
- uint8_t schInfoIdx;
uint16_t cellIdx;
MacDlSlot *currDlSlot = NULLP;
SlotTimingInfo muxTimingInfo;
{
if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx])
{
- for(schInfoIdx=0; schInfoIdx<currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++)
+ if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status)&& (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg))
{
- if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.isMsg4Pdu) &&
- ((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU) ||
- (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH)))
- {
- fillMsg4Pdu(currTimingInfo.cellId, &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx]);
- }
+ fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.dlMsgAlloc[ueIdx]);
}
}
}
- DU_LOG("\nINFO --> MAC : Received CfgReq for MAC layer, Entity = %d, Instance = %d", pst->srcEnt, pst->srcInst);
+ DU_LOG("\nINFO --> MAC : Received CfgReq for MAC layer, Entity = %d, Instance = %d", pst->srcEnt, pst->srcInst);
RG_IS_INST_VALID(pst->dstInst);
inst = pst->dstInst - RG_INST_START;
amDl->pollSn = (amDl->txNext - 1) & amDl->snModMask;
- DU_LOG("\nINFO --> RLC_DL : rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d",
+ DU_LOG("\nINFO --> RLC_DL : rlcAmmDlCheckAndSetPoll: Poll SN = %d UEID:%d CELLID:%d",
amDl->pollSn, rbCb->rlcId.ueId, rbCb->rlcId.cellId);
/* kw005.201: Fix for poll retransmission timer.
/* Starting timer to print throughput */
if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_UE_THROUGHPUT_TMR)) == FALSE)
{
- DU_LOG("\nINFO --> RLC_DL : Starting UE Throughput timer");
+ DU_LOG("\nINFO --> RLC_DL : Starting UE Throughput timer");
rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_UE_THROUGHPUT_TMR);
}
}
/* Starting timer to print throughput */
if((rlcChkTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_SNSSAI_THROUGHPUT_TMR)) == FALSE)
{
- DU_LOG("\nINFO --> RLC_DL : Starting SNSSAI Throughput timer");
+ DU_LOG("\nINFO --> RLC_DL : Starting SNSSAI Throughput timer");
rlcStartTmr(gCb, (PTR)(&gCb->rlcThpt), EVENT_RLC_SNSSAI_THROUGHPUT_TMR);
}
return (RFAILED);
}
- DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
+ DU_LOG("\nDEBUG --> RLC : RlcMiRlcConfigReq elmId(%d)", cfg->hdr.elmId.elmnt);
switch(cfg->hdr.elmId.elmnt)
{
snssaiNode = (RlcTptPerSnssai *)node->node;
if(memcmp(snssaiNode->snssai, snssai, sizeof(Snssai)) == 0)
{
- DU_LOG("\nDEBUG --> RLC : SNSSAI found in LL");
+ DU_LOG("\nDEBUG --> RLC : SNSSAI found in LL");
found = TRUE;
break;
}
if(snssaiTputNode != NULLP)
{
snssaiTputNode->dataVol += staIndTb->lchStaInd[count].totBufSize;
- DU_LOG("\nINFO -->SCH: SNSSAI List Grant:%d, lcId:%d, total :%ld",\
+ DU_LOG("\nINFO --> RLC_DL: SNSSAI List Grant:%d, lcId:%d, total :%ld",\
staIndTb->lchStaInd[count].totBufSize, staIndTb->lchStaInd[count].lcId,\
snssaiTputNode->dataVol);
}
pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
/* Storing pdschCfg pointer here. Required to access pdsch config while
fillig up pdcch pdu */
- SCH_ALLOC(pdcch->dci.pdschCfg, sizeof(PdschCfg));
- if(pdcch->dci.pdschCfg == NULLP)
- {
- DU_LOG("\nERROR --> SCH : Memory allocation failed in %s ", __func__);
- return RFAILED;
- }
- pdsch = pdcch->dci.pdschCfg;
+ pdsch = &pdcch->dci.pdschCfg;
/* fill the PDSCH PDU */
uint8_t cwCount = 0;
SCH_FREE(cellCb->cellCfg.plmnInfoList[plmnIdx].snssai, cellCb->cellCfg.plmnInfoList[plmnIdx].numSliceSupport*sizeof(Snssai*));
}
}
- SCH_FREE(cellCb->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg, sizeof(PdschCfg));
for(uint16_t idx =0; idx<MAX_SFN; idx++)
{
if(ssbOccasion && sib1Occasion)
{
broadcastPrbStart = cell->cellCfg.dlCfgCommon.schFreqInfoDlSib.offsetToPointA;
- broadcastPrbEnd = broadcastPrbStart + SCH_SSB_NUM_PRB + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+ broadcastPrbEnd = broadcastPrbStart + SCH_SSB_NUM_PRB + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
}
else if(ssbOccasion)
{
}
else if(sib1Occasion)
{
- broadcastPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.startPrb;
- broadcastPrbEnd = broadcastPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+ broadcastPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.startPrb;
+ broadcastPrbEnd = broadcastPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
}
/* Iterate through all free PRB blocks */
{
reservedPrbStart = cell->cellCfg.dlCfgCommon.schFreqInfoDlSib.offsetToPointA;
reservedPrbEnd = reservedPrbStart + SCH_SSB_NUM_PRB + \
- cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+ cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
}
else if(ssbOccasion)
{
}
else if(sib1Occasion)
{
- reservedPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.startPrb;
- reservedPrbEnd = reservedPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb -1;
+ reservedPrbStart = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.startPrb;
+ reservedPrbEnd = reservedPrbStart + cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc.numPrb -1;
}
else
{
uint8_t pdschUe; /*!< UE for which PDSCH is scheduled in this slot */
RarAlloc *rarAlloc[MAX_NUM_UE]; /*!< RAR allocation per UE*/
DciInfo *ulGrant;
- DlMsgAlloc *dlMsgAlloc[MAX_NUM_UE]; /*!< Dl msg allocation per UE*/
+ DlMsgSchInfo *dlMsgAlloc[MAX_NUM_UE]; /*!< Dl msg allocation per UE*/
}SchDlSlotInfo;
typedef struct schRaCb
uint8_t schFillRar(SchCellCb *cell, SlotTimingInfo rarTime, uint16_t ueId, RarAlloc *rarAlloc, uint8_t k0Index);
bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchDlHqProcCb **hqP);
uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t crnti,
-uint32_t tbSize, DlMsgAlloc *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol, uint8_t pdschNumSymbols,bool isRetx, SchDlHqProcCb* hqP);
-uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgAlloc *msg4Alloc,\
+uint32_t tbSize, DlMsgSchInfo *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol, uint8_t pdschNumSymbols,bool isRetx, SchDlHqProcCb* hqP);
+uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgSchInfo *msg4Alloc,\
uint8_t pdschStartSymbol, uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP);
uint8_t allocatePrbDl(SchCellCb *cell, SlotTimingInfo slotTime, uint8_t startSymbol, uint8_t symbolLength, \
uint16_t *startPrb, uint16_t numPrb);
-void fillDlMsgInfo(DlMsgInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb* hqP);
+void fillDlMsgInfo(DlMsgSchInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb* hqP);
bool findValidK0K1Value(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool dedMsg, uint8_t *pdschStartSymbol,\
uint8_t *pdschSymblLen, SlotTimingInfo *pdcchTime, SlotTimingInfo *pdschTime, SlotTimingInfo *pucchTime, bool isRetx, SchDlHqProcCb *hqP);
RaRspWindowStatus isInRaRspWindow(SchRaReq *raReq, SlotTimingInfo frameToCheck, uint16_t numSlotsPerSystemFrame);
bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchUlHqProcCb **hqP);
/*Generic Functions*/
-void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc, BsrInfo *bsrInfo, uint32_t *accumalatedBOSize);
+void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgSchInfo *dlMsgAlloc, BsrInfo *bsrInfo, uint32_t *accumalatedBOSize);
uint16_t searchLargestFreeBlock(SchCellCb *cell, SlotTimingInfo slotTime,uint16_t *startPrb, Direction dir);
LcInfo* handleLcLList(CmLListCp *lcLL, uint8_t lcId, ActionTypeLL action);
void prbAllocUsingRRMPolicy(CmLListCp *lcLL, bool dedicatedPRB, uint16_t mcsIdx,uint8_t numSymbols,\
}
dlBrdcstAlloc->crnti = SI_RNTI;
- dmrs = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->dmrs;
- freqAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschFreqAlloc;
- timeAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg->pdschTimeAlloc;
+ dmrs = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.dmrs;
+ freqAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschFreqAlloc;
+ timeAlloc = cell->sib1SchCfg.sib1PdcchCfg.dci.pdschCfg.pdschTimeAlloc;
schDlSlotInfo = cell->schDlSlotInfo[slotTime.slot];
/* Find total symbols used including DMRS */
}
memcpy(&dlBrdcstAlloc->sib1Alloc.bwp, &cell->sib1SchCfg.bwp, sizeof(BwpCfg));
- memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg));
- schDlSlotInfo->sib1Pres = true;
+ SCH_ALLOC(dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg,sizeof(PdcchCfg));
+ if(dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg)
+ {
+ memcpy(dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg));
+ schDlSlotInfo->sib1Pres = true;
+ }
+ else
+ {
+ DU_LOG("\nERROR --> SCH : Memory allocation failed in %s", __func__);
+ return RFAILED;
+ }
return ROK;
}
* Fills pdcch and pdsch info for msg4
*
* @params[in] SchCellCb *cell, SlotTimingInfo msg4Time
- * @params[in] uint8_t ueId, DlMsgAlloc *dlMsgAlloc
+ * @params[in] uint8_t ueId, DlMsgSchInfo *dlMsgAlloc
* @params[in] uint8_t pdschStartSymbol, uint8_t pdschNumSymbols
* @params[in] bool isRetx, SchDlHqProcCb *hqP
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgAlloc *dlMsgAlloc,\
+uint8_t schDlRsrcAllocMsg4(SchCellCb *cell, SlotTimingInfo msg4Time, uint8_t ueId, DlMsgSchInfo *dlMsgAlloc,\
uint8_t pdschStartSymbol, uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP)
{
uint8_t coreset0Idx = 0;
return RFAILED;
}
- msg4Alloc = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo];
+ msg4Alloc = dlMsgAlloc;
initialBwp = &cell->cellCfg.dlCfgCommon.schInitialDlBwp;
- pdcch = &msg4Alloc->dlMsgPdcchCfg;
- pdsch = &msg4Alloc->dlMsgPdschCfg;
+ SCH_ALLOC(msg4Alloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+
+ if(!msg4Alloc->dlMsgPdcchCfg)
+ {
+ DU_LOG("\nERROR --> SCH : Memory allocation failed in %s",__func__);
+ return RFAILED;
+ }
+ pdcch = msg4Alloc->dlMsgPdcchCfg;
bwp = &msg4Alloc->bwp;
coreset0Idx = initialBwp->pdcchCommon.commonSearchSpace.coresetId;
- fillDlMsgInfo(&msg4Alloc->dlMsgInfo, cell->raCb[ueId-1].tcrnti, isRetx, hqP);
- msg4Alloc->dlMsgInfo.dlMsgPduLen = cell->raCb[ueId-1].dlMsgPduLen;
+ fillDlMsgInfo(msg4Alloc, cell->raCb[ueId-1].tcrnti, isRetx, hqP);
+ msg4Alloc->dlMsgPduLen = cell->raCb[ueId-1].dlMsgPduLen;
/* derive the sib1 coreset0 params from table 13-1 spec 38.213 */
numRbs = coresetIdxTable[coreset0Idx][1];
pdcch->dci.beamPdcchInfo.prg[0].beamIdx[0] = 0;
pdcch->dci.txPdcchPower.beta_pdcch_1_0 = 0;
pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
- pdcch->dci.pdschCfg = pdsch;
-
+ pdsch = &pdcch->dci.pdschCfg;
+
/* fill the PDSCH PDU */
uint8_t cwCount = 0;
pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
if(isRetx != TRUE)
{
- tbSize = schCalcTbSize(msg4Alloc->dlMsgInfo.dlMsgPduLen + TX_PAYLOAD_HDR_LEN); /* MSG4 size + FAPI header size*/
+ tbSize = schCalcTbSize(msg4Alloc->dlMsgPduLen + TX_PAYLOAD_HDR_LEN); /* MSG4 size + FAPI header size*/
hqP->tbInfo[cwCount].tbSzReq = tbSize;
pdsch->codeword[cwCount].rvIndex = 0;
}
&pdsch->pdschFreqAlloc.startPrb, pdsch->pdschFreqAlloc.numPrb)) != ROK)
{
DU_LOG("\nERROR --> SCH : Resource allocation failed for MSG4");
+ SCH_FREE(msg4Alloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
return RFAILED;
}
pdsch->txPdschPower.powerControlOffset = 0;
pdsch->txPdschPower.powerControlOffsetSS = 0;
- msg4Alloc->dlMsgInfo.isMsg4Pdu = true;
return ROK;
}
*
* @params[in] SchCellCb *cell, SlotTimingInfo slotTime
* @params[in] uint16_t crnti, uint32_t tbSize
- * @params[in] DlMsgAlloc *dlMsgAlloc, uint16_t startPRB
+ * @params[in] DlMsgSchInfo *dlMsgAlloc, uint16_t startPRB
* @params[in] uint8_t pdschStartSymbol, uint8_t pdschNumSymbols
* @params[in] bool isRetx, SchDlHqProcCb *hqP
* @return ROK - success
*
* ****************************************************************/
uint8_t schDlRsrcAllocDlMsg(SchCellCb *cell, SlotTimingInfo slotTime, uint16_t crnti,
- uint32_t tbSize, DlMsgAlloc *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol,
+ uint32_t tbSize, DlMsgSchInfo *dlMsgAlloc, uint16_t startPRB, uint8_t pdschStartSymbol,
uint8_t pdschNumSymbols, bool isRetx, SchDlHqProcCb *hqP)
{
uint8_t ueId=0;
+ uint8_t cwCount = 0;
PdcchCfg *pdcch = NULLP;
PdschCfg *pdsch = NULLP;
BwpCfg *bwp = NULLP;
SchPdschConfig pdschCfg;
uint8_t dmrsStartSymbol, startSymbol, numSymbol;
- pdcch = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdcchCfg;
- pdsch = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdschCfg;
- bwp = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].bwp;
+ SCH_ALLOC(dlMsgAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ if(!dlMsgAlloc->dlMsgPdcchCfg)
+ {
+ DU_LOG("\nERROR --> SCH : Memory allocation failed in schDlRsrcAllocDlMsg");
+ return RFAILED;
+ }
+ pdcch = dlMsgAlloc->dlMsgPdcchCfg;
+ bwp = &dlMsgAlloc->bwp;
GET_UE_ID(crnti, ueId);
ueCb = cell->ueCb[ueId-1];
pdcch->dci.txPdcchPower.beta_pdcch_1_0 = 0;
pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
- /* fill the PDSCH PDU */
- uint8_t cwCount = 0;
+ pdsch = &pdcch->dci.pdschCfg;
pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
pdsch->rnti = ueCb.crnti;
pdsch->pduIndex = 0;
&pdsch->pdschFreqAlloc.startPrb, pdsch->pdschFreqAlloc.numPrb)) != ROK)
{
DU_LOG("\nERROR --> SCH : allocatePrbDl() failed for DL MSG");
+ SCH_FREE(dlMsgAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
return RFAILED;
}
pdsch->txPdschPower.powerControlOffset = 0;
pdsch->txPdschPower.powerControlOffsetSS = 0;
- pdcch->dci.pdschCfg = pdsch;
return ROK;
}
/*[Exit1]: All LCs are allocated(allocBO = 0 for fully unallocated LC)*/
if(lcNode->allocBO != 0)
{
- DU_LOG("\nDEBUG --> SCH: All LC are allocated [SharedPRB:%d]",*sharedPRB);
+ DU_LOG("\nDEBUG --> SCH: All LC are allocated [SharedPRB:%d]",*sharedPRB);
return;
}
/*Loop Exit: All resources exhausted*/
if(*sharedPRB == 0)
{
- DU_LOG("\nDEBUG --> SCH: Default resources exhausted for LC:%d",lcNode->lcId);
+ DU_LOG("\nDEBUG --> SCH: Default resources exhausted for LC:%d",lcNode->lcId);
return;
}
}
/*[Step4]*/
if((isTxPayloadLenAdded != NULLP) && (*isTxPayloadLenAdded == FALSE))
{
- DU_LOG("\nDEBUG --> SCH: LC:%d is the First node to be allocated which includes TX_PAYLOAD_HDR_LEN",\
+ DU_LOG("\nDEBUG --> SCH: LC:%d is the First node to be allocated which includes TX_PAYLOAD_HDR_LEN",\
lcNode->lcId);
*isTxPayloadLenAdded = TRUE;
lcNode->allocBO = calculateEstimateTBSize((lcNode->reqBO + TX_PAYLOAD_HDR_LEN),\
* @return void
*
* *******************************************************************************************/
-void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgAlloc *dlMsgAlloc,\
+void updateGrantSizeForBoRpt(CmLListCp *lcLL, DlMsgSchInfo *dlMsgAlloc,\
BsrInfo *bsrInfo, uint32_t *accumalatedBOSize)
{
CmLList *node = NULLP, *next = NULLP;
LcInfo *lcNode = NULLP;
- DlMsgSchInfo *dlMsgSchInfo = NULLP;
if(lcLL == NULLP)
{
lcNode = (LcInfo *)node->node;
if(lcNode != NULLP)
{
- DU_LOG("\nINFO --> SCH : LcID:%d, [reqBO, allocBO, allocPRB]:[%d,%d,%d]",\
+ DU_LOG("\nINFO --> SCH : LcID:%d, [reqBO, allocBO, allocPRB]:[%d,%d,%d]",\
lcNode->lcId, lcNode->reqBO, lcNode->allocBO, lcNode->allocPRB);
if(dlMsgAlloc != NULLP)
{
- dlMsgSchInfo = &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo];
/*Add this LC to dlMsgAlloc so that if this LC gets allocated, BO
* report for allocation can be sent to MAC*/
- dlMsgSchInfo->lcSchInfo[dlMsgSchInfo->numLc].lcId = lcNode->lcId;
- dlMsgSchInfo->lcSchInfo[dlMsgSchInfo->numLc].schBytes = lcNode->allocBO;
+ dlMsgAlloc->numOfTbs = 1;
+ dlMsgAlloc->transportBlock[0].lcSchInfo[dlMsgAlloc->transportBlock[0].numLc].lcId = lcNode->lcId;
+ dlMsgAlloc->transportBlock[0].lcSchInfo[dlMsgAlloc->transportBlock[0].numLc].schBytes = lcNode->allocBO;
/*Calculate the Total Payload/BO size allocated*/
- *accumalatedBOSize += dlMsgSchInfo->lcSchInfo[dlMsgSchInfo->numLc].schBytes;
+ *accumalatedBOSize += dlMsgAlloc->transportBlock[0].lcSchInfo[dlMsgAlloc->transportBlock[0].numLc].schBytes;
- DU_LOG("\nINFO --> SCH: Added in MAC BO report: LCID:%d,reqBO:%d,Idx:%d, TotalBO Size:%d",\
- lcNode->lcId,lcNode->reqBO, dlMsgSchInfo->numLc, *accumalatedBOSize);
+ DU_LOG("\nINFO --> SCH: Added in MAC BO report: LCID:%d,reqBO:%d,Idx:%d, TotalBO Size:%d",\
+ lcNode->lcId,lcNode->reqBO, dlMsgAlloc->transportBlock[0].numLc, *accumalatedBOSize);
- dlMsgSchInfo->numLc++;
+ dlMsgAlloc->transportBlock[0].numLc++;
handleLcLList(lcLL, lcNode->lcId, DELETE);
}
else if(bsrInfo != NULLP)
* @return void
*
*******************************************************************/
-void fillDlMsgInfo(DlMsgInfo *dlMsgInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb *hqP)
+void fillDlMsgInfo(DlMsgSchInfo *dlMsgSchInfo, uint8_t crnti, bool isRetx, SchDlHqProcCb *hqP)
{
hqP->tbInfo[0].isEnabled = TRUE;
hqP->tbInfo[0].state = HQ_TB_WAITING;
hqP->tbInfo[1].isEnabled = TRUE;
hqP->tbInfo[1].state = HQ_TB_WAITING;
hqP->tbInfo[1].txCntr++;
- dlMsgInfo->crnti = crnti;
- dlMsgInfo->ndi = hqP->tbInfo[0].ndi; /*How to handle two tb case?TBD*/
- dlMsgInfo->harqProcNum = hqP->procId;
- dlMsgInfo->dlAssignIdx = 0;
- dlMsgInfo->pucchTpc = 0;
- dlMsgInfo->pucchResInd = 0;
- dlMsgInfo->harqFeedbackInd = hqP->k1;
- dlMsgInfo->dciFormatId = 1;
+ dlMsgSchInfo->crnti = crnti;
+ dlMsgSchInfo->transportBlock[0].ndi = hqP->tbInfo[0].ndi; /*How to handle two tb case?TBD*/
+ dlMsgSchInfo->harqProcNum = hqP->procId;
+ dlMsgSchInfo->dlAssignIdx = 0;
+ dlMsgSchInfo->pucchTpc = 0;
+ dlMsgSchInfo->pucchResInd = 0;
+ dlMsgSchInfo->harqFeedbackInd = hqP->k1;
+ dlMsgSchInfo->dciFormatId = 1;
}
/*******************************************************************
{
uint8_t pdschStartSymbol = 0, pdschNumSymbols = 0;
SlotTimingInfo pdcchTime, pdschTime, pucchTime;
- DlMsgAlloc *dciSlotAlloc = NULLP; /* Stores info for transmission of PDCCH for Msg4 */
- DlMsgAlloc *msg4SlotAlloc = NULLP; /* Stores info for transmission of PDSCH for Msg4 */
+ DlMsgSchInfo *dciSlotAlloc = NULLP; /* Stores info for transmission of PDCCH for Msg4 */
+ DlMsgSchInfo *msg4SlotAlloc = NULLP; /* Stores info for transmission of PDSCH for Msg4 */
if(cell == NULL)
{
- DU_LOG("\nERROR --> SCH: schDlRsrcAllocMsg4() : Cell is NULL");
+ DU_LOG("\nERROR --> SCH: schProcessMsg4Req() : Cell is NULL");
return RFAILED;
}
{
if (RFAILED == schDlGetAvlHqProcess(cell, &cell->ueCb[ueId - 1], msg4HqProc))
{
- DU_LOG("\nERROR --> SCH: schDlRsrcAllocMsg4() : No process");
+ DU_LOG("\nERROR --> SCH: schProcessMsg4Req() : No process");
return RFAILED;
}
}
if(findValidK0K1Value(cell, currTime, ueId, false, &pdschStartSymbol, &pdschNumSymbols, &pdcchTime, &pdschTime,\
&pucchTime, isRetxMsg4, *msg4HqProc) != true )
{
- DU_LOG("\nERROR --> SCH: schDlRsrcAllocMsg4() : k0 k1 not found");
+ DU_LOG("\nERROR --> SCH: schProcessMsg4Req() : k0 k1 not found");
return RFAILED;
}
if(cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] == NULL)
{
- SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgSchInfo));
if(dciSlotAlloc == NULLP)
{
DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciSlotAlloc");
return RFAILED;
}
cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = dciSlotAlloc;
- memset(dciSlotAlloc, 0, sizeof(DlMsgAlloc));
- GET_CRNTI(dciSlotAlloc->crnti, ueId);
+ memset(dciSlotAlloc, 0, sizeof(DlMsgSchInfo));
}
else
dciSlotAlloc = cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1];
if((schDlRsrcAllocMsg4(cell, pdschTime, ueId, dciSlotAlloc, pdschStartSymbol, pdschNumSymbols, isRetxMsg4, *msg4HqProc)) != ROK)
{
DU_LOG("\nERROR --> SCH: Scheduling of Msg4 failed in slot [%d]", pdschTime.slot);
- if(dciSlotAlloc->numSchedInfo == 0)
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
return RFAILED;
}
*/
if(pdcchTime.slot == pdschTime.slot)
{
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = BOTH;
- dciSlotAlloc->numSchedInfo++;
+ SCH_ALLOC(dciSlotAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+ if(!dciSlotAlloc->dlMsgPdschCfg)
+ {
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciSlotAlloc->dlMsgPdschCfg");
+ SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+ return RFAILED;
+ }
+ memcpy(dciSlotAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
}
else
{
/* Allocate memory to schedule rarSlot to send RAR, pointer will be checked at schProcessSlotInd() */
if(cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] == NULL)
{
- SCH_ALLOC(msg4SlotAlloc, sizeof(DlMsgAlloc));
+ SCH_ALLOC(msg4SlotAlloc, sizeof(DlMsgSchInfo));
if(msg4SlotAlloc == NULLP)
{
DU_LOG("\nERROR --> SCH : Memory Allocation failed for msg4SlotAlloc");
- if(dciSlotAlloc->numSchedInfo == 0)
+ SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
return RFAILED;
}
cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = msg4SlotAlloc;
- memset(msg4SlotAlloc, 0, sizeof(DlMsgAlloc));
- msg4SlotAlloc->crnti = dciSlotAlloc->crnti;
+ memset(msg4SlotAlloc, 0, sizeof(DlMsgSchInfo));
}
else
msg4SlotAlloc = cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1];
- /* Copy all RAR info */
- memcpy(&msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo], \
- &dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], sizeof(DlMsgSchInfo));
- msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo].dlMsgPdcchCfg.dci.pdschCfg = \
- &msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo].dlMsgPdschCfg;
-
- /* Assign correct PDU types in corresponding slots */
- msg4SlotAlloc->dlMsgSchedInfo[msg4SlotAlloc->numSchedInfo].pduPres = PDSCH_PDU;
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = PDCCH_PDU;
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pdschSlot = pdschTime.slot;
+ /* Copy all msg4 pdschcfg info */
+ msg4SlotAlloc->crnti =dciSlotAlloc->crnti;
+ msg4SlotAlloc->bwp = dciSlotAlloc->bwp;
+ SCH_ALLOC(msg4SlotAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+ if(msg4SlotAlloc->dlMsgPdschCfg)
+ {
+ memcpy(msg4SlotAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
+ }
+ else
+ {
+ SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ if(dciSlotAlloc->dlMsgPdschCfg == NULLP)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
- dciSlotAlloc->numSchedInfo++;
- msg4SlotAlloc->numSchedInfo++;
+ }
+ SCH_FREE(msg4SlotAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for msg4SlotAlloc->dlMsgPdschCfg");
+ return RFAILED;
+ }
}
/* PUCCH resource */
}
else
{
- DU_LOG("\nERROR --> SCH : schProcessSrOrBsrReq(): K2 value is not found");
+ DU_LOG("\nDEBUG --> SCH : schProcessSrOrBsrReq(): K2 value is not found");
return false;
}
return true;
uint32_t accumalatedSize = 0;
CmLListCp *lcLL = NULLP;
uint16_t rsvdDedicatedPRB = 0;
- DlMsgAlloc *dciSlotAlloc;
+ DlMsgSchInfo *dciSlotAlloc;
/* TX_PAYLOAD_HDR_LEN: Overhead which is to be Added once for any UE while estimating Accumulated TB Size
* Following flag added to keep the record whether TX_PAYLOAD_HDR_LEN is added to the first Node getting allocated.
{
/*Re-Initalization per UE*/
/* scheduled LC data fill */
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].numLc = 0;
+ dciSlotAlloc->transportBlock[0].numLc = 0;
isTxPayloadLenAdded = FALSE; /*Re-initlaize the flag for every UE*/
accumalatedSize = 0;
{
DU_LOG("\nERROR --> SCH : Updation in LC List Failed");
/* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
- if(dciSlotAlloc->numSchedInfo == 0)
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
(*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
- return false;
+ return accumalatedSize;
}
}
- ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
}//End of for loop
if ((fcfsHqProcCb->lcCb.defLcList.count == 0) && (fcfsHqProcCb->lcCb.dedLcList.count == 0))
UNSET_ONE_BIT((*hqP)->hqEnt->ue->ueId, (*hqP)->hqEnt->cell->boIndBitMap);
/* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
- if(dciSlotAlloc->numSchedInfo == 0)
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
(*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-
/*TRUE because this UE has nothing to be scheduled*/
- return true;
+ return accumalatedSize;
}
}
ulSchedInfo->prachSchInfo.prachFormat = prachFormat;
ulSchedInfo->prachSchInfo.numRa = numRa;
ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol;
- DU_LOG("\nINFO --> SCH : RACH occassion set for slot %d", prachOccasionTimingInfo.slot);
+ DU_LOG("\nINFO --> SCH : RACH occassion set for slot %d", prachOccasionTimingInfo.slot);
}
/**
if((schFillRar(cell, rarTime, ueId, dciSlotAlloc, k0Index)) != ROK)
{
DU_LOG("\nERROR --> SCH: Scheduling of RAR failed in slot [%d]", rarSlot);
- SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
- cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ if(!dciSlotAlloc->rarPdschCfg)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+ cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ }
return false;
}
/* Fill RAR info */
- dciSlotAlloc->rarInfo.raRnti = cell->raReq[ueId-1]->raRnti;
+ dciSlotAlloc->raRnti = cell->raReq[ueId-1]->raRnti;
dciSlotAlloc->rarInfo.tcrnti = cell->raReq[ueId-1]->rachInd->crnti;
dciSlotAlloc->rarInfo.RAPID = cell->raReq[ueId-1]->rachInd->preambleIdx;
dciSlotAlloc->rarInfo.ta = cell->raReq[ueId-1]->rachInd->timingAdv;
* If not, allocate memory RAR PDSCH slot to store RAR info
*/
if(dciSlot == rarSlot)
- dciSlotAlloc->pduPres = BOTH;
+ {
+ SCH_ALLOC(dciSlotAlloc->rarPdschCfg, sizeof(PdschCfg));
+ if(dciSlotAlloc->rarPdschCfg)
+ {
+ memcpy(dciSlotAlloc->rarPdschCfg, &dciSlotAlloc->rarPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
+ }
+ else
+ {
+ SCH_FREE(dciSlotAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+ SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+ cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciSlotAlloc->rarPdschCfg");
+ return false;
+ }
+
+ }
else
{
/* Allocate memory to schedule rarSlot to send RAR, pointer will be checked at schProcessSlotInd() */
if(rarSlotAlloc == NULLP)
{
DU_LOG("\nERROR --> SCH : Memory Allocation failed for rarSlotAlloc");
- SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
- cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ SCH_FREE(dciSlotAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+ if(!dciSlotAlloc->rarPdschCfg)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+ cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ }
return false;
}
cell->schDlSlotInfo[rarSlot]->rarAlloc[ueId-1] = rarSlotAlloc;
/* Copy all RAR info */
- memcpy(rarSlotAlloc, dciSlotAlloc, sizeof(RarAlloc));
- rarSlotAlloc->rarPdcchCfg.dci.pdschCfg = &rarSlotAlloc->rarPdschCfg;
-
- /* Assign correct PDU types in corresponding slots */
- rarSlotAlloc->pduPres = PDSCH_PDU;
- dciSlotAlloc->pduPres = PDCCH_PDU;
- dciSlotAlloc->pdschSlot = rarSlot;
+ rarSlotAlloc->raRnti = dciSlotAlloc->raRnti;
+ rarSlotAlloc->bwp = dciSlotAlloc->bwp;
+ SCH_ALLOC(rarSlotAlloc->rarPdschCfg, sizeof(PdschCfg));
+ if(rarSlotAlloc->rarPdschCfg)
+ {
+ memcpy(rarSlotAlloc->rarPdschCfg, &dciSlotAlloc->rarPdcchCfg->dci.pdschCfg,sizeof(PdschCfg));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for rarSlotAlloc->rarPdschCfg");
+ SCH_FREE(dciSlotAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+ if(!dciSlotAlloc->rarPdschCfg)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(RarAlloc));
+ cell->schDlSlotInfo[dciSlot]->rarAlloc[ueId-1] = NULLP;
+ }
+ SCH_FREE(rarSlotAlloc, sizeof(RarAlloc));
+ cell->schDlSlotInfo[rarSlot]->rarAlloc[ueId-1] = NULLP;
+ return false;
+ }
}
cell->schDlSlotInfo[dciSlot]->pdcchUe = ueId;
uint8_t dmrsStartSymbol, startSymbol, numSymbol ;
uint16_t numRbs = 0;
uint16_t tbSize = 0;
+ PdschCfg *pdsch;
SchBwpDlCfg *initialBwp = &cell->cellCfg.dlCfgCommon.schInitialDlBwp;
- PdcchCfg *pdcch = &rarAlloc->rarPdcchCfg;
- PdschCfg *pdsch = &rarAlloc->rarPdschCfg;
+ SCH_ALLOC(rarAlloc->rarPdcchCfg, sizeof(PdcchCfg));
+ if(rarAlloc->rarPdcchCfg == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : Memory allocation failed in %s",__func__);
+ return RFAILED;
+ }
+ PdcchCfg *pdcch = rarAlloc->rarPdcchCfg;
BwpCfg *bwp = &rarAlloc->bwp;
/* derive the sib1 coreset0 params from table 13-1 spec 38.213 */
pdcch->dci.beamPdcchInfo.prg[0].beamIdx[0] = 0;
pdcch->dci.txPdcchPower.beta_pdcch_1_0 = 0;
pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
- pdcch->dci.pdschCfg = pdsch;
+ pdsch = &pdcch->dci.pdschCfg;
/* fill the PDSCH PDU */
uint8_t cwCount = 0;
pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
&pdsch->pdschFreqAlloc.startPrb, pdsch->pdschFreqAlloc.numPrb)) != ROK)
{
DU_LOG("\nERROR --> SCH : allocatePrbDl() failed for RAR");
+ SCH_FREE(rarAlloc->rarPdcchCfg, sizeof(PdcchCfg));
return RFAILED;
}
uint32_t accumalatedSize = 0;
CmLListCp *lcLL = NULLP;
uint16_t rsvdDedicatedPRB = 0;
- DlMsgAlloc *dciSlotAlloc;
+ DlMsgSchInfo *dciSlotAlloc;
/* TX_PAYLOAD_HDR_LEN: Overhead which is to be Added once for any UE while estimating Accumulated TB Size
* Following flag added to keep the record whether TX_PAYLOAD_HDR_LEN is added to the first Node getting allocated.
{
/*Re-Initalization per UE*/
/* scheduled LC data fill */
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].numLc = 0;
+ dciSlotAlloc->transportBlock[0].numLc = 0;
isTxPayloadLenAdded = FALSE; /*Re-initlaize the flag for every UE*/
accumalatedSize = 0;
{
DU_LOG("\nERROR --> SCH : Updation in LC List Failed");
/* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
- if(dciSlotAlloc->numSchedInfo == 0)
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
(*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
- return false;
+ return accumalatedSize;
}
}
- ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
}//End of for loop
if ((schSpcHqProcCb->lcCb.defLcList.count == 0) && (schSpcHqProcCb->lcCb.dedLcList.count == 0))
UNSET_ONE_BIT((*hqP)->hqEnt->ue->ueId, (*hqP)->hqEnt->cell->boIndBitMap);
/* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
- if(dciSlotAlloc->numSchedInfo == 0)
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
(*hqP)->hqEnt->cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueCb->ueId -1] = NULL;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
-
/*TRUE because this UE has nothing to be scheduled*/
- return true;
+ return accumalatedSize;
}
}
bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchDlHqProcCb **hqP)
{
uint8_t pdschNumSymbols = 0, pdschStartSymbol = 0;
+ uint8_t lcIdx = 0;
uint16_t startPrb = 0;
uint16_t crnti = 0;
uint32_t accumalatedSize = 0;
SchUeCb *ueCb = NULLP;
- DlMsgAlloc *dciSlotAlloc, *dlMsgAlloc;
+ DlMsgSchInfo *dciSlotAlloc, *dlMsgAlloc;
SlotTimingInfo pdcchTime, pdschTime, pucchTime;
GET_CRNTI(crnti,ueId);
if(cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] == NULL)
{
- SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgSchInfo));
if(!dciSlotAlloc)
{
DU_LOG("\nERROR --> SCH : Memory Allocation failed for ded DL msg alloc");
return false;
}
cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1] = dciSlotAlloc;
- memset(dciSlotAlloc, 0, sizeof(DlMsgAlloc));
- dciSlotAlloc->crnti = crnti;
+ memset(dciSlotAlloc, 0, sizeof(DlMsgSchInfo));
}
else
{
dciSlotAlloc = cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1];
}
/* Dl ded Msg info is copied, this was earlier filled in macSchDlRlcBoInfo */
- fillDlMsgInfo(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].dlMsgInfo, dciSlotAlloc->crnti, isRetx, *hqP);
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].isRetx = isRetx;
+ fillDlMsgInfo(dciSlotAlloc, crnti, isRetx, *hqP);
+ dciSlotAlloc->transportBlock[0].ndi = isRetx;
accumalatedSize = cell->api->SchScheduleDlLc(pdcchTime, pdschTime, pdschNumSymbols, isRetx, hqP);
DU_LOG("\nERROR --> SCH : Scheduling of DL dedicated message failed");
/* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
- if(dciSlotAlloc->numSchedInfo == 0)
+ if(!dciSlotAlloc->dlMsgPdschCfg)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1] = NULL;
}
- else
- {
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
- }
return false;
}
if(pdcchTime.slot == pdschTime.slot)
{
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = BOTH;
- dciSlotAlloc->numSchedInfo++;
+ SCH_ALLOC(dciSlotAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+ if(!dciSlotAlloc->dlMsgPdschCfg)
+ {
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for dciSlotAlloc->dlMsgPdschCfg");
+ SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+ return false;
+ }
+ memcpy(dciSlotAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
}
else
{
/* Allocate memory to schedule dlMsgAlloc to send DL_Msg, pointer will be checked at schProcessSlotInd() */
if(cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] == NULLP)
{
- SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgAlloc));
+ SCH_ALLOC(dlMsgAlloc, sizeof(DlMsgSchInfo));
if(dlMsgAlloc == NULLP)
{
DU_LOG("\nERROR --> SCH : Memory Allocation failed for dlMsgAlloc");
- if(dciSlotAlloc->numSchedInfo == 0)
+ SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ if(dciSlotAlloc->dlMsgPdschCfg == NULLP)
{
- SCH_FREE(dciSlotAlloc, sizeof(DlMsgAlloc));
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
}
- else
- memset(&dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], 0, sizeof(DlMsgSchInfo));
return false;
}
cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = dlMsgAlloc;
- memset(dlMsgAlloc, 0, sizeof(DlMsgAlloc));
- dlMsgAlloc->crnti = dciSlotAlloc->crnti;
+ memset(dlMsgAlloc, 0, sizeof(DlMsgSchInfo));
}
else
dlMsgAlloc = cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1];
/* Copy all DL_MSG info */
- memcpy(&dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo], \
- &dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo], sizeof(DlMsgSchInfo));
- dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdcchCfg.dci.pdschCfg = \
- &dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].dlMsgPdschCfg;
-
- /* Assign correct PDU types in corresponding slots */
- dlMsgAlloc->dlMsgSchedInfo[dlMsgAlloc->numSchedInfo].pduPres = PDSCH_PDU;
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pduPres = PDCCH_PDU;
- dciSlotAlloc->dlMsgSchedInfo[dciSlotAlloc->numSchedInfo].pdschSlot = pdschTime.slot;
-
- dciSlotAlloc->numSchedInfo++;
- dlMsgAlloc->numSchedInfo++;
+ dlMsgAlloc->crnti =crnti;
+ dlMsgAlloc->bwp = dciSlotAlloc->bwp;
+ SCH_ALLOC(dlMsgAlloc->dlMsgPdschCfg, sizeof(PdschCfg));
+ if(dlMsgAlloc->dlMsgPdschCfg)
+ {
+ memcpy(dlMsgAlloc->dlMsgPdschCfg, &dciSlotAlloc->dlMsgPdcchCfg->dci.pdschCfg, sizeof(PdschCfg));
+ }
+ else
+ {
+ SCH_FREE(dciSlotAlloc->dlMsgPdcchCfg, sizeof(PdcchCfg));
+ if(dciSlotAlloc->dlMsgPdschCfg == NULLP)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+
+ }
+ SCH_FREE(dlMsgAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdschTime.slot]->dlMsgAlloc[ueId-1] = NULLP;
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for dlMsgAlloc->dlMsgPdschCfg");
+ return false;
+ }
}
schAllocPucchResource(cell, pucchTime, crnti, ueCb, isRetx, *hqP);
cell->schDlSlotInfo[pdschTime.slot]->pdschUe = ueId;
cell->schUlSlotInfo[pucchTime.slot]->pucchUe = ueId;
+ /*Re-setting the BO's of all DL LCs in this UE*/
+ for(lcIdx = 0; lcIdx < MAX_NUM_LC; lcIdx++)
+ {
+ ueCb->dlInfo.dlLcCtxt[lcIdx].bo = 0;
+ }
+
/* after allocation is done, unset the bo bit for that ue */
UNSET_ONE_BIT(ueId, cell->boIndBitMap);
return true;
{
ADD_DELTA_TO_TIME((*pucchTime), hqP->pucchTime, 0, cell->numSlots);
}
+ pdcchTime->cellId = cell->cellId;
+ pdschTime->cellId = cell->cellId;
+
return true;
}
}
dciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0] = 0;
dciInfo->dciInfo.txPdcchPower.beta_pdcch_1_0 = 0;
dciInfo->dciInfo.txPdcchPower.powerControlOffsetSS = 0;
- dciInfo->dciInfo.pdschCfg = NULL; /* No DL data being sent */
+ memset(&dciInfo->dciInfo.pdschCfg, 0, sizeof(PdschCfg));
msg3HqProc->tbInfo.txCntr++;
puschInfo->harqProcId = msg3HqProc->procId;
dciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0] = 0;
dciInfo->dciInfo.txPdcchPower.beta_pdcch_1_0 = 0;
dciInfo->dciInfo.txPdcchPower.powerControlOffsetSS = 0;
- dciInfo->dciInfo.pdschCfg = NULL; /* No DL data being sent */
+ memset(&dciInfo->dciInfo.pdschCfg, 0, sizeof(PdschCfg));
return ROK;
}
/* Check if requested number of blocks can be allocated from the current block */
if(freeBlock->numFreePrb < numPrb)
+ {
+ DU_LOG("\nINFO --> SCH: In isPrbAvailable, numFreePrb:%d is less than reqPrb:%d", freeBlock->numFreePrb, numPrb);
+ node = node->next;
continue;
-
+ }
+
/* Check if requested PRBs belong within the range of current free block */
if(((startPrb >= freeBlock->startPrb) && (startPrb <= freeBlock->endPrb)) && \
((endPrb >= freeBlock->startPrb) && (endPrb <= freeBlock->endPrb)))
uint8_t aggregLevel;
BeamformingInfo beamPdcchInfo;
TxPowerPdcchInfo txPdcchPower;
- PdschCfg *pdschCfg;
+ PdschCfg pdschCfg;
}DlDCI;
typedef struct pdcchCfg
typedef struct sib1AllocInfo
{
BwpCfg bwp;
- PdcchCfg sib1PdcchCfg;
+ PdcchCfg *sib1PdcchCfg;
}Sib1AllocInfo;
typedef struct prachSchInfo
typedef struct rarInfo
{
- uint16_t raRnti;
uint8_t RAPID;
uint16_t ta;
Msg3UlGrant ulGrant;
typedef struct rarAlloc
{
- DlPduType pduPres;
- uint8_t pdschSlot;
- RarInfo rarInfo;
- BwpCfg bwp;
- PdcchCfg rarPdcchCfg;
- PdschCfg rarPdschCfg;
+ uint16_t raRnti;
+ RarInfo rarInfo;
+ BwpCfg bwp;
+ PdcchCfg *rarPdcchCfg;
+ PdschCfg *rarPdschCfg;
}RarAlloc;
-typedef struct dlMsgInfo
-{
- uint16_t crnti;
- uint8_t ndi;
- uint8_t harqProcNum;
- uint8_t dlAssignIdx;
- uint8_t pucchTpc;
- uint8_t pucchResInd;
- uint8_t harqFeedbackInd;
- uint8_t dciFormatId;
- bool isMsg4Pdu;
- uint16_t dlMsgPduLen;
- uint8_t *dlMsgPdu;
-}DlMsgInfo;
-
typedef struct lcSchInfo
{
uint8_t lcId;
- uint32_t schBytes; /* Number of scheduled bytes */
+ uint32_t schBytes;
}LcSchInfo;
-typedef struct dlMsgSchedInfo
+typedef struct ceSchInfo
+{
+ uint8_t ceLcId;
+ uint8_t *ceContent;
+}CeSchInfo;
+
+typedef struct freqDomainAlloc
+{
+ uint8_t resAllocType; /* Resource allocation type */
+ union
+ {
+ ResAllocType0 type0;
+ ResAllocType1 type1;
+ }resAlloc;
+}FreqDomainAlloc;
+
+typedef struct transportBlock
{
- bool isRetx;
+ uint8_t mcs;
+ bool ndi;
+ uint8_t rv;
+ uint16_t tbSize;
+ uint8_t numCe;
+ CeSchInfo ceSchInfo[MAX_NUM_LC];
uint8_t numLc;
- LcSchInfo lcSchInfo[MAX_NUM_LC]; /* Scheduled LC info */
- BwpCfg bwp;
- PdcchCfg dlMsgPdcchCfg;
- PdschCfg dlMsgPdschCfg;
- DlPduType pduPres;
- uint8_t pdschSlot;
- DlMsgInfo dlMsgInfo;
-}DlMsgSchInfo;
+ LcSchInfo lcSchInfo[MAX_NUM_LC];
+}TransportBlock;
-typedef struct dlMsgAlloc
+typedef struct dlMsgSchedInfo
{
- uint16_t crnti;
- uint8_t numSchedInfo;
- DlMsgSchInfo dlMsgSchedInfo[2];
-}DlMsgAlloc;
+ uint16_t crnti;
+ uint8_t dciFormatId;
+ uint8_t harqProcNum;
+ bool vrbPrbMapping;
+ uint8_t dlAssignIdx;
+ uint8_t pucchTpc;
+ uint8_t pucchResInd;
+ uint8_t harqFeedbackInd;
+ uint16_t dlMsgPduLen;
+ uint8_t *dlMsgPdu;
+ FreqDomainAlloc freqAlloc;
+ TimeDomainAlloc timeAlloc;
+ uint8_t numOfTbs;
+ TransportBlock transportBlock[2];
+ BwpCfg bwp;
+ PdcchCfg *dlMsgPdcchCfg;
+ PdschCfg *dlMsgPdschCfg;
+}DlMsgSchInfo;
typedef struct schSlotValue
{
SlotTimingInfo ulDciTime;
}SchSlotValue;
-typedef struct freqDomainAlloc
-{
- uint8_t resAllocType; /* Resource allocation type */
- union
- {
- ResAllocType0 type0;
- ResAllocType1 type1;
- }resAlloc;
-}FreqDomainAlloc;
/* Reference -> O-RAN.WG8.AAD.0-v07.00, Table 9-36 DCI Format0_0 Configuration */
typedef struct format0_0
DciInfo *ulGrant;
/* Allocation from dedicated DL msg */
- DlMsgAlloc *dlMsgAlloc[MAX_NUM_UE];
+ DlMsgSchInfo *dlMsgAlloc[MAX_NUM_UE];
}DlSchedInfo;
while(true)
{
- DU_LOG("\n INFO --> F1AP : Building UL RRC Message Transfer Message\n");
+ DU_LOG("\nINFO --> F1AP : Building UL RRC Message Transfer Message\n");
DU_ALLOC(f1apMsg, sizeof(F1AP_PDU_t));
if(f1apMsg == NULLP)
}
else
{
- DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
+ DU_LOG("\nDEBUG --> F1AP : Created APER encoded buffer for ULRRCMessageTransfer\n");
#ifdef DEBUG_ASN_PRINT
for(int i=0; i< encBufSize; i++)
{
DU_LOG("\nERROR --> DU_APP : System Task creation for DU APP failed");
return RFAILED;
}
- //ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
+ ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
/* system task for EGTP */
if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed");
return RFAILED;
}
- //ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0);
+ ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0);
/* system task for RLC_DL and MAC */
if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK)
}
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- //ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
+ ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
/* system task for RLC UL */
if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed");
return RFAILED;
}
- //ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
+ ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
/* system task for SCTP receiver thread */
if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed");
return RFAILED;
}
- //ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0);
+ ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0);
/* system task for lower-mac receiver thread */
if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK)
DU_LOG("\nERROR --> DU_APP : System Task creation for Lower MAC failed");
return RFAILED;
}
- //ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
+ ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
#ifndef INTEL_WLS_MEM
/* system task for phy stub's slot indication generator thread */
if(itfType == F1_INTERFACE)
{
- DU_LOG("\nDEBUG --> SCTP : sending the message to CU");
+ DU_LOG("\nDEBUG --> SCTP : sending the message to CU");
#ifdef CALL_FLOW_DEBUG_LOG
DU_LOG("\nCall Flow: ENTSCTP -> CU : EVENT_F1AP_MSG_TO_CU\n");
#endif
if(itfType == E2_INTERFACE)
{
- DU_LOG("\nDEBUG --> SCTP : sending the message to ric");
+ DU_LOG("\nDEBUG --> SCTP : sending the message to ric");
#ifdef CALL_FLOW_DEBUG_LOG
DU_LOG("\nCall Flow: ENTSCTP -> RIC : EVENT_E2AP_MSG_TO_RIC\n");
#endif
/* Filling post structure and sending msg */
FILL_PST_DUAPP_TO_RLC(pst, RLC_DL_INST, EVENT_DL_RRC_MSG_TRANS_TO_RLC);
- DU_LOG("\nDEBUG --> DU_APP: Sending Dl RRC Msg to RLC \n");
+ DU_LOG("\nDEBUG --> DU_APP: Sending Dl RRC Msg to RLC \n");
ret = (*duSendDlRrcMsgToRlcOpts[pst.selector])(&pst, dlRrcMsgInfo);
if(ret != ROK)
{