|
|
|
@@ -775,7 +775,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
|
|
|
|
}
|
|
|
|
|
} else if (ul_info) {
|
|
|
|
|
|
|
|
|
|
if (get_softmodem_params()->phy_test && ul_info->slot_tx == 8) { // ULSCH is handled only in phy-test mode (consistently with OAI gNB)
|
|
|
|
|
// ULSCH is handled only in phy-test mode (consistently with OAI gNB)
|
|
|
|
|
if (get_softmodem_params()->phy_test) {
|
|
|
|
|
|
|
|
|
|
uint8_t nb_dmrs_re_per_rb;
|
|
|
|
|
uint8_t ulsch_input_buffer[MAX_ULSCH_PAYLOAD_BYTES];
|
|
|
|
@@ -794,101 +795,107 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
|
|
|
|
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
|
|
|
|
uint8_t access_mode = SCHEDULED_ACCESS;
|
|
|
|
|
|
|
|
|
|
// program PUSCH with UL DCI parameters
|
|
|
|
|
nr_dcireq_t dcireq;
|
|
|
|
|
nr_scheduled_response_t scheduled_response;
|
|
|
|
|
fapi_nr_tx_request_t tx_req;
|
|
|
|
|
fapi_nr_tx_request_body_t tx_req_body;
|
|
|
|
|
fapi_nr_ul_config_request_t *ul_config = &dcireq.ul_config_req;
|
|
|
|
|
nfapi_nr_ue_ptrs_ports_t ptrs_ports_list;
|
|
|
|
|
fapi_nr_ul_config_request_t *ul_config_req = &mac->ul_config_request;
|
|
|
|
|
|
|
|
|
|
fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &mac->ul_config_request.ul_config_list[0];
|
|
|
|
|
// Schedule ULSCH only if the frame and slot are as indicated in ul_config_req.
|
|
|
|
|
// These values were set based on the values of slot in which UL DCI was received and K2.
|
|
|
|
|
if (ul_info->frame_tx == ul_config_req->sfn && ul_info->slot_tx == ul_config_req->slot) {
|
|
|
|
|
|
|
|
|
|
uint16_t rnti = ulcfg_pdu->pusch_config_pdu.rnti;
|
|
|
|
|
uint32_t rb_size = ulcfg_pdu->pusch_config_pdu.rb_size;
|
|
|
|
|
uint32_t rb_start = ulcfg_pdu->pusch_config_pdu.rb_start;
|
|
|
|
|
uint8_t nr_of_symbols = ulcfg_pdu->pusch_config_pdu.nr_of_symbols;
|
|
|
|
|
uint8_t start_symbol_index = ulcfg_pdu->pusch_config_pdu.start_symbol_index;
|
|
|
|
|
uint8_t nrOfLayers = 1;
|
|
|
|
|
uint8_t mcs_index = ulcfg_pdu->pusch_config_pdu.mcs_index;
|
|
|
|
|
uint8_t mcs_table = ulcfg_pdu->pusch_config_pdu.mcs_table;
|
|
|
|
|
uint8_t harq_process_id = ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id;
|
|
|
|
|
uint8_t rv_index = ulcfg_pdu->pusch_config_pdu.pusch_data.rv_index;
|
|
|
|
|
uint16_t l_prime_mask = get_l_prime(nr_of_symbols, typeB, pusch_dmrs_pos0, pusch_len1);
|
|
|
|
|
uint8_t dmrs_config_type = 0;
|
|
|
|
|
uint16_t pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
|
|
|
|
|
// These should come from RRC config!!!
|
|
|
|
|
uint8_t ptrs_mcs1 = 2;
|
|
|
|
|
uint8_t ptrs_mcs2 = 4;
|
|
|
|
|
uint8_t ptrs_mcs3 = 10;
|
|
|
|
|
uint16_t n_rb0 = 25;
|
|
|
|
|
uint16_t n_rb1 = 75;
|
|
|
|
|
uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, mcs_index, mcs_table);
|
|
|
|
|
uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, rb_size);
|
|
|
|
|
uint16_t number_dmrs_symbols = 0;
|
|
|
|
|
uint16_t ul_dmrs_symb_pos = l_prime_mask << start_symbol_index;
|
|
|
|
|
// program PUSCH with UL DCI parameters
|
|
|
|
|
nr_dcireq_t dcireq;
|
|
|
|
|
nr_scheduled_response_t scheduled_response;
|
|
|
|
|
fapi_nr_tx_request_t tx_req;
|
|
|
|
|
fapi_nr_tx_request_body_t tx_req_body;
|
|
|
|
|
fapi_nr_ul_config_request_t *ul_config = &dcireq.ul_config_req;
|
|
|
|
|
nfapi_nr_ue_ptrs_ports_t ptrs_ports_list;
|
|
|
|
|
|
|
|
|
|
fapi_nr_ul_config_request_pdu_t *ulcfg_pdu = &mac->ul_config_request.ul_config_list[0];
|
|
|
|
|
|
|
|
|
|
uint16_t rnti = ulcfg_pdu->pusch_config_pdu.rnti;
|
|
|
|
|
uint32_t rb_size = ulcfg_pdu->pusch_config_pdu.rb_size;
|
|
|
|
|
uint32_t rb_start = ulcfg_pdu->pusch_config_pdu.rb_start;
|
|
|
|
|
uint8_t nr_of_symbols = ulcfg_pdu->pusch_config_pdu.nr_of_symbols;
|
|
|
|
|
uint8_t start_symbol_index = ulcfg_pdu->pusch_config_pdu.start_symbol_index;
|
|
|
|
|
uint8_t nrOfLayers = 1;
|
|
|
|
|
uint8_t mcs_index = ulcfg_pdu->pusch_config_pdu.mcs_index;
|
|
|
|
|
uint8_t mcs_table = ulcfg_pdu->pusch_config_pdu.mcs_table;
|
|
|
|
|
uint8_t harq_process_id = ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id;
|
|
|
|
|
uint8_t rv_index = ulcfg_pdu->pusch_config_pdu.pusch_data.rv_index;
|
|
|
|
|
uint16_t l_prime_mask = get_l_prime(nr_of_symbols, typeB, pusch_dmrs_pos0, pusch_len1);
|
|
|
|
|
uint8_t dmrs_config_type = 0;
|
|
|
|
|
uint16_t pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
|
|
|
|
|
// These should come from RRC config!!!
|
|
|
|
|
uint8_t ptrs_mcs1 = 2;
|
|
|
|
|
uint8_t ptrs_mcs2 = 4;
|
|
|
|
|
uint8_t ptrs_mcs3 = 10;
|
|
|
|
|
uint16_t n_rb0 = 25;
|
|
|
|
|
uint16_t n_rb1 = 75;
|
|
|
|
|
uint8_t ptrs_time_density = get_L_ptrs(ptrs_mcs1, ptrs_mcs2, ptrs_mcs3, mcs_index, mcs_table);
|
|
|
|
|
uint8_t ptrs_freq_density = get_K_ptrs(n_rb0, n_rb1, rb_size);
|
|
|
|
|
uint16_t number_dmrs_symbols = 0;
|
|
|
|
|
uint16_t ul_dmrs_symb_pos = l_prime_mask << start_symbol_index;
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_DCI
|
|
|
|
|
LOG_I(MAC, " UL config params \n rnti: %x \n rb_size: %d \n",
|
|
|
|
|
rnti, rb_size);
|
|
|
|
|
LOG_I(MAC, "rb_start: %x \n nr_of_symbols: %d \n start_symbol_index: %d \n nrOfLayers: %d \n mcs_index: %d \n \
|
|
|
|
|
mcs_table: %d \n harq_process_id: %d \n ndi: %d \n num_cb: %d \n rv_index: %d \n",
|
|
|
|
|
rb_start, nr_of_symbols, start_symbol_index, nrOfLayers, mcs_index,
|
|
|
|
|
mcs_table, harq_process_id, ndi, num_cb, rv_index);
|
|
|
|
|
LOG_I(MAC, " UL config params \n rnti: %x \n rb_size: %d \n",
|
|
|
|
|
rnti, rb_size);
|
|
|
|
|
LOG_I(MAC, "rb_start: %x \n nr_of_symbols: %d \n start_symbol_index: %d \n nrOfLayers: %d \n mcs_index: %d \n \
|
|
|
|
|
mcs_table: %d \n harq_process_id: %d \n rv_index: %d \n",
|
|
|
|
|
rb_start, nr_of_symbols, start_symbol_index, nrOfLayers, mcs_index,
|
|
|
|
|
mcs_table, harq_process_id, rv_index);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// PTRS ports configuration
|
|
|
|
|
// TbD: ptrs_dmrs_port and ptrs_port_index are not initialised!
|
|
|
|
|
ptrs_ports_list.ptrs_re_offset = 0;
|
|
|
|
|
// PTRS ports configuration
|
|
|
|
|
// TbD: ptrs_dmrs_port and ptrs_port_index are not initialised!
|
|
|
|
|
ptrs_ports_list.ptrs_re_offset = 0;
|
|
|
|
|
|
|
|
|
|
// Num PRB Overhead from PUSCH-ServingCellConfig
|
|
|
|
|
if (mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->xOverhead == NULL)
|
|
|
|
|
N_PRB_oh = 0;
|
|
|
|
|
else
|
|
|
|
|
N_PRB_oh = *mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->xOverhead;
|
|
|
|
|
// Num PRB Overhead from PUSCH-ServingCellConfig
|
|
|
|
|
if (mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->xOverhead == NULL)
|
|
|
|
|
N_PRB_oh = 0;
|
|
|
|
|
else
|
|
|
|
|
N_PRB_oh = *mac->scg->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->xOverhead;
|
|
|
|
|
|
|
|
|
|
ul_config->slot = ul_info->slot_tx;
|
|
|
|
|
ul_config->number_pdus = 1;
|
|
|
|
|
ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.rnti = rnti;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.rb_size = rb_size;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.rb_start = rb_start;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.nr_of_symbols = nr_of_symbols;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol_index;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = ul_dmrs_symb_pos;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.mcs_index = mcs_index;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = 1;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = rv_index;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.nrOfLayers = nrOfLayers;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_process_id;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_time_density = ptrs_time_density;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = &ptrs_ports_list;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.target_code_rate = nr_get_code_rate_ul(mcs_index, mcs_table);
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.qam_mod_order = nr_get_Qm_ul(mcs_index, mcs_table);
|
|
|
|
|
ul_config->slot = ul_info->slot_tx;
|
|
|
|
|
ul_config->number_pdus = 1;
|
|
|
|
|
ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.rnti = rnti;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.rb_size = rb_size;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.rb_start = rb_start;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.nr_of_symbols = nr_of_symbols;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol_index;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = ul_dmrs_symb_pos;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.mcs_index = mcs_index;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.num_dmrs_cdm_grps_no_data = 1;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = 0;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = rv_index;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.nrOfLayers = nrOfLayers;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_process_id;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_time_density = ptrs_time_density;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_freq_density = ptrs_freq_density;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_ptrs.ptrs_ports_list = &ptrs_ports_list;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.target_code_rate = nr_get_code_rate_ul(mcs_index, mcs_table);
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.qam_mod_order = nr_get_Qm_ul(mcs_index, mcs_table);
|
|
|
|
|
|
|
|
|
|
if (1 << ptrs_time_density >= nr_of_symbols) {
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
|
|
|
|
|
}
|
|
|
|
|
if (1 << ptrs_time_density >= nr_of_symbols) {
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pdu_bit_map &= ~PUSCH_PDU_BITMAP_PUSCH_PTRS; // disable PUSCH PTRS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get_num_re_dmrs(&ul_config->ul_config_list[0].pusch_config_pdu,
|
|
|
|
|
&nb_dmrs_re_per_rb,
|
|
|
|
|
&number_dmrs_symbols);
|
|
|
|
|
get_num_re_dmrs(&ul_config->ul_config_list[0].pusch_config_pdu,
|
|
|
|
|
&nb_dmrs_re_per_rb,
|
|
|
|
|
&number_dmrs_symbols);
|
|
|
|
|
|
|
|
|
|
TBS = nr_compute_tbs(ul_config->ul_config_list[0].pusch_config_pdu.qam_mod_order,
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.target_code_rate,
|
|
|
|
|
rb_size,
|
|
|
|
|
nr_of_symbols,
|
|
|
|
|
nb_dmrs_re_per_rb*number_dmrs_symbols,
|
|
|
|
|
N_PRB_oh,
|
|
|
|
|
0,
|
|
|
|
|
nrOfLayers);
|
|
|
|
|
TBS_bytes = TBS/8;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS_bytes;
|
|
|
|
|
TBS = nr_compute_tbs(ul_config->ul_config_list[0].pusch_config_pdu.qam_mod_order,
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.target_code_rate,
|
|
|
|
|
rb_size,
|
|
|
|
|
nr_of_symbols,
|
|
|
|
|
nb_dmrs_re_per_rb*number_dmrs_symbols,
|
|
|
|
|
N_PRB_oh,
|
|
|
|
|
0,
|
|
|
|
|
nrOfLayers);
|
|
|
|
|
TBS_bytes = TBS/8;
|
|
|
|
|
ul_config->ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS_bytes;
|
|
|
|
|
|
|
|
|
|
if (IS_SOFTMODEM_NOS1){
|
|
|
|
|
// Getting IP traffic to be transmitted
|
|
|
|
@@ -930,32 +937,34 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
dcireq.module_id = mod_id;
|
|
|
|
|
dcireq.gNB_index = gNB_index;
|
|
|
|
|
dcireq.cc_id = cc_id;
|
|
|
|
|
dcireq.frame = rx_frame;
|
|
|
|
|
dcireq.slot = rx_slot;
|
|
|
|
|
dcireq.module_id = mod_id;
|
|
|
|
|
dcireq.gNB_index = gNB_index;
|
|
|
|
|
dcireq.cc_id = cc_id;
|
|
|
|
|
dcireq.frame = rx_frame;
|
|
|
|
|
dcireq.slot = rx_slot;
|
|
|
|
|
|
|
|
|
|
// Config UL TX PDU
|
|
|
|
|
tx_req.slot = slot_tx;
|
|
|
|
|
tx_req.sfn = frame_tx;
|
|
|
|
|
// tx_req->tx_config // TbD
|
|
|
|
|
tx_req.number_of_pdus = 1;
|
|
|
|
|
tx_req_body.pdu_length = TBS_bytes;
|
|
|
|
|
tx_req_body.pdu_index = 0;
|
|
|
|
|
tx_req_body.pdu = ulsch_input_buffer;
|
|
|
|
|
tx_req.tx_request_body = &tx_req_body;
|
|
|
|
|
// Config UL TX PDU
|
|
|
|
|
tx_req.slot = slot_tx;
|
|
|
|
|
tx_req.sfn = frame_tx;
|
|
|
|
|
// tx_req->tx_config // TbD
|
|
|
|
|
tx_req.number_of_pdus = 1;
|
|
|
|
|
tx_req_body.pdu_length = TBS_bytes;
|
|
|
|
|
tx_req_body.pdu_index = 0;
|
|
|
|
|
tx_req_body.pdu = ulsch_input_buffer;
|
|
|
|
|
tx_req.tx_request_body = &tx_req_body;
|
|
|
|
|
|
|
|
|
|
fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, rx_frame, rx_slot);
|
|
|
|
|
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
|
|
|
|
mac->if_module->scheduled_response(&scheduled_response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: expand
|
|
|
|
|
// Note: Contention resolution is currently not active
|
|
|
|
|
if (mac->RA_contention_resolution_timer_active == 1)
|
|
|
|
|
ue_contention_resolution(mod_id, gNB_index, cc_id, ul_info->frame_tx);
|
|
|
|
|
|
|
|
|
|
fill_scheduled_response(&scheduled_response, NULL, ul_config, &tx_req, mod_id, cc_id, rx_frame, rx_slot);
|
|
|
|
|
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL){
|
|
|
|
|
mac->if_module->scheduled_response(&scheduled_response);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: expand
|
|
|
|
|
// Note: Contention resolution is currently not active
|
|
|
|
|
if (mac->RA_contention_resolution_timer_active == 1)
|
|
|
|
|
ue_contention_resolution(mod_id, gNB_index, cc_id, ul_info->frame_tx);
|
|
|
|
|
|
|
|
|
|
} else if (get_softmodem_params()->do_ra){
|
|
|
|
|
|
|
|
|
|
NR_UE_MAC_INST_t *mac = get_mac_inst(ul_info->module_id);
|
|
|
|
@@ -2430,7 +2439,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
//////////////
|
|
|
|
|
int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_index,fapi_nr_dci_indication_pdu_t *dci) {
|
|
|
|
|
int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_index, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci) {
|
|
|
|
|
|
|
|
|
|
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
|
|
|
|
|
|
|
|
@@ -2438,10 +2447,10 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
|
|
|
|
|
dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits);
|
|
|
|
|
|
|
|
|
|
int dci_format = nr_extract_dci_info(mac,dci->dci_format,dci->payloadSize,dci->rnti,(uint64_t *)dci->payloadBits,def_dci_pdu_rel15);
|
|
|
|
|
return (nr_ue_process_dci(module_id, cc_id, gNB_index, def_dci_pdu_rel15, dci->rnti, dci_format));
|
|
|
|
|
return (nr_ue_process_dci(module_id, cc_id, gNB_index, frame, slot, def_dci_pdu_rel15, dci->rnti, dci_format));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format){
|
|
|
|
|
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, frame_t frame, int slot, dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format){
|
|
|
|
|
|
|
|
|
|
int bwp_id = 1;
|
|
|
|
|
|
|
|
|
@@ -2477,7 +2486,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, dc
|
|
|
|
|
* 49 PADDING_NR_DCI: (Note 2) If DCI format 0_0 is monitored in common search space
|
|
|
|
|
* 50 SUL_IND_0_0:
|
|
|
|
|
*/
|
|
|
|
|
ul_config->ul_config_list[ul_config->number_pdus].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
|
|
|
|
// It's redundant to process PUSCH pdu here in the Rx path. This is done
|
|
|
|
|
// in the Tx path in nr_ue_scheduler(). Hence removing here.
|
|
|
|
|
//ul_config->ul_config_list[ul_config->number_pdus].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
|
|
|
|
ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu.rnti = rnti;
|
|
|
|
|
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu_0_0 = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu;
|
|
|
|
|
/* IDENTIFIER_DCI_FORMATS */
|
|
|
|
@@ -2515,7 +2526,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, dc
|
|
|
|
|
}
|
|
|
|
|
/* SUL_IND_0_0 */ // To be implemented, FIXME!!!
|
|
|
|
|
|
|
|
|
|
ul_config->number_pdus = ul_config->number_pdus + 1;
|
|
|
|
|
// Removing since it's redundant to process PUSCH PDU in RX path!!
|
|
|
|
|
//ul_config->number_pdus = ul_config->number_pdus + 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NR_UL_DCI_FORMAT_0_1:
|
|
|
|
@@ -2547,7 +2559,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, dc
|
|
|
|
|
* 48 UL_SCH_IND
|
|
|
|
|
* 49 PADDING_NR_DCI: (Note 2) If DCI format 0_0 is monitored in common search space
|
|
|
|
|
*/
|
|
|
|
|
ul_config->ul_config_list[ul_config->number_pdus].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
|
|
|
|
// It's redundant to process PUSCH pdu here in the Rx path. This is done
|
|
|
|
|
// in the Tx path in nr_ue_scheduler(). Hence removing here.
|
|
|
|
|
//ul_config->ul_config_list[ul_config->number_pdus].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
|
|
|
|
ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu.rnti = rnti;
|
|
|
|
|
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu_0_1 = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu;
|
|
|
|
|
/* IDENTIFIER_DCI_FORMATS */
|
|
|
|
@@ -2841,7 +2855,29 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, dc
|
|
|
|
|
// A value of "1" indicates UL-SCH shall be transmitted on the PUSCH and
|
|
|
|
|
// a value of "0" indicates UL-SCH shall not be transmitted on the PUSCH
|
|
|
|
|
|
|
|
|
|
ul_config->number_pdus = ul_config->number_pdus + 1;
|
|
|
|
|
// Calculate the slot in which ULSCH should be scheduled. This is current slot + K2,
|
|
|
|
|
// where K2 is the offset between the slot in which UL DCI is received and the slot
|
|
|
|
|
// in which ULSCH should be scheduled. K2 is configured in RRC configuration.
|
|
|
|
|
|
|
|
|
|
// Get K2 from RRC configuration
|
|
|
|
|
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
|
|
|
|
if (pusch_config->pusch_TimeDomainAllocationList) {
|
|
|
|
|
pusch_TimeDomainAllocationList = pusch_config->pusch_TimeDomainAllocationList->choice.setup;
|
|
|
|
|
}
|
|
|
|
|
else if (mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
|
|
|
|
pusch_TimeDomainAllocationList = mac->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
|
|
|
|
}
|
|
|
|
|
long k2 = *pusch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->k2;
|
|
|
|
|
|
|
|
|
|
// Get the numerology to calculate the Tx frame and slot
|
|
|
|
|
int mu = mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing;
|
|
|
|
|
|
|
|
|
|
// Calculate the slot and frame
|
|
|
|
|
ul_config->slot = (slot + k2) % nr_slots_per_frame[mu];
|
|
|
|
|
ul_config->sfn = ((slot + k2) % nr_slots_per_frame[mu] > nr_slots_per_frame[mu]) ? (frame + 1) % 1024 : frame;
|
|
|
|
|
// Removing since it's redundant to process PUSCH PDU in RX path!!
|
|
|
|
|
//ul_config->number_pdus = ul_config->number_pdus + 1;
|
|
|
|
|
LOG_I(MAC, "nr_ue_process_dci(): Calculated frame and slot for pusch Tx: %d.%d\n", ul_config->sfn, ul_config->slot);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NR_DL_DCI_FORMAT_1_0:
|
|
|
|
|