-
-/* spec-38.211 Table 6.3.3.1-7 */
-uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX] =
-{0, 2, 4, 6, 8, 10, 12, 13, 15, 17, 19, 23, 27, 34, 46, 69};
+/*******************************************************************
+ *
+ * @brief Processes RACH Resource response from SCH
+ *
+ * @details
+ *
+ * Function : MacProcSchRachRsrcRsp
+ *
+ * Functionality: Processes RACH resource response from SCH
+ * Fills and sends RACH resource response towards DU APP
+ *
+ * @params[in] Post structure
+ * RACH resource response
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacProcSchRachRsrcRsp(Pst *pst, SchRachRsrcRsp *schRachRsrcRsp)
+{
+ uint16_t cellIdx = 0;
+ Pst rspPst;
+ MacRachRsrcRsp *rachRsrcRsp = NULLP;
+ MacCellCb *cellCb = NULLP;
+ MacUeCb *ueCb = NULLP;
+
+ DU_LOG("\nINFO --> MAC : Received RACH resource response from SCH : Cell ID [%d] CRNTI [%d]", \
+ schRachRsrcRsp->cellId, schRachRsrcRsp->crnti);
+
+ /* Fill RACH resource response to send to DU APP */
+ MAC_ALLOC_SHRABL_BUF(rachRsrcRsp, sizeof(MacRachRsrcRsp));
+ if(!rachRsrcRsp)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed for RACH resource response");
+ MAC_FREE(schRachRsrcRsp, sizeof(SchRachRsrcRsp));
+ return RFAILED;
+ }
+ rachRsrcRsp->cellId = schRachRsrcRsp->cellId;
+ GET_UE_ID(schRachRsrcRsp->crnti, rachRsrcRsp->ueId);
+ rachRsrcRsp->result = MAC_DU_APP_RSP_OK;
+
+ /* Fill Pst structure to send RACH resource response from MAC to DU APP */
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_RACH_RESOURCE_RSP);
+
+ /* If negative response is received from SCH, send it further to DU APP */
+ if(schRachRsrcRsp->result == RSP_NOK)
+ {
+ DU_LOG("\nINFO --> MAC : RACH Resource response from SCH : Result [FAILURE]");
+ rachRsrcRsp->result = MAC_DU_APP_RSP_NOK;
+ }
+ else
+ {
+ DU_LOG("\nINFO --> MAC : RACH Resource response from SCH : Result [SUCCESS]");
+
+ /* Fetch Cell Cb */
+ GET_CELL_IDX(schRachRsrcRsp->cellId, cellIdx);
+ if(macCb.macCell[cellIdx] && (macCb.macCell[cellIdx]->cellId == schRachRsrcRsp->cellId))
+ {
+ cellCb = macCb.macCell[cellIdx];
+
+ /* Fetch UE Cb */
+ if(cellCb->ueCb[rachRsrcRsp->ueId-1].crnti == schRachRsrcRsp->crnti)
+ ueCb = &cellCb->ueCb[rachRsrcRsp->ueId-1];
+ else
+ {
+ DU_LOG("\nERROR --> MAC : CRNTI [%d] not found", schRachRsrcRsp->crnti);
+ rachRsrcRsp->result = MAC_DU_APP_RSP_NOK;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : Cell ID [%d] not found", schRachRsrcRsp->cellId);
+ rachRsrcRsp->result = MAC_DU_APP_RSP_NOK;
+ }
+ }