{
DU_LOG("\nERROR --> DU APP: CellIdentity memory allocation failure");
return RFAILED;
- }
- *cellIdentity->buf = duCfgParam.sib1Params.cellIdentity;
+ }
+ memset(cellIdentity->buf, 0, cellIdentity->size);
+ cellIdentity->buf[4] = duCfgParam.sib1Params.cellIdentity;
return ROK;
}
DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed");
return RFAILED;
}
- elementCnt = ODU_VALUE_ONE;
+ elementCnt = duPdschCfg.numTimeDomRsrcAlloc;
pdschSetup->pdsch_TimeDomainAllocationList->list.count = elementCnt;
pdschSetup->pdsch_TimeDomainAllocationList->list.size = elementCnt * sizeof(PDSCH_TimeDomainResourceAllocation_t *);
}
}
- idx = 0;
- timeDomRsrcAllocInfo = pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx];
-
- /* K0 */
- DU_ALLOC(timeDomRsrcAllocInfo->k0, sizeof(long));
- if(!timeDomRsrcAllocInfo->k0)
- {
- DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed");
- return RFAILED;
- }
- *timeDomRsrcAllocInfo->k0 = duPdschCfg.k0;
-
- timeDomRsrcAllocInfo->mappingType = duPdschCfg.mapType;
- timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.sliv;
-
+ for(idx = 0; idx < pdschSetup->pdsch_TimeDomainAllocationList->list.count; idx++)
+ {
+ timeDomRsrcAllocInfo = pdschSetup->pdsch_TimeDomainAllocationList->list.array[idx];
+
+ /* K0 */
+ DU_ALLOC(timeDomRsrcAllocInfo->k0, sizeof(long));
+ if(!timeDomRsrcAllocInfo->k0)
+ {
+ DU_LOG("\nERROR --> DU APP : PDCCH Config memory alloc failed");
+ return RFAILED;
+ }
+ *timeDomRsrcAllocInfo->k0 = duPdschCfg.timeDomAlloc[idx].k0;
+
+ timeDomRsrcAllocInfo->mappingType = duPdschCfg.timeDomAlloc[idx].mapType;
+ timeDomRsrcAllocInfo->startSymbolAndLength = duPdschCfg.timeDomAlloc[idx].sliv;
+ }
break;
}
default:
return ROK;
}/* BuildBcchConfig */
+/*******************************************************************
+ *
+ * @brief fills First PDCCH monitoring Paging occasions
+ *
+ * @details
+ *
+ * Function : fillFirstPdcchMonitoringOcc
+ *
+ * Functionality:
+ * Fills PDCCH Monitoring PO in PCCH configuration
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t fillFirstPdcchMonitoringOcc(struct PCCH_Config__firstPDCCH_MonitoringOccasionOfPO *firstPO,\
+ PcchCfg *srcPcchCfg)
+{
+ uint8_t numPO = 0, poIdx = 0;
+
+ firstPO->present = srcPcchCfg->firstPDCCHMontioringType;
+
+ GET_NUM_PAGING_OCC(srcPcchCfg->ns, numPO);
+ if(srcPcchCfg->ns == 0)
+ {
+ DU_LOG("\nINFO --> DU APP : Paging Occasions is ZERO, no need to fill further");
+ return ROK;
+ }
+
+ /*Note: Valid values for each number of PO is from Spec 36.331: PCCH-COnfig*/
+ switch(firstPO->present)
+ {
+ case PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_NOTHING:
+ {
+ break;
+ }
+ case PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS15KHZoneT:
+ {
+ DU_ALLOC(firstPO->choice.sCS15KHZoneT, \
+ sizeof(struct PCCH_Config__firstPDCCH_MonitoringOccasionOfPO__sCS15KHZoneT));
+
+ if(firstPO->choice.sCS15KHZoneT == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : FirstPdcchMonitoringPO Memory allocation failure");
+ return RFAILED;
+ }
+ firstPO->choice.sCS15KHZoneT->list.count = numPO;
+ firstPO->choice.sCS15KHZoneT->list.size = numPO * sizeof(long *);
+
+ DU_ALLOC(firstPO->choice.sCS15KHZoneT->list.array, firstPO->choice.sCS15KHZoneT->list.size);
+ if(!firstPO->choice.sCS15KHZoneT->list.array)
+ {
+ DU_LOG("\nERROR --> DU APP : FirstPdcchMonitoringPO Memory allocation failure");
+ return RFAILED;
+ }
+
+ for(poIdx = 0; poIdx < numPO; poIdx++)
+ {
+ /* Spec 36.331: PCCH-Config: firstPDCCH-MonitoringOccasionOfPO [MAX of sCS15KHZoneT]
+ * Since FirstPDCCHMonitoring_PO is not valid thus no need to continue further*/
+ if(srcPcchCfg->firstPDCCHMontioringInfo[poIdx] > 139)
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid Paging Ocassion value for 15kHz");
+ return RFAILED;
+ }
+ DU_ALLOC(firstPO->choice.sCS15KHZoneT->list.array[poIdx], sizeof(long));
+ if(!firstPO->choice.sCS15KHZoneT->list.array[poIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : FirstPdcchMonitoringPO Memory allocation failure");
+ return RFAILED;
+ }
+ }
+
+ poIdx = 0;
+ *firstPO->choice.sCS15KHZoneT->list.array[poIdx] = srcPcchCfg->firstPDCCHMontioringInfo[poIdx];
+
+ break;
+ }
+ case PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS30KHZoneT_SCS15KHZhalfT:
+ {
+ DU_ALLOC(firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT, \
+ sizeof(struct PCCH_Config__firstPDCCH_MonitoringOccasionOfPO__sCS30KHZoneT_SCS15KHZhalfT));
+
+ if(firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : FirstPdcchMonitoringPO Memory allocation failure");
+ return RFAILED;
+ }
+ firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.count = numPO;
+ firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.size = numPO * sizeof(long *);
+
+ DU_ALLOC(firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.array, \
+ firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.size);
+
+ if(!firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.array)
+ {
+ DU_LOG("\nERROR --> DU APP : FirstPdcchMonitoringPO Memory allocation failure");
+ return RFAILED;
+ }
+
+ for(poIdx = 0; poIdx < numPO; poIdx++)
+ {
+ /* Spec 36.331: PCCH-Config:firstPDCCH-MonitoringOccasionOfPO [MAX of sCS30KHZoneT-SCS15KHZhalfT]
+ * Since FirstPDCCHMonitoring_PO is not valid thus no need to continue further*/
+ if(srcPcchCfg->firstPDCCHMontioringInfo[poIdx] > 279)
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid Paging Ocassion value for 30kHz or 15kHz HAlFT");
+ return RFAILED;
+ }
+ DU_ALLOC(firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.array[poIdx], sizeof(long));
+ if(!firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.array[poIdx])
+ {
+ DU_LOG("\nERROR --> DU APP : FirstPdcchMonitoringPO Memory allocation failure");
+ return RFAILED;
+ }
+ }
+
+ poIdx = 0;
+ *firstPO->choice.sCS30KHZoneT_SCS15KHZhalfT->list.array[poIdx] = srcPcchCfg->firstPDCCHMontioringInfo[poIdx];
+ break;
+ }
+ //TODO for other cases
+ default:
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid firstPDCCH-MonitoringOccasionOfPO");
+ return RFAILED;
+
+ break;
+ }
+ }
+ return ROK;
+}
/*******************************************************************
*
* @brief Builds PCCH configuration
duPcchCfg = duCfgParam.sib1Params.srvCellCfgCommSib.dlCfg.pcchCfg;
pcchCfg->defaultPagingCycle = duPcchCfg.dfltPagingCycle;
- pcchCfg->nAndPagingFrameOffset.present = duPcchCfg.nAndPagingFrmOffPresent;
+ pcchCfg->nAndPagingFrameOffset.present = duPcchCfg.nAndPagingFrmOffsetType;
switch(pcchCfg->nAndPagingFrameOffset.present)
{
+ /**Note: PagingFrame Offset Value differs for each Paging Duration
+ *(oneT, halfT,...). The Range of Offset given in Spec 38.331,Pcch-Config*/
case PCCH_Config__nAndPagingFrameOffset_PR_NOTHING:
- {
- //TODO
- break;
- }
+ {
+ //TODO
+ break;
+ }
case PCCH_Config__nAndPagingFrameOffset_PR_oneT:
- {
- //TODO
- break;
- }
+ {
+ pcchCfg->nAndPagingFrameOffset.choice.oneT = NULLD;
+ break;
+ }
case PCCH_Config__nAndPagingFrameOffset_PR_halfT:
- {
- //TODO
- break;
- }
+ {
+ /*Spec 38.331: PCCH_Config: nAndPagingFrameOffset [MAX value of halfT] */
+ if(duPcchCfg.pageFrameOffset > 1)
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid PagingFrameOffset for HALF_T");
+ return RFAILED;
+ }
+ pcchCfg->nAndPagingFrameOffset.choice.halfT = duPcchCfg.pageFrameOffset;
+ break;
+ }
case PCCH_Config__nAndPagingFrameOffset_PR_quarterT:
- {
- //TODO
- break;
- }
+ {
+ /*Spec 38.331: PCCH_Config: nAndPagingFrameOffset [MAX value of quarterT] */
+ if(duPcchCfg.pageFrameOffset > 3)
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid PagingFrameOffset for QUARTER_T");
+ return RFAILED;
+ }
+ pcchCfg->nAndPagingFrameOffset.choice.quarterT = duPcchCfg.pageFrameOffset;
+ break;
+ }
case PCCH_Config__nAndPagingFrameOffset_PR_oneEighthT:
- {
- //TODO
- break;
- }
+ {
+ /*Spec 38.331: PCCH_Config: nAndPagingFrameOffset [MAX value of oneEighthT] */
+ if(duPcchCfg.pageFrameOffset > 7)
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid PagingFrameOffset for ONE_EIGHTH_T");
+ return RFAILED;
+ }
+ pcchCfg->nAndPagingFrameOffset.choice.oneEighthT = duPcchCfg.pageFrameOffset;
+ break;
+ }
case PCCH_Config__nAndPagingFrameOffset_PR_oneSixteenthT:
- {
- //TODO
- break;
- }
+ {
+ /*Spec 38.331: PCCH_Config: nAndPagingFrameOffset [MAX value of oneSixteenthT] */
+ if(duPcchCfg.pageFrameOffset > 15)
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid PagingFrameOffset for ONE_SIXTEENTH_T");
+ return RFAILED;
+ }
+ pcchCfg->nAndPagingFrameOffset.choice.oneSixteenthT = duPcchCfg.pageFrameOffset;
+ break;
+ }
default:
- {
- DU_LOG("\nERROR --> DU APP : Invalid nAndPagingFrameOffset configuration");
- return RFAILED;
- }
+ {
+ DU_LOG("\nERROR --> DU APP : Invalid nAndPagingFrameOffset configuration");
+ return RFAILED;
+ }
}
- pcchCfg->ns = duPcchCfg.numPagingOcc;
+ pcchCfg->ns = duPcchCfg.ns;
+ DU_ALLOC(pcchCfg->firstPDCCH_MonitoringOccasionOfPO, \
+ sizeof(struct PCCH_Config__firstPDCCH_MonitoringOccasionOfPO));
+ if(pcchCfg->firstPDCCH_MonitoringOccasionOfPO == NULLP)
+ {
+ DU_LOG("\nERROR --> DU APP : BuildPcchConfig >> Memory Allocation fails");
+ return RFAILED;
+ }
+
+ if(fillFirstPdcchMonitoringOcc(pcchCfg->firstPDCCH_MonitoringOccasionOfPO, &duPcchCfg) == RFAILED)
+ {
+ DU_LOG("\nERROR --> DU APP : BuildPcchConfig >> Filling of Paging Occ failed");
+ return RFAILED;
+ }
return ROK;
}/* BuildPcchConfig */
duPuschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.puschCfg;
- puschCfg->present = duPuschCfg.present;
+ puschCfg->present = duPuschCfg.puschCfgPresent;
switch(puschCfg->present)
{
case BWP_UplinkCommon__pusch_ConfigCommon_PR_NOTHING:
DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed");
return RFAILED;
}
- elementCnt = ODU_VALUE_ONE;
+ elementCnt = duPuschCfg.numTimeDomRsrcAlloc;
setup->pusch_TimeDomainAllocationList->list.count = elementCnt;
setup->pusch_TimeDomainAllocationList->list.size = \
elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *);
}
}
- idx = 0;
- timeDomRsrcAllocInfo = setup->pusch_TimeDomainAllocationList->list.array[idx];
-
- /* K2 */
- DU_ALLOC(timeDomRsrcAllocInfo->k2, sizeof(long));
- if(!timeDomRsrcAllocInfo->k2)
- {
- DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed");
- return RFAILED;
- }
- *timeDomRsrcAllocInfo->k2 = duPuschCfg.k2;
-
- timeDomRsrcAllocInfo->mappingType = duPuschCfg.mapType;
- timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.sliv;
-
+ for(idx = 0; idx < elementCnt; idx++)
+ {
+ timeDomRsrcAllocInfo = setup->pusch_TimeDomainAllocationList->list.array[idx];
+
+ /* K2 */
+ DU_ALLOC(timeDomRsrcAllocInfo->k2, sizeof(long));
+ if(!timeDomRsrcAllocInfo->k2)
+ {
+ DU_LOG("\nERROR --> DU APP : PUSCH Config memory alloc failed");
+ return RFAILED;
+ }
+ *timeDomRsrcAllocInfo->k2 = duPuschCfg.timeDomAllocList[idx].k2;
+ timeDomRsrcAllocInfo->mappingType = duPuschCfg.timeDomAllocList[idx].mapType;
+ timeDomRsrcAllocInfo->startSymbolAndLength = duPuschCfg.timeDomAllocList[idx].sliv;
+ }
/* Msg3 Delta Preamble */
DU_ALLOC(setup->msg3_DeltaPreamble, sizeof(long));
if(!setup->msg3_DeltaPreamble)