K2 configuration from F1AP to SCH [Issue-ID: ODUHIGH-341] 72/6572/1
authorlal.harshita <Harshita.Lal@radisys.com>
Wed, 28 Jul 2021 14:51:26 +0000 (20:21 +0530)
committerHarshita Lal <harshita.lal@radisys.com>
Mon, 6 Sep 2021 06:48:41 +0000 (06:48 +0000)
Change-Id: I0f0fa2b1e99a41bf6e8f25336a1ea2359392f612
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
(cherry picked from commit 8ddfeabf3ec06d0be029789983022fdd1bb8c2e6)

src/5gnrmac/mac_cfg_hdl.c
src/5gnrsch/sch_rach.c
src/cm/du_app_mac_inf.h
src/cm/mac_sch_interface.h
src/cu_stub/cu_f1ap_msg_hdl.c
src/du_app/du_cfg.c
src/du_app/du_cfg.h
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_sys_info_hdl.c
src/du_app/du_ue_mgr.c

index 6448a61..3fa2e93 100644 (file)
@@ -290,13 +290,19 @@ uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
    schCellCfg.schInitialUlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialUlBwp.bwp.numPrb;
    schCellCfg.schInitialUlBwp.bwp.scs = macCellCfg->initialUlBwp.bwp.scs;
    schCellCfg.schInitialUlBwp.bwp.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
-   schCellCfg.schInitialUlBwp.puschCommon.k2 = macCellCfg->initialUlBwp.puschCommon.k2;
-   schCellCfg.schInitialUlBwp.puschCommon.mappingType =
-      macCellCfg->initialUlBwp.puschCommon.mappingType;
-   schCellCfg.schInitialUlBwp.puschCommon.startSymbol =
-      macCellCfg->initialUlBwp.puschCommon.startSymbol;
-   schCellCfg.schInitialUlBwp.puschCommon.lengthSymbol =
-      macCellCfg->initialUlBwp.puschCommon.lengthSymbol;
+   schCellCfg.schInitialUlBwp.puschCommon.numTimeDomRsrcAlloc = \
+      macCellCfg->initialUlBwp.puschCommon.numTimeDomRsrcAlloc;
+   for(idx = 0; idx < macCellCfg->initialUlBwp.puschCommon.numTimeDomRsrcAlloc; idx++)
+   {
+      schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[idx].k2 = 
+         macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[idx].k2;
+      schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[idx].mappingType =
+         macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[idx].mappingType;
+      schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[idx].startSymbol =
+         macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[idx].startSymbol;
+      schCellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[idx].symbolLength =
+         macCellCfg->initialUlBwp.puschCommon.timeDomRsrcAllocList[idx].symbolLength;
+   }
 #ifdef NR_TDD
    memcpy(&schCellCfg.tddCfg, &macCellCfg->tddCfg, sizeof(TDDCfg));
 #endif
index d5ae0ce..3339e4e 100644 (file)
@@ -120,8 +120,8 @@ uint8_t schAllocMsg3Pusch(Inst schInst, uint16_t slot, uint16_t crnti, \
    uint16_t   tbSize         = 0;
 
    cell = schCb[schInst].cells[schInst];
-   startSymb = cell->cellCfg.schInitialUlBwp.puschCommon.startSymbol;
-   symbLen = cell->cellCfg.schInitialUlBwp.puschCommon.lengthSymbol;
+   startSymb = cell->cellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol;
+   symbLen = cell->cellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength;
 
    startRb = cell->schUlSlotInfo[msg3SlotAlloc]->puschCurrentPrb;
    tbSize = schCalcTbSize(8); /* 6 bytes msg3  and 2 bytes header */
@@ -203,7 +203,7 @@ uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
 
    //puschMu = cell->cellCfg.puschMu;
    delta = puschDeltaTable[puschMu];
-   k2 = cell->cellCfg.schInitialUlBwp.puschCommon.k2;
+   k2 = cell->cellCfg.schInitialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2;
    /* RAR will sent with a delay of RAR_DELAY */
    rarSlot = (rachInd->timingInfo.slot+RAR_DELAY+PHY_DELTA_DL)%cell->numSlots;
 #ifdef NR_TDD
index 6a3fdbc..c5dbf84 100644 (file)
@@ -621,13 +621,22 @@ typedef struct pucchConfigCommon
    uint8_t pucchGroupHopping;
 }PucchConfigCommon;
 
