Commit d4344395 authored by Melissa Elkadi's avatar Melissa Elkadi

Using ul_config->prach_pdu in get_rach()

Also, changed freq_index hardcode to 0.
Logging ra_rnti in gNB and NR UE
parent 2dc4addf
......@@ -159,7 +159,7 @@ static void L1_nsa_prach_procedures(frame_t frame, int slot)
rach_ind.pdu_list[pdu_index].phy_cell_id = 0;
rach_ind.pdu_list[pdu_index].symbol_index = 0;
rach_ind.pdu_list[pdu_index].slot_index = slot;
rach_ind.pdu_list[pdu_index].freq_index = 1;
rach_ind.pdu_list[pdu_index].freq_index = 0;
rach_ind.pdu_list[pdu_index].avg_rssi = 128;
rach_ind.pdu_list[pdu_index].avg_snr = 0xff; // invalid for now
......@@ -218,10 +218,14 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
if (is_nr_UL_slot(mac->scc, ul_info.slot_tx)) {
LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__);
nr_ue_ul_indication(&ul_info);
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, ul_info.slot_tx);
if (!ul_config) {
LOG_E(NR_MAC, "mac->ul_config is null! \n");
return;
}
int CC_id = 0;
uint8_t gNB_id = 0;
prach_pdu = ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
uint8_t nr_prach = nr_ue_get_rach(&prach_resources, &prach_pdu, mod_id, CC_id, ul_info.frame_tx, gNB_id, ul_info.slot_tx);
if (nr_prach == 1)
......@@ -241,6 +245,7 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
//UE->UE_mode[0] = PRACH;
}
}
}
}
......
......@@ -392,8 +392,9 @@ uint16_t set_ra_rnti(NR_UE_MAC_INST_t *mac, fapi_nr_ul_config_prach_pdu *prach_p
uint8_t s_id = prach_pdu->prach_start_symbol;
ra->ra_rnti = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
//gNB: ra_rnti = 1 + symbol + (slotP * 14) + (freq_index * 14 * 80) + (ul_carrier_id * 14 * 80 * 8);
LOG_D(MAC, "Computed ra_RNTI is %x \n", ra->ra_rnti);
LOG_I(MAC, "Computed ra_RNTI is %x, sid %d, fid %d, tid %d \n", ra->ra_rnti, s_id, f_id, t_id);
return ra->ra_rnti;
......
......@@ -511,6 +511,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
ra_rnti = 1 + symbol + (9 /*slotP*/ * 14) + (freq_index * 14 * 80) + (ul_carrier_id * 14 * 80 * 8);
else
ra_rnti = 1 + symbol + (slotP * 14) + (freq_index * 14 * 80) + (ul_carrier_id * 14 * 80 * 8);
LOG_I(NR_MAC, "Melissa ra_rnti %x, symbol %d, slot %d, freq_idx %d, ul_carrier_id %d\n",
ra_rnti, symbol, slotP, freq_index, ul_carrier_id);
// This should be handled differently when we use the initialBWP for RA
ra->bwp_id = 1;
......
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