Commit 0b7489b1 authored by laurent's avatar laurent

astyle only

parent 445cf84e
...@@ -59,7 +59,7 @@ int lte_segmentation(unsigned char *input_buffer, ...@@ -59,7 +59,7 @@ int lte_segmentation(unsigned char *input_buffer,
} }
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) { if ((*C)>MAX_NUM_DLSCH_SEGMENTS) {
printf("%d\n",*(int*)0); printf("%d\n",*(int *)0);
LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
return(-1); return(-1);
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#ifdef DEBUG_UCI_TOOLS #ifdef DEBUG_UCI_TOOLS
#include "PHY/vars.h" #include "PHY/vars.h"
#endif #endif
//#define DEBUG_UCI 1 //#define DEBUG_UCI 1
...@@ -41,6 +41,7 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_ ...@@ -41,6 +41,7 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
uint16_t i; uint16_t i;
int16_t first_free_index=-1; int16_t first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n"); AssertFatal(eNB!=NULL,"eNB is null\n");
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) { for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
if ((eNB->uci_vars[i].active >0) && if ((eNB->uci_vars[i].active >0) &&
(eNB->uci_vars[i].rnti==rnti) && (eNB->uci_vars[i].rnti==rnti) &&
...@@ -48,9 +49,12 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_ ...@@ -48,9 +49,12 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
(eNB->uci_vars[i].subframe==subframe)) return(i); (eNB->uci_vars[i].subframe==subframe)) return(i);
else if ((eNB->uci_vars[i].active == 0) && (first_free_index==-1)) first_free_index=i; else if ((eNB->uci_vars[i].active == 0) && (first_free_index==-1)) first_free_index=i;
} }
if (type == SEARCH_EXIST) return(-1); if (type == SEARCH_EXIST) return(-1);
if (first_free_index==-1) if (first_free_index==-1)
LOG_E(MAC,"UCI table is full\n"); LOG_E(MAC,"UCI table is full\n");
return(first_free_index); return(first_free_index);
} }
......
...@@ -563,7 +563,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -563,7 +563,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
else else
tc = *decoder8; tc = *decoder8;
if(ulsch_harq->repetition_number == 1){ if(ulsch_harq->repetition_number == 1) {
memset(pusch_rep_buffer,0,(sizeof(int32_t)*3*(6144+64))) ; // reset the buffer every new repetitions memset(pusch_rep_buffer,0,(sizeof(int32_t)*3*(6144+64))) ; // reset the buffer every new repetitions
} }
...@@ -609,22 +609,18 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -609,22 +609,18 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
} }
stop_meas(&eNB->ulsch_rate_unmatching_stats); stop_meas(&eNB->ulsch_rate_unmatching_stats);
max_Ncb = 3*ulsch_harq->RTC[r]*32 ; max_Ncb = 3*ulsch_harq->RTC[r]*32 ;
if(ulsch_harq->total_number_of_repetitions > 1) if(ulsch_harq->total_number_of_repetitions > 1) {
{ if (ulsch_harq->rvidx==1) {
if (ulsch_harq->rvidx==1) // Store the result of HARQ combining in the last emtc repetitions of sequence 0,2,3,1
{ // Store the result of HARQ combining in the last emtc repetitions of sequence 0,2,3,1 for (int nn=0; nn<max_Ncb; nn++) {
for (int nn=0;nn<max_Ncb;nn++)
{
pusch_rep_buffer[nn] += ulsch_harq->w[r][nn] ; pusch_rep_buffer[nn] += ulsch_harq->w[r][nn] ;
} }
} }
if (ulsch_harq->repetition_number == ulsch_harq->total_number_of_repetitions)
{ if (ulsch_harq->repetition_number == ulsch_harq->total_number_of_repetitions) {
for (int nn=0;nn<max_Ncb;nn++) for (int nn=0; nn<max_Ncb; nn++) {
{
ulsch_harq->w[r][nn] = pusch_rep_buffer[nn] ; ulsch_harq->w[r][nn] = pusch_rep_buffer[nn] ;
} }
} }
...@@ -763,9 +759,9 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -763,9 +759,9 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
int frame = proc->frame_rx; int frame = proc->frame_rx;
int subframe = proc->subframe_rx; int subframe = proc->subframe_rx;
LTE_UL_eNB_HARQ_t *ulsch_harq; LTE_UL_eNB_HARQ_t *ulsch_harq;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
LOG_D(PHY,"ue_type %d\n",ulsch->ue_type); LOG_D(PHY,"ue_type %d\n",ulsch->ue_type);
if (ulsch->ue_type>0) harq_pid = 0; if (ulsch->ue_type>0) harq_pid = 0;
else else
#endif #endif
...@@ -774,7 +770,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -774,7 +770,6 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
// x1 is set in lte_gold_generic // x1 is set in lte_gold_generic
x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
ulsch_harq = ulsch->harq_processes[harq_pid]; ulsch_harq = ulsch->harq_processes[harq_pid];
......
...@@ -50,7 +50,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -50,7 +50,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy;
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
char phich_resource[6]; char phich_resource[6];
LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id, LOG_D(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",ue->Mod_id,
ue->rx_offset); ue->rx_offset);
...@@ -95,7 +94,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -95,7 +94,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
0); 0);
} }
LOG_D(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", LOG_D(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n",
ue->Mod_id, ue->Mod_id,
ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0), ue->measurements.rx_rssi_dBm[0] - ((ue->frame_parms.nb_antennas_rx==2) ? 3 : 0),
...@@ -106,7 +104,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -106,7 +104,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->measurements.rx_power_avg_dB[0], ue->measurements.rx_power_avg_dB[0],
ue->measurements.rx_power_avg[0], ue->measurements.rx_power_avg[0],
ue->rx_total_gain_dB); ue->rx_total_gain_dB);
LOG_D(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", LOG_D(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n",
ue->Mod_id, ue->Mod_id,
ue->measurements.n0_power_tot_dBm, ue->measurements.n0_power_tot_dBm,
...@@ -116,12 +113,12 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -116,12 +113,12 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->measurements.n0_power[1], ue->measurements.n0_power[1],
ue->measurements.n0_power_avg_dB, ue->measurements.n0_power_avg_dB,
ue->measurements.n0_power_avg); ue->measurements.n0_power_avg);
pbch_decoded = 0; pbch_decoded = 0;
for (frame_mod4=0; frame_mod4<4; frame_mod4++) { for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ue->FeMBMS_active != 2){
if (ue->FeMBMS_active != 2) {
#endif #endif
pbch_tx_ant = rx_pbch(&ue->common_vars, pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[0], ue->pbch_vars[0],
...@@ -131,7 +128,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -131,7 +128,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->high_speed_flag, ue->high_speed_flag,
frame_mod4); frame_mod4);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
}else{ } else {
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars, pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
ue->pbch_vars[0], ue->pbch_vars[0],
frame_parms, frame_parms,
...@@ -140,6 +137,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -140,6 +137,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->high_speed_flag, ue->high_speed_flag,
frame_mod4); frame_mod4);
} }
#endif #endif
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) { if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
...@@ -148,7 +146,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -148,7 +146,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
} }
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ue->FeMBMS_active != 2){
if (ue->FeMBMS_active != 2) {
#endif #endif
pbch_tx_ant = rx_pbch(&ue->common_vars, pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[0], ue->pbch_vars[0],
...@@ -158,7 +157,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -158,7 +157,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->high_speed_flag, ue->high_speed_flag,
frame_mod4); frame_mod4);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
}else{ } else {
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars, pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
ue->pbch_vars[0], ue->pbch_vars[0],
frame_parms, frame_parms,
...@@ -167,6 +166,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -167,6 +166,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->high_speed_flag, ue->high_speed_flag,
frame_mod4); frame_mod4);
} }
#endif #endif
if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) { if ((pbch_tx_ant>0) && (pbch_tx_ant<=2)) {
...@@ -218,6 +218,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -218,6 +218,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
} }
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(ue->FeMBMS_active != 2) { if(ue->FeMBMS_active != 2) {
#endif #endif
// now check for PHICH parameters // now check for PHICH parameters
...@@ -257,7 +258,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -257,7 +258,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
} }
LOG_D(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n", LOG_D(PHY,"[UE%d] Initial sync: pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, phich_duration %d, phich_resource %s!\n",
ue->Mod_id, ue->Mod_id,
frame_parms->nb_antenna_ports_eNB, frame_parms->nb_antenna_ports_eNB,
...@@ -266,14 +266,13 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -266,14 +266,13 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
frame_parms->N_RB_DL, frame_parms->N_RB_DL,
frame_parms->phich_config_common.phich_duration, frame_parms->phich_config_common.phich_duration,
phich_resource); //frame_parms->phich_config_common.phich_resource); phich_resource); //frame_parms->phich_config_common.phich_resource);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
}else{ } else {
for(int i=0; i<RX_NB_TH;i++) for(int i=0; i<RX_NB_TH; i++) {
{
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&31)<<1) + (ue->pbch_vars[0]->decoded_output[1]>>7))<<4; ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&31)<<1) + (ue->pbch_vars[0]->decoded_output[1]>>7))<<4;
ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx; ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
} }
LOG_D(PHY,"[UE%d] Initial sync: FeMBMS pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, AdditionalNonMBSFN_SF %d, frame_mod4 %d\n", LOG_D(PHY,"[UE%d] Initial sync: FeMBMS pbch decoded sucessfully p %d, tx_ant %d, frame %d, N_RB_DL %d, AdditionalNonMBSFN_SF %d, frame_mod4 %d\n",
ue->Mod_id, ue->Mod_id,
frame_parms->nb_antenna_ports_eNB, frame_parms->nb_antenna_ports_eNB,
...@@ -283,8 +282,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -283,8 +282,8 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode) {
0, 0,
frame_mod4 frame_mod4
); );
} }
#endif #endif
return(0); return(0);
} else { } else {
...@@ -310,7 +309,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -310,7 +309,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
frame_parms->frame_type=FDD; frame_parms->frame_type=FDD;
frame_parms->nb_antenna_ports_eNB = 2; frame_parms->nb_antenna_ports_eNB = 2;
init_frame_parms(frame_parms,1); init_frame_parms(frame_parms,1);
/* /*
LOG_M("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); LOG_M("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
exit(-1); exit(-1);
...@@ -325,9 +323,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -325,9 +323,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
else else
sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples; sync_pos2 = sync_pos + FRAME_LENGTH_COMPLEX_SAMPLES - frame_parms->nb_prefix_samples;
LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id); LOG_D(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
// SSS detection // SSS detection
// PSS is hypothesized in last symbol of first slot in Frame // PSS is hypothesized in last symbol of first slot in Frame
sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples; sync_pos_slot = (frame_parms->samples_per_tti>>1) - frame_parms->ofdm_symbol_size - frame_parms->nb_prefix_samples;
...@@ -350,22 +346,23 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -350,22 +346,23 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_D(PHY,"FDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ret==-1){
if (ret==-1) {
ue->FeMBMS_active = 2; ue->FeMBMS_active = 2;
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
if (ret==-1){
if (ret==-1) {
ue->FeMBMS_active = 0; ue->FeMBMS_active = 0;
frame_parms->FeMBMS_active = 0; frame_parms->FeMBMS_active = 0;
} } else frame_parms->FeMBMS_active = 1;
else frame_parms->FeMBMS_active = 1;
LOG_D(PHY,"FeMBMS Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_D(PHY,"FeMBMS Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret); frame_parms->Nid_cell,metric_fdd_ncp,phase_fdd_ncp,flip_fdd_ncp,ret);
} }
#endif #endif
} else { } else {
LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); LOG_D(PHY,"FDD Normal prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
...@@ -406,23 +403,22 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -406,23 +403,22 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
// LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata3.m","rxd3",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_D(PHY,"FDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret); frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (ret==-1){
if (ret==-1) {
ue->FeMBMS_active = 2; ue->FeMBMS_active = 2;
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
if (ret==-1){
if (ret==-1) {
ue->FeMBMS_active = 0; ue->FeMBMS_active = 0;
frame_parms->FeMBMS_active = 0; frame_parms->FeMBMS_active = 0;
} } else frame_parms->FeMBMS_active = 1;
else frame_parms->FeMBMS_active = 1;
LOG_I(PHY,"FeMBMS CAS Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_I(PHY,"FeMBMS CAS Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret); frame_parms->Nid_cell,metric_fdd_ecp,phase_fdd_ecp,flip_fdd_ecp,ret);
} }
#endif
#endif
} else { } else {
LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot); LOG_D(PHY,"FDD Extended prefix: SSS error condition: sync_pos %d, sync_pos_slot %d\n", sync_pos, sync_pos_slot);
} }
...@@ -460,9 +456,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -460,9 +456,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata4.m","rxd4",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_D(PHY,"TDD Normal prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret); frame_parms->Nid_cell,metric_tdd_ncp,phase_tdd_ncp,flip_tdd_ncp,ret);
if (ret==-1) { if (ret==-1) {
...@@ -496,9 +490,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -496,9 +490,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell); lte_gold(frame_parms,ue->lte_gold_table[0],frame_parms->Nid_cell);
ret = pbch_detection(ue,mode); ret = pbch_detection(ue,mode);
// LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1); // LOG_M("rxdata5.m","rxd5",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n", LOG_D(PHY,"TDD Extended prefix: CellId %d metric %d, phase %d, flip %d, pbch %d\n",
frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret); frame_parms->Nid_cell,metric_tdd_ecp,phase_tdd_ecp,flip_tdd_ecp,ret);
} }
} }
...@@ -525,7 +517,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -525,7 +517,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
generate_pcfich_reg_mapping(frame_parms); generate_pcfich_reg_mapping(frame_parms);
generate_phich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms);
ue->pbch_vars[0]->pdu_errors_conseq=0; ue->pbch_vars[0]->pdu_errors_conseq=0;
} }
LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id, LOG_I(PHY, "[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",ue->Mod_id,
...@@ -562,7 +553,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -562,7 +553,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
metric_tdd_ecp,Nid_cell_tdd_ecp);*/ metric_tdd_ecp,Nid_cell_tdd_ecp);*/
LOG_D(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id, LOG_D(PHY,"[UE%d] Initial sync : Estimated Nid_cell %d, Frame_type %d\n",ue->Mod_id,
frame_parms->Nid_cell,frame_parms->frame_type); frame_parms->Nid_cell,frame_parms->frame_type);
ue->UE_mode[0] = NOT_SYNCHED; ue->UE_mode[0] = NOT_SYNCHED;
ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors; ue->pbch_vars[0]->pdu_errors_last=ue->pbch_vars[0]->pdu_errors;
ue->pbch_vars[0]->pdu_errors++; ue->pbch_vars[0]->pdu_errors++;
...@@ -587,7 +577,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -587,7 +577,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
// we might add a low-pass filter here later // we might add a low-pass filter here later
ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; ue->measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx;
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]); ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]);
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] ); LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
if (IS_SOFTMODEM_BASICSIM ) if (IS_SOFTMODEM_BASICSIM )
...@@ -595,7 +584,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) { ...@@ -595,7 +584,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
} else { } else {
if (IS_SOFTMODEM_BASICSIM ) if (IS_SOFTMODEM_BASICSIM )
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
} }
return ret; return ret;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file phy_procedures_lte_ue.c /*! \file phy_procedures_lte_ue.c
* \brief Implementation of UE procedures from 36.213 LTE specifications / This includes FeMBMS UE procedures from 36.213 v14.2.0 specification * \brief Implementation of UE procedures from 36.213 LTE specifications / This includes FeMBMS UE procedures from 36.213 v14.2.0 specification
* \author R. Knopp, F. Kaltenberger, N. Nikaein, J. Morgade * \author R. Knopp, F. Kaltenberger, N. Nikaein, J. Morgade
* \date 2011 * \date 2011
...@@ -1665,7 +1665,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ...@@ -1665,7 +1665,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
generate_drs_pusch(ue, generate_drs_pusch(ue,
proc, proc,
(LTE_DL_FRAME_PARMS *)NULL, (LTE_DL_FRAME_PARMS *)NULL,
(int32_t**)NULL, (int32_t **)NULL,
eNB_id, eNB_id,
tx_amp, tx_amp,
subframe_tx, subframe_tx,
...@@ -2312,7 +2312,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2312,7 +2312,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
//for (pbch_phase=0;pbch_phase<4;pbch_phase++) { //for (pbch_phase=0;pbch_phase<4;pbch_phase++) {
//LOG_I(PHY,"[UE %d] Frame %d, Trying PBCH %d (NidCell %d, eNB_id %d)\n",ue->Mod_id,frame_rx,pbch_phase,ue->frame_parms.Nid_cell,eNB_id); //LOG_I(PHY,"[UE %d] Frame %d, Trying PBCH %d (NidCell %d, eNB_id %d)\n",ue->Mod_id,frame_rx,pbch_phase,ue->frame_parms.Nid_cell,eNB_id);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(is_fembms_cas_subframe(frame_rx,subframe_rx,&ue->frame_parms)){ if(is_fembms_cas_subframe(frame_rx,subframe_rx,&ue->frame_parms)) {
pbch_tx_ant = rx_pbch_fembms(&ue->common_vars, pbch_tx_ant = rx_pbch_fembms(&ue->common_vars,
ue->pbch_vars[eNB_id], ue->pbch_vars[eNB_id],
&ue->frame_parms, &ue->frame_parms,
...@@ -2320,8 +2320,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2320,8 +2320,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
ue->frame_parms.nb_antenna_ports_eNB==1?SISO:ALAMOUTI, ue->frame_parms.nb_antenna_ports_eNB==1?SISO:ALAMOUTI,
ue->high_speed_flag, ue->high_speed_flag,
pbch_phase); pbch_phase);
} else
}else
#endif #endif
pbch_tx_ant = rx_pbch(&ue->common_vars, pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[eNB_id], ue->pbch_vars[eNB_id],
...@@ -2357,21 +2356,21 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2357,21 +2356,21 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
return; return;
} }
ue->pbch_vars[eNB_id]->pdu_errors_conseq = 0; ue->pbch_vars[eNB_id]->pdu_errors_conseq = 0;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(is_fembms_cas_subframe(frame_rx,subframe_rx,&ue->frame_parms)){
if(is_fembms_cas_subframe(frame_rx,subframe_rx,&ue->frame_parms)) {
frame_tx = (int)((ue->pbch_vars[eNB_id]->decoded_output[2]&31)<<1); frame_tx = (int)((ue->pbch_vars[eNB_id]->decoded_output[2]&31)<<1);
frame_tx += ue->pbch_vars[eNB_id]->decoded_output[1]>>7; frame_tx += ue->pbch_vars[eNB_id]->decoded_output[1]>>7;
frame_tx +=4*pbch_phase; frame_tx +=4*pbch_phase;
}else{ } else {
#endif #endif
frame_tx = (((int)(ue->pbch_vars[eNB_id]->decoded_output[2]&0x03))<<8); frame_tx = (((int)(ue->pbch_vars[eNB_id]->decoded_output[2]&0x03))<<8);
frame_tx += ((int)(ue->pbch_vars[eNB_id]->decoded_output[1]&0xfc)); frame_tx += ((int)(ue->pbch_vars[eNB_id]->decoded_output[1]&0xfc));
frame_tx += pbch_phase; frame_tx += pbch_phase;
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
} }
#endif #endif
if (ue->mac_enabled==1) { if (ue->mac_enabled==1) {
...@@ -2795,9 +2794,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ...@@ -2795,9 +2794,9 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abstraction_flag void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abstraction_flag
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
, uint8_t fembms_flag , uint8_t fembms_flag
#endif #endif
) { ) {
int subframe_rx = proc->subframe_rx; int subframe_rx = proc->subframe_rx;
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
int pmch_mcs=-1; int pmch_mcs=-1;
...@@ -2828,51 +2827,54 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs ...@@ -2828,51 +2827,54 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
if (pmch_mcs>=0) { if (pmch_mcs>=0) {
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Programming PMCH demodulation for mcs %d\n",ue->Mod_id,frame_rx,subframe_rx,pmch_mcs); LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Programming PMCH demodulation for mcs %d\n",ue->Mod_id,frame_rx,subframe_rx,pmch_mcs);
fill_UE_dlsch_MCH(ue,pmch_mcs,1,0,0); fill_UE_dlsch_MCH(ue,pmch_mcs,1,0,0);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/){
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25, VCD_FUNCTION_IN); if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25, VCD_FUNCTION_IN);
slot_fep_mbsfn_khz_1dot25(ue,subframe_rx,0); slot_fep_mbsfn_khz_1dot25(ue,subframe_rx,0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN_KHZ_1DOT25, VCD_FUNCTION_OUT);
} } else {
else{
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN, VCD_FUNCTION_IN);
for (l=2; l<12; l++) { for (l=2; l<12; l++) {
slot_fep_mbsfn(ue, slot_fep_mbsfn(ue,
l, l,
subframe_rx, subframe_rx,
0,0);//ue->rx_offset,0); 0,0);//ue->rx_offset,0);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN, VCD_FUNCTION_OUT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_MBSFN, VCD_FUNCTION_OUT);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
} }
#endif
#endif
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/){
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25, VCD_FUNCTION_IN);
rx_pmch_khz_1dot25(ue,0,subframe_rx,pmch_mcs);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25, VCD_FUNCTION_OUT);
} if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/) {
else{ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25, VCD_FUNCTION_IN);
rx_pmch_khz_1dot25(ue,0,subframe_rx,pmch_mcs);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH_KHZ_1DOT25, VCD_FUNCTION_OUT);
} else {
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH, VCD_FUNCTION_IN);
for (l=2; l<12; l++) { for (l=2; l<12; l++) {
rx_pmch(ue, rx_pmch(ue,
0, 0,
subframe_rx, subframe_rx,
l); l);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH, VCD_FUNCTION_OUT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PMCH, VCD_FUNCTION_OUT);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
} }
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING, VCD_FUNCTION_IN); #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING, VCD_FUNCTION_IN);
ue->dlsch_MCH[0]->harq_processes[0]->Qm = get_Qm(pmch_mcs); ue->dlsch_MCH[0]->harq_processes[0]->Qm = get_Qm(pmch_mcs);
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/) if(fembms_flag /*subframe_rx == 3 || subframe_rx == 2*/)
ue->dlsch_MCH[0]->harq_processes[0]->G = get_G_khz_1dot25(&ue->frame_parms, ue->dlsch_MCH[0]->harq_processes[0]->G = get_G_khz_1dot25(&ue->frame_parms,
ue->dlsch_MCH[0]->harq_processes[0]->nb_rb, ue->dlsch_MCH[0]->harq_processes[0]->nb_rb,
...@@ -2913,7 +2915,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_D ...@@ -2913,7 +2915,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_D
subframe_rx, subframe_rx,
0, 0,
0,1); 0,1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING, VCD_FUNCTION_OUT);
if (mcch_active == 1) if (mcch_active == 1)
ue->dlsch_mcch_trials[sync_area][0]++; ue->dlsch_mcch_trials[sync_area][0]++;
...@@ -2960,7 +2962,6 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_D ...@@ -2960,7 +2962,6 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_D
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3, ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
ue->dlsch_MCH[0]->max_turbo_iterations, ue->dlsch_MCH[0]->max_turbo_iterations,
ue->dlsch_MCH[0]->harq_processes[0]->G); ue->dlsch_MCH[0]->harq_processes[0]->G);
ue_send_mch_sdu(ue->Mod_id, ue_send_mch_sdu(ue->Mod_id,
CC_id, CC_id,
frame_rx, frame_rx,
...@@ -3455,7 +3456,6 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, ...@@ -3455,7 +3456,6 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
eNB_id, eNB_id,
ue->dlsch_SI[eNB_id]->harq_processes[0]->b, ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3); ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
} else { } else {
ue_decode_si(ue->Mod_id, ue_decode_si(ue->Mod_id,
CC_id, CC_id,
...@@ -3464,6 +3464,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, ...@@ -3464,6 +3464,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
ue->dlsch_SI[eNB_id]->harq_processes[0]->b, ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3); ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
} }
#else #else
ue_decode_si(ue->Mod_id, ue_decode_si(ue->Mod_id,
CC_id, CC_id,
...@@ -4361,15 +4362,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ...@@ -4361,15 +4362,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
start_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]); start_meas(&ue->ue_front_end_stat[ue->current_thread_id[subframe_rx]]);
} }
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if(is_fembms_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)){
if(is_fembms_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms)) {
ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag,1); ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag,1);
return 0; return 0;
}else{ // this gets closed at end } else { // this gets closed at end
#endif #endif
pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0; pmch_flag = is_pmch_subframe(frame_rx,subframe_rx,&ue->frame_parms) ? 1 : 0;
if (do_pdcch_flag) { if (do_pdcch_flag) {
...@@ -4475,9 +4474,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ...@@ -4475,9 +4474,9 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
if (pmch_flag == 1) { if (pmch_flag == 1) {
ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag ue_pmch_procedures(ue,proc,eNB_id,abstraction_flag
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0 ,0
#endif #endif
); );
int next_subframe_rx = (1+subframe_rx)%10; int next_subframe_rx = (1+subframe_rx)%10;
if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) { if (subframe_select(&ue->frame_parms,next_subframe_rx) != SF_UL) {
...@@ -4768,8 +4767,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id, ...@@ -4768,8 +4767,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
} // This commes from feMBMS subframe filtering ! } // This commes from feMBMS subframe filtering !
#endif
#endif
// duplicate harq structure // duplicate harq structure
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid; uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->current_harq_pid;
LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid]; LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[subframe_rx]][eNB_id][0]->harq_processes[current_harq_pid];
......
...@@ -143,13 +143,14 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP, ...@@ -143,13 +143,14 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t *ra, frame_t frameP,
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL (ra->msg3_mcs, ra->msg3_nb_rb); ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL (ra->msg3_mcs, ra->msg3_nb_rb);
// Re13 fields // Re13 fields
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ra->rach_resource_type > 2 ? 2 : 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = ra->rach_resource_type > 2 ? 2 : 1;
if (ra->rach_resource_type > 0) { if (ra->rach_resource_type > 0) {
pusch_maxNumRepetitionCEmodeA_r13= *(rrc->configuration.pusch_maxNumRepetitionCEmodeA_r13[CC_id]); pusch_maxNumRepetitionCEmodeA_r13= *(rrc->configuration.pusch_maxNumRepetitionCEmodeA_r13[CC_id]);
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions= pusch_repetition_Table8_2_36213[pusch_maxNumRepetitionCEmodeA_r13][ra->pusch_repetition_levels]; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions= pusch_repetition_Table8_2_36213[pusch_maxNumRepetitionCEmodeA_r13][ra->pusch_repetition_levels];
} } else {
else{
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions=1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions=1;
} }
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.repetition_number = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (ra->Msg3_frame * 10) + ra->Msg3_subframe; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.initial_transmission_sf_io = (ra->Msg3_frame * 10) + ra->Msg3_subframe;
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
...@@ -274,8 +275,7 @@ void generate_Msg2(module_id_t module_idP, ...@@ -274,8 +275,7 @@ void generate_Msg2(module_id_t module_idP,
if (ra->rach_resource_type > 0) { if (ra->rach_resource_type > 0) {
PUSCH_Rep_Level= *(rrc->configuration.pusch_repetitionLevelCEmodeA_r13[CC_idP]); PUSCH_Rep_Level= *(rrc->configuration.pusch_repetitionLevelCEmodeA_r13[CC_idP]);
} } else {
else {
PUSCH_Rep_Level= 0; PUSCH_Rep_Level= 0;
} }
...@@ -347,9 +347,7 @@ void generate_Msg2(module_id_t module_idP, ...@@ -347,9 +347,7 @@ void generate_Msg2(module_id_t module_idP,
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space
AssertFatal (cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL, "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n"); AssertFatal (cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL, "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
LOG_E(MAC, "start_symbol = %d \n", dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol); LOG_E(MAC, "start_symbol = %d \n", dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol);
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.rnti_type = 2; // RA-RNTI
...@@ -913,7 +911,6 @@ generate_Msg4(module_id_t module_idP, ...@@ -913,7 +911,6 @@ generate_Msg4(module_id_t module_idP,
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (ra->rnti), T_INT (frameP), T_INT (subframeP), T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (ra->rnti), T_INT (frameP), T_INT (subframeP),
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], ra->msg4_TBsize)); T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], ra->msg4_TBsize));
trace_pdu (DIRECTION_DOWNLINK, (uint8_t *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], trace_pdu (DIRECTION_DOWNLINK, (uint8_t *) mac->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
ra->msg4_rrc_sdu_length, ra->msg4_rrc_sdu_length,
UE_id, 3, UE_RNTI (module_idP, UE_id), UE_id, 3, UE_RNTI (module_idP, UE_id),
...@@ -982,9 +979,7 @@ generate_Msg4(module_id_t module_idP, ...@@ -982,9 +979,7 @@ generate_Msg4(module_id_t module_idP,
1 - UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid], 1 - UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid],
0, // rv 0, // rv
0); // vrb_flag 0); // vrb_flag
UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid] = 1 - UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid]; UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid] = 1 - UE_list->UE_template[CC_idP][UE_id].oldNDI[ra->harq_pid];
LOG_D(MAC, LOG_D(MAC,
"Frame %d, subframe %d: Msg4 DCI pdu_num %d (rnti %x,rnti_type %d,harq_pid %d, resource_block_coding (%p) %d\n", "Frame %d, subframe %d: Msg4 DCI pdu_num %d (rnti %x,rnti_type %d,harq_pid %d, resource_block_coding (%p) %d\n",
frameP, subframeP, dl_req_body->number_pdu, frameP, subframeP, dl_req_body->number_pdu,
...@@ -1094,13 +1089,13 @@ generate_Msg4(module_id_t module_idP, ...@@ -1094,13 +1089,13 @@ generate_Msg4(module_id_t module_idP,
T_INT(subframeP), T_INT(0 /*harq_pid always 0? */ ), T_INT(subframeP), T_INT(0 /*harq_pid always 0? */ ),
T_BUFFER(&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id]. T_BUFFER(&mac->UE_list.DLSCH_pdu[CC_idP][0][UE_id].
payload[0], ra->msg4_TBsize)); payload[0], ra->msg4_TBsize));
trace_pdu(DIRECTION_DOWNLINK, trace_pdu(DIRECTION_DOWNLINK,
(uint8_t *) mac-> (uint8_t *) mac->
UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, WS_C_RNTI, rrc_sdu_length, UE_id, WS_C_RNTI,
UE_RNTI(module_idP, UE_id), mac->frame, UE_RNTI(module_idP, UE_id), mac->frame,
mac->subframe, 0, 0); mac->subframe, 0, 0);
if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR) { if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR) {
set_dl_ue_select_msg4(CC_idP, 4, UE_id, ra->rnti); set_dl_ue_select_msg4(CC_idP, 4, UE_id, ra->rnti);
} }
......
This diff is collapsed.
...@@ -565,7 +565,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -565,7 +565,6 @@ schedule_ue_spec(module_id_t module_idP,
dl_Bandwidth = cc[CC_id].mib->message.dl_Bandwidth; dl_Bandwidth = cc[CC_id].mib->message.dl_Bandwidth;
N_RB_DL[CC_id] = to_prb(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 // get number of PRBs less those used by common channels
total_nb_available_rb[CC_id] = N_RB_DL[CC_id]; total_nb_available_rb[CC_id] = N_RB_DL[CC_id];
...@@ -622,7 +621,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -622,7 +621,6 @@ schedule_ue_spec(module_id_t module_idP,
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d UE %d\n", LOG_D(MAC, "doing schedule_ue_spec for CC_id %d UE %d\n",
CC_id, CC_id,
UE_id); UE_id);
continue_flag = 0; // reset the flag to allow allocation for the remaining UEs continue_flag = 0; // reset the flag to allow allocation for the remaining UEs
rnti = UE_RNTI(module_idP, UE_id); rnti = UE_RNTI(module_idP, UE_id);
ue_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id]; ue_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
...@@ -776,6 +774,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -776,6 +774,7 @@ schedule_ue_spec(module_id_t module_idP,
if (ue_sched_ctrl->cdrx_configured) { if (ue_sched_ctrl->cdrx_configured) {
ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission ue_sched_ctrl->drx_retransmission_timer[harq_pid] = 0; // stop drx retransmission
/* /*
* Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop. * Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop.
*/ */
...@@ -1011,9 +1010,10 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1011,9 +1010,10 @@ schedule_ue_spec(module_id_t module_idP,
); );
if((rrc_release_info.num_UEs > 0) && (rlc_am_mui.rrc_mui_num > 0)) { if((rrc_release_info.num_UEs > 0) && (rlc_am_mui.rrc_mui_num > 0)) {
while(pthread_mutex_trylock(&rrc_release_freelist)){ while(pthread_mutex_trylock(&rrc_release_freelist)) {
/* spin... */ /* spin... */
} }
uint16_t release_total = 0; uint16_t release_total = 0;
for (release_num = 0, release_ctrl = &rrc_release_info.RRC_release_ctrl[0]; for (release_num = 0, release_ctrl = &rrc_release_info.RRC_release_ctrl[0];
...@@ -1060,10 +1060,10 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1060,10 +1060,10 @@ schedule_ue_spec(module_id_t module_idP,
if(release_total >= rrc_release_info.num_UEs) if(release_total >= rrc_release_info.num_UEs)
break; break;
} }
pthread_mutex_unlock(&rrc_release_freelist); pthread_mutex_unlock(&rrc_release_freelist);
} }
for (ra_ii = 0, ra = &eNB->common_channels[CC_id].ra[0]; ra_ii < NB_RA_PROC_MAX; ra_ii++, ra++) { for (ra_ii = 0, ra = &eNB->common_channels[CC_id].ra[0]; ra_ii < NB_RA_PROC_MAX; ra_ii++, ra++) {
if ((ra->rnti == rnti) && (ra->state == MSGCRNTI)) { if ((ra->rnti == rnti) && (ra->state == MSGCRNTI)) {
for (uint16_t mui_num = 0; mui_num < rlc_am_mui.rrc_mui_num; mui_num++) { for (uint16_t mui_num = 0; mui_num < rlc_am_mui.rrc_mui_num; mui_num++) {
...@@ -1254,7 +1254,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1254,7 +1254,6 @@ schedule_ue_spec(module_id_t module_idP,
header_length_total += header_length_last; header_length_total += header_length_last;
num_sdus++; num_sdus++;
ue_sched_ctrl->uplane_inactivity_timer = 0; ue_sched_ctrl->uplane_inactivity_timer = 0;
// reset RRC inactivity timer after uplane activity // reset RRC inactivity timer after uplane activity
ue_contextP = rrc_eNB_get_ue_context(RC.rrc[module_idP], rnti); ue_contextP = rrc_eNB_get_ue_context(RC.rrc[module_idP], rnti);
...@@ -1433,7 +1432,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1433,7 +1432,6 @@ schedule_ue_spec(module_id_t module_idP,
eNB->subframe, eNB->subframe,
0, 0,
0); 0);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T(T_ENB_MAC_UE_DL_PDU_WITH_DATA,
T_INT(module_idP), T_INT(module_idP),
T_INT(CC_id), T_INT(CC_id),
...@@ -1569,7 +1567,6 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1569,7 +1567,6 @@ schedule_ue_spec(module_id_t module_idP,
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG; dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
eNB->DL_req[CC_id].sfn_sf = frameP << 4 | subframeP; eNB->DL_req[CC_id].sfn_sf = frameP << 4 | subframeP;
eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST; eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST;
/* CDRX */ /* CDRX */
ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer ue_sched_ctrl->harq_rtt_timer[CC_id][harq_pid] = 1; // restart HARQ RTT timer
...@@ -1580,6 +1577,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1580,6 +1577,7 @@ schedule_ue_spec(module_id_t module_idP,
* Note: contrary to the spec drx_retransmission_timer[harq_pid] is reset not stop. * 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); 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) { 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]); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DRX_RETRANSMISSION_HARQ0, (unsigned long) ue_sched_ctrl->drx_retransmission_timer[0]);
} }
...@@ -2346,7 +2344,6 @@ schedule_ue_spec_br(module_id_t module_idP, ...@@ -2346,7 +2344,6 @@ schedule_ue_spec_br(module_id_t module_idP,
mac->subframe, mac->subframe,
0, 0,
0); 0);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T(T_ENB_MAC_UE_DL_PDU_WITH_DATA,
T_INT(module_idP), T_INT(module_idP),
T_INT(CC_id), T_INT(CC_id),
...@@ -2539,7 +2536,6 @@ schedule_ue_spec_br(module_id_t module_idP, ...@@ -2539,7 +2536,6 @@ schedule_ue_spec_br(module_id_t module_idP,
T_INT (subframeP), T_INT (subframeP),
T_INT (0 /* harq_pid always 0? */ ), T_INT (0 /* harq_pid always 0? */ ),
T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0], TX_req->pdu_length)); T_BUFFER (&mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0], TX_req->pdu_length));
trace_pdu(1, trace_pdu(1,
(uint8_t *) mac->UE_list.DLSCH_pdu[CC_id][0][(unsigned char) UE_id].payload[0], (uint8_t *) mac->UE_list.DLSCH_pdu[CC_id][0][(unsigned char) UE_id].payload[0],
TX_req->pdu_length, TX_req->pdu_length,
...@@ -3165,7 +3161,6 @@ schedule_PCH(module_id_t module_idP, ...@@ -3165,7 +3161,6 @@ schedule_PCH(module_id_t module_idP,
eNB->subframe, eNB->subframe,
0, 0,
0); 0);
eNB->eNB_stats[CC_id].total_num_pcch_pdu++; eNB->eNB_stats[CC_id].total_num_pcch_pdu++;
eNB->eNB_stats[CC_id].pcch_buffer = pcch_sdu_length; eNB->eNB_stats[CC_id].pcch_buffer = pcch_sdu_length;
eNB->eNB_stats[CC_id].total_pcch_buffer += pcch_sdu_length; eNB->eNB_stats[CC_id].total_pcch_buffer += pcch_sdu_length;
......
...@@ -644,16 +644,18 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id, ...@@ -644,16 +644,18 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
// Get total available RBS count and total UE count // Get total available RBS count and total UE count
N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth); N_RB_DL = to_prb(cc->mib->message.dl_Bandwidth);
temp_total_rbs_count = 0; temp_total_rbs_count = 0;
for(uint8_t rbg_i = 0;rbg_i < N_RBG[CC_id];rbg_i++ ){
if(rballoc_sub[CC_id][rbg_i] == 0){ for(uint8_t rbg_i = 0; rbg_i < N_RBG[CC_id]; rbg_i++ ) {
if(rballoc_sub[CC_id][rbg_i] == 0) {
if((rbg_i == N_RBG[CC_id] -1) && if((rbg_i == N_RBG[CC_id] -1) &&
((N_RB_DL == 25) || (N_RB_DL == 50))){ ((N_RB_DL == 25) || (N_RB_DL == 50))) {
temp_total_rbs_count += (min_rb_unit[CC_id] -1); temp_total_rbs_count += (min_rb_unit[CC_id] -1);
}else{ } else {
temp_total_rbs_count += min_rb_unit[CC_id]; temp_total_rbs_count += min_rb_unit[CC_id];
} }
} }
} }
temp_total_ue_count = dlsch_ue_select[CC_id].ue_num; temp_total_ue_count = dlsch_ue_select[CC_id].ue_num;
for (i = 0; i < dlsch_ue_select[CC_id].ue_num; i++) { for (i = 0; i < dlsch_ue_select[CC_id].ue_num; i++) {
...@@ -1305,10 +1307,11 @@ schedule_ue_spec_fairRR(module_id_t module_idP, ...@@ -1305,10 +1307,11 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
#endif #endif
); );
if((rrc_release_info.num_UEs > 0) && (rlc_am_mui.rrc_mui_num > 0)){ if((rrc_release_info.num_UEs > 0) && (rlc_am_mui.rrc_mui_num > 0)) {
while(pthread_mutex_trylock(&rrc_release_freelist)) { while(pthread_mutex_trylock(&rrc_release_freelist)) {
/* spin... */ /* spin... */
} }
uint16_t release_total = 0; uint16_t release_total = 0;
for(uint16_t release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) { for(uint16_t release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) {
...@@ -1345,6 +1348,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP, ...@@ -1345,6 +1348,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
if(release_total >= rrc_release_info.num_UEs) if(release_total >= rrc_release_info.num_UEs)
break; break;
} }
pthread_mutex_unlock(&rrc_release_freelist); pthread_mutex_unlock(&rrc_release_freelist);
} }
...@@ -1706,7 +1710,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP, ...@@ -1706,7 +1710,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], trace_pdu(DIRECTION_DOWNLINK, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
TBS, module_idP, WS_RA_RNTI, UE_RNTI(module_idP, UE_id), TBS, module_idP, WS_RA_RNTI, UE_RNTI(module_idP, UE_id),
eNB->frame, eNB->subframe,0,0); eNB->frame, eNB->subframe,0,0);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_BUFFER(UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS)); T_INT(harq_pid), T_BUFFER(UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS));
UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
...@@ -2048,6 +2051,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2048,6 +2051,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi];
format_flag = 2; format_flag = 2;
aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format0); aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format0);
if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) { if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) {
cc_id_flag[CC_id] = 1; cc_id_flag[CC_id] = 1;
continue; continue;
...@@ -2127,6 +2131,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2127,6 +2131,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
format_flag = 2; format_flag = 2;
rnti = UE_RNTI(module_idP,first_ue_id[CC_id][temp]); rnti = UE_RNTI(module_idP,first_ue_id[CC_id][temp]);
aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[first_ue_id[CC_id][temp]].dl_cqi[CC_id],format0); aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[first_ue_id[CC_id][temp]].dl_cqi[CC_id],format0);
if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) { if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) {
cc_id_flag[CC_id] = 1; cc_id_flag[CC_id] = 1;
break; break;
...@@ -2199,6 +2204,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2199,6 +2204,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi]; hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi];
format_flag = 2; format_flag = 2;
aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format0); aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id],format0);
if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) { if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) {
cc_id_flag[CC_id] = 1; cc_id_flag[CC_id] = 1;
continue; continue;
...@@ -2252,6 +2258,7 @@ void ulsch_scheduler_pre_ue_select_fairRR( ...@@ -2252,6 +2258,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
format_flag = 2; format_flag = 2;
rnti = UE_RNTI(module_idP,ul_inactivity_id[CC_id][temp]); rnti = UE_RNTI(module_idP,ul_inactivity_id[CC_id][temp]);
aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[ul_inactivity_id[CC_id][temp]].dl_cqi[CC_id],format0); aggregation=get_aggregation(get_bw_index(module_idP,CC_id),UE_list->UE_sched_ctrl[ul_inactivity_id[CC_id][temp]].dl_cqi[CC_id],format0);
if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) { if (CCE_allocation_infeasible(module_idP,CC_id,format_flag,subframeP,aggregation,rnti) == 1) {
cc_id_flag[CC_id] = 1; cc_id_flag[CC_id] = 1;
continue; continue;
...@@ -2450,13 +2457,13 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP, ...@@ -2450,13 +2457,13 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
UE_list->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = mcs; UE_list->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = mcs;
} }
} else { } else {
if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED){ if (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) {
// assigne RBS( 6 RBs) // assigne RBS( 6 RBs)
first_rb[CC_id] = first_rb[CC_id] + 6; first_rb[CC_id] = first_rb[CC_id] + 6;
UE_list->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul[0] = 6; UE_list->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul[0] = 6;
UE_list->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 5; UE_list->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 5;
UE_list->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10; UE_list->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
}else{ } else {
// assigne RBS( 3 RBs) // assigne RBS( 3 RBs)
first_rb[CC_id] = first_rb[CC_id] + 3; first_rb[CC_id] = first_rb[CC_id] + 3;
UE_list->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul[0] = 3; UE_list->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul[0] = 3;
...@@ -3043,7 +3050,6 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, ...@@ -3043,7 +3050,6 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d)\n", LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, TBS %d, harq_pid %d)\n",
module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs_rv,first_rb[CC_id],ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb,UE_template->TBS_UL[harq_pid],harq_pid); module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs_rv,first_rb[CC_id],ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb,UE_template->TBS_UL[harq_pid],harq_pid);
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB) // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
//store for possible retransmission //store for possible retransmission
UE_template->nb_rb_ul[harq_pid] = ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb; UE_template->nb_rb_ul[harq_pid] = ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb;
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#include "assertions.h" #include "assertions.h"
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
#include "intertask_interface.h" #include "intertask_interface.h"
#endif #endif
#include "SIMULATION/TOOLS/sim.h" // for taus #include "SIMULATION/TOOLS/sim.h" // for taus
...@@ -62,8 +62,7 @@ extern RAN_CONTEXT_t RC; ...@@ -62,8 +62,7 @@ extern RAN_CONTEXT_t RC;
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
int8_t int8_t
get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id, get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id,
uint8_t mbsfn_sync_area) uint8_t mbsfn_sync_area) {
{
// currently there is one-to-one mapping between sf allocation pattern and sync area // currently there is one-to-one mapping between sf allocation pattern and sync area
if (mbsfn_sync_area >= MAX_MBSFN_AREA) { if (mbsfn_sync_area >= MAX_MBSFN_AREA) {
LOG_W(MAC, LOG_W(MAC,
...@@ -84,9 +83,7 @@ get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id, ...@@ -84,9 +83,7 @@ get_mbsfn_sf_alloction(module_id_t module_idP, uint8_t CC_id,
int int
schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
sub_frame_t subframeP) sub_frame_t subframeP) {
{
int mcch_flag = 0, mtch_flag = 0, msi_flag = 0; int mcch_flag = 0, mtch_flag = 0, msi_flag = 0;
int mbsfn_period = 0; // 1<<(RC.mac[module_idP]->mbsfn_SubframeConfig[0]->radioframeAllocationPeriod); int mbsfn_period = 0; // 1<<(RC.mac[module_idP]->mbsfn_SubframeConfig[0]->radioframeAllocationPeriod);
int mcch_period = 0; //32<<(RC.mac[module_idP]->mbsfn_AreaInfo[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9); int mcch_period = 0; //32<<(RC.mac[module_idP]->mbsfn_AreaInfo[0]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
...@@ -106,9 +103,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -106,9 +103,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
unsigned char sdu_lcids[11], num_sdus = 0, offset = 0; unsigned char sdu_lcids[11], num_sdus = 0, offset = 0;
uint16_t sdu_lengths[11], sdu_length_total = 0; uint16_t sdu_lengths[11], sdu_length_total = 0;
unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only unsigned char mch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; // check the max value, this is for dlsch only
COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id];
cc->MCH_pdu.Pdu_size = 0; cc->MCH_pdu.Pdu_size = 0;
for (i = 0; i < cc->num_active_mbsfn_area; i++) { for (i = 0; i < cc->num_active_mbsfn_area; i++) {
...@@ -130,7 +125,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -130,7 +125,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
cc->num_active_mbsfn_area, j, cc->num_sf_allocation_pattern, cc->num_active_mbsfn_area, j, cc->num_sf_allocation_pattern,
mbsfn_period, mcch_period); mbsfn_period, mcch_period);
switch (cc->mbsfn_AreaInfo[i]->mcch_Config_r9.signallingMCS_r9) { switch (cc->mbsfn_AreaInfo[i]->mcch_Config_r9.signallingMCS_r9) {
case 0: case 0:
mcch_mcs = 2; mcch_mcs = 2;
...@@ -171,6 +165,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -171,6 +165,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
subframeAllocation.choice.oneFrame.buf[0], subframeAllocation.choice.oneFrame.buf[0],
msi_pos); msi_pos);
} }
// Check if the subframeP is for MSI, MCCH or MTCHs and Set the correspoding flag to 1 // Check if the subframeP is for MSI, MCCH or MTCHs and Set the correspoding flag to 1
switch (subframeP) { switch (subframeP) {
case 1: case 1:
...@@ -480,13 +475,13 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -480,13 +475,13 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
} else if (mtch_flag == 1) { // only MTCH in this subframeP } else if (mtch_flag == 1) { // only MTCH in this subframeP
cc->MCH_pdu.mcs = cc->pmch_Config[0]->dataMCS_r9; cc->MCH_pdu.mcs = cc->pmch_Config[0]->dataMCS_r9;
} }
// 2nd: Create MSI, get MCCH from RRC and MTCHs from RLC // 2nd: Create MSI, get MCCH from RRC and MTCHs from RLC
// there is MSI (MCH Scheduling Info) // there is MSI (MCH Scheduling Info)
if (msi_flag == 1) { if (msi_flag == 1) {
// Create MSI here // Create MSI here
uint16_t msi_control_element[29], *msi_ptr; uint16_t msi_control_element[29], *msi_ptr;
msi_ptr = &msi_control_element[0]; msi_ptr = &msi_control_element[0];
((MSI_ELEMENT *) msi_ptr)->lcid = MCCH_LCHANID; //MCCH ((MSI_ELEMENT *) msi_ptr)->lcid = MCCH_LCHANID; //MCCH
...@@ -499,7 +494,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -499,7 +494,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
} }
msi_ptr += sizeof(MSI_ELEMENT); msi_ptr += sizeof(MSI_ELEMENT);
//Header for MTCHs //Header for MTCHs
num_mtch = cc->mbms_SessionList[0]->list.count; num_mtch = cc->mbms_SessionList[0]->list.count;
...@@ -522,12 +516,10 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -522,12 +516,10 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
"[eNB %d] CC_id %d Frame %d : MSI->MCH, length of MSI is %d bytes \n", "[eNB %d] CC_id %d Frame %d : MSI->MCH, length of MSI is %d bytes \n",
module_idP, CC_id, frameP, msi_length); module_idP, CC_id, frameP, msi_length);
//LOG_D(MAC,"Scheduler: MSI is transmitted in this subframeP \n" ); //LOG_D(MAC,"Scheduler: MSI is transmitted in this subframeP \n" );
// LOG_D(MAC,"Scheduler: MSI length is %d bytes\n",msi_length); // LOG_D(MAC,"Scheduler: MSI length is %d bytes\n",msi_length);
// Store MSI data to mch_buffer[0] // Store MSI data to mch_buffer[0]
memcpy((char *) &mch_buffer[sdu_length_total], memcpy((char *) &mch_buffer[sdu_length_total],
msi_control_element, msi_length); msi_control_element, msi_length);
sdu_lcids[num_sdus] = MCH_SCHDL_INFO; sdu_lcids[num_sdus] = MCH_SCHDL_INFO;
sdu_lengths[num_sdus] = msi_length; sdu_lengths[num_sdus] = msi_length;
sdu_length_total += sdu_lengths[num_sdus]; sdu_length_total += sdu_lengths[num_sdus];
...@@ -536,12 +528,12 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -536,12 +528,12 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
num_sdus++; num_sdus++;
cc->msi_active = 1; cc->msi_active = 1;
} }
// there is MCCH // there is MCCH
if (mcch_flag == 1) { if (mcch_flag == 1) {
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d Subframe %d: Schedule MCCH MESSAGE (area %d, sfAlloc %d)\n", "[eNB %d] CC_id %d Frame %d Subframe %d: Schedule MCCH MESSAGE (area %d, sfAlloc %d)\n",
module_idP, CC_id, frameP, subframeP, i, j); module_idP, CC_id, frameP, subframeP, i, j);
mcch_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, MCCH, 0xFFFC, 1, &cc->MCCH_pdu.payload[0], mcch_sdu_length = mac_rrc_data_req(module_idP, CC_id, frameP, MCCH, 0xFFFC, 1, &cc->MCCH_pdu.payload[0],
i); // this is the mbsfn sync area index i); // this is the mbsfn sync area index
...@@ -549,7 +541,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -549,7 +541,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d subframeP %d : MCCH->MCH, Received %d bytes from RRC \n", "[eNB %d] CC_id %d Frame %d subframeP %d : MCCH->MCH, Received %d bytes from RRC \n",
module_idP, CC_id, frameP, subframeP, mcch_sdu_length); module_idP, CC_id, frameP, subframeP, mcch_sdu_length);
header_len_mcch = 2; header_len_mcch = 2;
if (cc->tdd_Config != NULL) { if (cc->tdd_Config != NULL) {
...@@ -565,7 +556,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -565,7 +556,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
} }
cc->mcch_active = 1; cc->mcch_active = 1;
memcpy((char *) &mch_buffer[sdu_length_total], memcpy((char *) &mch_buffer[sdu_length_total],
&cc->MCCH_pdu.payload[0], mcch_sdu_length); &cc->MCCH_pdu.payload[0], mcch_sdu_length);
sdu_lcids[num_sdus] = MCCH_LCHANID; sdu_lcids[num_sdus] = MCCH_LCHANID;
...@@ -614,19 +604,16 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -614,19 +604,16 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer); printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer);
*/ */
// get MTCH data from RLC (like for DTCH) // get MTCH data from RLC (like for DTCH)
LOG_D(MAC, LOG_D(MAC,
"[eNB %d] CC_id %d Frame %d subframeP %d: Schedule MTCH (area %d, sfAlloc %d)\n", "[eNB %d] CC_id %d Frame %d subframeP %d: Schedule MTCH (area %d, sfAlloc %d)\n",
module_idP, CC_id, frameP, subframeP, i, j); module_idP, CC_id, frameP, subframeP, i, j);
header_len_mtch = 3; header_len_mtch = 3;
LOG_D(MAC, LOG_D(MAC,
"[eNB %d], CC_id %d, Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n", "[eNB %d], CC_id %d, Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n",
module_idP, CC_id, frameP, MTCH, TBS, module_idP, CC_id, frameP, MTCH, TBS,
TBS - header_len_mcch - header_len_msi - sdu_length_total - TBS - header_len_mcch - header_len_msi - sdu_length_total -
header_len_mtch); header_len_mtch);
rlc_status = rlc_status =
mac_rlc_status_ind(module_idP, 0, frameP, subframeP, mac_rlc_status_ind(module_idP, 0, frameP, subframeP,
module_idP, ENB_FLAG_YES, MBMS_FLAG_YES, module_idP, ENB_FLAG_YES, MBMS_FLAG_YES,
...@@ -637,7 +624,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -637,7 +624,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
,0, 0 ,0, 0
#endif #endif
); );
LOG_D(MAC, LOG_D(MAC,
"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n", "e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",
MTCH, frameP, subframeP, rlc_status.bytes_in_buffer); MTCH, frameP, subframeP, rlc_status.bytes_in_buffer);
...@@ -648,7 +634,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -648,7 +634,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
module_idP, CC_id, frameP, module_idP, CC_id, frameP,
TBS - header_len_mcch - header_len_msi - TBS - header_len_mcch - header_len_msi -
sdu_length_total - header_len_mtch, header_len_mtch); sdu_length_total - header_len_mtch, header_len_mtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_YES, MTCH, 0, //not used sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_YES, MTCH, 0, //not used
(char *) (char *)
&mch_buffer[sdu_length_total] &mch_buffer[sdu_length_total]
...@@ -657,8 +642,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -657,8 +642,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
0 0
#endif #endif
); );
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(MAX_MOBILES_PER_ENB+1)), (char*)&mch_buffer[sdu_length_total]); //sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(MAX_MOBILES_PER_ENB+1)), (char*)&mch_buffer[sdu_length_total]);
LOG_I(MAC, LOG_I(MAC,
"[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n", "[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n",
...@@ -676,6 +659,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -676,6 +659,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
header_len_mtch = 0; header_len_mtch = 0;
} }
} }
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
// } // }
#endif #endif
...@@ -711,8 +695,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -711,8 +695,7 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
header_len_mtch + header_len_mcch + header_len_msi + header_len_mtch + header_len_mcch + header_len_msi +
sdu_length_total); sdu_length_total);
return 0; return 0;
} else } else if ((TBS - header_len_mtch - header_len_mcch - header_len_msi -
if ((TBS - header_len_mtch - header_len_mcch - header_len_msi -
sdu_length_total) <= 2) { sdu_length_total) <= 2) {
padding = padding =
(TBS - header_len_mtch - header_len_mcch - header_len_msi - (TBS - header_len_mtch - header_len_mcch - header_len_msi -
...@@ -740,7 +723,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -740,7 +723,6 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
31, // no timing advance 31, // no timing advance
NULL, // no contention res id NULL, // no contention res id
padding, post_padding); padding, post_padding);
cc->MCH_pdu.Pdu_size = TBS; cc->MCH_pdu.Pdu_size = TBS;
cc->MCH_pdu.sync_area = i; cc->MCH_pdu.sync_area = i;
cc->MCH_pdu.msi_active = cc->msi_active; cc->MCH_pdu.msi_active = cc->msi_active;
...@@ -766,10 +748,9 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -766,10 +748,9 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
} }
/* Tracing of PDU is done on UE side */ /* Tracing of PDU is done on UE side */
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) cc->MCH_pdu.payload, TBS, module_idP, WS_M_RNTI , 0xffff, // M_RNTI = 6 in wirehsark trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) cc->MCH_pdu.payload, TBS, module_idP, WS_M_RNTI, 0xffff, // M_RNTI = 6 in wirehsark
RC.mac[module_idP]->frame, RC.mac[module_idP]->frame,
RC.mac[module_idP]->subframe, 0, 0); RC.mac[module_idP]->subframe, 0, 0);
/* /*
for (j=0;j<sdu_length_total;j++) for (j=0;j<sdu_length_total;j++)
printf("%2x.",RC.mac[module_idP]->MCH_pdu.payload[j+offset]); printf("%2x.",RC.mac[module_idP]->MCH_pdu.payload[j+offset]);
...@@ -799,11 +780,10 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, ...@@ -799,11 +780,10 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
} }
MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
sub_frame_t subframeP) sub_frame_t subframeP) {
{
// RC.mac[module_idP]->MCH_pdu.mcs=0; // RC.mac[module_idP]->MCH_pdu.mcs=0;
//LOG_D(MAC," MCH_pdu.mcs is %d\n", RC.mac[module_idP]->MCH_pdu.mcs); //LOG_D(MAC," MCH_pdu.mcs is %d\n", RC.mac[module_idP]->MCH_pdu.mcs);
//#warning "MCH pdu should take the CC_id index" //#warning "MCH pdu should take the CC_id index"
return (&RC.mac[module_idP]->common_channels[CC_id].MCH_pdu); return (&RC.mac[module_idP]->common_channels[CC_id].MCH_pdu);
} }
......
This diff is collapsed.
...@@ -255,7 +255,6 @@ Msg1_transmitted(module_id_t module_idP, uint8_t CC_id, ...@@ -255,7 +255,6 @@ Msg1_transmitted(module_id_t module_idP, uint8_t CC_id,
"Transmission on secondary CCs is not supported yet\n"); "Transmission on secondary CCs is not supported yet\n");
// start contention resolution timer // start contention resolution timer
UE_mac_inst[module_idP].RA_attempt_number++; UE_mac_inst[module_idP].RA_attempt_number++;
trace_pdu(DIRECTION_UPLINK, NULL, 0, module_idP, WS_NO_RNTI, trace_pdu(DIRECTION_UPLINK, NULL, 0, module_idP, WS_NO_RNTI,
UE_mac_inst[module_idP].RA_prach_resources. UE_mac_inst[module_idP].RA_prach_resources.
ra_PreambleIndex, UE_mac_inst[module_idP].txFrame, ra_PreambleIndex, UE_mac_inst[module_idP].txFrame,
...@@ -275,7 +274,6 @@ Msg3_transmitted(module_id_t module_idP, uint8_t CC_id, ...@@ -275,7 +274,6 @@ Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
module_idP, frameP); module_idP, frameP);
UE_mac_inst[module_idP].RA_contention_resolution_cnt = 0; UE_mac_inst[module_idP].RA_contention_resolution_cnt = 0;
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 1; UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 1;
trace_pdu(DIRECTION_UPLINK, &UE_mac_inst[module_idP].CCCH_pdu.payload[0], trace_pdu(DIRECTION_UPLINK, &UE_mac_inst[module_idP].CCCH_pdu.payload[0],
UE_mac_inst[module_idP].RA_Msg3_size, module_idP, WS_C_RNTI, UE_mac_inst[module_idP].RA_Msg3_size, module_idP, WS_C_RNTI,
UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].crnti,
......
...@@ -50,17 +50,14 @@ extern RAN_CONTEXT_t RC; ...@@ -50,17 +50,14 @@ extern RAN_CONTEXT_t RC;
unsigned short unsigned short
fill_rar(const module_id_t module_idP, fill_rar(const module_id_t module_idP,
const int CC_id, const int CC_id,
RA_t * ra, RA_t *ra,
const frame_t frameP, const frame_t frameP,
uint8_t * const dlsch_buffer, uint8_t *const dlsch_buffer,
const uint16_t N_RB_UL, const uint8_t input_buffer_length) const uint16_t N_RB_UL, const uint8_t input_buffer_length)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer; RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer;
uint8_t *rar = (uint8_t *) (dlsch_buffer + 1); uint8_t *rar = (uint8_t *) (dlsch_buffer + 1);
// subheader fixed // subheader fixed
rarh->E = 0; // First and last RAR rarh->E = 0; // First and last RAR
rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader
...@@ -72,15 +69,17 @@ fill_rar(const module_id_t module_idP, ...@@ -72,15 +69,17 @@ fill_rar(const module_id_t module_idP,
rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4 rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4
rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4 rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4
COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id]; COMMON_channels_t *cc = &RC.mac[module_idP]->common_channels[CC_id];
if(N_RB_UL == 25){
if(N_RB_UL == 25) {
ra->msg3_first_rb = 1; ra->msg3_first_rb = 1;
}else{ } else {
if (cc->tdd_Config && N_RB_UL == 100) { if (cc->tdd_Config && N_RB_UL == 100) {
ra->msg3_first_rb = 3; ra->msg3_first_rb = 3;
} else { } else {
ra->msg3_first_rb = 2; ra->msg3_first_rb = 2;
} }
} }
ra->msg3_nb_rb = 1; ra->msg3_nb_rb = 1;
uint16_t rballoc = mac_computeRIV(N_RB_UL, ra->msg3_first_rb, ra->msg3_nb_rb); // first PRB only for UL Grant uint16_t rballoc = mac_computeRIV(N_RB_UL, ra->msg3_first_rb, ra->msg3_nb_rb); // first PRB only for UL Grant
rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc
...@@ -94,8 +93,7 @@ fill_rar(const module_id_t module_idP, ...@@ -94,8 +93,7 @@ fill_rar(const module_id_t module_idP,
rar[3] = rar[3] =
(((ra->msg3_mcs & 0x7) << 5)) | ((ra->msg3_TPC & 7) << 2) | (((ra->msg3_mcs & 0x7) << 5)) | ((ra->msg3_TPC & 7) << 2) |
((ra->msg3_ULdelay & 1) << 1) | (ra->msg3_cqireq & 1); ((ra->msg3_ULdelay & 1) << 1) | (ra->msg3_cqireq & 1);
trace_pdu(DIRECTION_DOWNLINK, dlsch_buffer, input_buffer_length, module_idP, WS_RA_RNTI, 1,
trace_pdu(DIRECTION_DOWNLINK , dlsch_buffer, input_buffer_length, module_idP, WS_RA_RNTI , 1,
RC.mac[module_idP]->frame, RC.mac[module_idP]->subframe, RC.mac[module_idP]->frame, RC.mac[module_idP]->subframe,
0, 0); 0, 0);
return (ra->rnti); return (ra->rnti);
...@@ -111,14 +109,13 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -111,14 +109,13 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
RA_t *ra, RA_t *ra,
const frame_t frameP, const frame_t frameP,
const sub_frame_t subframeP, const sub_frame_t subframeP,
uint8_t* const dlsch_buffer, uint8_t *const dlsch_buffer,
const uint8_t ce_level) const uint8_t ce_level)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer; RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer;
COMMON_channels_t *cc = &eNB->common_channels[CC_id]; COMMON_channels_t *cc = &eNB->common_channels[CC_id];
uint8_t *rar = (uint8_t *)(dlsch_buffer + 1); uint8_t *rar = (uint8_t *)(dlsch_buffer + 1);
uint32_t rballoc = 0; uint32_t rballoc = 0;
uint32_t ULdelay = 0; uint32_t ULdelay = 0;
uint32_t cqireq = 0; uint32_t cqireq = 0;
...@@ -126,20 +123,16 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -126,20 +123,16 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
uint32_t TPC = 0; uint32_t TPC = 0;
int input_buffer_length = 0; int input_buffer_length = 0;
int N_NB_index = 0; int N_NB_index = 0;
AssertFatal(ra != NULL, "RA is null \n"); AssertFatal(ra != NULL, "RA is null \n");
/* Subheader fixed */ /* Subheader fixed */
rarh->E = 0; // First and last RAR rarh->E = 0; // First and last RAR
rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader
rarh->RAPID = ra->preamble_index; // Respond to Preamble rarh->RAPID = ra->preamble_index; // Respond to Preamble
/* RAR PDU */ /* RAR PDU */
/* TA Command */ /* TA Command */
ra->timing_offset /= 16; // T_A = N_TA/16, where N_TA should be on a 30.72Msps ra->timing_offset /= 16; // T_A = N_TA/16, where N_TA should be on a 30.72Msps
rar[0] = (uint8_t) (ra->timing_offset >> 4) & 0x7f; // 7 MSBs of timing advance rar[0] = (uint8_t) (ra->timing_offset >> 4) & 0x7f; // 7 MSBs of timing advance
rar[1] = (uint8_t) (ra->timing_offset & 0x0f) << 4; // 4 LSBs of timing advance rar[1] = (uint8_t) (ra->timing_offset & 0x0f) << 4; // 4 LSBs of timing advance
/* Copy the Msg2 narrowband */ /* Copy the Msg2 narrowband */
ra->msg34_narrowband = ra->msg2_narrowband; ra->msg34_narrowband = ra->msg2_narrowband;
ra->msg3_first_rb = 0; ra->msg3_first_rb = 0;
...@@ -147,9 +140,7 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -147,9 +140,7 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
if (ce_level < 2) { // CE Level 0, 1 (CEmodeA) if (ce_level < 2) { // CE Level 0, 1 (CEmodeA)
input_buffer_length = 6; input_buffer_length = 6;
N_NB_index = get_numnarrowbandbits(cc->mib->message.dl_Bandwidth); N_NB_index = get_numnarrowbandbits(cc->mib->message.dl_Bandwidth);
/* UL Grant */ /* UL Grant */
ra->msg3_mcs = 7; ra->msg3_mcs = 7;
TPC = 3; // no power increase TPC = 3; // no power increase
...@@ -157,7 +148,6 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -157,7 +148,6 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
cqireq = 0; cqireq = 0;
mpdcch_nb_index = 0; mpdcch_nb_index = 0;
rballoc = mac_computeRIV(6, ra->msg3_first_rb, ra->msg3_nb_rb); rballoc = mac_computeRIV(6, ra->msg3_first_rb, ra->msg3_nb_rb);
uint32_t buffer = 0; uint32_t buffer = 0;
buffer |= ra->msg34_narrowband << (16 + (4 - N_NB_index)); buffer |= ra->msg34_narrowband << (16 + (4 - N_NB_index));
buffer |= ((rballoc & 0x0F) << (12 + (4 - N_NB_index))); buffer |= ((rballoc & 0x0F) << (12 + (4 - N_NB_index)));
...@@ -167,21 +157,15 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -167,21 +157,15 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
buffer |= ((cqireq & 0x01) << (3 + (4 - N_NB_index))); buffer |= ((cqireq & 0x01) << (3 + (4 - N_NB_index)));
buffer |= ((ULdelay & 0x01) << (2 + (4 - N_NB_index))); buffer |= ((ULdelay & 0x01) << (2 + (4 - N_NB_index)));
buffer |= (mpdcch_nb_index << (4 - N_NB_index)); buffer |= (mpdcch_nb_index << (4 - N_NB_index));
rar[1] |= (uint8_t) (buffer >> 16) & 0x0F; rar[1] |= (uint8_t) (buffer >> 16) & 0x0F;
rar[2] = (uint8_t) (buffer >> 8) & 0xFF; rar[2] = (uint8_t) (buffer >> 8) & 0xFF;
rar[3] = (uint8_t) buffer & 0xFF; rar[3] = (uint8_t) buffer & 0xFF;
/* RA CRNTI */ /* RA CRNTI */
rar[4] = (uint8_t)(ra->rnti >> 8); rar[4] = (uint8_t)(ra->rnti >> 8);
rar[5] = (uint8_t)(ra->rnti & 0xff); rar[5] = (uint8_t)(ra->rnti & 0xff);
} else { // CE level 2, 3 (CEModeB) } else { // CE level 2, 3 (CEModeB)
AssertFatal(1 == 0, "Shouldn't get here ...\n"); AssertFatal(1 == 0, "Shouldn't get here ...\n");
input_buffer_length = 5; input_buffer_length = 5;
rar[3] = (uint8_t)(ra->rnti >> 8); rar[3] = (uint8_t)(ra->rnti >> 8);
rar[4] = (uint8_t)(ra->rnti & 0xff); rar[4] = (uint8_t)(ra->rnti & 0xff);
} }
...@@ -189,7 +173,7 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -189,7 +173,7 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
LOG_I(MAC, "[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x, preamble %d/%d, TIMING OFFSET %d\n", LOG_I(MAC, "[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x, preamble %d/%d, TIMING OFFSET %d\n",
frameP, frameP,
subframeP, subframeP,
*(uint8_t*) rarh, *(uint8_t *) rarh,
rar[0], rar[0],
rar[1], rar[1],
rar[2], rar[2],
...@@ -201,7 +185,6 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -201,7 +185,6 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
rarh->RAPID, rarh->RAPID,
ra->preamble_index, ra->preamble_index,
ra->timing_offset); ra->timing_offset);
trace_pdu(DIRECTION_DOWNLINK, trace_pdu(DIRECTION_DOWNLINK,
dlsch_buffer, dlsch_buffer,
input_buffer_length, input_buffer_length,
...@@ -212,7 +195,6 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB, ...@@ -212,7 +195,6 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
eNB->subframe, eNB->subframe,
0, 0,
0); 0);
return (ra->rnti); return (ra->rnti);
} }
#endif #endif
......
...@@ -41,22 +41,23 @@ ...@@ -41,22 +41,23 @@
#define DEBUG_RAR #define DEBUG_RAR
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const frame_t frameP, const rnti_t ra_rnti, uint8_t * const dlsch_buffer, rnti_t * const t_crnti, const uint8_t preamble_index, uint8_t * selected_rar_buffer // output argument for storing the selected RAR header and RAR payload uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const frame_t frameP, const rnti_t ra_rnti, uint8_t *const dlsch_buffer, rnti_t *const t_crnti, const uint8_t preamble_index,
uint8_t *selected_rar_buffer // output argument for storing the selected RAR header and RAR payload
) )
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
uint16_t ret = 0; // return value uint16_t ret = 0; // return value
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer; RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer;
// RAR_PDU *rar = (RAR_PDU *)(dlsch_buffer+1); // RAR_PDU *rar = (RAR_PDU *)(dlsch_buffer+1);
uint8_t *rar = (uint8_t *) (dlsch_buffer + 1); uint8_t *rar = (uint8_t *) (dlsch_buffer + 1);
// get the last RAR payload for working with CMW500 // get the last RAR payload for working with CMW500
uint8_t n_rarpy = 0; // number of RAR payloads uint8_t n_rarpy = 0; // number of RAR payloads
uint8_t n_rarh = 0; // number of MAC RAR subheaders uint8_t n_rarh = 0; // number of MAC RAR subheaders
uint8_t best_rx_rapid = -1; // the closest RAPID receive from all RARs uint8_t best_rx_rapid = -1; // the closest RAPID receive from all RARs
while (1) { while (1) {
n_rarh++; n_rarh++;
if (rarh->T == 1) { if (rarh->T == 1) {
n_rarpy++; n_rarpy++;
LOG_D(MAC, "RAPID %d\n", rarh->RAPID); LOG_D(MAC, "RAPID %d\n", rarh->RAPID);
...@@ -84,6 +85,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra ...@@ -84,6 +85,7 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
rarh++; rarh++;
} }
}; };
LOG_D(MAC, "number of RAR subheader %d; number of RAR pyloads %d\n", LOG_D(MAC, "number of RAR subheader %d; number of RAR pyloads %d\n",
n_rarh, n_rarpy); n_rarh, n_rarpy);
...@@ -101,7 +103,6 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra ...@@ -101,7 +103,6 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
LOG_D(MAC, "[UE %d][RAPROC] rarh->T %d\n", module_idP, rarh->T); LOG_D(MAC, "[UE %d][RAPROC] rarh->T %d\n", module_idP, rarh->T);
LOG_D(MAC, "[UE %d][RAPROC] rarh->RAPID %d\n", module_idP, LOG_D(MAC, "[UE %d][RAPROC] rarh->RAPID %d\n", module_idP,
rarh->RAPID); rarh->RAPID);
// LOG_I(MAC,"[UE %d][RAPROC] rar->R %d\n",module_idP,rar->R); // LOG_I(MAC,"[UE %d][RAPROC] rar->R %d\n",module_idP,rar->R);
LOG_D(MAC, "[UE %d][RAPROC] rar->Timing_Advance_Command %d\n", LOG_D(MAC, "[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",
module_idP, (((uint16_t) (rar[0] & 0x7f)) << 4) + (rar[1] >> 4)); module_idP, (((uint16_t) (rar[0] & 0x7f)) << 4) + (rar[1] >> 4));
...@@ -114,7 +115,6 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra ...@@ -114,7 +115,6 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
LOG_D(MAC, "[UE %d][RAPROC] rar->t_crnti %x\n", module_idP, LOG_D(MAC, "[UE %d][RAPROC] rar->t_crnti %x\n", module_idP,
(uint16_t) rar[5] + (rar[4] << 8)); (uint16_t) rar[5] + (rar[4] << 8));
#endif #endif
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) dlsch_buffer, n_rarh + n_rarpy * 6, trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) dlsch_buffer, n_rarh + n_rarpy * 6,
module_idP, WS_RA_RNTI, ra_rnti, UE_mac_inst[module_idP].rxFrame, module_idP, WS_RA_RNTI, ra_rnti, UE_mac_inst[module_idP].rxFrame,
UE_mac_inst[module_idP].rxSubframe, 0, 0); UE_mac_inst[module_idP].rxSubframe, 0, 0);
...@@ -132,7 +132,5 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra ...@@ -132,7 +132,5 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
// move the selected RAR to the front of the RA_PDSCH buffer // move the selected RAR to the front of the RA_PDSCH buffer
memcpy(selected_rar_buffer + 0, (uint8_t *) rarh, 1); memcpy(selected_rar_buffer + 0, (uint8_t *) rarh, 1);
memcpy(selected_rar_buffer + 1, (uint8_t *) rar, 6); memcpy(selected_rar_buffer + 1, (uint8_t *) rar, 6);
return ret; return ret;
} }
...@@ -400,9 +400,7 @@ ue_send_sdu(module_id_t module_idP, ...@@ -400,9 +400,7 @@ ue_send_sdu(module_id_t module_idP,
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN); (VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN);
//LOG_D(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]); //LOG_D(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]);
trace_pdu(DIRECTION_DOWNLINK, sdu, sdu_len, module_idP, WS_C_RNTI, trace_pdu(DIRECTION_DOWNLINK, sdu, sdu_len, module_idP, WS_C_RNTI,
UE_mac_inst[module_idP].crnti, frameP, subframeP, 0, 0); UE_mac_inst[module_idP].crnti, frameP, subframeP, 0, 0);
payload_ptr = payload_ptr =
...@@ -591,17 +589,14 @@ ue_send_sdu(module_id_t module_idP, ...@@ -591,17 +589,14 @@ ue_send_sdu(module_id_t module_idP,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
void void
ue_decode_si_mbms(module_id_t module_idP, int CC_id, frame_t frameP, ue_decode_si_mbms(module_id_t module_idP, int CC_id, frame_t frameP,
uint8_t eNB_index, void *pdu, uint16_t len) uint8_t eNB_index, void *pdu, uint16_t len) {
{
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&UE_mac_inst[module_idP].rx_si); start_meas(&UE_mac_inst[module_idP].rx_si);
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN); (VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_IN);
LOG_D(MAC, "[UE %d] Frame %d Sending SI MBMS to RRC (LCID Id %d,len %d)\n", LOG_D(MAC, "[UE %d] Frame %d Sending SI MBMS to RRC (LCID Id %d,len %d)\n",
module_idP, frameP, BCCH, len); module_idP, frameP, BCCH, len);
mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe mac_rrc_data_ind_ue(module_idP, CC_id, frameP, 0, // unknown subframe
SI_RNTI, SI_RNTI,
BCCH_SI_MBMS, (uint8_t *) pdu, len, eNB_index, BCCH_SI_MBMS, (uint8_t *) pdu, len, eNB_index,
...@@ -641,7 +636,6 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -641,7 +636,6 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&UE_mac_inst[module_idP].rx_si); stop_meas(&UE_mac_inst[module_idP].rx_si);
#endif #endif
trace_pdu(DIRECTION_UPLINK, trace_pdu(DIRECTION_UPLINK,
(uint8_t *) pdu, (uint8_t *) pdu,
len, len,
...@@ -672,7 +666,6 @@ ue_decode_p(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -672,7 +666,6 @@ ue_decode_p(module_id_t module_idP, int CC_id, frame_t frameP,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&UE_mac_inst[module_idP].rx_p); stop_meas(&UE_mac_inst[module_idP].rx_p);
#endif #endif
trace_pdu(DIRECTION_UPLINK, trace_pdu(DIRECTION_UPLINK,
(uint8_t *) pdu, (uint8_t *) pdu,
len, len,
...@@ -2440,7 +2433,6 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP, ...@@ -2440,7 +2433,6 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu); stop_meas(&UE_mac_inst[module_idP].tx_ulsch_sdu);
#endif #endif
trace_pdu(DIRECTION_UPLINK, ulsch_buffer, buflen, module_idP, WS_C_RNTI, trace_pdu(DIRECTION_UPLINK, ulsch_buffer, buflen, module_idP, WS_C_RNTI,
UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].crnti,
UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txFrame,
......
This diff is collapsed.
How to configure wireshark for dissecting LTE protocols: How to configure wireshark for dissecting LTE protocols:
- start the wireshark as a sudoers - start the wireshark as a sudoers
- goto analyze->enabled prototols - goto analyze->enabled prototols
=> enable mac_lte_udp and rlc_lte_udp => enable mac_lte_udp and rlc_lte_udp
- goto edit/preferences and expand Protocols - goto edit/preferences and expand Protocols
- select UDP and check "try heuristic sub-dissectors first" - select UDP and check "try heuristic sub-dissectors first"
- select MAC-LTE, and check all the options (checkboxes), and set the "which layer info to show in info column" to "MAC info" - select MAC-LTE, and check all the options (checkboxes), and set the "which layer info to show in info column" to "MAC info"
- select RLC-LTE, and check all the options except the "May see RLC headers only", and set the "call PDCP dissector for DRB PDUs" to "12-bit SN". Optionally you may select the sequence analysis for RLC AM/UM. - select RLC-LTE, and check all the options except the "May see RLC headers only", and
set the "call PDCP dissector for DRB PDUs" to "12-bit SN". Optionally you may select the sequence analysis for RLC AM/UM.
How to use How to use
- start eNB or UE with option --opt.type wireshark - start eNB or UE with option --opt.type wireshark
--opt options are: --opt options are:
--opt.type none/wireshark/pcap --opt.type none/wireshark/pcap
--opt.ip 127.0.0.1 to specify the output IP address (default: 127.0.0.1) --opt.ip 127.0.0.1 to specify the output IP address (default: 127.0.0.1)
output port is always: 9999 (to change it, change constant: PACKET_MAC_LTE_DEFAULT_UDP_PORT in OAI code) output port is always: 9999 (to change it, change constant: PACKET_MAC_LTE_DEFAULT_UDP_PORT in OAI code)
--opt.path file_name to specify the file name (pcap) --opt.path file_name to specify the file name (pcap)
- capture on local interface "lo" - capture on local interface "lo"
- filter out the ICMP/DNS/TCP messages (e.g. "!icmp && !dns && !tcp") - filter out the ICMP/DNS/TCP messages (e.g. "!icmp && !dns && !tcp")
...@@ -400,7 +400,6 @@ void trace_pdu_implementation(int direction, uint8_t *pdu_buffer, unsigned int p ...@@ -400,7 +400,6 @@ void trace_pdu_implementation(int direction, uint8_t *pdu_buffer, unsigned int p
if (RC.eNB && RC.eNB[0][0]!=NULL) if (RC.eNB && RC.eNB[0][0]!=NULL)
radioType=RC.eNB[0][0]->frame_parms.frame_type== FDD ? FDD_RADIO:TDD_RADIO; radioType=RC.eNB[0][0]->frame_parms.frame_type== FDD ? FDD_RADIO:TDD_RADIO;
else if (PHY_vars_UE_g && PHY_vars_UE_g[0][0] != NULL) else if (PHY_vars_UE_g && PHY_vars_UE_g[0][0] != NULL)
radioType=PHY_vars_UE_g[0][0]->frame_parms.frame_type== FDD ? FDD_RADIO:TDD_RADIO; radioType=PHY_vars_UE_g[0][0]->frame_parms.frame_type== FDD ? FDD_RADIO:TDD_RADIO;
else { else {
......
...@@ -430,6 +430,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) { ...@@ -430,6 +430,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout) {
b->circularBuf[(index*nbAnt+a)%CirSize].i=0; b->circularBuf[(index*nbAnt+a)%CirSize].i=0;
} }
} }
if ( abs(b->th.timestamp-b->lastReceivedTS) > 50 ) if ( abs(b->th.timestamp-b->lastReceivedTS) > 50 )
LOG_W(HW,"gap of: %ld in reception\n", b->th.timestamp-b->lastReceivedTS ); LOG_W(HW,"gap of: %ld in reception\n", b->th.timestamp-b->lastReceivedTS );
} }
......
...@@ -7,18 +7,21 @@ ...@@ -7,18 +7,21 @@
volatile int oai_exit = 0; volatile int oai_exit = 0;
int fullread(int fd, void *_buf, int count) int fullread(int fd, void *_buf, int count) {
{
char *buf = _buf; char *buf = _buf;
int ret = 0; int ret = 0;
int l; int l;
while (count) { while (count) {
l = read(fd, buf, count); l = read(fd, buf, count);
if (l <= 0) return -1; if (l <= 0) return -1;
count -= l; count -= l;
buf += l; buf += l;
ret += l; ret += l;
} }
return ret; return ret;
} }
...@@ -79,7 +82,6 @@ sin_addr: ...@@ -79,7 +82,6 @@ sin_addr:
while(!connected) { while(!connected) {
//LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", IP, port); //LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", IP, port);
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) { if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
//LOG_I(HW,"rfsimulator: connection established\n"); //LOG_I(HW,"rfsimulator: connection established\n");
connected=true; connected=true;
...@@ -144,7 +146,8 @@ int main(int argc, char *argv[]) { ...@@ -144,7 +146,8 @@ int main(int argc, char *argv[]) {
uint64_t wroteTS=header.timestamp; uint64_t wroteTS=header.timestamp;
if (dataSize>bufSize) { if (dataSize>bufSize) {
void * new_buff = realloc(buff, dataSize); void *new_buff = realloc(buff, dataSize);
if (new_buff == NULL) { if (new_buff == NULL) {
free(buff); free(buff);
AssertFatal(1, "Could not reallocate"); AssertFatal(1, "Could not reallocate");
...@@ -157,6 +160,7 @@ int main(int argc, char *argv[]) { ...@@ -157,6 +160,7 @@ int main(int argc, char *argv[]) {
fullwrite(serviceSock, buff, dataSize); fullwrite(serviceSock, buff, dataSize);
// Purge incoming samples // Purge incoming samples
setblocking(serviceSock, blocking); setblocking(serviceSock, blocking);
while(readTS < wroteTS) { while(readTS < wroteTS) {
if ( fullread(serviceSock, &header,sizeof(header)) != sizeof(header) || if ( fullread(serviceSock, &header,sizeof(header)) != sizeof(header) ||
fullread(serviceSock, buff, sizeof(int32_t)*header.size*header.nbAnt) != fullread(serviceSock, buff, sizeof(int32_t)*header.size*header.nbAnt) !=
...@@ -165,6 +169,7 @@ int main(int argc, char *argv[]) { ...@@ -165,6 +169,7 @@ int main(int argc, char *argv[]) {
printf("error: %s\n", strerror(errno)); printf("error: %s\n", strerror(errno));
exit(1); exit(1);
} }
readTS=header.timestamp; readTS=header.timestamp;
} }
} }
......
This diff is collapsed.
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