X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_fsm.c;h=5f8e0494878fc254eca2bc6aeccb232e250d6e31;hb=6178d5e32f0c57e198de80afc23b92c635e4f6df;hp=eefda5803491d7b0839ac34a3b760fa4c7fa5c4c;hpb=8c0d3b68f4e2983fa0e601484cafcbfda69787d5;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index eefda5803..5f8e04948 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -2922,7 +2922,7 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\ * @return ROK * ******************************************************************/ -uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, \ +uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, int8_t dlMsgSchInfoIdx, \ RntiType rntiType, uint8_t coreSetType, uint8_t ueIdx) { if(dlTtiReqPdu != NULLP) @@ -2945,10 +2945,10 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, \ } else if(rntiType == TC_RNTI_TYPE || rntiType == C_RNTI_TYPE) { - pdcchInfo = &dlInfo->dlMsgAlloc[ueIdx]->dlMsgPdcchCfg; - bwp = &dlInfo->dlMsgAlloc[ueIdx]->bwp; + pdcchInfo = &dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgPdcchCfg; + bwp = &dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].bwp; fillDlMsgDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\ - &dlInfo->dlMsgAlloc[ueIdx]->dlMsgInfo); + &dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgInfo); } else { @@ -3107,12 +3107,14 @@ uint8_t calcDlTtiReqPduCount(DlSchedInfo *dlInfo) if(dlInfo->dlMsgAlloc[ueIdx] != NULLP) { + for(idx=0; idxdlMsgAlloc[ueIdx]->numSchedInfo; idx++) + { /* PDCCH and PDSCH PDU is filled */ - if(dlInfo->dlMsgAlloc[ueIdx]->pduPres == BOTH) + if(dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) count += 2; - else + else if(dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres != NONE) count += 1; - + } } } return count; @@ -3135,7 +3137,7 @@ uint8_t calcDlTtiReqPduCount(DlSchedInfo *dlInfo) * ********************************************************************/ uint8_t calcTxDataReqPduCount(DlSchedInfo *dlInfo) { - uint8_t count = 0, ueIdx=0; + uint8_t idx = 0, count = 0, ueIdx=0; if(dlInfo->isBroadcastPres && dlInfo->brdcstAlloc.sib1Trans) { @@ -3150,8 +3152,12 @@ uint8_t calcTxDataReqPduCount(DlSchedInfo *dlInfo) if(dlInfo->dlMsgAlloc[ueIdx] != NULLP) { - if(dlInfo->dlMsgAlloc[ueIdx]->pduPres == BOTH || dlInfo->dlMsgAlloc[ueIdx]->pduPres == PDSCH_PDU) - count++; + for(idx=0; idxdlMsgAlloc[ueIdx]->numSchedInfo; idx++) + { + if(dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH || \ + dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU) + count++; + } } } return count; @@ -3446,7 +3452,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) if(numPduEncoded != nPdu) { rntiType = SI_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded],&currDlSlot->dlInfo,\ + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &currDlSlot->dlInfo, -1, \ rntiType, CORESET_TYPE0, MAX_NUM_UE); numPduEncoded++; fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], @@ -3457,7 +3463,6 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) pduIndex++; numPduEncoded++; } - DU_LOG("\033[1;34m"); DU_LOG("\nDEBUG --> LWR_MAC: SIB1 sent..."); DU_LOG("\033[0m"); @@ -3474,7 +3479,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDCCH_PDU)) { fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - &currDlSlot->dlInfo, rntiType, CORESET_TYPE0, ueIdx); + &currDlSlot->dlInfo, -1, rntiType, CORESET_TYPE0, ueIdx); numPduEncoded++; } if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ @@ -3495,53 +3500,58 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) { - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgInfo.dlMsgPdu != NULLP) + for(idx=0; idxdlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++) { /* Filling Msg4 param */ - if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->pduPres == BOTH) || \ - (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->pduPres == PDCCH_PDU)) + if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ + (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDCCH_PDU)) { - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgInfo.isMsg4Pdu) + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) { rntiType = TC_RNTI_TYPE; fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - &currDlSlot->dlInfo, rntiType, CORESET_TYPE0, ueIdx); + &currDlSlot->dlInfo, idx, rntiType, CORESET_TYPE0, ueIdx); } else { /* Filling other DL msg params */ rntiType = C_RNTI_TYPE; fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \ - &currDlSlot->dlInfo, rntiType, CORESET_TYPE1, ueIdx); + &currDlSlot->dlInfo, idx, rntiType, CORESET_TYPE1, ueIdx); } numPduEncoded++; } - if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->pduPres == BOTH) || \ - (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->pduPres == PDSCH_PDU)) + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.dlMsgPdu != NULLP) { - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg, - currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp, pduIndex); - numPduEncoded++; - pduIndex++; - - DU_LOG("\033[1;32m"); - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgInfo.isMsg4Pdu) + if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ + (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU)) { - DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent..."); + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], \ + &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgPdschCfg,\ + currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].bwp, pduIndex); + numPduEncoded++; + pduIndex++; + + DU_LOG("\033[1;32m"); + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) + { + DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent..."); + } + else + { + DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent..."); + } + DU_LOG("\033[0m"); } - else - { - DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent..."); - } - DU_LOG("\033[0m"); - } - } - else - { - MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); - currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP; + } + /* else + { + MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); + currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP; + } + */ } } } @@ -3558,7 +3568,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) msgHeader->num_msg++; /* Intel L1 expects UL_DCI.request following DL_TTI.request */ - fillUlDciReq(currTimingInfo, dlTtiElem->p_next); + fillUlDciReq(dlTtiReqTimingInfo, dlTtiElem->p_next); msgHeader->num_msg++; /* send Tx-DATA req message */ @@ -3582,7 +3592,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) msgHeader->num_msg++; /* Intel L1 expects UL_DCI.request following DL_TTI.request */ - fillUlDciReq(currTimingInfo, dlTtiElem->p_next); + fillUlDciReq(dlTtiReqTimingInfo, dlTtiElem->p_next); msgHeader->num_msg++; prevElem = dlTtiElem->p_next->p_next; @@ -3640,6 +3650,7 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, DlSchedInfo *dlInfo, p_fap uint8_t nPdu = 0; uint8_t ueIdx=0; + uint8_t schInfoIdx = 0; uint16_t cellIdx=0; uint16_t pduIndex = 0; fapi_tx_data_req_t *txDataReq =NULLP; @@ -3690,12 +3701,21 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, DlSchedInfo *dlInfo, p_fap if(dlInfo->dlMsgAlloc[ueIdx] != NULLP) { - fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, &dlInfo->dlMsgAlloc[ueIdx]->dlMsgInfo, \ - dlInfo->dlMsgAlloc[ueIdx]->dlMsgPdschCfg); - pduIndex++; - txDataReq->num_pdus++; - MAC_FREE(dlInfo->dlMsgAlloc[ueIdx]->dlMsgInfo.dlMsgPdu, dlInfo->dlMsgAlloc[ueIdx]->dlMsgInfo.dlMsgPduLen); - dlInfo->dlMsgAlloc[ueIdx]->dlMsgInfo.dlMsgPdu = NULLP; + for(schInfoIdx=0; schInfoIdx < dlInfo->dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++) + { + if((dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH) || \ + (dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU)) + { + fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \ + &dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo, \ + dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg); + pduIndex++; + txDataReq->num_pdus++; + } + MAC_FREE(dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu, \ + dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen); + dlInfo->dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = NULLP; + } MAC_FREE(dlInfo->dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); } } @@ -4323,7 +4343,6 @@ uint16_t fillUlDciReq(SlotTimingInfo currTimingInfo, p_fapi_api_queue_elem_t pre numPduEncoded++; /* free UL GRANT at SCH */ MAC_FREE(currDlSlot->dlInfo.ulGrant, sizeof(DciInfo)); - currDlSlot->dlInfo.ulGrant = NULLP; } #ifdef ODU_SLOT_IND_DEBUG_LOG DU_LOG("\nDEBUG --> LWR_MAC: Sending UL DCI Request");