+/* PUSCH Time Domain Resource Allocation */
+typedef struct puschTimeDomRsrcAlloc
+{
+   uint8_t   k2;
+   CommonMappingType   mappingType;
+   uint8_t           startSymbol;
+   uint8_t           symbolLength;
+   uint8_t   startSymbolAndLength;
+}PuschTimeDomRsrcAlloc;
+
+
 typedef struct puschConfigCommon
 {
    /* PUSCH-TimeDomainResourceAllocation info */
-   uint8_t k2;
-   uint8_t mappingType;
-   uint8_t startSymbol;
-   uint8_t lengthSymbol;
+   uint8_t                 numTimeDomRsrcAlloc;
+   PuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
 }PuschConfigCommon;
 
 typedef struct bwpDlConfig
@@ -1049,16 +1058,6 @@ typedef struct dmrsUlCfg
    TransPrecodDisabled   transPrecodDisabled;  /* Transform precoding disabled */
 }DmrsUlCfg;
 
-/* PUSCH Time Domain Resource Allocation */
-typedef struct puschTimeDomRsrcAlloc
-{
-   uint8_t   k2;
-   CommonMappingType   mappingType;
-   uint8_t           startSymbol;
-   uint8_t           symbolLength;
-   uint8_t   startSymbolAndLength;
-}PuschTimeDomRsrcAlloc;
-
 /* PUSCH Configuration */
 typedef struct puschCfg
 {
index 194a7dd..4fa5e7b 100644 (file)
@@ -630,12 +630,19 @@ typedef struct schPucchCfgCmn
    uint8_t pucchGroupHopping;
 }SchPucchCfgCmn;
 
+/* PUSCH Time Domain Resource Allocation */
+typedef struct schPuschTimeDomRsrcAlloc
+{
+   uint8_t   k2;
+   SchTimeDomRsrcAllocMappingType   mappingType;
+   uint8_t   startSymbol;
+   uint8_t   symbolLength;
+}SchPuschTimeDomRsrcAlloc;
+
 typedef struct schPuschCfgCmn
 {
-   uint8_t k2;
-   uint8_t mappingType;
-   uint8_t startSymbol;
-   uint8_t lengthSymbol;
+   uint8_t                    numTimeDomRsrcAlloc;
+   SchPuschTimeDomRsrcAlloc   timeDomRsrcAllocList[MAX_NUM_UL_ALLOC]; /* PUSCH time domain UL resource allocation list */
 }SchPuschCfgCmn;
 
 typedef struct schBwpDlCfg
@@ -1296,15 +1303,6 @@ typedef struct SchDmrsUlCfg
    SchTransPrecodDisabled     transPrecodDisabled;  /* Transform precoding disabled */
 }SchDmrsUlCfg;
 
-/* PUSCH Time Domain Resource Allocation */
-typedef struct schPuschTimeDomRsrcAlloc
-{
-   uint8_t   k2;
-   SchTimeDomRsrcAllocMappingType   mappingType;
-   uint8_t   startSymbol;
-   uint8_t   symbolLength;
-}SchPuschTimeDomRsrcAlloc;
-
 /* PUSCH Configuration */
 typedef struct schPuschCfg
 {
index 1b40aff..d6d1c6f 100644 (file)
 #define PDSCH_MAPPING_TYPE_B 1
 
 /* MACRO Define for PUSCH Configuration */
-#define PUSCH_K2  3
+#define PUSCH_K2_CFG1  3
+#define PUSCH_K2_CFG2  4
 
 #define PUSCH_MSG3_DELTA_PREAMBLE 0
 #define PUSCH_P0_NOMINAL_WITH_GRANT -70
@@ -3551,7 +3552,7 @@ uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
       return RFAILED;
    }
 
-   elementCnt = 1;
+   elementCnt = 2;
    timeDomAllocList->choice.setup->list.count = elementCnt;
    timeDomAllocList->choice.setup->list.size = \
                                               elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *);
@@ -3584,9 +3585,22 @@ uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
       DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
       return RFAILED;
    }
-   *(timeDomAlloc->k2) = PUSCH_K2;
+   *(timeDomAlloc->k2) = PUSCH_K2_CFG1;
    timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
    timeDomAlloc->startSymbolAndLength = 66; 
+
+   idx++;
+   timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+   CU_ALLOC(timeDomAlloc->k2, sizeof(long));
+   if(!timeDomAlloc->k2)
+   {
+       DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+       return RFAILED;
+   }
+   *(timeDomAlloc->k2) = PUSCH_K2_CFG2;
+   timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
+   timeDomAlloc->startSymbolAndLength = 66;
+
    return ROK;
 }
 
