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
......@@ -557,7 +557,7 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
GTPU_DEBUG("Received T-PDU over tunnel end-point '%x' of size %u (%u) (decapsulated %u)from "NW_IPV4_ADDR"\n",
ntohl(msgHdr->teid), gpduLen, pMsg->msgLen, pMsg->msgBufLen, NW_IPV4_ADDR_FORMAT((peerIp)));
#endif
MSC_LOG_RX_MESSAGE(
MSC_LOG_RX_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
......@@ -569,14 +569,14 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg);
}
} else {
MSC_LOG_RX_DISCARDED_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
0,
" G-PDU ltid %u size %u",
tunnelEndPointKey.teid,
gpduLen);
MSC_LOG_RX_DISCARDED_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
0,
" G-PDU ltid %u size %u",
tunnelEndPointKey.teid,
gpduLen);
GTPU_ERROR("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR"\n",
ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp)));
}
......@@ -609,12 +609,12 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
seqNum = ntohs(*(NwU16T *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4)));
MSC_LOG_RX_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
0,
MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u",
0,0,seqNum, msgBufLen);
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
0,
MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u",
0,0,seqNum, msgBufLen);
/* Send Echo Response */
rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz,
......@@ -651,12 +651,12 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
seqNum);
#endif
MSC_LOG_TX_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
0,
MSC_AS_TIME_FMT" ECHO-RSP seq %u",
0,0,seqNum);
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL,
0,
MSC_AS_TIME_FMT" ECHO-RSP seq %u",
0,0,seqNum);
rc = nwGtpv1uCreateAndSendMsg(
thiz,
peerIp,
......@@ -687,8 +687,8 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, NwU32T stac
memset(thiz, 0, sizeof(NwGtpv1uStackT));
if(thiz) {
thiz->id = (NwPtrT)thiz;
thiz->stackType = stackType;
thiz->id = (NwPtrT)thiz;
thiz->stackType = stackType;
thiz->seq = (NwU16T) ((NwU32T)thiz) ; // FIXME interesting casts... don't know what this is good for...
RB_INIT(&(thiz->outstandingTxSeqNumMap));
RB_INIT(&(thiz->outstandingRxSeqNumMap));
......
......@@ -73,10 +73,10 @@ 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
// write_output("rxsig0.m","rxs0",ue->lte_ue_common_vars.rxdata[0],30720,1,1);
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) {
//for (i = 15360-3072*2; i<15360+3072+1; i+=3072) {
//compute frequency-domain representation of 6144-sample chunk
......@@ -92,17 +92,17 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
/*
printf("i %d: sp %p\n",i,sp);
if (i==12288) {
printf("i %d: sp %p\n",i,sp);
if (i==12288) {
write_output("scan6144F.m","s6144F",sp,6144,1,1);
write_output("scan6144.m","s6144",rxp,6144,1,1);
write_output("pss0_6144.m","pss0",pss6144_0_0,256,1,1);
}*/
write_output("pss0_6144.m","pss0",pss6144_0_0,256,1,1);
}*/
for (f = -2000; f<2000; f++) { // this is -10MHz to 10 MHz in 5 kHz steps
if ((f<-256)||(f>=0)) { // no split around DC
// printf("No split, f %d (%d)\n",f,f&3);
// printf("No split, f %d (%d)\n",f,f&3);
// align filters and input buffer pointer to 128-bit
switch (f&3) {
......@@ -138,7 +138,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
re256=32;
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
// printf("f %d, re %d\n",f,re);
// printf("f %d, re %d\n",f,re);
s = sp2[re];
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
......@@ -158,7 +158,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
re256 = (re256+1)&0x3f;
}
} else { // Split around DC, this is the negative frequencies
// printf("split around DC, f %d (f/4 %d, f&3 %d)\n",f,f>>2,f&3);
// printf("split around DC, f %d (f/4 %d, f&3 %d)\n",f,f>>2,f&3);
// align filters and input buffer pointer to 128-bit
switch (f&3) {
......@@ -195,9 +195,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
s = sp2[re];
/* printf("re %d, %p\n",re,&sp2[re]);
print_shorts("s",&s);
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
/* printf("re %d, %p\n",re,&sp2[re]);
print_shorts("s",&s);
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
......@@ -250,9 +250,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
s = sp2[re];
/* printf("re %d %p\n",re,&sp2[re]);
print_shorts("s",&s);
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
/* printf("re %d %p\n",re,&sp2[re]);
print_shorts("s",&s);
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
......@@ -275,15 +275,15 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
// ifft, accumulate energy over two half-frames
idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1);
/*
if (i==12288) {
sprintf(fname,"corr256F_%d.m",abs(f));
sprintf(vname,"c256F_%d",abs(f));
write_output(fname,vname,autocorr0,256,1,1);
sprintf(fname,"corr256_%d.m",abs(f));
sprintf(vname,"c256_%d",abs(f));
write_output(fname,vname,tmp_t,256,1,1);
}*/
/*
if (i==12288) {
sprintf(fname,"corr256F_%d.m",abs(f));
sprintf(vname,"c256F_%d",abs(f));
write_output(fname,vname,autocorr0,256,1,1);
sprintf(fname,"corr256_%d.m",abs(f));
sprintf(vname,"c256_%d",abs(f));
write_output(fname,vname,tmp_t,256,1,1);
}*/
memset((void*)autocorr0_t,0,256*4);
memset((void*)autocorr1_t,0,256*4);
......@@ -335,7 +335,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
if (maxcorr[pssind]>minamp) {
scan_info->amp[pssind][pos]=maxcorr[pssind];
scan_info->freq_offset_Hz[pssind][pos]=((f+128)*5000)+DL_freq;
printf("pss %d, amp %d (%d>%d) freq %u (%d), i %d\n",pssind,dB_fixed(maxcorr[pssind]),maxcorr[pssind],minamp,((f+128)*5000)+DL_freq,f,i);
printf("pss %d, amp %d (%d>%d) freq %u (%d), i %d\n",pssind,dB_fixed(maxcorr[pssind]),maxcorr[pssind],minamp,((f+128)*5000)+DL_freq,f,i);
}
} // loop on pss index
}
......@@ -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]);
......
......@@ -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);
......
......@@ -71,9 +71,9 @@ static inline unsigned long long rdtsc_oai(void)
static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline));
static inline unsigned long long rdtsc_oai(void)
{
uint32_t r = 0;
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) );
return (unsigned long long)r;
uint32_t r = 0;
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) );
return (unsigned long long)r;
}
#endif
......
......@@ -153,7 +153,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
return(-1);
} else {
if (phy_vars_eNB->eNB_UE_stats[i].crnti==0) {
MSC_LOG_EVENT(MSC_PHY_ENB, "Add ue %"PRIx16" ", rnti);
MSC_LOG_EVENT(MSC_PHY_ENB, "Add ue %"PRIx16" ", rnti);
LOG_I(PHY,"UE_id %d associated with rnti %x\n",i, rnti);
phy_vars_eNB->dlsch_eNB[i][0]->rnti = rnti;
phy_vars_eNB->ulsch_eNB[i]->rnti = rnti;
......@@ -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);
}
......@@ -2788,8 +2789,8 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch->rnti,dl_harq_pid[m]);
#endif
MSC_LOG_EVENT(MSC_PHY_ENB, "HARQ DLSCH Failed RNTI %"PRIx16" round %u",
dlsch->rnti,
dlsch_harq_proc->round);
dlsch->rnti,
dlsch_harq_proc->round);
dlsch_harq_proc->round = 0;
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
......
......@@ -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,13 +385,13 @@ 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){
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);
LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
}
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);
LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
}
nprb[CC_id]= nprb[CC_id] + 3;
nCCE[CC_id] = nCCE[CC_id] + 4;
......
......@@ -123,15 +123,15 @@ schedule_next_dlue(
//------------------------------------------------------------------------------
unsigned char
generate_dlsch_header(
unsigned char* mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char drx_cmd,
short timing_advance_cmd,
unsigned char *ue_cont_res_id,
unsigned char short_padding,
unsigned short post_padding
unsigned char* mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char drx_cmd,
short timing_advance_cmd,
unsigned char *ue_cont_res_id,
unsigned char short_padding,
unsigned short post_padding
)
//------------------------------------------------------------------------------
{
......@@ -419,12 +419,12 @@ set_ul_DAI(
//------------------------------------------------------------------------------
void
schedule_ue_spec(
module_id_t module_idP,
frame_t frameP,
sub_frame_t subframeP,
unsigned int *nb_rb_used0,
unsigned int *nCCE_used,
int* mbsfn_flag
module_id_t module_idP,
frame_t frameP,
sub_frame_t subframeP,
unsigned int *nb_rb_used0,
unsigned int *nCCE_used,
int* mbsfn_flag
)
//------------------------------------------------------------------------------
{
......@@ -1077,12 +1077,13 @@ schedule_ue_spec(
NULL, // contention res id
padding,
post_padding);
//#ifdef DEBUG_eNB_SCHEDULER
if (ta_update) {
LOG_I(MAC,
"[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n",
module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,
ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
"[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n",
module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,
ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
}
//#endif
......@@ -1105,14 +1106,15 @@ 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){
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);
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
UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
......@@ -2085,7 +2087,7 @@ fill_DLSCH_dci(
if(rballoc_sub[i] == 1) {
rballoc[CC_id] |= (0x0001<<i); // TO be FIXED!!!!!!
}
}
}
......@@ -2408,9 +2410,9 @@ update_ul_dci(
//------------------------------------------------------------------------------
void set_ue_dai(
sub_frame_t subframeP,
uint8_t tdd_config,
int UE_id,
uint8_t CC_id,
uint8_t tdd_config,
int UE_id,
uint8_t CC_id,
UE_list_t* UE_list
)
//------------------------------------------------------------------------------
......
......@@ -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);
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);
module_idP, frameP, TBS);
}
/*
for (j=0;j<sdu_length_total;j++)
printf("%2x.",eNB_mac_inst[module_idP].MCH_pdu.payload[j+offset]);
......
......@@ -70,14 +70,14 @@
uint8_t rb_table[33] = {1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,72,75,80,81,90,96,100};
void rx_sdu(
const module_id_t enb_mod_idP,
const int CC_idP,
const frame_t frameP,
const rnti_t rntiP,
uint8_t *sduP,
const uint16_t sdu_lenP,
const int harq_pidP,
uint8_t *msg3_flagP)
const module_id_t enb_mod_idP,
const int CC_idP,
const frame_t frameP,
const rnti_t rntiP,
uint8_t *sduP,
const uint16_t sdu_lenP,
const int harq_pidP,
uint8_t *msg3_flagP)
{
unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr;
......@@ -274,11 +274,11 @@ void rx_sdu(
frameP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
rx_lcids[i],
(char *)payload_ptr,
rx_lengths[i],
1,
NULL);//(unsigned int*)crc_status);
rx_lcids[i],
(char *)payload_ptr,
rx_lengths[i],
1,
NULL);//(unsigned int*)crc_status);
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
......@@ -310,11 +310,11 @@ void rx_sdu(
frameP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DTCH,
(char *)payload_ptr,
rx_lengths[i],
1,
NULL);//(unsigned int*)crc_status);
DTCH,
(char *)payload_ptr,
rx_lengths[i],
1,
NULL);//(unsigned int*)crc_status);
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
}
......@@ -1116,7 +1116,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
//weight[cba_group] = floor(total_UEs/active_groups);//find_num_active_UEs_in_cbagroup(module_idP, cba_group);
for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) {
if (UE_RNTI(module_idP,UE_id)==NOT_A_RNTI)
if (UE_RNTI(module_idP,UE_id)==NOT_A_RNTI)
continue;
// simple UE identity based grouping
......
......@@ -312,7 +312,7 @@ void sort_UEs (module_id_t Mod_idP,
rnti1 = UE_RNTI(Mod_idP,i);
if(rnti1 == NOT_A_RNTI)
if(rnti1 == NOT_A_RNTI)
continue;
UE_id1 = i;
......@@ -409,16 +409,16 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// Initialize scheduling information for all active UEs
dlsch_scheduler_pre_processor_reset(
UE_id,
CC_id,
N_RBG[CC_id],
dl_pow_off,
nb_rbs_required,
pre_nb_available_rbs,
nb_rbs_required_remaining,
rballoc_sub_UE,
rballoc_sub,
MIMO_mode_indicator);
UE_id,
CC_id,
N_RBG[CC_id],
dl_pow_off,
nb_rbs_required,
pre_nb_available_rbs,
nb_rbs_required_remaining,
rballoc_sub_UE,
rballoc_sub,
MIMO_mode_indicator);
}
}
......@@ -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];
......@@ -846,7 +847,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
rnti = UE_RNTI(module_idP,i);
if (rnti==NOT_A_RNTI)
if (rnti==NOT_A_RNTI)
continue;
UE_id = i;
......@@ -872,12 +873,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} else if (total_ue_count == 1 ) { // increase the available RBs, special case,
average_rbs_per_user[CC_id] = frame_parms->N_RB_UL-first_rb[CC_id]+1;
} else if( (total_ue_count <= (frame_parms->N_RB_DL-first_rb[CC_id])) &&
(total_ue_count <= max_num_ue_to_be_scheduled)) {
(total_ue_count <= max_num_ue_to_be_scheduled)) {
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);
......@@ -922,7 +922,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
rnti = UE_RNTI(module_idP,i);
if (rnti==NOT_A_RNTI)
if (rnti==NOT_A_RNTI)
continue;
UE_id = i;
......@@ -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,
......@@ -1124,7 +1125,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
rnti1 = UE_RNTI(module_idP,i);
if(rnti1 == NOT_A_RNTI)
if(rnti1 == NOT_A_RNTI)
continue;
UE_id1 = i;
......
......@@ -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;
}
......@@ -1449,8 +1448,8 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, subframe, 0, 0);
}
LOG_D(OPT,"[UE %d][ULSCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, UE_mac_inst[module_idP].crnti, buflen);
LOG_D(OPT,"[UE %d][ULSCH] Frame %d trace pdu for rnti %x with size %d\n",
module_idP, frameP, UE_mac_inst[module_idP].crnti, buflen);
#endif
LOG_D(MAC,"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n",
......@@ -1691,7 +1690,7 @@ ue_scheduler(
UE_mac_inst[module_idP].PHR_reporting_active = 1;
} else if (UE_mac_inst[module_idP].PHR_reporting_active == 0 ) {
UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF--;
}
}
}
} else { // release / nothing
UE_mac_inst[module_idP].PHR_reporting_active = 0; // release PHR
......
......@@ -192,7 +192,7 @@ rrc_ue_process_measConfig(
void rrc_ue_process_radioResourceConfigDedicated(
const protocol_ctxt_t* const ctxt_pP,
uint8_t eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
// eNB/CH RRC Procedures
......@@ -445,8 +445,8 @@ uint8_t check_trigger_meas_event(
uint8_t eNB_index,
uint8_t ue_cnx_index,
uint8_t meas_index,
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
//void rrc_ue_process_ueCapabilityEnquiry(uint8_t module_idP,uint32_t frame,UECapabilityEnquiry_t *UECapabilityEnquiry,uint8_t eNB_index);
/*void
......
......@@ -583,7 +583,7 @@ rrc_ue_decode_ccch(
rrc_ue_process_radioResourceConfigDedicated(
ctxt_pP,
eNB_index,
&dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated);
&dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated);
rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
......@@ -1199,7 +1199,7 @@ rrc_ue_process_radioResourceConfigDedicated(
MSC_AS_TIME_ARGS(ctxt_pP),
ctxt_pP->rnti,
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm |
(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4));
(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4));
// Refresh DRBs
rrc_pdcp_config_asn1_req(ctxt_pP,
......@@ -1431,8 +1431,8 @@ rrc_ue_process_securityModeCommand(
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
}
}
}
}
//-----------------------------------------------------------------------------
void
......@@ -1546,7 +1546,7 @@ rrc_ue_process_ueCapabilityEnquiry(
void
rrc_ue_process_rrcConnectionReconfiguration(
const protocol_ctxt_t* const ctxt_pP,
RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
uint8_t eNB_index
)
//-----------------------------------------------------------------------------
......@@ -1960,7 +1960,7 @@ rrc_ue_decode_dcch(
rrc_ue_generate_RRCConnectionReconfigurationComplete(
ctxt_pP,
target_eNB_index,
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier);
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier);
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP].State = RRC_HO_EXECUTION;
UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED;
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",
......@@ -2017,7 +2017,7 @@ rrc_ue_decode_dcch(
rrc_ue_generate_RRCConnectionReconfigurationComplete(
ctxt_pP,
eNB_indexP,
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier);
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier);
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP].State = RRC_RECONFIGURED;
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n",
ctxt_pP->module_id,
......@@ -2444,27 +2444,27 @@ decode_SIB1(
plmn_Identity = &(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list.array[plmn]->plmn_Identity;
if (
(
(plmn_Identity->mcc == NULL)
||
(
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MCCdigit1 == *(plmn_Identity->mcc->list.array[0])) &&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MCCdigit2 == *(plmn_Identity->mcc->list.array[1])) &&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MCCdigit3 == *(plmn_Identity->mcc->list.array[2]))
)
)
&&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit1 == *(plmn_Identity->mnc.list.array[0]))
&&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit2 == *(plmn_Identity->mnc.list.array[1]))
&&
(
((UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit3 == 0xf) && (plmn_Identity->mnc.list.count == 2))
||
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit3 == *(plmn_Identity->mnc.list.array[2]))
)
) {
if (
(
(plmn_Identity->mcc == NULL)
||
(
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MCCdigit1 == *(plmn_Identity->mcc->list.array[0])) &&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MCCdigit2 == *(plmn_Identity->mcc->list.array[1])) &&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MCCdigit3 == *(plmn_Identity->mcc->list.array[2]))
)
)
&&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit1 == *(plmn_Identity->mnc.list.array[0]))
&&
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit2 == *(plmn_Identity->mnc.list.array[1]))
&&
(
((UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit3 == 0xf) && (plmn_Identity->mnc.list.count == 2))
||
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit3 == *(plmn_Identity->mnc.list.array[2]))
)
) {
/* PLMN match, send a confirmation to NAS */
MessageDef *msg_p;
......@@ -3473,7 +3473,7 @@ void
RRC_MAC_MCCH_DATA_IND (msg_p).enb_index,
RRC_MAC_MCCH_DATA_IND (msg_p).sdu,
RRC_MAC_MCCH_DATA_IND (msg_p).sdu_size,
RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
break;
# endif
......@@ -3485,7 +3485,7 @@ void
msg_name,
RRC_DCCH_DATA_IND (msg_p).frame,
RRC_DCCH_DATA_IND (msg_p).dcch_index,
RRC_DCCH_DATA_IND (msg_p).eNB_index);
RRC_DCCH_DATA_IND (msg_p).eNB_index);
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"Received %s DCCH %d, eNB %d",
PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt),
......@@ -3521,13 +3521,13 @@ void
UE_rrc_inst[ue_mod_id].plmnID = NAS_CELL_SELECTION_REQ (msg_p).plmnID;
UE_rrc_inst[ue_mod_id].rat = NAS_CELL_SELECTION_REQ (msg_p).rat;
LOG_I(RRC, "[UE %d] Save cell selection criterion MCC %X%X%X MNC %X%X%X\n",
ue_mod_id,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit1,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit2,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit3,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit1,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit2,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit3);
ue_mod_id,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit1,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit2,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit3,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit1,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit2,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit3);
}
......
This diff is collapsed.
......@@ -102,10 +102,10 @@ rrc_eNB_S1AP_compare_ue_ids(
if (c1_pP->ue_initial_id < c2_pP->ue_initial_id) {
return -1;
}
}
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(
......@@ -150,7 +150,8 @@ rrc_eNB_S1AP_remove_ue_ids(
if (rrc_instance_pP == NULL) {
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];
}
}
......@@ -212,7 +213,7 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
// found by ue_initial_id, fill now eNB_ue_s1ap_idP
if (temp->eNB_ue_s1ap_id != eNB_ue_s1ap_idP) {
temp->eNB_ue_s1ap_id = eNB_ue_s1ap_idP;
}
}
return rrc_eNB_get_ue_context(
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
......@@ -426,24 +427,25 @@ rrc_pdcp_config_security(
if (h_rc == HASH_TABLE_OK) {
pdcp_config_set_security(
pdcp_config_set_security(
ctxt_pP,
pdcp_p,
DCCH,
DCCH+2,
(send_security_mode_command == TRUE) ?
pdcp_p,
DCCH,
DCCH+2,
(send_security_mode_command == TRUE) ?
0 | (ue_context_pP->ue_context.integrity_algorithm << 4) :
(ue_context_pP->ue_context.ciphering_algorithm ) |
(ue_context_pP->ue_context.integrity_algorithm << 4),
kRRCenc,
kRRCint,
kUPenc);
kRRCenc,
kRRCint,
kUPenc);
} else {
LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT"Could not get PDCP instance for SRB DCCH %u\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH);
}
#endif
}
......@@ -710,10 +712,10 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
s1ap_eNB_new_data_request (
ctxt_pP->module_id,
ue_context_pP,
rrcConnectionSetupComplete->dedicatedInfoNAS.
buf,
rrcConnectionSetupComplete->dedicatedInfoNAS.
size);
rrcConnectionSetupComplete->dedicatedInfoNAS.
buf,
rrcConnectionSetupComplete->dedicatedInfoNAS.
size);
}
#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;
......@@ -805,8 +808,8 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
instance,
&buffer,
rrc_eNB_get_next_transaction_identifier (instance),
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length,
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer);
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length,
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer);
#ifdef RRC_MSG_PRINT
int i=0;
......@@ -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:
......@@ -2665,7 +2668,7 @@ int main( int argc, char **argv )
#ifdef ETHERNET
if (frame_parms[0]->N_RB_DL == 6) openair0_cfg[0].samples_per_packet = 256;
else openair0_cfg[0].samples_per_packet = 1536;
else openair0_cfg[0].samples_per_packet = 1536;
printf("HW: samples_per_packet %d\n",openair0_cfg[0].samples_per_packet);
#endif
......@@ -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
......
......@@ -231,10 +231,10 @@ static void *UE_thread_synch(void *arg)
if (UE->UE_scan == 0) {
do {
current_band = eutra_bands[ind].band;
printf( "Scanning band %d, dl_min %"PRIu32"\n", current_band, eutra_bands[ind].dl_min );
current_band = eutra_bands[ind].band;
printf( "Scanning band %d, dl_min %"PRIu32"\n", current_band, eutra_bands[ind].dl_min );
if ((eutra_bands[ind].dl_min <= downlink_frequency[0][0]) && (eutra_bands[ind].dl_max >= downlink_frequency[0][0])) {
if ((eutra_bands[ind].dl_min <= downlink_frequency[0][0]) && (eutra_bands[ind].dl_max >= downlink_frequency[0][0])) {
for (card=0; card<MAX_NUM_CCs; card++)
for (i=0; i<4; i++)
uplink_frequency_offset[card][i] = eutra_bands[ind].ul_min - eutra_bands[ind].dl_min;
......@@ -244,24 +244,26 @@ static void *UE_thread_synch(void *arg)
}
ind++;
} while (current_band < sizeof(eutra_bands) / sizeof(eutra_bands[0]));
} while (current_band < sizeof(eutra_bands) / sizeof(eutra_bands[0]));
if (found == 0) {
exit_fun("Can't find EUTRA band for frequency");
return &UE_thread_synch_retval;
return &UE_thread_synch_retval;
}
#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] );
// 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
}
else if (UE->UE_scan == 1) {
else if (UE->UE_scan == 1) {
current_band=0;
for (card=0; card<MAX_CARDS; card++) {
......@@ -383,7 +385,7 @@ static void *UE_thread_synch(void *arg)
printf("UE synch: setting RX gain (%d,%d) to %f\n",card,i,openair0_cfg[card].rx_gain[i]);
#endif
}
}
#ifdef EXMIMO
//openair0_config(&openair0_cfg[card],1);
......@@ -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) {
......@@ -996,7 +999,7 @@ void *UE_thread(void *arg)
UE->PHY_measurements.rx_power_avg_dB[0] - rx_input_level_dBm,
UE->rx_total_gain_dB,
openair0_cfg[0].rx_gain[0]
);
);
exit_fun("[HW][UE] UE in RX calibration mode, exiting");
return &UE_thread_retval;
}
......@@ -1384,7 +1387,7 @@ void *UE_thread(void *arg)
UE->PHY_measurements.rx_power_avg_dB[0] - rx_input_level_dBm,
UE->rx_total_gain_dB,
openair0_cfg[0].rx_gain[0]
);
);
exit_fun("[HW][UE] UE in RX calibration mode, exiting");
}
}
......@@ -1420,8 +1423,8 @@ void *UE_thread(void *arg)
}
/*
if ((slot%2000)<10)
LOG_D(HW,"fun0: doing very hard work\n");
if ((slot%2000)<10)
LOG_D(HW,"fun0: doing very hard work\n");
*/
// now increment slot and frame counters
slot++;
......
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