X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_handle_phy.c;h=7e9d54e89c5f9b79234e3abc9f07aeccdd637a06;hb=8748e788a43465b180c15d31908c276504dad6d4;hp=ebcd761ffcb992c07e2b61f8a0f71acd8e8a3ed0;hpb=ef723e2e773fc6a6dcff43005569e509201df198;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_handle_phy.c b/src/5gnrmac/lwr_mac_handle_phy.c index ebcd761ff..7e9d54e89 100644 --- a/src/5gnrmac/lwr_mac_handle_phy.c +++ b/src/5gnrmac/lwr_mac_handle_phy.c @@ -116,6 +116,7 @@ uint8_t procSlotInd(fapi_slot_ind_t *fapiSlotInd) slotInd->slot = fapiSlotInd->slot; FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_SLOT_IND_TO_MAC); + pst.selector = ODU_SELECTOR_LWLC; ret = (*sendSlotIndOpts[pst.selector])(&pst, slotInd); } else @@ -159,6 +160,7 @@ uint8_t procStopInd() DU_LOG("\nINFO --> LWR_MAC: PHY has moved to configured state"); FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_STOP_IND_TO_MAC); + pst.selector = ODU_SELECTOR_LWLC; return (*sendStopIndOpts[pst.selector])(&pst, cellId); } @@ -180,9 +182,6 @@ uint8_t procStopInd() * ****************************************************************/ uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd) { -/* TODO : Remove the following #ifndef TEMP_INTG_FLAG, when testing - * RACH.indication in radio mode integration */ -#ifndef TEMP_INTG_FLAG Pst pst; uint8_t pduIdx; uint8_t prmbleIdx; @@ -192,9 +191,14 @@ uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd) MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd)); if(!rachInd) { - DU_LOG("\nERROR --> LWR_MAC: Memory Allocation failed in procRachInd"); + DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRachInd"); return RFAILED; } + if(!fapiRachInd->numPdus) + { + DU_LOG("\nDEBUG --> LWR_MAC : No PDU in RACH.indication at [%d, %d]", fapiRachInd->sfn, fapiRachInd->slot); + return ROK; + } rachInd->cellId = lwrMacCb.cellCb[0].cellId; rachInd->timingInfo.sfn = fapiRachInd->sfn; @@ -220,9 +224,6 @@ uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd) /* Fill post and sent to MAC */ FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_RACH_IND_TO_MAC); return (*sendRachIndOpts[pst.selector])(&pst, rachInd); -#else - return ROK; -#endif }/* handleRachInd */ /******************************************************************* @@ -253,9 +254,14 @@ uint8_t procCrcInd(fapi_crc_ind_t *fapiCrcInd) MAC_ALLOC_SHRABL_BUF(crcInd, sizeof(CrcInd)); if(!crcInd) { - DU_LOG("\nERROR --> LWR_MAC: Memory Allocation failed in procCrcInd"); + DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procCrcInd"); return RFAILED; } + if(!fapiCrcInd->numCrcs) + { + DU_LOG("\nDEBUG --> LWR_MAC : No CRC PDUs in CRC.indication at [%d, %d]", fapiCrcInd->sfn, fapiCrcInd->slot); + return ROK; + } crcInd->cellId = lwrMacCb.cellCb[0].cellId; crcInd->timingInfo.sfn = fapiCrcInd->sfn; @@ -312,9 +318,14 @@ uint8_t procRxDataInd(fapi_rx_data_indication_t *fapiRxDataInd) MAC_ALLOC_SHRABL_BUF(rxDataInd, sizeof(RxDataInd)); if(!rxDataInd) { - DU_LOG("\nERROR --> LWR_MAC: Memory Allocation failed in procRxDataInd"); + DU_LOG("\nERROR --> LWR_MAC : Memory Allocation failed in procRxDataInd"); return RFAILED; } + if(!fapiRxDataInd->numPdus) + { + DU_LOG("\nDEBUG --> LWR_MAC : No PDU in RX_Data.indication at [%d, %d]", fapiRxDataInd->sfn, fapiRxDataInd->slot); + return ROK; + } rxDataInd->cellId = lwrMacCb.cellCb[0].cellId; rxDataInd->timingInfo.sfn = fapiRxDataInd->sfn;