diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 2c8b613b1d..075c611345 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -752,6 +752,13 @@ typedef struct { #ifdef LOCALIZATION eNB_UE_estimated_distances distance; #endif + +#ifdef Rel14 + uint8_t rach_resource_type; + + +#endif + } UE_TEMPLATE; /*! \brief scheduling control information set through an API (not used)*/ diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 1b835de69c..969895f18c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -710,7 +710,11 @@ void dump_ue_list(UE_list_t *listP, int ul_flag) } } -int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) +int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP + #ifdef Rel14 + ,uint8_t rach_resource_type + #endif + ) { int UE_id; int i, j; @@ -732,6 +736,11 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) UE_list->ordered_ULCCids[0][UE_id] = cc_idP; UE_list->num_UEs++; UE_list->active[UE_id] = TRUE; + +#ifdef Rel14 + UE_list->UE_template[cc_idP][UE_id].rach_resource_type = rach_resource_type ; +#endif + memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl)); memset((void*)&UE_list->eNB_UE_stats[cc_idP][UE_id],0,sizeof(eNB_UE_STATS)); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index 2851c91db6..6621a72766 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -370,7 +370,11 @@ void rx_sdu(const module_id_t enb_mod_idP, LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %ld\n", enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP); - if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,RA_template->rnti,harq_pid)) == -1 ) { + if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pid + #ifdef Rel14 + ,eNB->common_channels[CC_idP].RA_template[ii].rach_resource_type + #endif + )) == -1 ) { AssertFatal(1==0,"[MAC][eNB] Max user count reached\n"); // kill RA procedure } else diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 66e7226d23..b64a02ad28 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -521,7 +521,11 @@ int to_prb(int); int to_rbg(int); int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active); int mac_init(void); -int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid); +int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid + #ifdef Rel14 + ,uint8_t rach_resource_type + #endif + ); int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);