uint8_t MacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfg)
{
uint8_t idx;
+ uint8_t lcId;
+ uint8_t lcIdx;
uint16_t ueIdx;
SchCellCb *cellCb;
SchUeCb *ueCb;
/* Fill received Ue Configuration in UeCb */
memset(ueCb, 0, sizeof(SchUeCb));
-
- GET_UE_IDX(ueCfg->crnti, ueCb->ueIdx);
+ ueCb->ueIdx = ueIdx;
ueCb->crnti = ueCfg->crnti;
memcpy(&ueCb->ueCfg, ueCfg, sizeof(SchUeCfg));
ueCb->state = SCH_UE_STATE_ACTIVE;
+
+ /* Fill SRB1 info */
+ for(lcIdx = 0; lcIdx < ueCfg->numLc; lcIdx++)
+ {
+ lcId = ueCfg->lcCfgList[lcIdx].lcId;
+ ueCb->dlLcCtxt[lcId].lcp = ueCfg->lcCfgList[lcIdx].dlLcCfg.lcp;
+ ueCb->dlLcCtxt[lcId].lcState = SCH_LC_STATE_ACTIVE;
+ ueCb->dlLcCtxt[lcId].bo = 0;
+ ueCb->numDlLc++;
+
+ if(ueCfg->lcCfgList[lcIdx].ulLcCfg)
+ {
+ /* TODO : Fill UL LC Cfg. As of now for SRB1, it is null */
+ }
+ }
+
cellCb->numActvUe++;
+ SET_ONE_BIT(ueCb->ueIdx, cellCb->actvUeBitMap);
ueCb->cellCb = cellCb;
ueCb->srRcvd = false;
cellCb->schUlSlotInfo[puschSlot]->puschCurrentPrb += numRb;
+ puschInfo->crnti = ueCb->crnti;
puschInfo->harqProcId = SCH_HARQ_PROC_ID;
puschInfo->resAllocType = SCH_ALLOC_TYPE_1;
puschInfo->fdAlloc.startPrb = startRb;