Commit 202862bc authored by David Kim's avatar David Kim

Updated for multiple UEs CBRA procedure.

1. Added rnti filter for multiple UEs.
2. Adjusted mode offset for SA mode.
parent 99a75d6f
...@@ -492,6 +492,12 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) ...@@ -492,6 +492,12 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
nr_ue_ul_indication(&ul_info); nr_ue_ul_indication(&ul_info);
check_nr_prach(mac, &ul_info, &prach_resources); check_nr_prach(mac, &ul_info, &prach_resources);
} }
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) {
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, mac->crnti, frame, slot, 0);
pdcp_run(&ctxt);
}
process_queued_nr_nfapi_msgs(mac, sfn_slot); process_queued_nr_nfapi_msgs(mac, sfn_slot);
free(slot_ind); free(slot_ind);
slot_ind = NULL; slot_ind = NULL;
......
...@@ -458,7 +458,7 @@ int main( int argc, char **argv ) { ...@@ -458,7 +458,7 @@ int main( int argc, char **argv ) {
init_NR_UE(1,rrc_config_path); init_NR_UE(1,rrc_config_path);
int mode_offset = get_softmodem_params()->nsa ? NUMBER_OF_UE_MAX : 0; int mode_offset = get_softmodem_params()->nsa ? NUMBER_OF_UE_MAX : 1;
uint16_t node_number = get_softmodem_params()->node_number; uint16_t node_number = get_softmodem_params()->node_number;
ue_id_g = (node_number == 0) ? 0 : node_number - 2; ue_id_g = (node_number == 0) ? 0 : node_number - 2;
AssertFatal(ue_id_g >= 0, "UE id is expected to be nonnegative.\n"); AssertFatal(ue_id_g >= 0, "UE id is expected to be nonnegative.\n");
......
...@@ -599,6 +599,15 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in ...@@ -599,6 +599,15 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format];
if (get_softmodem_params()->sa) {
if (((dci->rnti != 0xFFFF) && (mac->ra.ra_state <= GENERATE_PREAMBLE)) ||
((dci->rnti != 0x10b) && (mac->ra.ra_state == WAIT_RAR)) ||
((dci->rnti != mac->ra.t_crnti ) && (mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)) ||
((dci->rnti != mac->crnti ) && (mac->ra.ra_state == RA_SUCCEEDED))) {
return -1;
}
}
LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n", LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n",
dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits); dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits);
int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15);
...@@ -3795,6 +3804,11 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t ...@@ -3795,6 +3804,11 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
LOG_D(NR_MAC, "In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", __FUNCTION__, frame, slot, mod_id, preamble_index); LOG_D(NR_MAC, "In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", __FUNCTION__, frame, slot, mod_id, preamble_index);
if (ra->RA_RAPID_found == 1)
{
return -1;
}
while (1) { while (1) {
n_subheaders++; n_subheaders++;
if (rarh->T == 1) { if (rarh->T == 1) {
......
...@@ -278,6 +278,12 @@ static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu ...@@ -278,6 +278,12 @@ static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu
{ {
if (received_pdu->RNTI != mac->crnti && mac->ra.ra_state == RA_SUCCEEDED) if (received_pdu->RNTI != mac->crnti && mac->ra.ra_state == RA_SUCCEEDED)
return false; return false;
if (received_pdu->RNTI != mac->ra.t_crnti && mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)
return false;
if (received_pdu->RNTI != 0x10b && mac->ra.ra_state == WAIT_RAR)
return false;
if (received_pdu->RNTI != 0xFFFF && mac->ra.ra_state <= GENERATE_PREAMBLE)
return false;
} }
return true; return true;
} }
...@@ -316,7 +322,10 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ ...@@ -316,7 +322,10 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_
uint16_t num_dcis = pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; uint16_t num_dcis = pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci;
if (num_dcis > 0) if (num_dcis > 0)
{ {
dl_info->dci_ind = CALLOC(1, sizeof(fapi_nr_dci_indication_t)); if (!dl_info->dci_ind && !pdu_idx)
{
dl_info->dci_ind = CALLOC(1, sizeof(fapi_nr_dci_indication_t));
}
dl_info->dci_ind->SFN = dl_tti_request->SFN; dl_info->dci_ind->SFN = dl_tti_request->SFN;
dl_info->dci_ind->slot = dl_tti_request->Slot; dl_info->dci_ind->slot = dl_tti_request->Slot;
AssertFatal(num_dcis < sizeof(dl_info->dci_ind->dci_list) / sizeof(dl_info->dci_ind->dci_list[0]), AssertFatal(num_dcis < sizeof(dl_info->dci_ind->dci_list) / sizeof(dl_info->dci_ind->dci_list[0]),
...@@ -1044,6 +1053,10 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ ...@@ -1044,6 +1053,10 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
dl_info->dci_ind->dci_list+i); dl_info->dci_ind->dci_list+i);
fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i;
if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) {
LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n");
break;
}
dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format];
g_harq_pid = def_dci_pdu_rel15->harq_pid; g_harq_pid = def_dci_pdu_rel15->harq_pid;
LOG_D(NR_MAC, "Setting harq_pid = %d and dci_index = %d (based on format)\n", g_harq_pid, dci_index->dci_format); LOG_D(NR_MAC, "Setting harq_pid = %d and dci_index = %d (based on format)\n", g_harq_pid, dci_index->dci_format);
......
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