#endif
#include "lwr_mac_fsm.h"
#include "lwr_mac_phy.h"
+#include "lwr_mac_utils.h"
#include "mac_utils.h"
#define MIB_SFN_BITMASK 0xFC
dlTtiReqPdu->pdu.pdcch_pdu.startSymbolIndex = pageAlloc->pageDlDci.ssStartSymbolIndex;
dlTtiReqPdu->pdu.pdcch_pdu.durationSymbols = pageAlloc->pageDlDci.durationSymbols;
- memcpy(dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource, pageAlloc->pageDlDci.freqDomainResource, 6*sizeof(uint8_t));
+ convertFreqDomRsrcMapToIAPIFormat(pageAlloc->pageDlDci.freqDomainResource, \
+ dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource);
dlTtiReqPdu->pdu.pdcch_pdu.cceRegMappingType = pageAlloc->pageDlDci.cceRegMappingType;
dlTtiReqPdu->pdu.pdcch_pdu.regBundleSize = pageAlloc->pageDlDci.cceReg.interleaved.regBundleSize;
dlTtiReqPdu->pdu.pdcch_pdu.interleaverSize = pageAlloc->pageDlDci.cceReg.interleaved.interleaverSize;
dlTtiReqPdu->pdu.pdcch_pdu.startSymbolIndex = pdcchInfo->coresetCfg.startSymbolIndex;
dlTtiReqPdu->pdu.pdcch_pdu.durationSymbols = pdcchInfo->coresetCfg.durationSymbols;
- memcpy(dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource, pdcchInfo->coresetCfg.freqDomainResource, 6);
+ convertFreqDomRsrcMapToIAPIFormat(pdcchInfo->coresetCfg.freqDomainResource,\
+ dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource);
dlTtiReqPdu->pdu.pdcch_pdu.cceRegMappingType = pdcchInfo->coresetCfg.cceRegMappingType;
dlTtiReqPdu->pdu.pdcch_pdu.regBundleSize = pdcchInfo->coresetCfg.regBundleSize;
dlTtiReqPdu->pdu.pdcch_pdu.interleaverSize = pdcchInfo->coresetCfg.interleaverSize;
ulDciReqPdu->pdcchPduConfig.cyclicPrefix = dlInfo->ulGrant->bwpCfg.cyclicPrefix;
ulDciReqPdu->pdcchPduConfig.startSymbolIndex = dlInfo->ulGrant->coresetCfg.startSymbolIndex;
ulDciReqPdu->pdcchPduConfig.durationSymbols = dlInfo->ulGrant->coresetCfg.durationSymbols;
- memcpy(ulDciReqPdu->pdcchPduConfig.freqDomainResource, dlInfo->ulGrant->coresetCfg.freqDomainResource, 6);
+ convertFreqDomRsrcMapToIAPIFormat(dlInfo->ulGrant->coresetCfg.freqDomainResource, \
+ ulDciReqPdu->pdcchPduConfig.freqDomainResource);
ulDciReqPdu->pdcchPduConfig.cceRegMappingType = dlInfo->ulGrant->coresetCfg.cceRegMappingType;
ulDciReqPdu->pdcchPduConfig.regBundleSize = dlInfo->ulGrant->coresetCfg.regBundleSize;
ulDciReqPdu->pdcchPduConfig.interleaverSize = dlInfo->ulGrant->coresetCfg.interleaverSize;
}
}
+/*
+ * As per FAPI spec,
+ * Frequency domain resources is a bitmap defining non-overlapping groups of 6 PRBs in ascending order.
+ * [TS38.213 10.1]. Bitmap of uint8 array. 45 bits.
+ *
+ * As per IAPI,
+ * CORESET-freqdom.frequencyDomainResources : The bits of the bitmap have a one-to-one mapping with
+ * non-overlapping groups of 6 RBs. The most significant bit of the first word corresponds to
+ * the most significant bit defined in 38.331.
+ *
+ * FAPI and IAPI both are 45 bits. Mapped from bit 0 LS Byte for the FAPI and
+ * bit 0 LS U32 entry for IAPI.
+ * FAPI is to be filled in following format such that Intel L1 is able to decode it :
+ *
+ * FAPI IAPI
+ * FreqDomainResource[0] bits 7-0 -> nFreqDomain[0] bits 7-0
+ * FreqDomainResource[1] bits 7-0 -> nFreqDomain[0] bits 15-8
+ * FreqDomainResource[2] bits 7-0 -> nFreqDomain[0] bits 23-16
+ * FreqDomainResource[3] bits 7-0 -> nFreqDomain[0] bits 31-24
+ * FreqDomainResource[4] bits 7-0 -> nFreqDomain[1] bits 7-0
+ * FreqDomainResource[5] bits 7-0 -> nFreqDomain[1] bits 15-8
+ *
+ * where for the last entry bits 7,6 and 5 are don't care in the FAPI and bits
+ * 31-13 are don't care in the IAPI.
+ */
+void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap)
+{
+ int8_t idx;
+ uint8_t numBitsToShift = 0;
+ uint64_t freqDomainResources = 0;
+
+ /* Bit operation to create a 64-bit integer that has
+ * 48 LSBs [Bit 47 to Bit 0] mapped to sourceBitMap[0] to sourceBitMap[5]
+ */
+ for(idx = FREQ_DOM_RSRC_SIZE-1; idx >=0; idx--)
+ {
+ freqDomainResources |= ((uint64_t)sourceBitMap[idx] << numBitsToShift);
+ numBitsToShift += 8;
+ }
+
+ /* Right shift 3 bits because bits[2-0] are unused in sourceBitMap[5] */
+ freqDomainResources = freqDomainResources >> 3;
+ /* Filling destBitMap such that LSB bit 0 of freqDomainResources maps to LSB
+ * of first word of destBitMap */
+ numBitsToShift = 0;
+ for(idx=0; idx<FREQ_DOM_RSRC_SIZE; idx++)
+ {
+ destBitMap[idx] = freqDomainResources >> numBitsToShift;
+ numBitsToShift += 8;
+ }
+}
/**********************************************************************
End of file
_pst.intfVer = 0; \
}
+void convertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap);
/**********************************************************************
End of file
**********************************************************************/
uint8_t mValue = 0;
uint8_t firstSymbol = 0; /* need to calculate using formula mentioned in 38.213 */
uint8_t slotIndex = 0;
- uint8_t FreqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
+ uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
uint16_t tbSize = 0;
uint8_t ssbIdx = 0;
PdcchCfg *pdcch;
pdcch->coresetCfg.durationSymbols = numSymbols;
/* Fill Bitmap for PRBs in coreset */
- fillCoresetFeqDomAllocMap(((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource);
- covertFreqDomRsrcMapToIAPIFormat(FreqDomainResource, pdcch->coresetCfg.freqDomainResource);
+ fillCoresetFeqDomAllocMap(((offsetPointA-offset)/6), (numRbs/6), freqDomainResource);
+ memcpy(pdcch->coresetCfg.freqDomainResource, freqDomainResource, FREQ_DOM_RSRC_SIZE);
pdcch->coresetCfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
pdcch->coresetCfg.regBundleSize = 6; /* spec-38.211 sec 7.3.2.2 */
offset = coresetIdxTable[coreset0Idx][3];
fillCoresetFeqDomAllocMap(((cellCb->cellCfg.dlCfgCommon.schFreqInfoDlSib.offsetToPointA - offset)/6), \
(numRbs/6), freqDomainResource);
- covertFreqDomRsrcMapToIAPIFormat(freqDomainResource, \
- cellCb->cellCfg.dlCfgCommon.schInitialDlBwp.pdcchCommon.commonSearchSpace.freqDomainRsrc);
-
+ memcpy(cellCb->cellCfg.dlCfgCommon.schInitialDlBwp.pdcchCommon.commonSearchSpace.freqDomainRsrc,\
+ freqDomainResource,FREQ_DOM_RSRC_SIZE);
/* Fill K0 - K1 table for common cfg*/
BuildK0K1Table(cellCb, &cellCb->k0K1InfoTbl, true, cellCb->cellCfg.dlCfgCommon.schInitialDlBwp.pdschCommon,
pdschCfg, DEFAULT_UL_ACK_LIST_COUNT, defaultUlAckTbl);
uint8_t fillSchUeCbFrmCfgReq(Inst inst, SchUeCb *ueCb, SchUeCfgReq *ueCfg)
{
uint8_t lcIdx, ueLcIdx, idx;
- uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
SchPdschCfgCmn pdschCfg;
SchPucchDlDataToUlAck *dlDataToUlAck;
uint8_t retDL = ROK, retUL = ROK;
}
fillSpCellInSchCb(&ueCb->ueCfg.spCellCfg, &ueCfg->spCellCfg);
- covertFreqDomRsrcMapToIAPIFormat(ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc,\
- freqDomainResource);
- memset(ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc, 0, FREQ_DOM_RSRC_SIZE);
- memcpy(ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc, freqDomainResource, FREQ_DOM_RSRC_SIZE);
-
ueCb->ueCfg.spCellCfgPres = true;
dlDataToUlAck = ueCfg->spCellCfg.servCellCfg.initUlBwp.pucchCfg.dlDataToUlAck;
if(ueCb->cellCb)
uint8_t fillSchUeCbFrmRecfgReq(Inst inst, SchUeCb *ueCb, SchUeRecfgReq *ueRecfg)
{
uint8_t lcIdx, ueLcIdx, idx;
- uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
SchPdschCfgCmn pdschCfg;
SchPucchDlDataToUlAck *dlDataToUlAck;
uint8_t retDL = ROK, retUL = ROK;
}
memcpy(&ueCb->ueCfg.spCellCfg , &ueRecfg->spCellRecfg, sizeof(SchSpCellRecfg));
- covertFreqDomRsrcMapToIAPIFormat(ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc,\
- freqDomainResource);
- memset(ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc, 0, FREQ_DOM_RSRC_SIZE);
- memcpy(ueCb->ueCfg.spCellCfg.servCellRecfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc, freqDomainResource, FREQ_DOM_RSRC_SIZE);
-
ueCb->ueCfg.spCellCfgPres = true;
dlDataToUlAck = ueRecfg->spCellRecfg.servCellRecfg.initUlBwp.pucchCfg.dlDataToUlAck;
if(ueCb->cellCb)
}
#endif
-/*
- * As per FAPI spec,
- * Frequency domain resources is a bitmap defining non-overlapping groups of 6 PRBs in ascending order.
- * [TS38.213 10.1]. Bitmap of uint8 array. 45 bits.
- *
- * As per IAPI,
- * CORESET-freqdom.frequencyDomainResources : The bits of the bitmap have a one-to-one mapping with
- * non-overlapping groups of 6 RBs. The most significant bit of the first word corresponds to
- * the most significant bit defined in 38.331.
- *
- * FAPI and IAPI both are 45 bits. Mapped from bit 0 LS Byte for the FAPI and
- * bit 0 LS U32 entry for IAPI.
- * FAPI is to be filled in following format such that Intel L1 is able to decode it :
- *
- * FAPI IAPI
- * FreqDomainResource[0] bits 7-0 -> nFreqDomain[0] bits 7-0
- * FreqDomainResource[1] bits 7-0 -> nFreqDomain[0] bits 15-8
- * FreqDomainResource[2] bits 7-0 -> nFreqDomain[0] bits 23-16
- * FreqDomainResource[3] bits 7-0 -> nFreqDomain[0] bits 31-24
- * FreqDomainResource[4] bits 7-0 -> nFreqDomain[1] bits 7-0
- * FreqDomainResource[5] bits 7-0 -> nFreqDomain[1] bits 15-8
- *
- * where for the last entry bits 7,6 and 5 are don't care in the FAPI and bits
- * 31-13 are don't care in the IAPI.
- */
-void covertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap)
-{
- int8_t idx;
- uint8_t numBitsToShift = 0;
- uint64_t freqDomainResources = 0;
-
- /* Bit operation to create a 64-bit integer that has
- * 48 LSBs [Bit 47 to Bit 0] mapped to sourceBitMap[0] to sourceBitMap[5]
- */
- for(idx = FREQ_DOM_RSRC_SIZE-1; idx >=0; idx--)
- {
- freqDomainResources |= ((uint64_t)sourceBitMap[idx] << numBitsToShift);
- numBitsToShift += 8;
- }
-
- /* Right shift 3 bits because bits[2-0] are unused in sourceBitMap[5] */
- freqDomainResources = freqDomainResources >> 3;
-
- /* Filling destBitMap such that LSB bit 0 of freqDomainResources maps to LSB
- * of first word of destBitMap */
- numBitsToShift = 0;
- for(idx=0; idx<FREQ_DOM_RSRC_SIZE; idx++)
- {
- destBitMap[idx] = freqDomainResources >> numBitsToShift;
- numBitsToShift += 8;
- }
-}
/**********************************************************************
End of file
**********************************************************************/
void removeAllocatedPrbFromFreePrbList(CmLListCp *freePrbBlockList, CmLList *node, \
uint16_t startPrb, uint16_t numPrb);
uint8_t findDmrsStartSymbol(uint16_t dlDmrsSymbBitMap);
-void covertFreqDomRsrcMapToIAPIFormat(uint8_t *sourceBitMap, uint8_t *destBitMap);
uint8_t updateLcListReqPRB(CmLListCp *lcLL, uint8_t lcId, uint32_t payloadSize);
uint32_t calculateEstimateTBSize(uint32_t reqBO, uint16_t mcsIdx,uint8_t numSymbols,\