X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_handle_phy.c;h=ecdd4317532e2a1cddc6fd2d9e656001cdd5aeb5;hb=a2484c58e5beeb1ab9e1c86104cf9d9bc56750d1;hp=736aca2edc32accc3030dac92bcbc0e0282d6d3a;hpb=db0a2ee4edd328449d01ab184d253327fca950d6;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_handle_phy.c b/src/5gnrmac/lwr_mac_handle_phy.c index 736aca2ed..ecdd43175 100644 --- a/src/5gnrmac/lwr_mac_handle_phy.c +++ b/src/5gnrmac/lwr_mac_handle_phy.c @@ -46,6 +46,7 @@ #include "lwr_mac_fsm.h" #include "lwr_mac_phy.h" #include "lwr_mac_upr_inf.h" +#include "rg.h" #ifdef FAPI /* Function pointer for slot indication from lower mac to mac */ @@ -80,7 +81,13 @@ packRxDataIndMsg sendRxDataIndOpts[] = packRxDataInd }; - +/* Function pointer for stop indication from lower mac to mac */ +packStopIndMsg sendStopIndOpts[] = +{ + packStopInd, + fapiMacStopInd, + packStopInd +}; /******************************************************************* * * @brief Fills post structure @@ -154,7 +161,35 @@ U16 handleSlotInd(fapi_slot_ind_t *fapiSlotInd) return ret; } +/******************************************************************* + * + * @brief Handles stop indication recived from PHY + * + * @details + * + * Function : handleStopInd + * + * Functionality: + * Handles Stop Indication received from PHY + * + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t handleStopInd() +{ + uint8_t ret; + Pst pst; + + clGlobalCp.phyState = PHY_STATE_CONFIGURED; + DU_LOG("\nLWR_MAC: PHY has moved to configured state"); + + fillLwrMacToMacPst(&pst); + pst.event = EVENT_STOP_IND_TO_MAC; + ret = (*sendStopIndOpts[pst.selector])(&pst); + return ret; +} /******************************************************************* * * @brief Processes Rach Indication from PHY and sends to MAC @@ -299,8 +334,9 @@ uint8_t handleRxDataInd(fapi_rx_data_indication_t *fapiRxDataInd) pdu->ul_cqi = fapiRxDataInd->pdus[pduIdx].ul_cqi; pdu->timingAdvance = fapiRxDataInd->pdus[pduIdx].timingAdvance; pdu->rssi = fapiRxDataInd->pdus[pduIdx].rssi; - /* TODO : Copy pdu from FAPI msg to MAC structure*/ - //pdu->pduData; + + MAC_ALLOC(pdu->pduData, pdu->pduLength); + memcpy(pdu->pduData, fapiRxDataInd->pdus[pduIdx].pduData, pdu->pduLength); } fillLwrMacToMacPst(&pst); @@ -372,6 +408,12 @@ void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg) rachInd = (fapi_rach_indication_t *)msg; handleRachInd(rachInd); break; + } + case FAPI_STOP_INDICATION: + { + DU_LOG("\nLWR_MAC: Handling Stop Indication"); + handleStopInd(); + break; } } #ifdef INTEL_WLS