Ready to fill rach indication.

Had to hack the code to schedule the prach.
Need to verify this is ok because ul_config = NULL.
Also had to change logic for calling fill_schedule_response.
This commit is contained in:
Melissa Elkadi
2021-05-27 12:53:27 -07:00
parent b32e3f735f
commit 96be5588b4
3 changed files with 15 additions and 27 deletions
+6 -1
View File
@@ -179,8 +179,13 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
if (nr_prach == 1)
{
/* Fill rach indication here and send to proxy. Basically take pieces from
L1_nr_prach_procedures() and send it to the proxy. prach from ue->gNb->gnb sends rach->ue receives rach
The UE is basically filling the rach and proxy will receive and think that it came from the gNB. The
received rach in the proxy will trigger gNB to send back the RAR. RAR will go to proxy then goes to UE
and the UE will get the DCI for RAR and the payload. have to handle receving the RAR once we get it. */
LOG_I(NR_PHY, "Melissa! Calling nr_Msg1_transmitted!!!\n");
nr_Msg1_transmitted(mod_id, CC_id, frame_tx, gNB_id);
nr_Msg1_transmitted(mod_id, CC_id, frame_tx, gNB_id); //This is called when phy layer has sent the prach
}
else if (nr_prach == 2)
{
+4 -5
View File
@@ -529,7 +529,10 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
}
if (prach_resources->init_msg1) {
if (is_nr_UL_slot(mac->scc, nr_slot_tx)) {
LOG_D(MAC, "calling nr_ue_prach_scheduler\n");
nr_ue_prach_scheduler(mod_id, nr_slot_tx, frame, 0);
}
if (ra->RA_active == 0) {
/* RA not active - checking if RRC is ready to initiate the RA procedure */
@@ -626,10 +629,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Fill in preamble and PRACH resources
ra->RA_window_cnt--;
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
if (is_nr_UL_slot(mac->scc, nr_slot_tx)) {
nr_ue_scheduler(NULL, mac->ul_config_request);
nr_ue_prach_scheduler(mod_id, frame, nr_slot_tx, 0);
}
} else if (ra->RA_backoff_cnt > 0) {
+5 -21
View File
@@ -1650,17 +1650,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
//fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
fapi_nr_ul_config_request_t *ul_config = &mac->ul_config_request[0];
#if 0 //Melissa
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH);
if (!ul_config) {
LOG_W(MAC, "In %s: ul_config request is NULL. "
"Probably due to unexpected UL DCI in frame.slot %d.%d. Ignoring DCI!\n",
__FUNCTION__, frameP, slotP);
return;
}
#endif
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
fapi_nr_prach_config_t *prach_config = &cfg->prach_config;
@@ -1693,12 +1682,8 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
format = prach_occasion_info_p->format;
format0 = format & 0xff; // single PRACH format
format1 = (format >> 8) & 0xff; // dual PRACH format
#if 1 //Melissa
ul_config->sfn = frameP;
ul_config->slot = slotP;
ul_config->ul_config_list[ul_config->number_pdus].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PRACH;
#endif
if (ul_config == NULL)
return;
prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
ul_config->number_pdus += 1;
@@ -1779,11 +1764,10 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
AssertFatal(1 == 0, "Invalid PRACH format");
}
} // if format1
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
mac->if_module->scheduled_response(&scheduled_response);
} // is_nr_prach_slot
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
mac->if_module->scheduled_response(&scheduled_response);
} // if is_nr_UL_slot
}