Commit 3e9274ee authored by Laurent THOMAS's avatar Laurent THOMAS

simplify and make more efficient the tx data pdu attach to the pusch configuration

parent cc436a20
......@@ -168,7 +168,6 @@ typedef struct {
typedef struct {
uint16_t pdu_length;
uint16_t pdu_index;
uint8_t* pdu;
} fapi_nr_tx_request_body_t;
......@@ -358,6 +357,7 @@ typedef struct
nfapi_nr_ue_ul_beamforming_t beamforming;
//OAI specific
int8_t absolute_delta_PUSCH;
fapi_nr_tx_request_body_t tx_request_body;
} nfapi_nr_ue_pusch_pdu_t;
typedef struct {
......
......@@ -152,18 +152,14 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind));
nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind));
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu;
if (scheduled_response->tx_request) {
AssertFatal(
scheduled_response->tx_request->number_of_pdus < sizeofArray(scheduled_response->tx_request->tx_request_body),
"Too many tx_req pdus %d",
scheduled_response->tx_request->number_of_pdus);
if (pusch_config_pdu->tx_request_body.pdu) {
rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
rx_ind->sfn = frame;
rx_ind->slot = slot;
rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus;
rx_ind->number_of_pdus = 1; // scheduled_response->tx_request->number_of_pdus;
rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list));
for (int j = 0; j < rx_ind->number_of_pdus; j++) {
fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[j];
fapi_nr_tx_request_body_t *tx_req_body = &pusch_config_pdu->tx_request_body;
rx_ind->pdu_list[j].handle = pusch_config_pdu->handle;
rx_ind->pdu_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
rx_ind->pdu_list[j].pdu_length = tx_req_body->pdu_length;
......@@ -226,7 +222,6 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
}
LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__);
scheduled_response->tx_request->number_of_pdus = 0;
}
break;
}
......@@ -447,7 +442,6 @@ static void nr_ue_scheduled_response_dl(NR_UE_MAC_INST_t *mac,
static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy,
fapi_nr_ul_config_request_t *ul_config,
fapi_nr_tx_request_t *tx_request,
nr_phy_data_tx_t *phy_data,
int module_id,
int cc_id)
......@@ -511,36 +505,27 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy,
pusch_config_pdu->num_dmrs_cdm_grps_no_data);
memcpy(pusch_pdu, pusch_config_pdu, sizeof(nfapi_nr_ue_pusch_pdu_t));
if (tx_request) {
for (int j = 0; j < tx_request->number_of_pdus; j++) {
fapi_nr_tx_request_body_t *tx_req_body = &tx_request->tx_request_body[j];
if ((tx_req_body->pdu_index == i) && (tx_req_body->pdu_length > 0)) {
LOG_D(PHY,
"%d.%d Copying %d bytes to harq_process_ul_ue->a (harq_pid %d)\n",
ul_config->frame,
slot,
tx_req_body->pdu_length,
current_harq_pid);
memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length);
break;
}
}
harq_process_ul_ue->status = ACTIVE;
ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
pdu_done++;
if (pusch_config_pdu->tx_request_body.pdu) {
LOG_D(PHY,
"%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n",
"%d.%d Copying %d bytes to harq_process_ul_ue->a (harq_pid %d)\n",
ul_config->frame,
slot,
ul_config,
pdu_type,
pdu_done,
ul_config->number_pdus);
} else {
LOG_E(PHY, "[phy_procedures_nrUE_TX] harq_process_ul_ue is NULL !!\n");
pusch_config_pdu->tx_request_body.pdu_length,
current_harq_pid);
memcpy(harq_process_ul_ue->a, pusch_config_pdu->tx_request_body.pdu, pusch_config_pdu->tx_request_body.pdu_length);
}
harq_process_ul_ue->status = ACTIVE;
ul_config->ul_config_list[i].pdu_type = FAPI_NR_UL_CONFIG_TYPE_DONE; // not handle it any more
pdu_done++;
LOG_D(PHY,
"%d.%d ul A ul_config %p t %d pdu_done %d number_pdus %d\n",
ul_config->frame,
slot,
ul_config,
pdu_type,
pdu_done,
ul_config->number_pdus);
} break;
case FAPI_NR_UL_CONFIG_TYPE_PUCCH: {
......@@ -629,8 +614,6 @@ static void nr_ue_scheduled_response_ul(PHY_VARS_NR_UE *phy,
// Clear the fields when all the config pdu are done
if (pdu_done == ul_config->number_pdus) {
if (tx_request)
tx_request->number_of_pdus = 0;
ul_config->frame = 0;
ul_config->slot = 0;
ul_config->number_pdus = 0;
......@@ -654,7 +637,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
if (scheduled_response->ul_config)
nr_ue_scheduled_response_ul(phy,
scheduled_response->ul_config,
scheduled_response->tx_request,
(nr_phy_data_tx_t *)scheduled_response->phy_data,
scheduled_response->module_id,
scheduled_response->CC_id);
......
......@@ -718,8 +718,7 @@ int main(int argc, char *argv[])
uint32_t errors_decoding = 0;
fapi_nr_ul_config_request_t ul_config={0};
fapi_nr_tx_request_t tx_req={0};
fapi_nr_ul_config_request_t ul_config = {0};
uint8_t ptrs_mcs1 = 2;
uint8_t ptrs_mcs2 = 4;
......@@ -1072,18 +1071,7 @@ int main(int argc, char *argv[])
nr_schedule_response(Sched_INFO);
// --------- setting parameters for UE --------
nr_scheduled_response_t scheduled_response = {.ul_config = &ul_config,
.tx_request = &tx_req,
.phy_data = (void *)&phy_data};
// Config UL TX PDU
tx_req.slot = slot;
tx_req.sfn = frame;
tx_req.number_of_pdus = 1; //do_SRS == 1 ? 2 : 1;
tx_req.tx_request_body[0].pdu_length = TBS / 8;
tx_req.tx_request_body[0].pdu_index = 0;
tx_req.tx_request_body[0].pdu = &ulsch_input_buffer[0];
nr_scheduled_response_t scheduled_response = {.ul_config = &ul_config, .phy_data = (void *)&phy_data};
ul_config.slot = slot;
ul_config.number_pdus = do_SRS == 1 ? 2 : 1;
......@@ -1091,6 +1079,9 @@ int main(int argc, char *argv[])
fapi_nr_ul_config_request_pdu_t *ul_config0 = &ul_config.ul_config_list[0];
ul_config0->pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config0->pusch_config_pdu;
// Config UL TX PDU
pusch_config_pdu->tx_request_body.pdu = ulsch_input_buffer;
pusch_config_pdu->tx_request_body.pdu_length = TBS / 8;
pusch_config_pdu->rnti = n_rnti;
pusch_config_pdu->pdu_bit_map = pdu_bit_map;
pusch_config_pdu->qam_mod_order = mod_order;
......
......@@ -1003,13 +1003,10 @@ void nr_ue_ul_scheduler(nr_uplink_indication_t *ul_info)
ul_config->slot);
uint8_t ulsch_input_buffer_array[NFAPI_MAX_NUM_UL_PDU][MAX_ULSCH_PAYLOAD_BYTES];
fapi_nr_tx_request_t tx_req;
tx_req.slot = slot_tx;
tx_req.sfn = frame_tx;
tx_req.number_of_pdus = 0;
int number_of_pdus = 0;
for (int j = 0; j < ul_config->number_pdus; j++) {
uint8_t *ulsch_input_buffer = ulsch_input_buffer_array[tx_req.number_of_pdus];
uint8_t *ulsch_input_buffer = ulsch_input_buffer_array[number_of_pdus];
fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &ul_config->ul_config_list[j];
......@@ -1038,10 +1035,9 @@ void nr_ue_ul_scheduler(nr_uplink_indication_t *ul_info)
// Config UL TX PDU
if (mac_pdu_exist) {
tx_req.tx_request_body[tx_req.number_of_pdus].pdu_length = TBS_bytes;
tx_req.tx_request_body[tx_req.number_of_pdus].pdu_index = j;
tx_req.tx_request_body[tx_req.number_of_pdus].pdu = ulsch_input_buffer;
tx_req.number_of_pdus++;
ulcfg_pdu->pusch_config_pdu.tx_request_body.pdu = ulsch_input_buffer;
ulcfg_pdu->pusch_config_pdu.tx_request_body.pdu_length = TBS_bytes;
number_of_pdus++;
}
if (ra->ra_state == WAIT_CONTENTION_RESOLUTION && !ra->cfra){
LOG_I(NR_MAC,"[RAPROC][%d.%d] RA-Msg3 retransmitted\n", frame_tx, slot_tx);
......@@ -1059,8 +1055,7 @@ void nr_ue_ul_scheduler(nr_uplink_indication_t *ul_info)
.mac = mac,
.module_id = ul_info->module_id,
.CC_id = ul_info->cc_id,
.phy_data = ul_info->phy_data,
.tx_request = &tx_req};
.phy_data = ul_info->phy_data};
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
LOG_D(NR_MAC,"3# scheduled_response transmitted,%d, %d\n", frame_tx, slot_tx);
mac->if_module->scheduled_response(&scheduled_response);
......
......@@ -142,9 +142,6 @@ typedef struct {
// Sidelink TX configuration request
sl_nr_tx_config_request_t *sl_tx_config;
/// data transmission request structure
fapi_nr_tx_request_t *tx_request;
/// PHY data structure initially passed on to L2 via the nr_downlink_indication_t and
/// returned to L1 via nr_scheduled_response_t
void *phy_data;
......
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