#include "sch.h"
#include "sch_utils.h"
-SchRachRsrcRspFunc SchRachRsrcRspOpts[] =
-{
- packSchRachRsrcRsp, /* LC */
- MacProcSchRachRsrcRsp, /* TC */
- packSchRachRsrcRsp /* LWLC */
-};
-
/**
* @brief Checks if PRACH can be scheduled in current slot
*
*
* @details
*
- * Function : MacSchRachRsrcReq
+ * Function : SchProcRachRsrcReq
*
* This function processes RACH resorce request
* from MAC for CFRA. It assigns a dedicated preamble
* @return ROK
* RFAILED
**/
-uint8_t MacSchRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq)
+uint8_t SchProcRachRsrcReq(Pst *pst, SchRachRsrcReq *schRachRsrcReq)
{
uint8_t ssbIdx = 0, cfraSsbIdx = 0;
uint8_t firstCFPreambleIndex = 0, lastCFPreambleIndex = 0;
SCH_FREE(schRachRsrcReq, sizeof(SchRachRsrcReq));
/* Send RACH resource response to MAC */
- return (SchRachRsrcRspOpts[rspPst.selector](&rspPst, rachRsrcRsp));
+ return(MacMessageRouter(&rspPst, (void *)rachRsrcRsp));
}
/**
*
* @details
*
- * Function : schProcessRachInd
+ * Function : SchProcRachInd
*
* This function process rach indication
*
* @param[in] shed instance
* @return ROK
**/
-uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
+uint8_t SchProcRachInd(Pst *pst, RachIndInfo *rachInd)
{
- SchCellCb *cell = schCb[schInst].cells[schInst];
SchRaReq *raReq = NULLP;
- float slotDuration;
- uint8_t winNumSlots;
- uint8_t ueId;
+ float slotDuration;
+ uint8_t winNumSlots;
+ uint8_t ueId;
+ Inst schInst = pst->dstInst-SCH_INST_START;
+ SchCellCb *cell = schCb[schInst].cells[schInst];
+
+ DU_LOG("\nINFO --> SCH : Received Rach indication");
if(cell == NULLP)
{
- DU_LOG("\nERROR --> SCH: Failed to find cell in schProcessRachInd");
+ DU_LOG("\nERROR --> SCH: Failed to find cell in SchProcRachInd");
return RFAILED;
}
SCH_ALLOC(raReq, sizeof(SchRaReq));
if(!raReq)
{
- DU_LOG("\nERROR --> SCH : Memory allocation failure in schProcessRachInd");
+ DU_LOG("\nERROR --> SCH : Memory allocation failure in SchProcRachInd");
SCH_FREE(rachInd, sizeof(RachIndInfo));
return RFAILED;
}
cell->raReq[ueId -1] = raReq;
/* Adding UE Id to list of pending UEs to be scheduled */
- addUeToBeScheduled(cell, ueId);
-
+ cell->api->SchRachInd(cell, ueId);
return ROK;
}
*
* @details
*
- * Function : MacSchRachRsrcRel
+ * Function : SchProcRachRsrcRel
*
* This function processes RACH resorce release
* from MAC after CFRA. It releases the dedicated
* @return ROK
* RFAILED
*/
-uint8_t MacSchRachRsrcRel(Pst *pst, SchRachRsrcRel *schRachRsrcRel)
+uint8_t SchProcRachRsrcRel(Pst *pst, SchRachRsrcRel *schRachRsrcRel)
{
uint8_t ret = ROK;
uint8_t ssbIdx = 0, cfraSsbIdx = 0;
{
DU_LOG("\nINFO --> SCH: State change for ueId[%2d] to SCH_RA_STATE_MSG4_DONE\n",ueCb->ueId);
ueCb->cellCb->raCb[ueCb->ueId-1].raState = SCH_RA_STATE_MSG4_DONE;
- ueCb->msg4Proc = ueCb->retxMsg4HqProc = NULLP;
+ ueCb->msg4HqProc = ueCb->retxMsg4HqProc = NULLP;
}
/**********************************************************************
End of file