Commit 29ccc58e authored by Robert Schmidt's avatar Robert Schmidt

Slightly refactor configure_fapi_dl_Tx()

parent 7c5b67a1
...@@ -194,8 +194,6 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo ...@@ -194,8 +194,6 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo
const int CC_id = 0; const int CC_id = 0;
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[gNB_mac->TX_req[CC_id].Number_of_PDUs];
NR_UE_list_t *UE_list = &gNB_mac->UE_list; NR_UE_list_t *UE_list = &gNB_mac->UE_list;
...@@ -313,7 +311,8 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo ...@@ -313,7 +311,8 @@ void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slo
for (int j = 0; j < (TBS_bytes - offset); j++) for (int j = 0; j < (TBS_bytes - offset); j++)
gNB_mac->UE_list.DLSCH_pdu[0][UE_id].payload[0][offset + j] = 0; gNB_mac->UE_list.DLSCH_pdu[0][UE_id].payload[0][offset + j] = 0;
configure_fapi_dl_Tx(module_idP, frameP, slotP, dl_req, tx_req, TBS_bytes, gNB_mac->pdu_index[CC_id]); configure_fapi_dl_Tx(
gNB_mac, CC_id, frameP, slotP, TBS_bytes, UE_list->DLSCH_pdu[0][0].payload[0]);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_I(MAC, "%d.%d first 10 payload bytes UE %d TBSsize %d:", frameP, slotP, UE_id, TBS_bytes); LOG_I(MAC, "%d.%d first 10 payload bytes UE %d TBSsize %d:", frameP, slotP, UE_id, TBS_bytes);
......
...@@ -261,8 +261,6 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, ...@@ -261,8 +261,6 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
//NR_COMMON_channels_t *cc = nr_mac->common_channels; //NR_COMMON_channels_t *cc = nr_mac->common_channels;
//NR_ServingCellConfigCommon_t *scc=cc->ServingCellConfigCommon; //NR_ServingCellConfigCommon_t *scc=cc->ServingCellConfigCommon;
nfapi_nr_dl_tti_request_body_t *dl_req = &gNB_mac->DL_req[CC_id].dl_tti_request_body;
nfapi_nr_pdu_t *tx_req = &gNB_mac->TX_req[CC_id].pdu_list[gNB_mac->TX_req[CC_id].Number_of_PDUs];
mac_rlc_status_resp_t rlc_status; mac_rlc_status_resp_t rlc_status;
...@@ -422,7 +420,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, ...@@ -422,7 +420,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0][offset + j] = 0; // mac_pdu[offset + j] = 0; gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0][offset + j] = 0; // mac_pdu[offset + j] = 0;
} }
configure_fapi_dl_Tx(module_idP, frameP, slotP, dl_req, tx_req, TBS_bytes, gNB_mac->pdu_index[CC_id]); configure_fapi_dl_Tx(gNB_mac, CC_id, frameP, slotP, TBS_bytes, gNB_mac->UE_list.DLSCH_pdu[0][0].payload[0]);
if(IS_SOFTMODEM_NOS1){ if(IS_SOFTMODEM_NOS1){
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
......
...@@ -1525,18 +1525,16 @@ uint32_t configure_fapi_dl_pdu(gNB_MAC_INST *nr_mac, ...@@ -1525,18 +1525,16 @@ uint32_t configure_fapi_dl_pdu(gNB_MAC_INST *nr_mac,
return TBS; //Return TBS in bytes return TBS; //Return TBS in bytes
} }
void configure_fapi_dl_Tx(module_id_t Mod_idP, void configure_fapi_dl_Tx(gNB_MAC_INST *nr_mac,
int CC_id,
frame_t frameP, frame_t frameP,
sub_frame_t slotP, sub_frame_t slotP,
nfapi_nr_dl_tti_request_body_t *dl_req,
nfapi_nr_pdu_t *tx_req,
int tbs_bytes, int tbs_bytes,
int16_t pdu_index) { uint8_t *mac_pdu) {
int CC_id = 0; nfapi_nr_dl_tti_request_body_t *dl_req = &nr_mac->DL_req[CC_id].dl_tti_request_body;
nfapi_nr_pdu_t *tx_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs];
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs+1]; nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdsch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs+1];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15;
gNB_MAC_INST *nr_mac = RC.nrmac[Mod_idP];
LOG_D(MAC, "DLSCH PDU: start PRB %d n_PRB %d start symbol %d nb_symbols %d nb_layers %d nb_codewords %d mcs %d TBS (bytes): %d\n", LOG_D(MAC, "DLSCH PDU: start PRB %d n_PRB %d start symbol %d nb_symbols %d nb_layers %d nb_codewords %d mcs %d TBS (bytes): %d\n",
pdsch_pdu_rel15->rbStart, pdsch_pdu_rel15->rbStart,
...@@ -1555,7 +1553,7 @@ void configure_fapi_dl_Tx(module_id_t Mod_idP, ...@@ -1555,7 +1553,7 @@ void configure_fapi_dl_Tx(module_id_t Mod_idP,
tx_req->num_TLV = 1; tx_req->num_TLV = 1;
tx_req->TLVs[0].length = tbs_bytes +2; tx_req->TLVs[0].length = tbs_bytes +2;
memcpy((void*)&tx_req->TLVs[0].value.direct[0], (void*)&nr_mac->UE_list.DLSCH_pdu[0][0].payload[0], tbs_bytes);; memcpy(tx_req->TLVs[0].value.direct, mac_pdu, tbs_bytes);
nr_mac->TX_req[CC_id].Number_of_PDUs++; nr_mac->TX_req[CC_id].Number_of_PDUs++;
nr_mac->TX_req[CC_id].SFN = frameP; nr_mac->TX_req[CC_id].SFN = frameP;
......
...@@ -91,13 +91,12 @@ uint32_t configure_fapi_dl_pdu(gNB_MAC_INST *nr_mac, ...@@ -91,13 +91,12 @@ uint32_t configure_fapi_dl_pdu(gNB_MAC_INST *nr_mac,
void config_uldci(NR_BWP_Uplink_t *ubwp,nfapi_nr_pusch_pdu_t *pusch_pdu,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15, int *dci_formats, int *rnti_types); void config_uldci(NR_BWP_Uplink_t *ubwp,nfapi_nr_pusch_pdu_t *pusch_pdu,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15, dci_pdu_rel15_t *dci_pdu_rel15, int *dci_formats, int *rnti_types);
void configure_fapi_dl_Tx(module_id_t Mod_idP, void configure_fapi_dl_Tx(gNB_MAC_INST *nr_mac,
int CC_id,
frame_t frameP, frame_t frameP,
sub_frame_t slotP, sub_frame_t slotP,
nfapi_nr_dl_tti_request_body_t *dl_req,
nfapi_nr_pdu_t *tx_req,
int tbs_bytes, int tbs_bytes,
int16_t pdu_index); uint8_t *mac_pdu);
void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
frame_t frameP, frame_t frameP,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment