Commit 73762320 authored by Lionel Gauthier's avatar Lionel Gauthier

Sebastian Held patches15/0045-reformatted.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7347 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 20ec0b02
......@@ -73,7 +73,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
/* char fname[100],vname[100];*/
for (i=0;i<38400*4;i+=3072) { // steps of 200 us with 100 us overlap, 0 to 5s
for (i=0; i<38400*4; i+=3072) { // steps of 200 us with 100 us overlap, 0 to 5s
// write_output("rxsig0.m","rxs0",ue->lte_ue_common_vars.rxdata[0],30720,1,1);
//for (i = 15360-3072*2; i<15360+3072+1; i+=3072) {
......@@ -351,8 +351,10 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (band_idx=0; band_idx<10; band_idx++)
printf("pss 0: level %d dB, freq %u\n", dB_fixed(scan_info->amp[0][band_idx]),scan_info->freq_offset_Hz[0][band_idx]);
for (band_idx=0; band_idx<10; band_idx++)
printf("pss 1: level %d dB, freq %u\n", dB_fixed(scan_info->amp[1][band_idx]),scan_info->freq_offset_Hz[1][band_idx]);
for (band_idx=0; band_idx<10; band_idx++)
printf("pss 2: level %d dB, freq %u\n", dB_fixed(scan_info->amp[2][band_idx]),scan_info->freq_offset_Hz[2][band_idx]);
......
......@@ -1078,11 +1078,13 @@ void dlsch_channel_compensation(int **rxdataF_ext,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==1) // 10 out of 12 so don't reduce size
{ nb_rb=1+(5*nb_rb/6); }
if (frame_parms->mode1_flag==1) { // 10 out of 12 so don't reduce size
nb_rb=1+(5*nb_rb/6);
}
else
{ pilots=1; }
else {
pilots=1;
}
}
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
......@@ -1123,6 +1125,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128[3]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch128[4], dl_ch128[4]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
......@@ -1256,6 +1259,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
}
}
}
#endif
}
......@@ -1308,7 +1312,8 @@ void prec2A_TM56_128(unsigned char pmi,__m128i *ch0,__m128i *ch1)
}
#elif defined(__arm__)
void prec2A_TM56_128(unsigned char pmi,int16x8_t* ch0,int16x8_t* ch1) {
void prec2A_TM56_128(unsigned char pmi,int16x8_t* ch0,int16x8_t* ch1)
{
int16x8_t amp;
amp = vmovq_n_s16(ONE_OVER_SQRT2_Q15);
......@@ -1384,7 +1389,8 @@ static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1)
#elif defined(__arm__)
void prec2A_TM3_128(int16x8_t* ch0, int16x8_t* ch1) {
void prec2A_TM3_128(int16x8_t* ch0, int16x8_t* ch1)
{
int16x8_t tmp0,tmp1;
......@@ -1672,11 +1678,13 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==1) // 10 out of 12 so don't reduce size
{ nb_rb=1+(5*nb_rb/6); }
if (frame_parms->mode1_flag==1) { // 10 out of 12 so don't reduce size
nb_rb=1+(5*nb_rb/6);
}
else
{ pilots=1; }
else {
pilots=1;
}
}
......@@ -1816,6 +1824,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
(nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx]));
// rx_antennas
}
phy_measurements->precoded_cqi_dB[eNB_id][0] = dB_fixed2(precoded_signal_strength,phy_measurements->n0_power_tot);
#endif
......@@ -2196,11 +2205,13 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
if (frame_parms->mode1_flag==1) // 10 out of 12 so don't reduce size
{ nb_rb=1+(5*nb_rb/6); }
if (frame_parms->mode1_flag==1) { // 10 out of 12 so don't reduce size
nb_rb=1+(5*nb_rb/6);
}
else
{ pilots=1; }
else {
pilots=1;
}
}
......@@ -2681,6 +2692,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
}
}
}
#elif defined(__arm__)
#endif
......
......@@ -691,6 +691,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
n_shift_ra = du[u]/NCS;
d_start = (du[u]<<1) + (n_shift_ra * NCS);
......@@ -1218,6 +1219,7 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
n_shift_ra = du[u]/NCS;
d_start = (du[u]<<1) + (n_shift_ra * NCS);
......@@ -1577,6 +1579,7 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common,
u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
n_shift_ra = du[u]/NCS;
d_start = (du[u]<<1) + (n_shift_ra * NCS);
......
......@@ -192,6 +192,7 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction
}
}
}
MSC_LOG_EVENT(MSC_PHY_ENB, "Failed remove ue %"PRIx16" (not found)", rnti);
return(-1);
}
......
......@@ -349,6 +349,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
TBsize = 57;
}
break;
}
}
......@@ -384,7 +385,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
&eNB->common_channels[CC_id].CCCH_pdu.payload[0],
rrc_sdu_length);
if (opt_enabled==1){
if (opt_enabled==1) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
eNB->subframe,0,0);
......
......@@ -1077,6 +1077,7 @@ schedule_ue_spec(
NULL, // contention res id
padding,
post_padding);
//#ifdef DEBUG_eNB_SCHEDULER
if (ta_update) {
LOG_I(MAC,
......@@ -1105,13 +1106,14 @@ schedule_ue_spec(
}
//eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset+sdu_lengths[0]+j] = (char)(taus()&0xff);
if (opt_enabled == 1){
if (opt_enabled == 1) {
trace_pdu(1, (uint8_t *)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
TBS, module_idP, 3, UE_RNTI(module_idP,UE_id),
eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n",
module_idP, frameP, UE_RNTI(module_idP,UE_id), TBS);
}
aggregation = process_ue_cqi(module_idP,UE_id);
nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE
nCCE_used[CC_id]+=(1<<aggregation); // adjust the remaining nCCE
......
......@@ -78,8 +78,7 @@ int8_t get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t CC_id, uint8_t mb
return -1;
} else if (eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) {
return mbsfn_sync_area;
}
else {
} else {
LOG_W(MAC,"[eNB %d] MBSFN Subframe Config pattern %d not found \n ", module_idP, mbsfn_sync_area);
return -1;
}
......@@ -620,14 +619,16 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
for (j=0; j<(TBS-sdu_length_total-offset); j++) {
eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload[offset+sdu_length_total+j] = (char)(taus()&0xff);
}
/* Tracing of PDU is done on UE side */
if (opt_enabled ==1 ){
if (opt_enabled ==1 ) {
trace_pdu(1, (uint8_t *)eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu.payload,
TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark
eNB_mac_inst[module_idP].subframe,0,0);
LOG_D(OPT,"[eNB %d][MCH] Frame %d : MAC PDU with size %d\n",
module_idP, frameP, TBS);
}
/*
for (j=0;j<sdu_length_total;j++)
printf("%2x.",eNB_mac_inst[module_idP].MCH_pdu.payload[j+offset]);
......
......@@ -494,6 +494,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// extend nb_rbs_required to capture per LCID RB required
for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
rnti = UE_RNTI(Mod_id,i);
for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) {
CC_id = UE_list->ordered_CCids[ii][i];
......@@ -876,8 +877,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
average_rbs_per_user[CC_id] = (uint16_t) floor((frame_parms->N_RB_UL-first_rb[CC_id])/total_ue_count);
} else if (max_num_ue_to_be_scheduled > 0 ) {
average_rbs_per_user[CC_id] = (uint16_t) floor((frame_parms->N_RB_UL-first_rb[CC_id])/max_num_ue_to_be_scheduled);
}
else {
} else {
average_rbs_per_user[CC_id]=1;
LOG_W(MAC,"[eNB %d] frame %d subframe %d: UE %d CC %d: can't get average rb per user (should not be here)\n",
module_idP,frameP,subframeP,UE_id,CC_id);
......@@ -1035,6 +1035,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
// This is the actual CC_id in the list
CC_id = UE_list->ordered_ULCCids[n][UE_id];
if (CC_id >= MAX_NUM_CCs) {
LOG_E( MAC, "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u",
CC_id,
......
......@@ -130,8 +130,7 @@ void get_prach_resources(module_id_t module_idP,
if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
}
else {
} else {
LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP);
mac_xface->macphy_exit("MAC FATAL radioResourceConfigCommon is NULL");
return; // not reached
......
......@@ -633,8 +633,7 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are
return -1;
} else if (UE_mac_inst[module_idP].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) {
return mbsfn_sync_area;
}
else {
} else {
LOG_W( MAC, "[UE %"PRIu8"] MBSFN Subframe Config pattern %"PRIu8" not found \n", module_idP, mbsfn_sync_area );
return -1;
}
......
......@@ -1432,7 +1432,7 @@ rrc_ue_process_securityModeCommand(
PDCP_TRANSMISSION_MODE_CONTROL);
}
}
}
}
//-----------------------------------------------------------------------------
void
......
......@@ -610,7 +610,7 @@ void rrc_eNB_emulation_notify_ue_module_id(
if (NULL != ue_context_p) {
oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_module_id][ue_context_p->local_uid] = ue_module_idP;
}
}
return;
}
......@@ -657,6 +657,7 @@ rrc_eNB_free_mem_UE_context(
ASN_STRUCT_FREE(asn_DEF_PhysicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated);
ue_context_pP->ue_context.physicalConfigDedicated = NULL;
}
if (ue_context_pP->ue_context.sps_Config) {
ASN_STRUCT_FREE(asn_DEF_SPS_Config, ue_context_pP->ue_context.sps_Config);
ue_context_pP->ue_context.sps_Config = NULL;
......@@ -667,7 +668,7 @@ rrc_eNB_free_mem_UE_context(
ASN_STRUCT_FREE(asn_DEF_MeasObjectToAddMod, ue_context_pP->ue_context.MeasObj[i]);
ue_context_pP->ue_context.MeasObj[i] = NULL;
}
}
}
for (i=0; i < MAX_MEAS_CONFIG; i++) {
if (ue_context_pP->ue_context.ReportConfig[i] != NULL) {
......@@ -1498,9 +1499,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
/* TODO parameters yet to process ... */
{
// ue_context_pP->ue_context.e_rab[i].param.qos;
// ue_context_pP->ue_context.e_rab[i].param.sgw_addr;
// ue_context_pP->ue_context.e_rab[i].param.gtp_teid;
// ue_context_pP->ue_context.e_rab[i].param.qos;
// ue_context_pP->ue_context.e_rab[i].param.sgw_addr;
// ue_context_pP->ue_context.e_rab[i].param.gtp_teid;
}
/* TODO should test if e RAB are Ok before! */
......@@ -3755,6 +3756,7 @@ rrc_eNB_decode_dcch(
dec_rval.consumed);
return -1;
}
ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[ctxt_pP->module_id],
ctxt_pP->rnti);
......
......@@ -105,7 +105,7 @@ rrc_eNB_S1AP_compare_ue_ids(
}
return 0;
}
}
if (c1_pP->eNB_ue_s1ap_id > c2_pP->eNB_ue_s1ap_id) {
return 1;
......@@ -138,7 +138,7 @@ rrc_eNB_S1AP_get_ue_ids(
temp.ue_initial_id = ue_initial_id;
temp.eNB_ue_s1ap_id = eNB_ue_s1ap_id;
return RB_FIND(rrc_rnti_tree_s, &rrc_instance_pP->rrc_rnti_head, &temp);
}
}
//------------------------------------------------------------------------------
void
rrc_eNB_S1AP_remove_ue_ids(
......@@ -151,6 +151,7 @@ rrc_eNB_S1AP_remove_ue_ids(
LOG_E(RRC, "Bad RRC instance\n");
return;
}
if (ue_ids_pP == NULL) {
LOG_E(RRC, "Trying to free a NULL S1AP UE IDs\n");
return;
......@@ -181,7 +182,7 @@ get_next_ue_initial_id(
}
return ue_initial_id[mod_id];
}
}
......@@ -444,6 +445,7 @@ rrc_pdcp_config_security(
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH);
}
#endif
}
......@@ -784,6 +786,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
return (-1);
} else {
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
/* Is it the first income from S1AP ? */
if (ue_context_p->ue_context.eNB_ue_s1ap_id == 0) {
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id;
......@@ -894,7 +897,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
/* TODO parameters yet to process ... */
{
// S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).ue_ambr;
// S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).ue_ambr;
}
rrc_eNB_process_security (
......@@ -970,7 +973,7 @@ int rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char
/* TODO parameters yet to process ... */
{
if (S1AP_UE_CTXT_MODIFICATION_REQ(msg_p).present & S1AP_UE_CONTEXT_MODIFICATION_UE_AMBR) {
// S1AP_UE_CTXT_MODIFICATION_REQ(msg_p).ue_ambr;
// S1AP_UE_CTXT_MODIFICATION_REQ(msg_p).ue_ambr;
}
}
......
......@@ -1903,11 +1903,13 @@ static void get_options (int argc, char **argv)
case LONG_OPTION_RXGAIN:
for (i=0; i<4; i++)
rx_gain[0][i] = atof(optarg);
break;
case LONG_OPTION_TXGAIN:
for (i=0; i<4; i++)
tx_gain[0][i] = atof(optarg);
break;
case 'M':
......@@ -2009,6 +2011,7 @@ static void get_options (int argc, char **argv)
case 'r':
UE_scan = 0;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
switch(atoi(optarg)) {
case 6:
......@@ -2778,9 +2781,9 @@ int main( int argc, char **argv )
if (UE_flag==1) {
fill_ue_band_info();
mac_xface->dl_phy_sync_success (0, 0, 0, 1);
}
else
} else
mac_xface->mrbch_phy_sync_failure (0, 0, 0);
#endif
/* #ifdef OPENAIR2
......
......@@ -252,11 +252,13 @@ static void *UE_thread_synch(void *arg)
}
#ifdef OAI_USRP
// now we know the uplink_frequency_offset
// set the correct TX frequency
for (i=0; i<openair0_cfg[card].tx_num_channels; i++) {
openair0_cfg[0].tx_freq[i] = downlink_frequency[0][i] + uplink_frequency_offset[0][i];
}
openair0_set_frequencies( &openair0, &openair0_cfg[0] );
#endif
}
......@@ -477,6 +479,7 @@ static void *UE_thread_synch(void *arg)
default:
break;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SYNCH, 0 );
if (pthread_mutex_lock(&UE->mutex_synch) != 0) {
......
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