Commit 465f1a77 authored by Andrew Burger's avatar Andrew Burger

New prach procedures

parent d089d4a2
......@@ -84,8 +84,8 @@
#define MAX_eNB 2
#define MAX_gNB 2
#else
#define MAX_MOBILES_PER_ENB 20 // This was maxed at 4 Why? -Andrew
#define MAX_MOBILES_PER_ENB_NB_IoT 4
#define MAX_MOBILES_PER_ENB 256 // This was maxed at 4 Why? -Andrew
#define MAX_MOBILES_PER_ENB_NB_IoT 256
#define MAX_MOBILES_PER_GNB 2//16
#define MAX_eNB 2
#define MAX_gNB 2
......
......@@ -2603,7 +2603,7 @@ ue_scheduler(const module_id_t module_idP,
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { // phy_stub mode
// Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
// PRACH state.
LOG_I(MAC, "nfapi_mode3: Setting UE_mode to PRACH 2 \n");
LOG_A(MAC, "nfapi_mode3: Setting UE_mode to PRACH 2 \n");
UE_mac_inst[module_idP].UE_mode[eNB_indexP] = PRACH;
//ra_failed(module_idP,CC_id,eNB_index);UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
} else {
......
......@@ -1044,6 +1044,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
{
LOG_W(MAC, "repeated sfn_sf = %d.%d\n",
sfn_sf >> 4, sfn_sf & 15);
continue;
}
last_sfn_sf = sfn_sf;
......@@ -1171,21 +1172,28 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
// Prepare the future Tx data
if ((subframe_select(&UE->frame_parms, NFAPI_SFNSF2SF(sfn_sf)) == SF_UL) ||
(UE->frame_parms.frame_type == FDD))
if (UE->mode != loop_through_memory) {
if (UE->mode != loop_through_memory)
{
// We make the start of RA between consecutive UEs differ by 20 frames
//if ((UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id == 0) || (UE_mac_inst[Mod_id].UE_mode[0] == PRACH && Mod_id>0 && rx_frame >= UE_mac_inst[Mod_id-1].ra_frame + 20) ) {
if (UE_mac_inst[ue_Mod_id].UE_mode[0] == RA_RESPONSE &&
is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)))
{
UE_mac_inst[ue_Mod_id].UE_mode[0] = PRACH;
}
LOG_I(MAC, "UE_mode: %d\n", UE_mac_inst[ue_Mod_id].UE_mode[0]);
if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH) { //&& ue_Mod_id == next_Mod_id) {
if (UE_mac_inst[ue_Mod_id].UE_mode[0] == PRACH)
{ //&& ue_Mod_id == next_Mod_id) {
next_ra_frame++;
// if (next_ra_frame > 500) {
// check if we have PRACH opportunity
LOG_I(MAC, "is_prach_subframe(): %d\n",
is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)));
if (is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1) {
if (is_prach_subframe(&UE->frame_parms, NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf)) && UE_mac_inst[ue_Mod_id].SI_Decoded == 1)
{
// The one working strangely...
//if (is_prach_subframe(&UE->frame_parms,NFAPI_SFNSF2SFN(sfn_sf), NFAPI_SFNSF2SF(sfn_sf) && Mod_id == (module_id_t) init_ra_UE) ) {
PRACH_RESOURCES_t *prach_resources = ue_get_rach(ue_Mod_id, 0, NFAPI_SFNSF2SFN(sfn_sf), 0, NFAPI_SFNSF2SF(sfn_sf));
if (prach_resources != NULL) {
if (prach_resources != NULL)
{
LOG_I(MAC, "preamble_received_tar_power: %d\n",
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER);
UE_mac_inst[ue_Mod_id].ra_frame = NFAPI_SFNSF2SFN(sfn_sf); // Is this why RACH comes in late to proxy? - Andrew
......@@ -1198,7 +1206,6 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
//next_ra_frame = (rx_frame + 20)%1000;
next_ra_frame = 0;
}
//ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode);
}
// }
......
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