From 29b5f01d779caab32dbc5b3686a5d917e4c818ec Mon Sep 17 00:00:00 2001 From: Balaji Shankaran Date: Thu, 6 Aug 2020 12:52:23 +0530 Subject: [PATCH] ODUHIGH-199:Addressing mux review comments Change-Id: Ifb0442cecc0ac85a3e2be77e73ac89fc486747d3 Signed-off-by: Balaji Shankaran --- src/5gnrmac/mac.h | 3 ++- src/5gnrmac/mac_slot_ind.c | 45 ++++++++++++++++++++++++++++++++++++++++++--- src/5gnrmac/rg_tom.c | 13 ++----------- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/5gnrmac/mac.h b/src/5gnrmac/mac.h index 99c769d39..800b49dc2 100644 --- a/src/5gnrmac/mac.h +++ b/src/5gnrmac/mac.h @@ -148,7 +148,8 @@ void fillMacCe(MacCeInfo *macCeData, uint8_t *msg3Pdu); void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint16_t tbSize); int unpackRxData(RxDataIndPdu *rxDataIndPdu); uint16_t macSendUlCcchInd(uint8_t *rrcContainer, uint16_t cellId, uint16_t crnti); -void BuildAndSendMsg4MuxPdu(Msg4Alloc *msg4Alloc); +void fillMg4Pdu(Msg4Alloc *msg4Alloc); +void buildAndSendMuxPdu(SlotIndInfo currTimingInfo); #endif /********************************************************************** diff --git a/src/5gnrmac/mac_slot_ind.c b/src/5gnrmac/mac_slot_ind.c index c30b94639..bca05f28a 100644 --- a/src/5gnrmac/mac_slot_ind.c +++ b/src/5gnrmac/mac_slot_ind.c @@ -94,8 +94,19 @@ int MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo) return ROK; } -void BuildAndSendMsg4MuxPdu(Msg4Alloc *msg4Alloc) -{ +/** + * @brief Forming anf filling the MUX Pdu + * @details + * + * Function : fillMsg4Pdu + * + * Forming and filling of Msg4Pdu + * + * @param[in] Msg4Alloc *msg4Alloc + * @return void + **/ +void fillMsg4Pdu(Msg4Alloc *msg4Alloc) +{ MacDlData msg4DlData; MacCeInfo macCeData; @@ -109,7 +120,7 @@ void BuildAndSendMsg4MuxPdu(Msg4Alloc *msg4Alloc) if(msg4DlData.pduInfo[0].dlPdu != NULLP) { fillMsg4DlData(&msg4DlData, macCb.macCell->macRaCb[0].msg4Pdu); - fillMacCe(&macCeData, &macCb.macCell->macRaCb[0].msg3Pdu); + fillMacCe(&macCeData, macCb.macCell->macRaCb[0].msg3Pdu); /* Forming Mux Pdu */ macCb.macCell->macRaCb[0].msg4TxPdu = NULLP; MAC_ALLOC(macCb.macCell->macRaCb[0].msg4TxPdu, macCb.macCell->macRaCb[0].msg4TbSize); @@ -150,6 +161,34 @@ void BuildAndSendMsg4MuxPdu(Msg4Alloc *msg4Alloc) MAC_FREE(macCb.macCell->macRaCb[0].msg4Pdu, macCb.macCell->macRaCb[0].msg4PduLen); */ } +/** + * @brief Builds and Send the Muxed Pdu to Lower MAC + * + * @details + * + * Function : buildAndSendMuxPdu + * + * Build and Sends the Muxed Pdu to Lower MAC. + * + * @param[in] SlotIndInfo *slotInd + * @return void + **/ + +void buildAndSendMuxPdu(SlotIndInfo currTimingInfo) +{ + MacDlSlot *currDlSlot = NULLP; + SlotIndInfo muxTimingInfo; + memset(&muxTimingInfo, 0, sizeof(SlotIndInfo)); + + ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA); + currDlSlot = &macCb.macCell->dlSlot[muxTimingInfo.slot]; + if(currDlSlot->dlInfo.msg4Alloc) + { + fillMsg4Pdu(currDlSlot->dlInfo.msg4Alloc); + currDlSlot = NULLP; + } +} + /** * @brief Transmission time interval indication from PHY. * diff --git a/src/5gnrmac/rg_tom.c b/src/5gnrmac/rg_tom.c index f4cd5d944..e01b4aa33 100755 --- a/src/5gnrmac/rg_tom.c +++ b/src/5gnrmac/rg_tom.c @@ -597,17 +597,8 @@ SlotIndInfo slotInd #endif /* Mux Pdu for Msg4 */ - SlotIndInfo muxTimingInfo; - memset(&muxTimingInfo, 0, sizeof(SlotIndInfo)); - MacDlSlot *currDlSlot = NULLP; - ADD_DELTA_TO_TIME(slotInd, muxTimingInfo, PHY_DELTA); - currDlSlot = &macCb.macCell->dlSlot[muxTimingInfo.slot]; - if(currDlSlot->dlInfo.msg4Alloc) - { - BuildAndSendMsg4MuxPdu(currDlSlot->dlInfo.msg4Alloc); - currDlSlot = NULLP; - } - + buildAndSendMuxPdu(slotInd); + /* Trigger for DL TTI REQ */ handleDlTtiReq(slotInd); -- 2.16.6