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=54a6643952b772cc5e11c6288ca3f234d413cb69;hpb=2324a199636bc2e127af6bb3beefef668b4f45d7;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_handle_phy.c b/src/5gnrmac/lwr_mac_handle_phy.c index 54a664395..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); } @@ -189,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; @@ -217,7 +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); - }/* handleRachInd */ /******************************************************************* @@ -248,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; @@ -307,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;