Commit 3406634b authored by Louis Adrien Dufrene's avatar Louis Adrien Dufrene

This is version 1.0. To test. Cleanup of phy_procedures_lte_eNb.c...

This is version 1.0. To test. Cleanup of phy_procedures_lte_eNb.c eNB_scheduler_dlsch.c eNB_scheduler_ulsch.c pre_processor.c and asn1_msg.c
parent a73f639d
......@@ -1619,7 +1619,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
//-----------------------------------------------------------------------------
/*
* Release the harq if its round is >= 'after_rounds'
* Release the harq process if its round is >= 'after_rounds'
*/
static void do_release_harq(PHY_VARS_eNB *eNB,
int UE_id,
......@@ -1683,26 +1683,6 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
}
#endif
/*
LOG_I(PHY, "UE_id = %d; Frame %d, subframe %d: Releasing harq %d for UE %x, CC_id = %d; HARQ RTT Timer = %d,%d,%d,%d,%d,%d,%d,%d, drx-ReTX = %d, cdrx-configured = %d\n",
UE_id_mac,
frame,
subframe,
harq_pid,
dlsch0->rnti,
eNB->CC_id,
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][0],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][1],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][2],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][3],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][4],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][5],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][6],
UE_scheduling_control->harq_rtt_timer[eNB->CC_id][7],
UE_scheduling_control->drx_retransmission_timer[harq_pid],
UE_scheduling_control->cdrx_configured);
*/
if (dlsch0_harq->round >= after_rounds) {
dlsch0_harq->status = SCH_IDLE;
dlsch0->harq_mask &= ~(1 << harq_pid);
......@@ -1766,7 +1746,8 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
}
static void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) {
/* Maximum number of DL transmissions = 4.
/*
* Maximum number of DL transmissions = 4.
* TODO: get the value from configuration.
* If is_ack is true then we release immediately. The value -1 can be used for that.
*/
......
......@@ -457,6 +457,9 @@ void getRepetition(UE_TEMPLATE * pue_template,unsigned int *maxRep , unsigned i
}
//------------------------------------------------------------------------------
/*
* Schedule the DLSCH
*/
void
schedule_ue_spec(module_id_t module_idP,
int slice_idxP,
......@@ -564,14 +567,13 @@ schedule_ue_spec(module_id_t module_idP,
}
}
//weight = get_ue_weight(module_idP,UE_id);
aggregation = 2;
for (CC_id = 0, eNB_stats = &eNB->eNB_stats[0]; CC_id < nb_mac_CC; CC_id++, eNB_stats++) {
dl_Bandwidth = cc[CC_id].mib->message.dl_Bandwidth;
N_RB_DL[CC_id] = to_prb(dl_Bandwidth);
min_rb_unit[CC_id] = get_min_rb_unit(module_idP,
CC_id);
min_rb_unit[CC_id] = get_min_rb_unit(module_idP, CC_id);
// get number of PRBs less those used by common channels
total_nb_available_rb[CC_id] = N_RB_DL[CC_id];
......@@ -603,14 +605,6 @@ schedule_ue_spec(module_id_t module_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,
VCD_FUNCTION_OUT);
//RC.mac[module_idP]->slice_info.slice_counter--;
// Do the multiplexing and actual allocation only when all slices have been pre-processed.
//if (RC.mac[module_idP]->slice_info.slice_counter > 0) {
//stop_meas(&eNB->schedule_dlsch);
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH, VCD_FUNCTION_OUT);
//return;
//}
if (RC.mac[module_idP]->slice_info.interslice_share_active) {
dlsch_scheduler_interslice_multiplexing(module_idP,
frameP,
......@@ -776,7 +770,6 @@ schedule_ue_spec(module_id_t module_idP,
/* Process retransmission */
if (round_DL != 8) {
//if (round_DL > 0) {
// get freq_allocation
nb_rb = ue_template->nb_rb[harq_pid];
TBS = get_TBS_DL(ue_template->oldmcs1[harq_pid],
......@@ -785,27 +778,11 @@ schedule_ue_spec(module_id_t module_idP,
if (nb_rb <= nb_available_rb) {
/* CDRX */
ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer
/*
LOG_W(MAC, "HELLO : round!=8 UE_id = %d, frame = %d; subframe = %d; CC_id %d, harq_pid = %d , RTT_timer = %d,%d,%d,%d,%d,%d,%d,%d\n",
UE_id,
frameP,
subframeP,
CC_id,
harq_pid,
ue_sched_ctrl->harq_rtt_timer[CC_id][0],
ue_sched_ctrl->harq_rtt_timer[CC_id][1],
ue_sched_ctrl->harq_rtt_timer[CC_id][2],
ue_sched_ctrl->harq_rtt_timer[CC_id][3],
ue_sched_ctrl->harq_rtt_timer[CC_id][4],
ue_sched_ctrl->harq_rtt_timer[CC_id][5],
ue_sched_ctrl->harq_rtt_timer[CC_id][6],
ue_sched_ctrl->harq_rtt_timer[CC_id][7]);
*/
if (ue_sched_ctrl->cdrx_configured) {
ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission
/* May be a problem with drx_retransmission_timer[harq_pid]. Here the timer is reset not stop.
* Can create a problem with several CC_id with the same UE??
/*
* Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop.
*/
if (harq_pid == 0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) ue_sched_ctrl->drx_retransmission_timer[0]);
......@@ -850,14 +827,6 @@ schedule_ue_spec(module_id_t module_idP,
}
nb_available_rb -= nb_rb;
/*
eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb;
eNB->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctrl->dl_pow_off[CC_id];
for(j = 0; j < N_RBG[CC_id]; ++j) {
eNB->mu_mimo_mode[UE_id].rballoc_sub[j] = ue_template->rballoc_subband[harq_pid][j];
}
*/
switch (get_tmode(module_idP, CC_id, UE_id)) {
case 1:
......@@ -1283,6 +1252,7 @@ schedule_ue_spec(module_id_t module_idP,
header_length_total += header_length_last;
num_sdus++;
ue_sched_ctrl->uplane_inactivity_timer = 0;
// reset RRC inactivity timer after uplane activity
ue_contextP = rrc_eNB_get_ue_context(RC.rrc[module_idP], rnti);
......@@ -1607,28 +1577,12 @@ schedule_ue_spec(module_id_t module_idP,
/* CDRX */
ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer
/*
LOG_W(MAC, "HELLO : round=8, UE_id = %d, frame = %d; subframe = %d ; CC_id %d, harq_pid = %d , RTT_timer = %d,%d,%d,%d,%d,%d,%d,%d\n",
UE_id,
frameP,
subframeP,
CC_id,
harq_pid,
ue_sched_ctrl->harq_rtt_timer[CC_id][0],
ue_sched_ctrl->harq_rtt_timer[CC_id][1],
ue_sched_ctrl->harq_rtt_timer[CC_id][2],
ue_sched_ctrl->harq_rtt_timer[CC_id][3],
ue_sched_ctrl->harq_rtt_timer[CC_id][4],
ue_sched_ctrl->harq_rtt_timer[CC_id][5],
ue_sched_ctrl->harq_rtt_timer[CC_id][6],
ue_sched_ctrl->harq_rtt_timer[CC_id][7]);
*/
if (ue_sched_ctrl->cdrx_configured) {
ue_sched_ctrl->drx_inactivity_timer = 1; // restart drx inactivity timer when new transmission
ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission
/* May be a problem with drx_retransmission_timer[harq_pid]. Here the timer is reset not stop.
* Can create a problem with several CC_id with the same UE??
/*
* Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop.
*/
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) ue_sched_ctrl->drx_inactivity_timer);
if (harq_pid == 0) {
......@@ -2050,13 +2004,6 @@ schedule_ue_spec_br(module_id_t module_idP,
continue;
}
/* CDRX LTE-M */
if (ue_sched_ctl->cdrx_configured == TRUE) {
if ((ue_sched_ctl->bypass_cdrx == FALSE) && (ue_sched_ctl->in_active_time == FALSE)) {
continue;
}
}
round_DL = ue_sched_ctl->round[CC_id][harq_pid];
AssertFatal (UE_template->physicalConfigDedicated != NULL, "UE_template->physicalConfigDedicated is null\n");
......
......@@ -235,8 +235,11 @@ rx_sdu(const module_id_t enb_mod_idP,
if (UE_scheduling_control->cdrx_configured == TRUE) {
/* Synchronous UL HARQ */
UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5;
/* In case of asynchronous UL HARQ process restart here relevant RTT timer
* Stop corresponding CDRX ULRetransmission timer
/*
* The NACK is programmed in n+4 subframes, so UE will have drxRetransmission running.
* Setting ul_synchronous_harq_timer = 5 will trigger drxRetransmission timer.
* Note: in case of asynchronous UL HARQ process restart here relevant RTT timer.
* Start corresponding CDRX ULRetransmission timer.
*/
}
......@@ -897,6 +900,7 @@ rx_sdu(const module_id_t enb_mod_idP,
/* Reset RRC inactivity timer after uplane activity */
ue_contextP = rrc_eNB_get_ue_context(RC.rrc[enb_mod_idP], current_rnti);
if (ue_contextP != NULL) {
ue_contextP->ue_context.ue_rrc_inactivity_timer = 1;
} else {
......@@ -936,7 +940,10 @@ rx_sdu(const module_id_t enb_mod_idP,
if (UE_scheduling_control->cdrx_configured == TRUE) {
/* Synchronous UL HARQ */
UE_scheduling_control->ul_synchronous_harq_timer[CC_idP][harq_pid] = 5;
/* Note: in case of asynchronous UL HARQ process restart here relevant RTT timer
/*
* The ACK is programmed in n+4 subframes, so UE will have drxRetransmission running.
* Setting ul_synchronous_harq_timer = 5 will trigger drxRetransmission timer.
* Note: in case of asynchronous UL HARQ process restart here relevant RTT timer
* Stop corresponding CDRX ULRetransmission timer
*/
}
......@@ -1418,7 +1425,8 @@ schedule_ulsch_rnti(module_id_t module_idP,
UE_list->first_rb_offset[CC_id][slice_idx] = cmin(n_rb_ul_tab[CC_id], sli->ul[slice_idx].first_rb);
}
/* ULSCH preprocessor: set UE_template->
/*
* ULSCH preprocessor: set UE_template->
* pre_allocated_nb_rb_ul[slice_idx]
* pre_assigned_mcs_ul
* pre_allocated_rb_table_index_ul
......@@ -1434,6 +1442,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
if (!ue_ul_slice_membership(module_idP, UE_id, slice_idx)) {
continue;
}
if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id].rach_resource_type > 0) continue;
// don't schedule if Msg5 is not received yet
......@@ -2040,14 +2049,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
continue;
}
/* CDRX LTE-M */
UE_sched_ctrl = &(UE_list->UE_sched_ctrl[UE_id]);
if (UE_sched_ctrl->cdrx_configured == TRUE) {
if ((UE_sched_ctrl->bypass_cdrx == FALSE) && (UE_sched_ctrl->in_active_time == FALSE)) {
continue;
}
}
/* Loop over all active UL CC_ids for this UE */
for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) {
/* This is the actual CC_id in the list */
......@@ -2147,13 +2148,6 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
/* New transmission */
if (round_UL == 0) {
/* CDRX LTE-M */
if (UE_sched_ctrl->cdrx_configured == TRUE) {
UE_sched_ctrl->drx_inactivity_timer = 1; // reset drx inactivity timer when new transmission
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_INACTIVITY, (unsigned long) UE_sched_ctrl->drx_inactivity_timer);
}
ndi = 1 - UE_template->oldNDI_UL[harq_pid];
UE_template->oldNDI_UL[harq_pid] = ndi;
......
......@@ -458,27 +458,28 @@ void decode_slice_positioning(module_id_t Mod_idP,
}
}
// This function sorts the UE in order their dlsch buffer and CQI
void
sort_UEs(module_id_t Mod_idP,
//-----------------------------------------------------------------------------
/*
* This function sorts the UEs in order, depending on their dlsch buffer and CQI
*/
void sort_UEs(module_id_t Mod_idP,
int slice_idx,
int frameP,
sub_frame_t subframeP)
//-----------------------------------------------------------------------------
{
int i;
int list[MAX_MOBILES_PER_ENB];
int list_size = 0;
struct sort_ue_dl_params params = {Mod_idP, frameP, subframeP, slice_idx};
UE_list_t *UE_list = &RC.mac[Mod_idP]->UE_list;
UE_list_t *UE_list = &(RC.mac[Mod_idP]->UE_list);
UE_sched_ctrl *UE_scheduling_control = NULL;
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
UE_scheduling_control = &(UE_list->UE_sched_ctrl[i]);
/* Check CDRX configuration and if UE is in active time for this subframe */
if (UE_scheduling_control->cdrx_configured == TRUE) {
if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) {
continue;
}
......@@ -496,8 +497,9 @@ sort_UEs(module_id_t Mod_idP,
qsort_r(list, list_size, sizeof(int), ue_dl_compare, &params);
if (list_size) {
for (i = 0; i < list_size - 1; ++i)
for (int i = 0; i < list_size - 1; ++i) {
UE_list->next[list[i]] = list[i + 1];
}
UE_list->next[list[list_size - 1]] = -1;
UE_list->head = list[0];
......@@ -1992,26 +1994,29 @@ static int ue_ul_compare(const void *_a, const void *_b, void *_params) {
return 0;
}
void
sort_ue_ul(module_id_t module_idP,
//-----------------------------------------------------------------------------
/*
* This function sorts the UEs in order, depending on their ulsch buffer and CQI
*/
void sort_ue_ul(module_id_t module_idP,
int slice_idx,
int frameP,
sub_frame_t subframeP,
rnti_t *rntiTable)
//-----------------------------------------------------------------------------
{
int i;
int list[MAX_MOBILES_PER_ENB];
int list_size = 0;
struct sort_ue_ul_params params = { module_idP, frameP, subframeP };
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
UE_sched_ctrl *UE_scheduling_control = NULL;
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
UE_scheduling_control = &(UE_list->UE_sched_ctrl[i]);
/* Check CDRX configuration and if UE is in active time for this subframe */
if (UE_scheduling_control->cdrx_configured == TRUE) {
if ((UE_scheduling_control->bypass_cdrx == FALSE) && (UE_scheduling_control->in_active_time == FALSE)) {
continue;
}
......@@ -2030,11 +2035,14 @@ sort_ue_ul(module_id_t module_idP,
qsort_r(list, list_size, sizeof(int), ue_ul_compare, &params);
if (list_size) { // At mimimum one list element
for (i = 0; i < list_size - 1; i++)
for (int i = 0; i < list_size - 1; i++) {
UE_list->next_ul[list[i]] = list[i + 1];
}
UE_list->next_ul[list[list_size - 1]] = -1;
UE_list->head_ul = list[0];
} else { // No element
UE_list->head_ul = -1;
}
......
......@@ -3546,6 +3546,9 @@ uint16_t do_RRCConnectionReconfiguration_BR(const protocol_ctxt_t* const
#endif
//------------------------------------------------------------------------------
/*
* Copy the different Information Elements in the RRC structure
*/
uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
uint8_t *buffer,
uint8_t Transaction_id,
......@@ -3582,7 +3585,8 @@ uint16_t do_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctx
dl_dcch_msg.message.present = LTE_DL_DCCH_MessageType_PR_c1;
dl_dcch_msg.message.choice.c1.present = LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration;
rrcConnectionReconfiguration = &dl_dcch_msg.message.choice.c1.choice.rrcConnectionReconfiguration;
// RRCConnectionReconfiguration
/* RRC Connection Reconfiguration */
rrcConnectionReconfiguration->rrc_TransactionIdentifier = Transaction_id;
rrcConnectionReconfiguration->criticalExtensions.present = LTE_RRCConnectionReconfiguration__criticalExtensions_PR_c1;
rrcConnectionReconfiguration->criticalExtensions.choice.c1.present = LTE_RRCConnectionReconfiguration__criticalExtensions__c1_PR_rrcConnectionReconfiguration_r8 ;
......
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