index a0c2831..ac754e4 100644 (file)
@@ -333,15 +333,25 @@ uint8_t readMacCfg()
    duCfgParam.macCellCfg.initialUlBwp.bwp.scs = SCS_15KHZ; /* numerology is 0, 15Khz */
 #endif
    duCfgParam.macCellCfg.initialUlBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
-   duCfgParam.macCellCfg.initialUlBwp.puschCommon.k2 = PUSCH_K2;
-   duCfgParam.macCellCfg.initialUlBwp.puschCommon.mappingType = 
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.numTimeDomRsrcAlloc = 2;
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].k2 = PUSCH_K2_CFG1;
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].mappingType = 
       PUSCH_MAPPING_TYPE_A;
-   duCfgParam.macCellCfg.initialUlBwp.puschCommon.startSymbol = 
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].startSymbol = 
       PUSCH_START_SYMBOL;
-   duCfgParam.macCellCfg.initialUlBwp.puschCommon.lengthSymbol =
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[0].symbolLength =
+      PUSCH_LENGTH_SYMBOL;
+
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].k2 = PUSCH_K2_CFG2;
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].mappingType = 
+      PUSCH_MAPPING_TYPE_A;
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].startSymbol = 
+      PUSCH_START_SYMBOL;
+   duCfgParam.macCellCfg.initialUlBwp.puschCommon.timeDomRsrcAllocList[1].symbolLength =
       PUSCH_LENGTH_SYMBOL;
 
    duCfgParam.macCellCfg.dmrsTypeAPos = DMRS_TYPE_A_POS; 
+
    /* fill PUCCH config common */
    duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchResourceCommon = PUCCH_RSRC_COMMON;
    duCfgParam.macCellCfg.initialUlBwp.pucchCommon.pucchGroupHopping = PUCCH_GROUP_HOPPING;
@@ -534,10 +544,14 @@ uint8_t fillServCellCfgCommSib(SrvCellCfgCommSib *srvCellCfgComm)
    srvCellCfgComm->ulCfg.rachCfg = rachCfg;
 
    /* Configuring PUSCH Config Common for SIB1 */
-   puschCfg.present = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
-   puschCfg.k2 = PUSCH_K2;
-   puschCfg.mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
-   puschCfg.sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
+   puschCfg.puschCfgPresent = BWP_UplinkCommon__pusch_ConfigCommon_PR_setup;
+   puschCfg.numTimeDomRsrcAlloc = 2;
+   puschCfg.timeDomAllocList[0].k2 = PUSCH_K2_CFG1;
+   puschCfg.timeDomAllocList[0].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
+   puschCfg.timeDomAllocList[0].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
+   puschCfg.timeDomAllocList[1].k2 = PUSCH_K2_CFG2;
+   puschCfg.timeDomAllocList[1].mapType = PUSCH_TimeDomainResourceAllocation__mappingType_typeA;
+   puschCfg.timeDomAllocList[1].sliv = calcSliv(PUSCH_START_SYMBOL,PUSCH_LENGTH_SYMBOL);
    puschCfg.msg3DeltaPreamble = PUSCH_MSG3_DELTA_PREAMBLE;
    puschCfg.p0NominalWithGrant = PUSCH_P0_NOMINAL_WITH_GRANT;
    srvCellCfgComm->ulCfg.puschCfg = puschCfg;
index 584f4c8..fabeaaf 100644 (file)
 #define PDSCH_NUM_HARQ_PROC 5
 
 /* MACRO Define for PUSCH Configuration */
-#define PUSCH_K2  3
+#define MAX_UL_ALLOC 16
+#define PUSCH_K2_CFG1  3
+#define PUSCH_K2_CFG2  4
 #define PUSCH_START_SYMBOL  3
 #define PUSCH_LENGTH_SYMBOL 11
 
@@ -1156,12 +1158,18 @@ typedef struct rachCfgCommon
    long   restrictedSetCfg;  /* Restricted set configuration */
 }RachCfgCommon;
 
-typedef struct  puschCfgCommon
+typedef struct puschCfgCmnTimeDomAlloc
 {
-   uint8_t  present;
    long     k2;
    long     mapType;
    uint16_t sliv;
+}PuschCfgCmnTimeDomAlloc;
+
+typedef struct  puschCfgCommon
+{
+   uint8_t  puschCfgPresent;
+   uint8_t  numTimeDomRsrcAlloc;
+   PuschCfgCmnTimeDomAlloc timeDomAllocList[MAX_UL_ALLOC];
    long     msg3DeltaPreamble;
    long     p0NominalWithGrant;
 }PuschCfgCommon;
