diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index a52403cac4..825a6f255e 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -112,7 +112,7 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP, nfapi_hi_dci0_request_body_t *hi_dci0_req_body; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; uint8_t sf_ahead_dl; - uint8_t rvseq[4] = { 0, 2, 3, 1 }; + uint8_t rvseq[4] = {0, 2, 3, 1}; ul_req = &mac->UL_req_tmp[CC_id][ra->Msg3_subframe]; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index e3748d87e6..87a95e59da 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -1142,11 +1142,18 @@ schedule_ulsch(module_id_t module_idP, /* Second setup step */ int sched_subframe = 0; + int sched_frame = 0; + int n_rb_ul_tab = 0; /* Second init step */ sched_subframe = (subframeP + 4) % 10; + sched_frame = frameP; cc = mac->common_channels; + if (sched_subframe < subframeP) { + sched_frame++; + } + /* For TDD: check subframes where we have to act and return if nothing should be done now */ if (cc->tdd_Config) { // Done only for CC_id = 0, assume tdd_Config for all CC_id int tdd_sfa = cc->tdd_Config->subframeAssignment; @@ -1261,6 +1268,24 @@ schedule_ulsch(module_id_t module_idP, // break; } } + + /* Louis-Adrien: Only set for FDD (for the moment) + * Hard coded for prach-ConfigIndex = 0 and prach-Freqoffset = 2 + * ToDo: The PRACH resources should be added with modularity (here?) + */ + if (cc[CC_id].tdd_Config == NULL) { // FDD + if (((sched_frame %2) == 0) && sched_subframe == 1) { // RACH frame and subframe + if (first_rb[CC_id] < 8) { + n_rb_ul_tab = to_prb(cc[CC_id].ul_Bandwidth); // return total number of PRB + + if (n_rb_ul_tab >= 8) { + first_rb[CC_id] = 8; + } else { + return; + } + } + } + } } /* Run each enabled slice-specific schedulers one by one */ diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h index 7785abd16f..60496424b5 100644 --- a/openair2/LAYER2/MAC/mac.h +++ b/openair2/LAYER2/MAC/mac.h @@ -997,6 +997,7 @@ typedef struct { uint8_t crnti_reconfigurationcomplete_flag; uint8_t cqi_req_flag; } UE_sched_ctrl; + /*! \brief eNB template for the Random access information */ typedef struct { /// Flag to indicate this process is active