index 4c2911e..89f1f29 100644 (file)
@@ -4110,7 +4110,7 @@ uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
       return RFAILED;
    }
 
-   elementCnt = 1;
+   elementCnt = 2;
    timeDomAllocList->choice.setup->list.count = elementCnt;
    timeDomAllocList->choice.setup->list.size = \
                                               elementCnt * sizeof(PUSCH_TimeDomainResourceAllocation_t *);
@@ -4143,9 +4143,22 @@ uint8_t BuildInitialDlBWP(BWP_DownlinkDedicated_t *dlBwp)
       DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
       return RFAILED;
    }
-   *(timeDomAlloc->k2) = PUSCH_K2;
+   *(timeDomAlloc->k2) = PUSCH_K2_CFG1;
+   timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
+   timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+
+   idx++;
+   timeDomAlloc = timeDomAllocList->choice.setup->list.array[idx];
+   DU_ALLOC(timeDomAlloc->k2, sizeof(long));
+   if(!timeDomAlloc->k2)
+   {
+      DU_LOG("\nERROR  -->  F1AP : Memory allocation failed in BuildPuschTimeDomAllocList");
+      return RFAILED;
+   }
+   *(timeDomAlloc->k2) = PUSCH_K2_CFG2;
    timeDomAlloc->mappingType = PUSCH_MAPPING_TYPE_A;
    timeDomAlloc->startSymbolAndLength = calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+
    return ROK;
 }
 
index 1d8a4cc..4974325 100644 (file)
@@ -1797,7 +1797,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf
 
    duPuschCfg = duCfgParam.sib1Params.srvCellCfgCommSib.ulCfg.puschCfg;
 
-   puschCfg->present = duPuschCfg.present;
+   puschCfg->present = duPuschCfg.puschCfgPresent;
    switch(puschCfg->present)
    {
       case BWP_UplinkCommon__pusch_ConfigCommon_PR_NOTHING:
@@ -1828,7 +1828,7 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf
            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 *);
@@ -1852,21 +1852,21 @@ uint8_t BuildPuschCfgCommon(struct BWP_UplinkCommon__pusch_ConfigCommon *puschCf
            }
         }
 
-        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)
index edca41d..16ade9f 100644 (file)
@@ -704,17 +704,25 @@ void fillDefaultInitUlBwp(InitialUlBwp *initUlBwp)
         initUlBwp->puschCfg.dmrsUlCfgForPuschMapTypeA.transPrecodDisabled. \
            scramblingId0 = SCRAMBLING_ID; 
         initUlBwp->puschCfg.resourceAllocType = RESOURCEALLOCATION_TYPE1;
-        initUlBwp->puschCfg.numTimeDomRsrcAlloc = 1;
+        initUlBwp->puschCfg.numTimeDomRsrcAlloc = 2;
         idx = 0;
         if(initUlBwp->puschCfg.numTimeDomRsrcAlloc <= MAX_NUM_UL_ALLOC)
         {
-           initUlBwp->puschCfg.timeDomRsrcAllocList[idx].k2 = PUSCH_K2;
+           initUlBwp->puschCfg.timeDomRsrcAllocList[idx].k2 = PUSCH_K2_CFG1;
            initUlBwp->puschCfg.timeDomRsrcAllocList[idx].mappingType =\
               MAPPING_TYPEA;
            initUlBwp->puschCfg.timeDomRsrcAllocList[idx].startSymbol = PUSCH_START_SYMBOL;
            initUlBwp->puschCfg.timeDomRsrcAllocList[idx].symbolLength = PUSCH_LENGTH_SYMBOL;
            initUlBwp->puschCfg.timeDomRsrcAllocList[idx].startSymbolAndLength =\
               calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
+
+       idx++;
+       initUlBwp->puschCfg.timeDomRsrcAllocList[idx].k2 = PUSCH_K2_CFG2;
+       initUlBwp->puschCfg.timeDomRsrcAllocList[idx].mappingType = MAPPING_TYPEA;
+       initUlBwp->puschCfg.timeDomRsrcAllocList[idx].startSymbol = PUSCH_START_SYMBOL;
+       initUlBwp->puschCfg.timeDomRsrcAllocList[idx].symbolLength = PUSCH_LENGTH_SYMBOL;
+       initUlBwp->puschCfg.timeDomRsrcAllocList[idx].startSymbolAndLength =\
+          calcSliv(PUSCH_START_SYMBOL, PUSCH_LENGTH_SYMBOL);
         }
         initUlBwp->puschCfg.transformPrecoder = TRANSFORM_PRECODER_DISABLED;
       }