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, ...@@ -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", 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))); ntohl(msgHdr->teid), gpduLen, pMsg->msgLen, pMsg->msgBufLen, NW_IPV4_ADDR_FORMAT((peerIp)));
#endif #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_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL, NULL,
...@@ -569,14 +569,14 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz, ...@@ -569,14 +569,14 @@ nwGtpv1uProcessGpdu( NwGtpv1uStackT *thiz,
rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg); rc = nwGtpSessionSendMsgApiToUlpEntity(pTunnelEndPoint, pMsg);
} }
} else { } else {
MSC_LOG_RX_DISCARDED_MESSAGE( MSC_LOG_RX_DISCARDED_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL, NULL,
0, 0,
" G-PDU ltid %u size %u", " G-PDU ltid %u size %u",
tunnelEndPointKey.teid, tunnelEndPointKey.teid,
gpduLen); gpduLen);
GTPU_ERROR("Received T-PDU over non-existent tunnel end-point '%x' from "NW_IPV4_ADDR"\n", 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))); ntohl(msgHdr->teid), NW_IPV4_ADDR_FORMAT((peerIp)));
} }
...@@ -609,12 +609,12 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, ...@@ -609,12 +609,12 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
seqNum = ntohs(*(NwU16T *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4))); seqNum = ntohs(*(NwU16T *) (msgBuf + (((*msgBuf) & 0x02) ? 8 : 4)));
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_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL, NULL,
0, 0,
MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u", MSC_AS_TIME_FMT" ECHO-REQ seq %u size %u",
0,0,seqNum, msgBufLen); 0,0,seqNum, msgBufLen);
/* Send Echo Response */ /* Send Echo Response */
rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz, rc = nwGtpv1uMsgNew( (NwGtpv1uStackHandleT)thiz,
...@@ -651,12 +651,12 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz, ...@@ -651,12 +651,12 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
seqNum); seqNum);
#endif #endif
MSC_LOG_TX_MESSAGE( MSC_LOG_TX_MESSAGE(
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW, (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_ENB:MSC_GTPU_SGW,
(thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB, (thiz->stackType == GTPU_STACK_ENB) ? MSC_GTPU_SGW:MSC_GTPU_ENB,
NULL, NULL,
0, 0,
MSC_AS_TIME_FMT" ECHO-RSP seq %u", MSC_AS_TIME_FMT" ECHO-RSP seq %u",
0,0,seqNum); 0,0,seqNum);
rc = nwGtpv1uCreateAndSendMsg( rc = nwGtpv1uCreateAndSendMsg(
thiz, thiz,
peerIp, peerIp,
...@@ -687,8 +687,8 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, NwU32T stac ...@@ -687,8 +687,8 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, NwU32T stac
memset(thiz, 0, sizeof(NwGtpv1uStackT)); memset(thiz, 0, sizeof(NwGtpv1uStackT));
if(thiz) { if(thiz) {
thiz->id = (NwPtrT)thiz; thiz->id = (NwPtrT)thiz;
thiz->stackType = stackType; thiz->stackType = stackType;
thiz->seq = (NwU16T) ((NwU32T)thiz) ; // FIXME interesting casts... don't know what this is good for... thiz->seq = (NwU16T) ((NwU32T)thiz) ; // FIXME interesting casts... don't know what this is good for...
RB_INIT(&(thiz->outstandingTxSeqNumMap)); RB_INIT(&(thiz->outstandingTxSeqNumMap));
RB_INIT(&(thiz->outstandingRxSeqNumMap)); RB_INIT(&(thiz->outstandingRxSeqNumMap));
......
...@@ -73,10 +73,10 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -73,10 +73,10 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
/* char fname[100],vname[100];*/ /* 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); // 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 //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) ...@@ -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); printf("i %d: sp %p\n",i,sp);
if (i==12288) { if (i==12288) {
write_output("scan6144F.m","s6144F",sp,6144,1,1); write_output("scan6144F.m","s6144F",sp,6144,1,1);
write_output("scan6144.m","s6144",rxp,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 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 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 // align filters and input buffer pointer to 128-bit
switch (f&3) { switch (f&3) {
...@@ -138,7 +138,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -138,7 +138,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
re256=32; re256=32;
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS 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]; s = sp2[re];
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15); 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); 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) ...@@ -158,7 +158,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
re256 = (re256+1)&0x3f; re256 = (re256+1)&0x3f;
} }
} else { // Split around DC, this is the negative frequencies } 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 // align filters and input buffer pointer to 128-bit
switch (f&3) { switch (f&3) {
...@@ -195,9 +195,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -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 for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
s = sp2[re]; s = sp2[re];
/* printf("re %d, %p\n",re,&sp2[re]); /* printf("re %d, %p\n",re,&sp2[re]);
print_shorts("s",&s); print_shorts("s",&s);
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/ print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15); 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); 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) ...@@ -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 for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
s = sp2[re]; s = sp2[re];
/* printf("re %d %p\n",re,&sp2[re]); /* printf("re %d %p\n",re,&sp2[re]);
print_shorts("s",&s); print_shorts("s",&s);
print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/ print_shorts("pss",&((__m128i*)pss6144_0)[re]);*/
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15); 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); 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); 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) ...@@ -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 // ifft, accumulate energy over two half-frames
idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1); idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1);
/* /*
if (i==12288) { if (i==12288) {
sprintf(fname,"corr256F_%d.m",abs(f)); sprintf(fname,"corr256F_%d.m",abs(f));
sprintf(vname,"c256F_%d",abs(f)); sprintf(vname,"c256F_%d",abs(f));
write_output(fname,vname,autocorr0,256,1,1); write_output(fname,vname,autocorr0,256,1,1);
sprintf(fname,"corr256_%d.m",abs(f)); sprintf(fname,"corr256_%d.m",abs(f));
sprintf(vname,"c256_%d",abs(f)); sprintf(vname,"c256_%d",abs(f));
write_output(fname,vname,tmp_t,256,1,1); write_output(fname,vname,tmp_t,256,1,1);
}*/ }*/
memset((void*)autocorr0_t,0,256*4); memset((void*)autocorr0_t,0,256*4);
memset((void*)autocorr1_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) ...@@ -335,7 +335,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
if (maxcorr[pssind]>minamp) { if (maxcorr[pssind]>minamp) {
scan_info->amp[pssind][pos]=maxcorr[pssind]; scan_info->amp[pssind][pos]=maxcorr[pssind];
scan_info->freq_offset_Hz[pssind][pos]=((f+128)*5000)+DL_freq; 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 } // loop on pss index
} }
...@@ -351,8 +351,10 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -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++) 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]); 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++) 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]); 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++) 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]); 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]);
......
...@@ -813,7 +813,7 @@ void dlsch_channel_compensation(int **rxdataF_ext, ...@@ -813,7 +813,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
PHY_MEASUREMENTS *phy_measurements) PHY_MEASUREMENTS *phy_measurements)
{ {
#if defined(__i386) || defined(__x86_64) #if defined(__i386) || defined(__x86_64)
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0; unsigned char aatx,aarx,symbol_mod,pilots=0;
...@@ -1065,197 +1065,201 @@ void dlsch_channel_compensation(int **rxdataF_ext, ...@@ -1065,197 +1065,201 @@ void dlsch_channel_compensation(int **rxdataF_ext,
#elif defined(__arm__) #elif defined(__arm__)
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0; unsigned char aatx,aarx,symbol_mod,pilots=0;
int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128,*rho128; int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128,*rho128;
int32x4_t mmtmpD0,mmtmpD1; int32x4_t mmtmpD0,mmtmpD1;
int16x8_t *dl_ch_mag128,*dl_ch_mag128b,mmtmpD2,mmtmpD3,*rxdataF_comp128; int16x8_t *dl_ch_mag128,*dl_ch_mag128b,mmtmpD2,mmtmpD3,*rxdataF_comp128;
int16x4_t QAM_amp128,QAM_amp128b; int16x4_t QAM_amp128,QAM_amp128b;
int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1}; int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1};
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) { 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 if (frame_parms->mode1_flag==1) { // 10 out of 12 so don't reduce size
{ nb_rb=1+(5*nb_rb/6); } nb_rb=1+(5*nb_rb/6);
}
else else {
{ pilots=1; } pilots=1;
} }
}
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) { for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
if (mod_order == 4) { if (mod_order == 4) {
QAM_amp128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10) QAM_amp128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = vmov_n_s16(0); QAM_amp128b = vmov_n_s16(0);
} else if (mod_order == 6) {
QAM_amp128 = vmov_n_s16(QAM64_n1); //
QAM_amp128b = vmov_n_s16(QAM64_n2);
}
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (int16x4_t*)&dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128 = (int16x8_t*)&dl_ch_mag[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128b = (int16x8_t*)&dl_ch_magb[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (int16x8_t*)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) {
if (mod_order>2) {
// get channel amplitude if not QPSK
mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128[0]);
// mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3];
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
// mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits
mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128[1]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
// mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits
mmtmpD0 = vmull_s16(dl_ch128[2], dl_ch128[2]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
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);
mmtmpD1 = vmull_s16(dl_ch128[5], dl_ch128[5]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
}
} else if (mod_order == 6) { dl_ch_mag128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128b);
QAM_amp128 = vmov_n_s16(QAM64_n1); // dl_ch_mag128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128b);
QAM_amp128b = vmov_n_s16(QAM64_n2); dl_ch_mag128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128);
dl_ch_mag128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128);
if (pilots==0) {
dl_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b);
dl_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128);
}
} }
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol); mmtmpD0 = vmull_s16(dl_ch128[0], rx_dataF128[0]);
//mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])]
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { mmtmpD1 = vmull_s16(dl_ch128[1], rx_dataF128[1]);
//mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])]
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
dl_ch128 = (int16x4_t*)&dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128 = (int16x8_t*)&dl_ch_mag[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12]; mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[0],*(int16x4_t*)conj)), rx_dataF128[0]);
dl_ch_mag128b = (int16x8_t*)&dl_ch_magb[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12]; //mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[1],*(int16x4_t*)conj)), rx_dataF128[1]);
rxdataF_comp128 = (int16x8_t*)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12]; //mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
for (rb=0; rb<nb_rb; rb++) { //mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
if (mod_order>2) {
// get channel amplitude if not QPSK mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128[0]); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
// mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3]; rxdataF_comp128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
// mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits mmtmpD0 = vmull_s16(dl_ch128[2], rx_dataF128[2]);
mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128[1]); mmtmpD1 = vmull_s16(dl_ch128[3], rx_dataF128[3]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[2],*(int16x4_t*)conj)), rx_dataF128[2]);
// mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[3],*(int16x4_t*)conj)), rx_dataF128[3]);
mmtmpD0 = vmull_s16(dl_ch128[2], dl_ch128[2]); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128[3]); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch128[4], dl_ch128[4]); if (pilots==0) {
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vmull_s16(dl_ch128[4], rx_dataF128[4]);
mmtmpD1 = vmull_s16(dl_ch128[5], dl_ch128[5]); mmtmpD1 = vmull_s16(dl_ch128[5], rx_dataF128[5]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[4],*(int16x4_t*)conj)), rx_dataF128[4]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[5],*(int16x4_t*)conj)), rx_dataF128[5]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
}
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
dl_ch_mag128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128b); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
dl_ch_mag128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128b); rxdataF_comp128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
dl_ch_mag128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128);
dl_ch_mag128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128);
dl_ch128+=6;
dl_ch_mag128+=3;
if (pilots==0) { dl_ch_mag128b+=3;
dl_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b); rxdataF128+=6;
dl_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128); rxdataF_comp128+=3;
}
} } else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
dl_ch128+=4;
mmtmpD0 = vmull_s16(dl_ch128[0], rx_dataF128[0]); dl_ch_mag128+=2;
//mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])] dl_ch_mag128b+=2;
mmtmpD1 = vmull_s16(dl_ch128[1], rx_dataF128[1]); rxdataF128+=4;
//mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])] rxdataF_comp128+=2;
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[0],*(int16x4_t*)conj)), rx_dataF128[0]);
//mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[1],*(int16x4_t*)conj)), rx_dataF128[1]);
//mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch128[2], rx_dataF128[2]);
mmtmpD1 = vmull_s16(dl_ch128[3], rx_dataF128[3]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[2],*(int16x4_t*)conj)), rx_dataF128[2]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[3],*(int16x4_t*)conj)), rx_dataF128[3]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch128[4], rx_dataF128[4]);
mmtmpD1 = vmull_s16(dl_ch128[5], rx_dataF128[5]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[4],*(int16x4_t*)conj)), rx_dataF128[4]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[5],*(int16x4_t*)conj)), rx_dataF128[5]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
dl_ch128+=6;
dl_ch_mag128+=3;
dl_ch_mag128b+=3;
rxdataF128+=6;
rxdataF_comp128+=3;
} else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
dl_ch128+=4;
dl_ch_mag128+=2;
dl_ch_mag128b+=2;
rxdataF128+=4;
rxdataF_comp128+=2;
}
}
} }
}
} }
}
if (rho) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { if (rho) {
rho128 = (int16x8_t*)&rho[aarx][symbol*frame_parms->N_RB_DL*12]; for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; rho128 = (int16x8_t*)&rho[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch128_2 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch128_2 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) {
for (rb=0; rb<nb_rb; rb++) {
mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128_2[0]);
mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128_2[1]); mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128_2[0]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128_2[1]);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[0],*(int16x4_t*)conj)), dl_ch128_2[0]); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[1],*(int16x4_t*)conj)), dl_ch128_2[1]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[0],*(int16x4_t*)conj)), dl_ch128_2[0]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[1],*(int16x4_t*)conj)), dl_ch128_2[1]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
rho128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rho128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch128[2], dl_ch128_2[2]);
mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128_2[3]); mmtmpD0 = vmull_s16(dl_ch128[2], dl_ch128_2[2]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128_2[3]);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[2],*(int16x4_t*)conj)), dl_ch128_2[2]); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[3],*(int16x4_t*)conj)), dl_ch128_2[3]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[2],*(int16x4_t*)conj)), dl_ch128_2[2]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[3],*(int16x4_t*)conj)), dl_ch128_2[3]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
rho128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rho128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128_2[0]);
mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128_2[1]); mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128_2[0]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128_2[1]);
mmtmpD0 = vrev32q_s16(vmul_s16(dl_ch128[4],*(int16x4_t*)conj), dl_ch128_2[4]); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[5],*(int16x4_t*)conj)), dl_ch128_2[5]); mmtmpD0 = vrev32q_s16(vmul_s16(dl_ch128[4],*(int16x4_t*)conj), dl_ch128_2[4]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[5],*(int16x4_t*)conj)), dl_ch128_2[5]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
rho128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rho128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
dl_ch128+=6;
dl_ch128_2+=6; dl_ch128+=6;
rho128+=3; dl_ch128_2+=6;
} rho128+=3;
}
if (first_symbol_flag==1) {
phy_measurements->rx_correlation[0][aarx] = signal_energy(&rho[aarx][symbol*frame_parms->N_RB_DL*12],rb*12); if (first_symbol_flag==1) {
} phy_measurements->rx_correlation[0][aarx] = signal_energy(&rho[aarx][symbol*frame_parms->N_RB_DL*12],rb*12);
} }
} }
}
#endif #endif
} }
...@@ -1308,36 +1312,37 @@ void prec2A_TM56_128(unsigned char pmi,__m128i *ch0,__m128i *ch1) ...@@ -1308,36 +1312,37 @@ void prec2A_TM56_128(unsigned char pmi,__m128i *ch0,__m128i *ch1)
} }
#elif defined(__arm__) #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); int16x8_t amp;
amp = vmovq_n_s16(ONE_OVER_SQRT2_Q15);
switch (pmi) {
case 0 : // +1 +1 switch (pmi) {
// print_shorts("phase 0 :ch0",ch0); case 0 : // +1 +1
// print_shorts("phase 0 :ch1",ch1); // print_shorts("phase 0 :ch0",ch0);
ch0[0] = vqadd_s16(ch0[0],ch1[0]); // print_shorts("phase 0 :ch1",ch1);
break; ch0[0] = vqadd_s16(ch0[0],ch1[0]);
break;
case 1 : // +1 -1
// print_shorts("phase 1 :ch0",ch0); case 1 : // +1 -1
// print_shorts("phase 1 :ch1",ch1); // print_shorts("phase 1 :ch0",ch0);
ch0[0] = vqsub_s16(ch0[0],ch1[0]); // print_shorts("phase 1 :ch1",ch1);
// print_shorts("phase 1 :ch0-ch1",ch0); ch0[0] = vqsub_s16(ch0[0],ch1[0]);
break; // print_shorts("phase 1 :ch0-ch1",ch0);
break;
case 2 : // +1 +j
ch1[0] = vrev32q_s16(vmul_s16(ch1[0],*(int16x4_t*)conj)); case 2 : // +1 +j
ch0[0] = vqsub_s16(ch0[0],ch1[0]); ch1[0] = vrev32q_s16(vmul_s16(ch1[0],*(int16x4_t*)conj));
break; // +1 -j ch0[0] = vqsub_s16(ch0[0],ch1[0]);
break; // +1 -j
case 3 :
ch1[0] = vrev32q_s16(vmul_s16(ch1[0],*(int16x4_t*)conj)); case 3 :
ch0[0] = vqadd_s16(ch0[0],ch1[0]); ch1[0] = vrev32q_s16(vmul_s16(ch1[0],*(int16x4_t*)conj));
break; ch0[0] = vqadd_s16(ch0[0],ch1[0]);
} break;
}
ch0[0] = vmulhq_s16(ch0[0],amp);
ch0[0] = vmulhq_s16(ch0[0],amp);
} }
#endif #endif
...@@ -1352,8 +1357,8 @@ short TM3_prec[8]__attribute__((aligned(16))) = {1,1,-1,-1,1,1,-1,-1} ; ...@@ -1352,8 +1357,8 @@ short TM3_prec[8]__attribute__((aligned(16))) = {1,1,-1,-1,1,1,-1,-1} ;
static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1) __attribute__((always_inline)); static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1) __attribute__((always_inline));
static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1) static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1)
{ {
// __m128i amp = _mm_set1_epi16(ONE_OVER_SQRT2_Q15); // __m128i amp = _mm_set1_epi16(ONE_OVER_SQRT2_Q15);
__m128i tmp0,tmp1; __m128i tmp0,tmp1;
...@@ -1384,14 +1389,15 @@ static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1) ...@@ -1384,14 +1389,15 @@ static inline void prec2A_TM3_128(__m128i *ch0,__m128i *ch1)
#elif defined(__arm__) #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; int16x8_t tmp0,tmp1;
tmp0 = ch0[0]; tmp0 = ch0[0];
tmp1 = vmulq_s16(ch1[0],((int16x8_t*)&TM3_prec)[0]); tmp1 = vmulq_s16(ch1[0],((int16x8_t*)&TM3_prec)[0]);
ch0[0] = vhaddq_s16(ch0[0],tmp1); ch0[0] = vhaddq_s16(ch0[0],tmp1);
ch1[0] = vhsubq_s16(tmp0,tmp1); ch1[0] = vhsubq_s16(tmp0,tmp1);
} }
#endif #endif
...@@ -1441,7 +1447,7 @@ void prec2A_TM4_128(int pmi,__m128i *ch0,__m128i *ch1) ...@@ -1441,7 +1447,7 @@ void prec2A_TM4_128(int pmi,__m128i *ch0,__m128i *ch1)
ch1[0] = vqsub_s16(ch0[0],ch1[0]); ch1[0] = vqsub_s16(ch0[0],ch1[0]);
} else { } else {
tmp0 = ch0[0]; tmp0 = ch0[0];
tmp1 = vrev32q_s16(vmul_s16(ch1[0],*(int16x4_t*)conj)); tmp1 = vrev32q_s16(vmul_s16(ch1[0],*(int16x4_t*)conj));
ch0[0] = vqadd_s16(tmp0,tmp1); ch0[0] = vqadd_s16(tmp0,tmp1);
ch1[0] = vqsub_s16(tmp0,tmp1); ch1[0] = vqsub_s16(tmp0,tmp1);
} }
...@@ -1659,165 +1665,168 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext, ...@@ -1659,165 +1665,168 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
#elif defined(__arm__) #elif defined(__arm__)
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0; unsigned char aatx,aarx,symbol_mod,pilots=0;
int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128,*rho128; int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128,*rho128;
int32x4_t mmtmpD0,mmtmpD1; int32x4_t mmtmpD0,mmtmpD1;
int16x8_t *dl_ch_mag128,*dl_ch_mag128b,mmtmpD2,mmtmpD3,*rxdataF_comp128; int16x8_t *dl_ch_mag128,*dl_ch_mag128b,mmtmpD2,mmtmpD3,*rxdataF_comp128;
int16x4_t QAM_amp128,QAM_amp128b; int16x4_t QAM_amp128,QAM_amp128b;
int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1}; int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1};
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) { 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 if (frame_parms->mode1_flag==1) { // 10 out of 12 so don't reduce size
{ nb_rb=1+(5*nb_rb/6); } nb_rb=1+(5*nb_rb/6);
}
else else {
{ pilots=1; } pilots=1;
} }
}
if (mod_order == 4) { if (mod_order == 4) {
QAM_amp128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10) QAM_amp128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10)
QAM_amp128b = vmov_n_s16(0); QAM_amp128b = vmov_n_s16(0);
} else if (mod_order == 6) { } else if (mod_order == 6) {
QAM_amp128 = vmov_n_s16(QAM64_n1); // QAM_amp128 = vmov_n_s16(QAM64_n1); //
QAM_amp128b = vmov_n_s16(QAM64_n2); QAM_amp128b = vmov_n_s16(QAM64_n2);
} }
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol); // printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
dl_ch1_128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch1_128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch2_128 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch2_128 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128 = (int16x8_t*)&dl_ch_mag[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag128 = (int16x8_t*)&dl_ch_mag[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag128b = (int16x8_t*)&dl_ch_magb[aarx][symbol*frame_parms->N_RB_DL*12]; dl_ch_mag128b = (int16x8_t*)&dl_ch_magb[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp128 = (int16x8_t*)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12]; rxdataF_comp128 = (int16x8_t*)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) { for (rb=0; rb<nb_rb; rb++) {
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("mode 6 prec: rb %d, pmi->%d\n",rb,pmi_ext[rb]); printf("mode 6 prec: rb %d, pmi->%d\n",rb,pmi_ext[rb]);
#endif #endif
prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128[0],&dl_ch1_128[0]); prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128[0],&dl_ch1_128[0]);
prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128[1],&dl_ch1_128[1]); prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128[1],&dl_ch1_128[1]);
if (pilots==0) { if (pilots==0) {
prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128[2],&dl_ch1_128[2]); prec2A_TM56_128(pmi_ext[rb],&dl_ch0_128[2],&dl_ch1_128[2]);
} }
if (mod_order>2) { if (mod_order>2) {
// get channel amplitude if not QPSK // get channel amplitude if not QPSK
mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128[0]); mmtmpD0 = vmull_s16(dl_ch128[0], dl_ch128[0]);
// mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3]; // mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3];
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
// mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits // mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits
mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128[1]); mmtmpD1 = vmull_s16(dl_ch128[1], dl_ch128[1]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
// mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits // mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits
mmtmpD0 = vmull_s16(dl_ch128[2], dl_ch128[2]); mmtmpD0 = vmull_s16(dl_ch128[2], dl_ch128[2]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128[3]); mmtmpD1 = vmull_s16(dl_ch128[3], dl_ch128[3]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) { if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch128[4], dl_ch128[4]); mmtmpD0 = vmull_s16(dl_ch128[4], dl_ch128[4]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch128[5], dl_ch128[5]); mmtmpD1 = vmull_s16(dl_ch128[5], dl_ch128[5]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
} }
dl_ch_mag128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128b); dl_ch_mag128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128b);
dl_ch_mag128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128b); dl_ch_mag128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128b);
dl_ch_mag128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128); dl_ch_mag128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp128);
dl_ch_mag128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128); dl_ch_mag128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp128);
if (pilots==0) { if (pilots==0) {
dl_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b); dl_ch_mag128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128b);
dl_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128); dl_ch_mag128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp128);
} }
} }
mmtmpD0 = vmull_s16(dl_ch128[0], rx_dataF128[0]); mmtmpD0 = vmull_s16(dl_ch128[0], rx_dataF128[0]);
//mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])] //mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])]
mmtmpD1 = vmull_s16(dl_ch128[1], rx_dataF128[1]); mmtmpD1 = vmull_s16(dl_ch128[1], rx_dataF128[1]);
//mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])] //mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])]
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])] //mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[0],*(int16x4_t*)conj)), rx_dataF128[0]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[0],*(int16x4_t*)conj)), rx_dataF128[0]);
//mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])] //mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[1],*(int16x4_t*)conj)), rx_dataF128[1]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[1],*(int16x4_t*)conj)), rx_dataF128[1]);
//mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])] //mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])] //mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch128[2], rx_dataF128[2]); mmtmpD0 = vmull_s16(dl_ch128[2], rx_dataF128[2]);
mmtmpD1 = vmull_s16(dl_ch128[3], rx_dataF128[3]); mmtmpD1 = vmull_s16(dl_ch128[3], rx_dataF128[3]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[2],*(int16x4_t*)conj)), rx_dataF128[2]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[2],*(int16x4_t*)conj)), rx_dataF128[2]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[3],*(int16x4_t*)conj)), rx_dataF128[3]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[3],*(int16x4_t*)conj)), rx_dataF128[3]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) { if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch128[4], rx_dataF128[4]); mmtmpD0 = vmull_s16(dl_ch128[4], rx_dataF128[4]);
mmtmpD1 = vmull_s16(dl_ch128[5], rx_dataF128[5]); mmtmpD1 = vmull_s16(dl_ch128[5], rx_dataF128[5]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[4],*(int16x4_t*)conj)), rx_dataF128[4]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[4],*(int16x4_t*)conj)), rx_dataF128[4]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[5],*(int16x4_t*)conj)), rx_dataF128[5]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch128[5],*(int16x4_t*)conj)), rx_dataF128[5]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
dl_ch128+=6; dl_ch128+=6;
dl_ch_mag128+=3; dl_ch_mag128+=3;
dl_ch_mag128b+=3; dl_ch_mag128b+=3;
rxdataF128+=6; rxdataF128+=6;
rxdataF_comp128+=3; rxdataF_comp128+=3;
} else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less } else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
dl_ch128+=4; dl_ch128+=4;
dl_ch_mag128+=2; dl_ch_mag128+=2;
dl_ch_mag128b+=2; dl_ch_mag128b+=2;
rxdataF128+=4; rxdataF128+=4;
rxdataF_comp128+=2; rxdataF_comp128+=2;
}
} }
Nre = (pilots==0) ? 12 : 8;
precoded_signal_strength += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*Nre],
(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);
Nre = (pilots==0) ? 12 : 8;
precoded_signal_strength += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*Nre],
(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 #endif
} }
...@@ -2157,10 +2166,10 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2157,10 +2166,10 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
Nre = (pilots==0) ? 12 : 8; Nre = (pilots==0) ? 12 : 8;
precoded_signal_strength0 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*Nre], precoded_signal_strength0 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*Nre],
(nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx])); (nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx]));
precoded_signal_strength1 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx+2][symbol*frame_parms->N_RB_DL*Nre], precoded_signal_strength1 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx+2][symbol*frame_parms->N_RB_DL*Nre],
(nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx])); (nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx]));
} // rx_antennas } // rx_antennas
phy_measurements->precoded_cqi_dB[eNB_id][0] = dB_fixed2(precoded_signal_strength0,phy_measurements->n0_power_tot); phy_measurements->precoded_cqi_dB[eNB_id][0] = dB_fixed2(precoded_signal_strength0,phy_measurements->n0_power_tot);
...@@ -2174,272 +2183,274 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -2174,272 +2183,274 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
#elif defined(__arm__) #elif defined(__arm__)
unsigned short rb; unsigned short rb;
unsigned char aatx,aarx,symbol_mod,pilots=0; unsigned char aatx,aarx,symbol_mod,pilots=0;
int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128; int16x4_t *dl_ch128,*dl_ch128_2,*rxdataF128;
int32x4_t mmtmpD0,mmtmpD1; int32x4_t mmtmpD0,mmtmpD1;
int16x8_t *dl_ch_mag0_128,*dl_ch_mag1_128b,mmtmpD2,mmtmpD3,*rxdataF_comp0_128,*rxdataF_comp1_128; int16x8_t *dl_ch_mag0_128,*dl_ch_mag1_128b,mmtmpD2,mmtmpD3,*rxdataF_comp0_128,*rxdataF_comp1_128;
int16x4_t QAM_amp0_128,QAM_amp1_128b; int16x4_t QAM_amp0_128,QAM_amp1_128b;
int **rxdataF_ext = lte_ue_pdsch_vars->rxdataF_ext; int **rxdataF_ext = lte_ue_pdsch_vars->rxdataF_ext;
int **dl_ch_estimates_ext = lte_ue_pdsch_vars->dl_ch_estimates_ext; int **dl_ch_estimates_ext = lte_ue_pdsch_vars->dl_ch_estimates_ext;
int **dl_ch_mag0 = lte_ue_pdsch_vars->dl_ch_mag0; int **dl_ch_mag0 = lte_ue_pdsch_vars->dl_ch_mag0;
int **dl_ch_mag1 = lte_ue_pdsch_vars->dl_ch_mag1; int **dl_ch_mag1 = lte_ue_pdsch_vars->dl_ch_mag1;
int **dl_ch_magb0 = lte_ue_pdsch_vars->dl_ch_magb0; int **dl_ch_magb0 = lte_ue_pdsch_vars->dl_ch_magb0;
int **dl_ch_magb1 = lte_ue_pdsch_vars->dl_ch_magb1; int **dl_ch_magb1 = lte_ue_pdsch_vars->dl_ch_magb1;
int **rxdataF_comp0 = lte_ue_pdsch_vars->rxdataF_comp0; int **rxdataF_comp0 = lte_ue_pdsch_vars->rxdataF_comp0;
int **rxdataF_comp1 = lte_ue_pdsch_vars->rxdataF_comp1[round]; //? int **rxdataF_comp1 = lte_ue_pdsch_vars->rxdataF_comp1[round]; //?
int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1};
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; int16_t conj[4]__attribute__((aligned(16))) = {1,-1,1,-1};
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) { symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
if (frame_parms->mode1_flag==1) // 10 out of 12 so don't reduce size
{ nb_rb=1+(5*nb_rb/6); }
else if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
{ pilots=1; } if (frame_parms->mode1_flag==1) { // 10 out of 12 so don't reduce size
nb_rb=1+(5*nb_rb/6);
} }
else {
if (mod_order0 == 4) { pilots=1;
QAM_amp0_128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10)
QAM_amp0_128b = vmov_n_s16(0);
} else if (mod_order0 == 6) {
QAM_amp0_128 = vmov_n_s16(QAM64_n1); //
QAM_amp0_128b = vmov_n_s16(QAM64_n2);
} }
}
if (mod_order1 == 4) {
QAM_amp1_128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10) if (mod_order0 == 4) {
QAM_amp1_128b = vmov_n_s16(0); QAM_amp0_128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10)
QAM_amp0_128b = vmov_n_s16(0);
} else if (mod_order1 == 6) {
QAM_amp1_128 = vmov_n_s16(QAM64_n1); // } else if (mod_order0 == 6) {
QAM_amp1_128b = vmov_n_s16(QAM64_n2); QAM_amp0_128 = vmov_n_s16(QAM64_n1); //
} QAM_amp0_128b = vmov_n_s16(QAM64_n2);
}
// printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
if (mod_order1 == 4) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { QAM_amp1_128 = vmov_n_s16(QAM16_n1); // 2/sqrt(10)
QAM_amp1_128b = vmov_n_s16(0);
} else if (mod_order1 == 6) {
dl_ch1_128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; QAM_amp1_128 = vmov_n_s16(QAM64_n1); //
dl_ch2_128 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; QAM_amp1_128b = vmov_n_s16(QAM64_n2);
dl_ch_mag0_128 = (int16x8_t*)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12]; }
dl_ch_mag0_128b = (int16x8_t*)&dl_ch_mag0b[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag1_128 = (int16x8_t*)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12]; // printf("comp: rxdataF_comp %p, symbol %d\n",rxdataF_comp[0],symbol);
dl_ch_mag1_128b = (int16x8_t*)&dl_ch_mag1b[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
rxdataF_comp0_128 = (int16x8_t*)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp1_128 = (int16x8_t*)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) { dl_ch1_128 = (int16x4_t*)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch2_128 = (int16x4_t*)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag0_128 = (int16x8_t*)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag0_128b = (int16x8_t*)&dl_ch_mag0b[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag1_128 = (int16x8_t*)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12];
dl_ch_mag1_128b = (int16x8_t*)&dl_ch_mag1b[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF128 = (int16x4_t*)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp0_128 = (int16x8_t*)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12];
rxdataF_comp1_128 = (int16x8_t*)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12];
for (rb=0; rb<nb_rb; rb++) {
#ifdef DEBUG_DLSCH_DEMOD #ifdef DEBUG_DLSCH_DEMOD
printf("mode 6 prec: rb %d, pmi->%d\n",rb,pmi_ext[rb]); printf("mode 6 prec: rb %d, pmi->%d\n",rb,pmi_ext[rb]);
#endif #endif
prec2A_TM3_128(&dl_ch0_128[0],&dl_ch1_128[0]); prec2A_TM3_128(&dl_ch0_128[0],&dl_ch1_128[0]);
prec2A_TM3_128(&dl_ch0_128[1],&dl_ch1_128[1]); prec2A_TM3_128(&dl_ch0_128[1],&dl_ch1_128[1]);
if (pilots==0) { if (pilots==0) {
prec2A_TM3_128(&dl_ch0_128[2],&dl_ch1_128[2]); prec2A_TM3_128(&dl_ch0_128[2],&dl_ch1_128[2]);
} }
if (mod_order0>2) { if (mod_order0>2) {
// get channel amplitude if not QPSK // get channel amplitude if not QPSK
mmtmpD0 = vmull_s16(dl_ch0_128[0], dl_ch0_128[0]); mmtmpD0 = vmull_s16(dl_ch0_128[0], dl_ch0_128[0]);
// mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3]; // mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3];
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
// mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits // mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits
mmtmpD1 = vmull_s16(dl_ch0_128[1], dl_ch0_128[1]); mmtmpD1 = vmull_s16(dl_ch0_128[1], dl_ch0_128[1]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
// mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits // mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits
mmtmpD0 = vmull_s16(dl_ch0_128[2], dl_ch0_128[2]); mmtmpD0 = vmull_s16(dl_ch0_128[2], dl_ch0_128[2]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch0_128[3], dl_ch0_128[3]); mmtmpD1 = vmull_s16(dl_ch0_128[3], dl_ch0_128[3]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) { if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch0_128[4], dl_ch0_128[4]); mmtmpD0 = vmull_s16(dl_ch0_128[4], dl_ch0_128[4]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch0_128[5], dl_ch0_128[5]); mmtmpD1 = vmull_s16(dl_ch0_128[5], dl_ch0_128[5]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
} }
dl_ch_mag0_128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp0_128b); dl_ch_mag0_128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp0_128b);
dl_ch_mag0_128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp0_128b); dl_ch_mag0_128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp0_128b);
dl_ch_mag0_128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp0_128); dl_ch_mag0_128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp0_128);
dl_ch_mag0_128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp0_128); dl_ch_mag0_128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp0_128);
if (pilots==0) { if (pilots==0) {
dl_ch_mag0_128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp0_128b); dl_ch_mag0_128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp0_128b);
dl_ch_mag0_128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp0_128); dl_ch_mag0_128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp0_128);
} }
} }
if (mod_order1>2) { if (mod_order1>2) {
// get channel amplitude if not QPSK // get channel amplitude if not QPSK
mmtmpD0 = vmull_s16(dl_ch1_128[0], dl_ch1_128[0]); mmtmpD0 = vmull_s16(dl_ch1_128[0], dl_ch1_128[0]);
// mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3]; // mmtmpD0 = [ch0*ch0,ch1*ch1,ch2*ch2,ch3*ch3];
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
// mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits // mmtmpD0 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3]>>output_shift on 32-bits
mmtmpD1 = vmull_s16(dl_ch1_128[1], dl_ch1_128[1]); mmtmpD1 = vmull_s16(dl_ch1_128[1], dl_ch1_128[1]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD2 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
// mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits // mmtmpD2 = [ch0*ch0 + ch1*ch1,ch0*ch0 + ch1*ch1,ch2*ch2 + ch3*ch3,ch2*ch2 + ch3*ch3,ch4*ch4 + ch5*ch5,ch4*ch4 + ch5*ch5,ch6*ch6 + ch7*ch7,ch6*ch6 + ch7*ch7]>>output_shift on 16-bits
mmtmpD0 = vmull_s16(dl_ch1_128[2], dl_ch1_128[2]); mmtmpD0 = vmull_s16(dl_ch1_128[2], dl_ch1_128[2]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch1_128[3], dl_ch1_128[3]); mmtmpD1 = vmull_s16(dl_ch1_128[3], dl_ch1_128[3]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD3 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) { if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch1_128[4], dl_ch1_128[4]); mmtmpD0 = vmull_s16(dl_ch1_128[4], dl_ch1_128[4]);
mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift); mmtmpD0 = vqshlq_s32(vqaddq_s32(mmtmpD0,vrev64q_s32(mmtmpD0)),-output_shift);
mmtmpD1 = vmull_s16(dl_ch1_128[5], dl_ch1_128[5]); mmtmpD1 = vmull_s16(dl_ch1_128[5], dl_ch1_128[5]);
mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift); mmtmpD1 = vqshlq_s32(vqaddq_s32(mmtmpD1,vrev64q_s32(mmtmpD1)),-output_shift);
mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); mmtmpD4 = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
} }
dl_ch_mag1_128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp1_128b); dl_ch_mag1_128b[0] = vqdmulhq_s16(mmtmpD2,QAM_amp1_128b);
dl_ch_mag1_128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp1_128b); dl_ch_mag1_128b[1] = vqdmulhq_s16(mmtmpD3,QAM_amp1_128b);
dl_ch_mag1_128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp1_128); dl_ch_mag1_128[0] = vqdmulhq_s16(mmtmpD2,QAM_amp1_128);
dl_ch_mag1_128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp1_128); dl_ch_mag1_128[1] = vqdmulhq_s16(mmtmpD3,QAM_amp1_128);
if (pilots==0) { if (pilots==0) {
dl_ch_mag1_128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp1_128b); dl_ch_mag1_128b[2] = vqdmulhq_s16(mmtmpD4,QAM_amp1_128b);
dl_ch_mag1_128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp1_128); dl_ch_mag1_128[2] = vqdmulhq_s16(mmtmpD4,QAM_amp1_128);
} }
} }
mmtmpD0 = vmull_s16(dl_ch0_128[0], rx_dataF128[0]); mmtmpD0 = vmull_s16(dl_ch0_128[0], rx_dataF128[0]);
//mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])] //mmtmpD0 = [Re(ch[0])Re(rx[0]) Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1]) Im(ch[1])Im(ch[1])]
mmtmpD1 = vmull_s16(dl_ch0_128[1], rx_dataF128[1]); mmtmpD1 = vmull_s16(dl_ch0_128[1], rx_dataF128[1]);
//mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])] //mmtmpD1 = [Re(ch[2])Re(rx[2]) Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3]) Im(ch[3])Im(ch[3])]
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])] //mmtmpD0 = [Re(ch[0])Re(rx[0])+Im(ch[0])Im(ch[0]) Re(ch[1])Re(rx[1])+Im(ch[1])Im(ch[1]) Re(ch[2])Re(rx[2])+Im(ch[2])Im(ch[2]) Re(ch[3])Re(rx[3])+Im(ch[3])Im(ch[3])]
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[0],*(int16x4_t*)conj)), rx_dataF128[0]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[0],*(int16x4_t*)conj)), rx_dataF128[0]);
//mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])] //mmtmpD0 = [-Im(ch[0])Re(rx[0]) Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1]) Re(ch[1])Im(rx[1])]
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[1],*(int16x4_t*)conj)), rx_dataF128[1]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[1],*(int16x4_t*)conj)), rx_dataF128[1]);
//mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])] //mmtmpD0 = [-Im(ch[2])Re(rx[2]) Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3]) Re(ch[3])Im(rx[3])]
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
//mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])] //mmtmpD1 = [-Im(ch[0])Re(rx[0])+Re(ch[0])Im(rx[0]) -Im(ch[1])Re(rx[1])+Re(ch[1])Im(rx[1]) -Im(ch[2])Re(rx[2])+Re(ch[2])Im(rx[2]) -Im(ch[3])Re(rx[3])+Re(ch[3])Im(rx[3])]
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp0_128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp0_128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch0_128[2], rx_dataF128[2]); mmtmpD0 = vmull_s16(dl_ch0_128[2], rx_dataF128[2]);
mmtmpD1 = vmull_s16(dl_ch0_128[3], rx_dataF128[3]); mmtmpD1 = vmull_s16(dl_ch0_128[3], rx_dataF128[3]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[2],*(int16x4_t*)conj)), rx_dataF128[2]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[2],*(int16x4_t*)conj)), rx_dataF128[2]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[3],*(int16x4_t*)conj)), rx_dataF128[3]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[3],*(int16x4_t*)conj)), rx_dataF128[3]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp0_128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp0_128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch1_128[0], rx_dataF128[0]); mmtmpD0 = vmull_s16(dl_ch1_128[0], rx_dataF128[0]);
mmtmpD1 = vmull_s16(dl_ch1_128[1], rx_dataF128[1]); mmtmpD1 = vmull_s16(dl_ch1_128[1], rx_dataF128[1]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[0],*(int16x4_t*)conj)), rx_dataF128[0]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[0],*(int16x4_t*)conj)), rx_dataF128[0]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[1],*(int16x4_t*)conj)), rx_dataF128[1]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[1],*(int16x4_t*)conj)), rx_dataF128[1]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp1_128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp1_128[0] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch1_128[2], rx_dataF128[2]); mmtmpD0 = vmull_s16(dl_ch1_128[2], rx_dataF128[2]);
mmtmpD1 = vmull_s16(dl_ch1_128[3], rx_dataF128[3]); mmtmpD1 = vmull_s16(dl_ch1_128[3], rx_dataF128[3]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[2],*(int16x4_t*)conj)), rx_dataF128[2]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[2],*(int16x4_t*)conj)), rx_dataF128[2]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[3],*(int16x4_t*)conj)), rx_dataF128[3]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[3],*(int16x4_t*)conj)), rx_dataF128[3]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp1_128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp1_128[1] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
if (pilots==0) { if (pilots==0) {
mmtmpD0 = vmull_s16(dl_ch0_128[4], rx_dataF128[4]); mmtmpD0 = vmull_s16(dl_ch0_128[4], rx_dataF128[4]);
mmtmpD1 = vmull_s16(dl_ch0_128[5], rx_dataF128[5]); mmtmpD1 = vmull_s16(dl_ch0_128[5], rx_dataF128[5]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[4],*(int16x4_t*)conj)), rx_dataF128[4]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[4],*(int16x4_t*)conj)), rx_dataF128[4]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[5],*(int16x4_t*)conj)), rx_dataF128[5]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch0_128[5],*(int16x4_t*)conj)), rx_dataF128[5]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp0_128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp0_128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
mmtmpD0 = vmull_s16(dl_ch1_128[4], rx_dataF128[4]); mmtmpD0 = vmull_s16(dl_ch1_128[4], rx_dataF128[4]);
mmtmpD1 = vmull_s16(dl_ch1_128[5], rx_dataF128[5]); mmtmpD1 = vmull_s16(dl_ch1_128[5], rx_dataF128[5]);
mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD0 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch1_128[4],*(int16x4_t*)conj)), rx_dataF128[4]); mmtmpD0 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch1_128[4],*(int16x4_t*)conj)), rx_dataF128[4]);
mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch1_128[5],*(int16x4_t*)conj)), rx_dataF128[5]); mmtmpD1 = vmull_s16(vrev32q_s16(vmulq_s16(dl_ch1_128[5],*(int16x4_t*)conj)), rx_dataF128[5]);
mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1); mmtmpD1 = vpadd_s32(mmtmpD0,mmtmpD1);
mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift); mmtmpD0 = vqshlq_s32(mmtmpD0,-output_shift);
mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift); mmtmpD1 = vqshlq_s32(mmtmpD1,-output_shift);
rxdataF_comp1_128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1)); rxdataF_comp1_128[2] = vcombine_s16(vqmovn_s32(mmtmpD0),vwmovn_s32(mmtmpD1));
dl_ch0_128+=6; dl_ch0_128+=6;
dl_ch1_128+=6; dl_ch1_128+=6;
dl_ch_mag0_128+=3; dl_ch_mag0_128+=3;
dl_ch_mag0_128b+=3; dl_ch_mag0_128b+=3;
dl_ch_mag1_128+=3; dl_ch_mag1_128+=3;
dl_ch_mag1_128b+=3; dl_ch_mag1_128b+=3;
rxdataF128+=6; rxdataF128+=6;
rxdataF_comp0_128+=3; rxdataF_comp0_128+=3;
rxdataF_comp1_128+=3; rxdataF_comp1_128+=3;
} else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less } else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
dl_ch0_128+=4; dl_ch0_128+=4;
dl_ch1_128+=4; dl_ch1_128+=4;
dl_ch_mag0_128+=2; dl_ch_mag0_128+=2;
dl_ch_mag0_128b+=2; dl_ch_mag0_128b+=2;
dl_ch_mag1_128+=2; dl_ch_mag1_128+=2;
dl_ch_mag1_128b+=2; dl_ch_mag1_128b+=2;
rxdataF128+=4; rxdataF128+=4;
rxdataF_comp0_128+=2; rxdataF_comp0_128+=2;
rxdataF_comp1_128+=2; rxdataF_comp1_128+=2;
}
} }
Nre = (pilots==0) ? 12 : 8;
precoded_signal_strength0 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*Nre],
(nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx]));
precoded_signal_strength1 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx+2][symbol*frame_parms->N_RB_DL*Nre],
(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_strength0,phy_measurements->n0_power_tot);
phy_measurements->precoded_cqi_dB[eNB_id][1] = dB_fixed2(precoded_signal_strength1,phy_measurements->n0_power_tot);
Nre = (pilots==0) ? 12 : 8;
precoded_signal_strength0 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*Nre],
(nb_rb*Nre))*rx_power_correction) - (phy_measurements->n0_power[aarx]));
precoded_signal_strength1 += ((signal_energy_nodc(&dl_ch_estimates_ext[aarx+2][symbol*frame_parms->N_RB_DL*Nre],
(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_strength0,phy_measurements->n0_power_tot);
phy_measurements->precoded_cqi_dB[eNB_id][1] = dB_fixed2(precoded_signal_strength1,phy_measurements->n0_power_tot);
#endif #endif
} }
...@@ -2681,6 +2692,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext, ...@@ -2681,6 +2692,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
} }
} }
} }
#elif defined(__arm__) #elif defined(__arm__)
#endif #endif
......
...@@ -691,6 +691,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra ...@@ -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]; u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0; uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) { if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
n_shift_ra = du[u]/NCS; n_shift_ra = du[u]/NCS;
d_start = (du[u]<<1) + (n_shift_ra * 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 ...@@ -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]; u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0; uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) { if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
n_shift_ra = du[u]/NCS; n_shift_ra = du[u]/NCS;
d_start = (du[u]<<1) + (n_shift_ra * NCS); d_start = (du[u]<<1) + (n_shift_ra * NCS);
...@@ -1577,6 +1579,7 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common, ...@@ -1577,6 +1579,7 @@ void compute_prach_seq(PRACH_CONFIG_COMMON *prach_config_common,
u = prach_root_sequence_map[index]; u = prach_root_sequence_map[index];
uint16_t n_group_ra = 0; uint16_t n_group_ra = 0;
if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) { if ( (du[u]<(N_ZC/3)) && (du[u]>=NCS) ) {
n_shift_ra = du[u]/NCS; n_shift_ra = du[u]/NCS;
d_start = (du[u]<<1) + (n_shift_ra * NCS); d_start = (du[u]<<1) + (n_shift_ra * NCS);
......
...@@ -71,9 +71,9 @@ static inline unsigned long long rdtsc_oai(void) ...@@ -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) __attribute__((always_inline));
static inline unsigned long long rdtsc_oai(void) static inline unsigned long long rdtsc_oai(void)
{ {
uint32_t r = 0; uint32_t r = 0;
asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) ); asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) );
return (unsigned long long)r; return (unsigned long long)r;
} }
#endif #endif
......
...@@ -153,7 +153,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) ...@@ -153,7 +153,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
return(-1); return(-1);
} else { } else {
if (phy_vars_eNB->eNB_UE_stats[i].crnti==0) { 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); 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->dlsch_eNB[i][0]->rnti = rnti;
phy_vars_eNB->ulsch_eNB[i]->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 ...@@ -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); MSC_LOG_EVENT(MSC_PHY_ENB, "Failed remove ue %"PRIx16" (not found)", rnti);
return(-1); return(-1);
} }
...@@ -2788,8 +2789,8 @@ void process_HARQ_feedback(uint8_t UE_id, ...@@ -2788,8 +2789,8 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch->rnti,dl_harq_pid[m]); dlsch->rnti,dl_harq_pid[m]);
#endif #endif
MSC_LOG_EVENT(MSC_PHY_ENB, "HARQ DLSCH Failed RNTI %"PRIx16" round %u", MSC_LOG_EVENT(MSC_PHY_ENB, "HARQ DLSCH Failed RNTI %"PRIx16" round %u",
dlsch->rnti, dlsch->rnti,
dlsch_harq_proc->round); dlsch_harq_proc->round);
dlsch_harq_proc->round = 0; dlsch_harq_proc->round = 0;
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++; 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 ...@@ -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; ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
TBsize = 57; TBsize = 57;
} }
break; break;
} }
} }
...@@ -384,13 +385,13 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un ...@@ -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], &eNB->common_channels[CC_id].CCCH_pdu.payload[0],
rrc_sdu_length); 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], 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), rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
eNB->subframe,0,0); eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n", 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); module_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
} }
nprb[CC_id]= nprb[CC_id] + 3; nprb[CC_id]= nprb[CC_id] + 3;
nCCE[CC_id] = nCCE[CC_id] + 4; nCCE[CC_id] = nCCE[CC_id] + 4;
......
...@@ -123,15 +123,15 @@ schedule_next_dlue( ...@@ -123,15 +123,15 @@ schedule_next_dlue(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
unsigned char unsigned char
generate_dlsch_header( generate_dlsch_header(
unsigned char* mac_header, unsigned char* mac_header,
unsigned char num_sdus, unsigned char num_sdus,
unsigned short *sdu_lengths, unsigned short *sdu_lengths,
unsigned char *sdu_lcids, unsigned char *sdu_lcids,
unsigned char drx_cmd, unsigned char drx_cmd,
short timing_advance_cmd, short timing_advance_cmd,
unsigned char *ue_cont_res_id, unsigned char *ue_cont_res_id,
unsigned char short_padding, unsigned char short_padding,
unsigned short post_padding unsigned short post_padding
) )
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
...@@ -419,12 +419,12 @@ set_ul_DAI( ...@@ -419,12 +419,12 @@ set_ul_DAI(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
schedule_ue_spec( schedule_ue_spec(
module_id_t module_idP, module_id_t module_idP,
frame_t frameP, frame_t frameP,
sub_frame_t subframeP, sub_frame_t subframeP,
unsigned int *nb_rb_used0, unsigned int *nb_rb_used0,
unsigned int *nCCE_used, unsigned int *nCCE_used,
int* mbsfn_flag int* mbsfn_flag
) )
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
...@@ -1077,12 +1077,13 @@ schedule_ue_spec( ...@@ -1077,12 +1077,13 @@ schedule_ue_spec(
NULL, // contention res id NULL, // contention res id
padding, padding,
post_padding); post_padding);
//#ifdef DEBUG_eNB_SCHEDULER //#ifdef DEBUG_eNB_SCHEDULER
if (ta_update) { if (ta_update) {
LOG_I(MAC, 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", "[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, 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); ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
} }
//#endif //#endif
...@@ -1105,14 +1106,15 @@ schedule_ue_spec( ...@@ -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); //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], 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), TBS, module_idP, 3, UE_RNTI(module_idP,UE_id),
eNB->subframe,0,0); eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n", LOG_D(OPT,"[eNB %d][DLSCH] Frame %d rnti %x with size %d\n",
module_idP, frameP, UE_RNTI(module_idP,UE_id), TBS); module_idP, frameP, UE_RNTI(module_idP,UE_id), TBS);
} }
aggregation = process_ue_cqi(module_idP,UE_id);
aggregation = process_ue_cqi(module_idP,UE_id);
nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE
nCCE_used[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; UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
...@@ -2085,7 +2087,7 @@ fill_DLSCH_dci( ...@@ -2085,7 +2087,7 @@ fill_DLSCH_dci(
if(rballoc_sub[i] == 1) { if(rballoc_sub[i] == 1) {
rballoc[CC_id] |= (0x0001<<i); // TO be FIXED!!!!!! rballoc[CC_id] |= (0x0001<<i); // TO be FIXED!!!!!!
} }
} }
...@@ -2408,9 +2410,9 @@ update_ul_dci( ...@@ -2408,9 +2410,9 @@ update_ul_dci(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void set_ue_dai( void set_ue_dai(
sub_frame_t subframeP, sub_frame_t subframeP,
uint8_t tdd_config, uint8_t tdd_config,
int UE_id, int UE_id,
uint8_t CC_id, uint8_t CC_id,
UE_list_t* UE_list 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 ...@@ -78,8 +78,7 @@ int8_t get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t CC_id, uint8_t mb
return -1; return -1;
} else if (eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) { } else if (eNB_mac_inst[module_idP].common_channels[CC_id].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) {
return mbsfn_sync_area; return mbsfn_sync_area;
} } else {
else {
LOG_W(MAC,"[eNB %d] MBSFN Subframe Config pattern %d not found \n ", module_idP, mbsfn_sync_area); LOG_W(MAC,"[eNB %d] MBSFN Subframe Config pattern %d not found \n ", module_idP, mbsfn_sync_area);
return -1; return -1;
} }
...@@ -620,14 +619,16 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra ...@@ -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++) { 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); 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 */ /* 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, 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 TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark
eNB_mac_inst[module_idP].subframe,0,0); eNB_mac_inst[module_idP].subframe,0,0);
LOG_D(OPT,"[eNB %d][MCH] Frame %d : MAC PDU with size %d\n", 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++) for (j=0;j<sdu_length_total;j++)
printf("%2x.",eNB_mac_inst[module_idP].MCH_pdu.payload[j+offset]); printf("%2x.",eNB_mac_inst[module_idP].MCH_pdu.payload[j+offset]);
......
...@@ -70,14 +70,14 @@ ...@@ -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}; 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( void rx_sdu(
const module_id_t enb_mod_idP, const module_id_t enb_mod_idP,
const int CC_idP, const int CC_idP,
const frame_t frameP, const frame_t frameP,
const rnti_t rntiP, const rnti_t rntiP,
uint8_t *sduP, uint8_t *sduP,
const uint16_t sdu_lenP, const uint16_t sdu_lenP,
const int harq_pidP, const int harq_pidP,
uint8_t *msg3_flagP) uint8_t *msg3_flagP)
{ {
unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr; unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr;
...@@ -274,11 +274,11 @@ void rx_sdu( ...@@ -274,11 +274,11 @@ void rx_sdu(
frameP, frameP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
rx_lcids[i], rx_lcids[i],
(char *)payload_ptr, (char *)payload_ptr,
rx_lengths[i], rx_lengths[i],
1, 1,
NULL);//(unsigned int*)crc_status); 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_pdu_rx[rx_lcids[i]]+=1;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; 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( ...@@ -310,11 +310,11 @@ void rx_sdu(
frameP, frameP,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
DTCH, DTCH,
(char *)payload_ptr, (char *)payload_ptr,
rx_lengths[i], rx_lengths[i],
1, 1,
NULL);//(unsigned int*)crc_status); 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_pdu_rx[rx_lcids[i]]+=1;
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i]; 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 ...@@ -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); //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]) { 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; continue;
// simple UE identity based grouping // simple UE identity based grouping
......
...@@ -312,7 +312,7 @@ void sort_UEs (module_id_t Mod_idP, ...@@ -312,7 +312,7 @@ void sort_UEs (module_id_t Mod_idP,
rnti1 = UE_RNTI(Mod_idP,i); rnti1 = UE_RNTI(Mod_idP,i);
if(rnti1 == NOT_A_RNTI) if(rnti1 == NOT_A_RNTI)
continue; continue;
UE_id1 = i; UE_id1 = i;
...@@ -409,16 +409,16 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -409,16 +409,16 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// Initialize scheduling information for all active UEs // Initialize scheduling information for all active UEs
dlsch_scheduler_pre_processor_reset( dlsch_scheduler_pre_processor_reset(
UE_id, UE_id,
CC_id, CC_id,
N_RBG[CC_id], N_RBG[CC_id],
dl_pow_off, dl_pow_off,
nb_rbs_required, nb_rbs_required,
pre_nb_available_rbs, pre_nb_available_rbs,
nb_rbs_required_remaining, nb_rbs_required_remaining,
rballoc_sub_UE, rballoc_sub_UE,
rballoc_sub, rballoc_sub,
MIMO_mode_indicator); MIMO_mode_indicator);
} }
} }
...@@ -494,6 +494,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id, ...@@ -494,6 +494,7 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
// extend nb_rbs_required to capture per LCID RB required // extend nb_rbs_required to capture per LCID RB required
for(i=UE_list->head; i>=0; i=UE_list->next[i]) { for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
rnti = UE_RNTI(Mod_id,i); rnti = UE_RNTI(Mod_id,i);
for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) { for (ii=0; ii<UE_num_active_CC(UE_list,i); ii++) {
CC_id = UE_list->ordered_CCids[ii][i]; CC_id = UE_list->ordered_CCids[ii][i];
...@@ -846,7 +847,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -846,7 +847,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
rnti = UE_RNTI(module_idP,i); rnti = UE_RNTI(module_idP,i);
if (rnti==NOT_A_RNTI) if (rnti==NOT_A_RNTI)
continue; continue;
UE_id = i; UE_id = i;
...@@ -872,12 +873,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -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, } 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; 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])) && } 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); 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 ) { } 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); 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; 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", 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); module_idP,frameP,subframeP,UE_id,CC_id);
...@@ -922,7 +922,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -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]) { for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
rnti = UE_RNTI(module_idP,i); rnti = UE_RNTI(module_idP,i);
if (rnti==NOT_A_RNTI) if (rnti==NOT_A_RNTI)
continue; continue;
UE_id = i; UE_id = i;
...@@ -1035,6 +1035,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra ...@@ -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++) { for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
// This is the actual CC_id in the list // This is the actual CC_id in the list
CC_id = UE_list->ordered_ULCCids[n][UE_id]; CC_id = UE_list->ordered_ULCCids[n][UE_id];
if (CC_id >= MAX_NUM_CCs) { if (CC_id >= MAX_NUM_CCs) {
LOG_E( MAC, "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u", LOG_E( MAC, "CC_id %u should be < %u, loop n=%u < numactiveULCCs[%u]=%u",
CC_id, CC_id,
...@@ -1124,7 +1125,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP) ...@@ -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); rnti1 = UE_RNTI(module_idP,i);
if(rnti1 == NOT_A_RNTI) if(rnti1 == NOT_A_RNTI)
continue; continue;
UE_id1 = i; UE_id1 = i;
......
...@@ -130,8 +130,7 @@ void get_prach_resources(module_id_t module_idP, ...@@ -130,8 +130,7 @@ void get_prach_resources(module_id_t module_idP,
if (UE_mac_inst[module_idP].radioResourceConfigCommon) { if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon; rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
} } else {
else {
LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP); LOG_E(MAC,"[UE %d] FATAL radioResourceConfigCommon is NULL !!!\n",module_idP);
mac_xface->macphy_exit("MAC FATAL radioResourceConfigCommon is NULL"); mac_xface->macphy_exit("MAC FATAL radioResourceConfigCommon is NULL");
return; // not reached return; // not reached
......
...@@ -633,8 +633,7 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are ...@@ -633,8 +633,7 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are
return -1; return -1;
} else if (UE_mac_inst[module_idP].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) { } else if (UE_mac_inst[module_idP].mbsfn_SubframeConfig[mbsfn_sync_area] != NULL) {
return mbsfn_sync_area; return mbsfn_sync_area;
} } else {
else {
LOG_W( MAC, "[UE %"PRIu8"] MBSFN Subframe Config pattern %"PRIu8" not found \n", module_idP, mbsfn_sync_area ); LOG_W( MAC, "[UE %"PRIu8"] MBSFN Subframe Config pattern %"PRIu8" not found \n", module_idP, mbsfn_sync_area );
return -1; 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 ...@@ -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); 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", 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); module_idP, frameP, UE_mac_inst[module_idP].crnti, buflen);
#endif #endif
LOG_D(MAC,"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n", LOG_D(MAC,"[UE %d][SR] Gave SDU to PHY, clearing any scheduling request\n",
...@@ -1691,7 +1690,7 @@ ue_scheduler( ...@@ -1691,7 +1690,7 @@ ue_scheduler(
UE_mac_inst[module_idP].PHR_reporting_active = 1; UE_mac_inst[module_idP].PHR_reporting_active = 1;
} else if (UE_mac_inst[module_idP].PHR_reporting_active == 0 ) { } else if (UE_mac_inst[module_idP].PHR_reporting_active == 0 ) {
UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF--; UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF--;
} }
} }
} else { // release / nothing } else { // release / nothing
UE_mac_inst[module_idP].PHR_reporting_active = 0; // release PHR UE_mac_inst[module_idP].PHR_reporting_active = 0; // release PHR
......
...@@ -192,7 +192,7 @@ rrc_ue_process_measConfig( ...@@ -192,7 +192,7 @@ rrc_ue_process_measConfig(
void rrc_ue_process_radioResourceConfigDedicated( void rrc_ue_process_radioResourceConfigDedicated(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
uint8_t eNB_index, uint8_t eNB_index,
RadioResourceConfigDedicated_t *radioResourceConfigDedicated); RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
// eNB/CH RRC Procedures // eNB/CH RRC Procedures
...@@ -445,8 +445,8 @@ uint8_t check_trigger_meas_event( ...@@ -445,8 +445,8 @@ uint8_t check_trigger_meas_event(
uint8_t eNB_index, uint8_t eNB_index,
uint8_t ue_cnx_index, uint8_t ue_cnx_index,
uint8_t meas_index, uint8_t meas_index,
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys, 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 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 rrc_ue_process_ueCapabilityEnquiry(uint8_t module_idP,uint32_t frame,UECapabilityEnquiry_t *UECapabilityEnquiry,uint8_t eNB_index);
/*void /*void
......
...@@ -583,7 +583,7 @@ rrc_ue_decode_ccch( ...@@ -583,7 +583,7 @@ rrc_ue_decode_ccch(
rrc_ue_process_radioResourceConfigDedicated( rrc_ue_process_radioResourceConfigDedicated(
ctxt_pP, ctxt_pP,
eNB_index, 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_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED); rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
...@@ -1199,7 +1199,7 @@ rrc_ue_process_radioResourceConfigDedicated( ...@@ -1199,7 +1199,7 @@ rrc_ue_process_radioResourceConfigDedicated(
MSC_AS_TIME_ARGS(ctxt_pP), MSC_AS_TIME_ARGS(ctxt_pP),
ctxt_pP->rnti, ctxt_pP->rnti,
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm | 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 // Refresh DRBs
rrc_pdcp_config_asn1_req(ctxt_pP, rrc_pdcp_config_asn1_req(ctxt_pP,
...@@ -1431,8 +1431,8 @@ rrc_ue_process_securityModeCommand( ...@@ -1431,8 +1431,8 @@ rrc_ue_process_securityModeCommand(
buffer, buffer,
PDCP_TRANSMISSION_MODE_CONTROL); PDCP_TRANSMISSION_MODE_CONTROL);
} }
}
} }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
...@@ -1546,7 +1546,7 @@ rrc_ue_process_ueCapabilityEnquiry( ...@@ -1546,7 +1546,7 @@ rrc_ue_process_ueCapabilityEnquiry(
void void
rrc_ue_process_rrcConnectionReconfiguration( rrc_ue_process_rrcConnectionReconfiguration(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
RRCConnectionReconfiguration_t *rrcConnectionReconfiguration, RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
uint8_t eNB_index uint8_t eNB_index
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -1960,7 +1960,7 @@ rrc_ue_decode_dcch( ...@@ -1960,7 +1960,7 @@ rrc_ue_decode_dcch(
rrc_ue_generate_RRCConnectionReconfigurationComplete( rrc_ue_generate_RRCConnectionReconfigurationComplete(
ctxt_pP, ctxt_pP,
target_eNB_index, 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[eNB_indexP].State = RRC_HO_EXECUTION;
UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED; 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", LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",
...@@ -2017,7 +2017,7 @@ rrc_ue_decode_dcch( ...@@ -2017,7 +2017,7 @@ rrc_ue_decode_dcch(
rrc_ue_generate_RRCConnectionReconfigurationComplete( rrc_ue_generate_RRCConnectionReconfigurationComplete(
ctxt_pP, ctxt_pP,
eNB_indexP, 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; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP].State = RRC_RECONFIGURED;
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n", LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n",
ctxt_pP->module_id, ctxt_pP->module_id,
...@@ -2444,27 +2444,27 @@ decode_SIB1( ...@@ -2444,27 +2444,27 @@ decode_SIB1(
plmn_Identity = &(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list.array[plmn]->plmn_Identity; plmn_Identity = &(*sib1)->cellAccessRelatedInfo.plmn_IdentityList.list.array[plmn]->plmn_Identity;
if ( if (
( (
(plmn_Identity->mcc == NULL) (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.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.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.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.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.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 == 0xf) && (plmn_Identity->mnc.list.count == 2))
|| ||
(UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit3 == *(plmn_Identity->mnc.list.array[2])) (UE_rrc_inst[ctxt_pP->module_id].plmnID.MNCdigit3 == *(plmn_Identity->mnc.list.array[2]))
) )
) { ) {
/* PLMN match, send a confirmation to NAS */ /* PLMN match, send a confirmation to NAS */
MessageDef *msg_p; MessageDef *msg_p;
...@@ -3473,7 +3473,7 @@ void ...@@ -3473,7 +3473,7 @@ void
RRC_MAC_MCCH_DATA_IND (msg_p).enb_index, 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,
RRC_MAC_MCCH_DATA_IND (msg_p).sdu_size, 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; break;
# endif # endif
...@@ -3485,7 +3485,7 @@ void ...@@ -3485,7 +3485,7 @@ void
msg_name, msg_name,
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).frame,
RRC_DCCH_DATA_IND (msg_p).dcch_index, 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", LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"Received %s DCCH %d, eNB %d",
PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt), PROTOCOL_RRC_CTXT_UE_ARGS(&ctxt),
...@@ -3521,13 +3521,13 @@ void ...@@ -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].plmnID = NAS_CELL_SELECTION_REQ (msg_p).plmnID;
UE_rrc_inst[ue_mod_id].rat = NAS_CELL_SELECTION_REQ (msg_p).rat; 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", LOG_I(RRC, "[UE %d] Save cell selection criterion MCC %X%X%X MNC %X%X%X\n",
ue_mod_id, ue_mod_id,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit1, UE_rrc_inst[ue_mod_id].plmnID.MCCdigit1,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit2, UE_rrc_inst[ue_mod_id].plmnID.MCCdigit2,
UE_rrc_inst[ue_mod_id].plmnID.MCCdigit3, UE_rrc_inst[ue_mod_id].plmnID.MCCdigit3,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit1, UE_rrc_inst[ue_mod_id].plmnID.MNCdigit1,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit2, UE_rrc_inst[ue_mod_id].plmnID.MNCdigit2,
UE_rrc_inst[ue_mod_id].plmnID.MNCdigit3); UE_rrc_inst[ue_mod_id].plmnID.MNCdigit3);
} }
......
...@@ -197,9 +197,9 @@ init_SI( ...@@ -197,9 +197,9 @@ init_SI(
&eNB_rrc_inst[ctxt_pP->module_id].siblock1, &eNB_rrc_inst[ctxt_pP->module_id].siblock1,
&eNB_rrc_inst[ctxt_pP->module_id].sib1 &eNB_rrc_inst[ctxt_pP->module_id].sib1
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
, configuration , configuration
#endif #endif
); );
else { else {
LOG_E(RRC, PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1 allocated\n", LOG_E(RRC, PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1 allocated\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
...@@ -221,7 +221,7 @@ init_SI( ...@@ -221,7 +221,7 @@ init_SI(
if (eNB_rrc_inst[ctxt_pP->module_id].SIB23) { if (eNB_rrc_inst[ctxt_pP->module_id].SIB23) {
eNB_rrc_inst[ctxt_pP->module_id].sizeof_SIB23 = do_SIB23( eNB_rrc_inst[ctxt_pP->module_id].sizeof_SIB23 = do_SIB23(
ctxt_pP->module_id, ctxt_pP->module_id,
mac_xface->lte_frame_parms, mac_xface->lte_frame_parms,
eNB_rrc_inst[ctxt_pP->module_id].SIB23, eNB_rrc_inst[ctxt_pP->module_id].SIB23,
&eNB_rrc_inst[ctxt_pP->module_id].systemInformation, &eNB_rrc_inst[ctxt_pP->module_id].systemInformation,
&eNB_rrc_inst[ctxt_pP->module_id].sib2, &eNB_rrc_inst[ctxt_pP->module_id].sib2,
...@@ -231,9 +231,9 @@ init_SI( ...@@ -231,9 +231,9 @@ init_SI(
eNB_rrc_inst[ctxt_pP->module_id].MBMS_flag eNB_rrc_inst[ctxt_pP->module_id].MBMS_flag
#endif #endif
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
, configuration , configuration
#endif #endif
); );
/* /*
eNB_rrc_inst[ctxt_pP->module_id].sizeof_SIB23 = do_SIB2_AT4(ctxt_pP->module_id, eNB_rrc_inst[ctxt_pP->module_id].sizeof_SIB23 = do_SIB2_AT4(ctxt_pP->module_id,
...@@ -561,7 +561,7 @@ rrc_eNB_get_next_free_ue_context( ...@@ -561,7 +561,7 @@ rrc_eNB_get_next_free_ue_context(
PROTOCOL_RRC_CTXT_UE_FMT" Cannot create new UE context, no memory\n", PROTOCOL_RRC_CTXT_UE_FMT" Cannot create new UE context, no memory\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
return NULL; return NULL;
} }
ue_context_p->ue_id_rnti = ctxt_pP->rnti; // here ue_id_rnti is just a key, may be something else ue_context_p->ue_id_rnti = ctxt_pP->rnti; // here ue_id_rnti is just a key, may be something else
ue_context_p->ue_context.rnti = ctxt_pP->rnti; // yes duplicate, 1 may be removed ue_context_p->ue_context.rnti = ctxt_pP->rnti; // yes duplicate, 1 may be removed
...@@ -610,7 +610,7 @@ void rrc_eNB_emulation_notify_ue_module_id( ...@@ -610,7 +610,7 @@ void rrc_eNB_emulation_notify_ue_module_id(
if (NULL != ue_context_p) { 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; oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_module_id][ue_context_p->local_uid] = ue_module_idP;
} }
return; return;
} }
...@@ -656,7 +656,8 @@ rrc_eNB_free_mem_UE_context( ...@@ -656,7 +656,8 @@ rrc_eNB_free_mem_UE_context(
if (ue_context_pP->ue_context.physicalConfigDedicated) { if (ue_context_pP->ue_context.physicalConfigDedicated) {
ASN_STRUCT_FREE(asn_DEF_PhysicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated); ASN_STRUCT_FREE(asn_DEF_PhysicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated);
ue_context_pP->ue_context.physicalConfigDedicated = NULL; ue_context_pP->ue_context.physicalConfigDedicated = NULL;
} }
if (ue_context_pP->ue_context.sps_Config) { if (ue_context_pP->ue_context.sps_Config) {
ASN_STRUCT_FREE(asn_DEF_SPS_Config, 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; ue_context_pP->ue_context.sps_Config = NULL;
...@@ -667,7 +668,7 @@ rrc_eNB_free_mem_UE_context( ...@@ -667,7 +668,7 @@ rrc_eNB_free_mem_UE_context(
ASN_STRUCT_FREE(asn_DEF_MeasObjectToAddMod, ue_context_pP->ue_context.MeasObj[i]); ASN_STRUCT_FREE(asn_DEF_MeasObjectToAddMod, ue_context_pP->ue_context.MeasObj[i]);
ue_context_pP->ue_context.MeasObj[i] = NULL; ue_context_pP->ue_context.MeasObj[i] = NULL;
} }
} }
for (i=0; i < MAX_MEAS_CONFIG; i++) { for (i=0; i < MAX_MEAS_CONFIG; i++) {
if (ue_context_pP->ue_context.ReportConfig[i] != NULL) { if (ue_context_pP->ue_context.ReportConfig[i] != NULL) {
...@@ -698,7 +699,7 @@ rrc_eNB_free_mem_UE_context( ...@@ -698,7 +699,7 @@ rrc_eNB_free_mem_UE_context(
if (ue_context_pP->ue_context.measConfig) { if (ue_context_pP->ue_context.measConfig) {
ASN_STRUCT_FREE(asn_DEF_MeasConfig, ue_context_pP->ue_context.measConfig); ASN_STRUCT_FREE(asn_DEF_MeasConfig, ue_context_pP->ue_context.measConfig);
ue_context_pP->ue_context.measConfig = NULL; ue_context_pP->ue_context.measConfig = NULL;
} }
if (ue_context_pP->ue_context.measConfig) { if (ue_context_pP->ue_context.measConfig) {
ASN_STRUCT_FREE(asn_DEF_MeasConfig, ue_context_pP->ue_context.measConfig); ASN_STRUCT_FREE(asn_DEF_MeasConfig, ue_context_pP->ue_context.measConfig);
...@@ -758,12 +759,12 @@ rrc_eNB_free_UE( ...@@ -758,12 +759,12 @@ rrc_eNB_free_UE(
#if defined(ENABLE_USE_MME) #if defined(ENABLE_USE_MME)
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_p, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_p, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost
/* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered) /* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered)
* If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before * If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before
* triggering the S1 UE Context Release Request procedure * triggering the S1 UE Context Release Request procedure
* in order to allow the UE to perform the NAS recovery * in order to allow the UE to perform the NAS recovery
* procedure, see TS 23.401 [17]. * procedure, see TS 23.401 [17].
*/ */
#else #else
AssertFatal(ue_context_p->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_p->local_uid, NUMBER_OF_UE_MAX, rntiP); AssertFatal(ue_context_p->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_p->local_uid, NUMBER_OF_UE_MAX, rntiP);
ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid]; ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid];
...@@ -773,8 +774,8 @@ rrc_eNB_free_UE( ...@@ -773,8 +774,8 @@ rrc_eNB_free_UE(
#endif #endif
ue_context_p->ue_context.Status = RRC_IDLE; ue_context_p->ue_context.Status = RRC_IDLE;
rrc_rlc_remove_ue(&ctxt); rrc_rlc_remove_ue(&ctxt);
pdcp_remove_UE(&ctxt); pdcp_remove_UE(&ctxt);
rrc_eNB_remove_ue_context( rrc_eNB_remove_ue_context(
&ctxt, &ctxt,
...@@ -1498,9 +1499,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration( ...@@ -1498,9 +1499,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
/* TODO parameters yet to process ... */ /* TODO parameters yet to process ... */
{ {
// ue_context_pP->ue_context.e_rab[i].param.qos; // 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.sgw_addr;
// ue_context_pP->ue_context.e_rab[i].param.gtp_teid; // ue_context_pP->ue_context.e_rab[i].param.gtp_teid;
} }
/* TODO should test if e RAB are Ok before! */ /* TODO should test if e RAB are Ok before! */
...@@ -2207,10 +2208,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ...@@ -2207,10 +2208,10 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
(RadioResourceConfigCommonSIB_t*) NULL, (RadioResourceConfigCommonSIB_t*) NULL,
ue_context_pP->ue_context.physicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated,
#ifdef Rel10 #ifdef Rel10
(SCellToAddMod_r10_t *)NULL, (SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL, //(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif #endif
(MeasObjectToAddMod_t **) NULL, (MeasObjectToAddMod_t **) NULL,
ue_context_pP->ue_context.mac_MainConfig, ue_context_pP->ue_context.mac_MainConfig,
1, 1,
SRB1_logicalChannelConfig, SRB1_logicalChannelConfig,
...@@ -2222,14 +2223,14 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ...@@ -2222,14 +2223,14 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
NULL, NULL,
NULL, NULL,
NULL, NULL,
(MBSFN_SubframeConfigList_t *) NULL (MBSFN_SubframeConfigList_t *) NULL
#ifdef Rel10 #ifdef Rel10
, 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL , 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL
#endif #endif
#ifdef CBA #ifdef CBA
, eNB_rrc_inst[ctxt_pP->module_id].num_active_cba_groups, eNB_rrc_inst[ctxt_pP->module_id].cba_rnti[0] , eNB_rrc_inst[ctxt_pP->module_id].num_active_cba_groups, eNB_rrc_inst[ctxt_pP->module_id].cba_rnti[0]
#endif #endif
); );
// Configure target eNB SRB2 // Configure target eNB SRB2
/// SRB2 /// SRB2
...@@ -2729,7 +2730,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ...@@ -2729,7 +2730,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
SRB_configList2, SRB_configList2,
DRB_configList2, DRB_configList2,
NULL, // DRB2_list, NULL, // DRB2_list,
NULL, //*sps_Config, NULL, //*sps_Config,
ue_context_pP->ue_context.physicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated,
MeasObj_list, MeasObj_list,
ReportConfig_list, ReportConfig_list,
...@@ -2743,9 +2744,9 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ...@@ -2743,9 +2744,9 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
NULL, NULL,
dedicatedInfoNASList dedicatedInfoNASList
#ifdef Rel10 #ifdef Rel10
, NULL // SCellToAddMod_r10_t , NULL // SCellToAddMod_r10_t
#endif #endif
); );
LOG_I(RRC, LOG_I(RRC,
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration for handover (bytes %d, UE rnti %x)\n", "[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration for handover (bytes %d, UE rnti %x)\n",
...@@ -2774,27 +2775,27 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover( ...@@ -2774,27 +2775,27 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
ENB_FLAG_YES, ENB_FLAG_YES,
ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.rnti,
0, 0,
(RadioResourceConfigCommonSIB_t *) NULL, (RadioResourceConfigCommonSIB_t *) NULL,
ue_context_pP->ue_context.physicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated,
#ifdef Rel10 #ifdef Rel10
(SCellToAddMod_r10_t *)NULL, (SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL, //(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif #endif
(MeasObjectToAddMod_t **) NULL, (MeasObjectToAddMod_t **) NULL,
ue_context_pP->ue_context.mac_MainConfig, ue_context_pP->ue_context.mac_MainConfig,
1, 1,
SRB1_logicalChannelConfig, SRB1_logicalChannelConfig,
ue_context_pP->ue_context.measGapConfig, ue_context_pP->ue_context.measGapConfig,
(TDD_Config_t *) NULL, (TDD_Config_t *) NULL,
(MobilityControlInfo_t *) mobilityInfo, (MobilityControlInfo_t *) mobilityInfo,
(uint8_t *) NULL, (uint16_t *) NULL, NULL, NULL, NULL, (MBSFN_SubframeConfigList_t *) NULL (uint8_t *) NULL, (uint16_t *) NULL, NULL, NULL, NULL, (MBSFN_SubframeConfigList_t *) NULL
#ifdef Rel10 #ifdef Rel10
, 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL , 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL
#endif #endif
#ifdef CBA #ifdef CBA
, 0, 0 , 0, 0
#endif #endif
); );
/* /*
handoverCommand.criticalExtensions.present = HandoverCommand__criticalExtensions_PR_c1; handoverCommand.criticalExtensions.present = HandoverCommand__criticalExtensions_PR_c1;
...@@ -3174,28 +3175,28 @@ rrc_eNB_generate_RRCConnectionSetup( ...@@ -3174,28 +3175,28 @@ rrc_eNB_generate_RRCConnectionSetup(
ENB_FLAG_YES, ENB_FLAG_YES,
ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.rnti,
0, 0,
(RadioResourceConfigCommonSIB_t *) NULL, (RadioResourceConfigCommonSIB_t *) NULL,
ue_context_pP->ue_context.physicalConfigDedicated, ue_context_pP->ue_context.physicalConfigDedicated,
#ifdef Rel10 #ifdef Rel10
(SCellToAddMod_r10_t *)NULL, (SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL, //(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif #endif
(MeasObjectToAddMod_t **) NULL, (MeasObjectToAddMod_t **) NULL,
ue_context_pP->ue_context.mac_MainConfig, ue_context_pP->ue_context.mac_MainConfig,
1, 1,
SRB1_logicalChannelConfig, SRB1_logicalChannelConfig,
ue_context_pP->ue_context.measGapConfig, ue_context_pP->ue_context.measGapConfig,
(TDD_Config_t *) NULL, (TDD_Config_t *) NULL,
NULL, NULL,
(uint8_t *) NULL, (uint8_t *) NULL,
(uint16_t *) NULL, NULL, NULL, NULL, (MBSFN_SubframeConfigList_t *) NULL (uint16_t *) NULL, NULL, NULL, NULL, (MBSFN_SubframeConfigList_t *) NULL
#ifdef Rel10 #ifdef Rel10
, 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL , 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL
#endif #endif
#ifdef CBA #ifdef CBA
, 0, 0 , 0, 0
#endif #endif
); );
break; break;
} }
} }
...@@ -3518,7 +3519,7 @@ rrc_eNB_decode_ccch( ...@@ -3518,7 +3519,7 @@ rrc_eNB_decode_ccch(
{ {
memcpy(((uint8_t*) & random_value) + 3, memcpy(((uint8_t*) & random_value) + 3,
rrcConnectionRequest->ue_Identity.choice.randomValue.buf, rrcConnectionRequest->ue_Identity.choice.randomValue.buf,
rrcConnectionRequest->ue_Identity.choice.randomValue.size); rrcConnectionRequest->ue_Identity.choice.randomValue.size);
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value); ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value);
} }
LOG_D(RRC, LOG_D(RRC,
...@@ -3530,18 +3531,18 @@ rrc_eNB_decode_ccch( ...@@ -3530,18 +3531,18 @@ rrc_eNB_decode_ccch(
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
/* Check s-TMSI presence in message */ /* Check s-TMSI presence in message */
ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = ue_context_p->ue_context.Initialue_identity_s_TMSI.presence =
(rrcConnectionRequest->ue_Identity.present == InitialUE_Identity_PR_s_TMSI); (rrcConnectionRequest->ue_Identity.present == InitialUE_Identity_PR_s_TMSI);
if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence) { if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence) {
/* Save s-TMSI */ /* Save s-TMSI */
S_TMSI_t s_TMSI = rrcConnectionRequest->ue_Identity.choice.s_TMSI; S_TMSI_t s_TMSI = rrcConnectionRequest->ue_Identity.choice.s_TMSI;
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code =
BIT_STRING_to_uint8(&s_TMSI.mmec); BIT_STRING_to_uint8(&s_TMSI.mmec);
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi =
BIT_STRING_to_uint32(&s_TMSI.m_TMSI); BIT_STRING_to_uint32(&s_TMSI.m_TMSI);
MSC_LOG_RX_DISCARDED_MESSAGE( MSC_LOG_RX_DISCARDED_MESSAGE(
MSC_RRC_ENB, MSC_RRC_ENB,
...@@ -3567,10 +3568,10 @@ rrc_eNB_decode_ccch( ...@@ -3567,10 +3568,10 @@ rrc_eNB_decode_ccch(
ue_context_p->ue_context.rnti, ue_context_p->ue_context.rnti,
dec_rval.consumed, dec_rval.consumed,
ue_context_p->ue_context.random_ue_identity); ue_context_p->ue_context.random_ue_identity);
} }
ue_context_p->ue_context.establishment_cause = ue_context_p->ue_context.establishment_cause =
rrcConnectionRequest->establishmentCause; rrcConnectionRequest->establishmentCause;
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n", LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_p->ue_context.random_ue_identity, ue_context_p->ue_context.random_ue_identity,
...@@ -3597,27 +3598,27 @@ rrc_eNB_decode_ccch( ...@@ -3597,27 +3598,27 @@ rrc_eNB_decode_ccch(
send_msg(&S_rrc, msg_rrc_MR_attach_ind(ctxt_pP->module_id, Mac_id)); send_msg(&S_rrc, msg_rrc_MR_attach_ind(ctxt_pP->module_id, Mac_id));
#else #else
//LG COMMENT Idx = (ue_mod_idP * NB_RB_MAX) + DCCH; //LG COMMENT Idx = (ue_mod_idP * NB_RB_MAX) + DCCH;
Idx = DCCH; Idx = DCCH;
// SRB1 // SRB1
ue_context_p->ue_context.Srb1.Active = 1; ue_context_p->ue_context.Srb1.Active = 1;
ue_context_p->ue_context.Srb1.Srb_info.Srb_id = Idx; ue_context_p->ue_context.Srb1.Srb_info.Srb_id = Idx;
memcpy(&ue_context_p->ue_context.Srb1.Srb_info.Lchan_desc[0], memcpy(&ue_context_p->ue_context.Srb1.Srb_info.Lchan_desc[0],
&DCCH_LCHAN_DESC, &DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE); LCHAN_DESC_SIZE);
memcpy(&ue_context_p->ue_context.Srb1.Srb_info.Lchan_desc[1], memcpy(&ue_context_p->ue_context.Srb1.Srb_info.Lchan_desc[1],
&DCCH_LCHAN_DESC, &DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE); LCHAN_DESC_SIZE);
// SRB2 // SRB2
ue_context_p->ue_context.Srb2.Active = 1; ue_context_p->ue_context.Srb2.Active = 1;
ue_context_p->ue_context.Srb2.Srb_info.Srb_id = Idx; ue_context_p->ue_context.Srb2.Srb_info.Srb_id = Idx;
memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[0], memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[0],
&DCCH_LCHAN_DESC, &DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE); LCHAN_DESC_SIZE);
memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[1], memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[1],
&DCCH_LCHAN_DESC, &DCCH_LCHAN_DESC,
LCHAN_DESC_SIZE); LCHAN_DESC_SIZE);
rrc_eNB_generate_RRCConnectionSetup(ctxt_pP, ue_context_p); rrc_eNB_generate_RRCConnectionSetup(ctxt_pP, ue_context_p);
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n", LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n",
...@@ -3635,25 +3636,25 @@ rrc_eNB_decode_ccch( ...@@ -3635,25 +3636,25 @@ rrc_eNB_decode_ccch(
rrc_pdcp_config_asn1_req(ctxt_pP, rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList, ue_context_p->ue_context.SRB_configList,
(DRB_ToAddModList_t *) NULL, (DRB_ToAddModList_t *) NULL,
(DRB_ToReleaseList_t*) NULL, (DRB_ToReleaseList_t*) NULL,
0xff, 0xff,
NULL, NULL,
NULL, NULL,
NULL NULL
# ifdef Rel10 # ifdef Rel10
, (PMCH_InfoList_r9_t *) NULL , (PMCH_InfoList_r9_t *) NULL
# endif # endif
); );
rrc_rlc_config_asn1_req(ctxt_pP, rrc_rlc_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList, ue_context_p->ue_context.SRB_configList,
(DRB_ToAddModList_t*) NULL, (DRB_ToAddModList_t*) NULL,
(DRB_ToReleaseList_t*) NULL (DRB_ToReleaseList_t*) NULL
# ifdef Rel10 # ifdef Rel10
, (PMCH_InfoList_r9_t *) NULL , (PMCH_InfoList_r9_t *) NULL
# endif # endif
); );
#endif //NO_RRM #endif //NO_RRM
break; break;
...@@ -3755,6 +3756,7 @@ rrc_eNB_decode_dcch( ...@@ -3755,6 +3756,7 @@ rrc_eNB_decode_dcch(
dec_rval.consumed); dec_rval.consumed);
return -1; return -1;
} }
ue_context_p = rrc_eNB_get_ue_context( ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[ctxt_pP->module_id], &eNB_rrc_inst[ctxt_pP->module_id],
ctxt_pP->rnti); ctxt_pP->rnti);
...@@ -3778,8 +3780,8 @@ rrc_eNB_decode_dcch( ...@@ -3778,8 +3780,8 @@ rrc_eNB_decode_dcch(
rrc_eNB_process_MeasurementReport( rrc_eNB_process_MeasurementReport(
ctxt_pP, ctxt_pP,
ue_context_p, ue_context_p,
&ul_dcch_msg->message.choice.c1.choice.measurementReport. &ul_dcch_msg->message.choice.c1.choice.measurementReport.
criticalExtensions.choice.c1.choice.measurementReport_r8.measResults); criticalExtensions.choice.c1.choice.measurementReport_r8.measResults);
break; break;
case UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete: case UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete:
...@@ -3815,10 +3817,10 @@ rrc_eNB_decode_dcch( ...@@ -3815,10 +3817,10 @@ rrc_eNB_decode_dcch(
rrc_eNB_process_RRCConnectionReconfigurationComplete( rrc_eNB_process_RRCConnectionReconfigurationComplete(
ctxt_pP, ctxt_pP,
ue_context_p, ue_context_p,
&ul_dcch_msg->message.choice.c1.choice. &ul_dcch_msg->message.choice.c1.choice.
rrcConnectionReconfigurationComplete. rrcConnectionReconfigurationComplete.
criticalExtensions.choice. criticalExtensions.choice.
rrcConnectionReconfigurationComplete_r8); rrcConnectionReconfigurationComplete_r8);
ue_context_p->ue_context.Status = RRC_RECONFIGURED; ue_context_p->ue_context.Status = RRC_RECONFIGURED;
LOG_I(RRC, LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED \n", PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED \n",
......
...@@ -102,10 +102,10 @@ rrc_eNB_S1AP_compare_ue_ids( ...@@ -102,10 +102,10 @@ rrc_eNB_S1AP_compare_ue_ids(
if (c1_pP->ue_initial_id < c2_pP->ue_initial_id) { if (c1_pP->ue_initial_id < c2_pP->ue_initial_id) {
return -1; return -1;
} }
return 0; return 0;
} }
if (c1_pP->eNB_ue_s1ap_id > c2_pP->eNB_ue_s1ap_id) { if (c1_pP->eNB_ue_s1ap_id > c2_pP->eNB_ue_s1ap_id) {
return 1; return 1;
...@@ -138,7 +138,7 @@ rrc_eNB_S1AP_get_ue_ids( ...@@ -138,7 +138,7 @@ rrc_eNB_S1AP_get_ue_ids(
temp.ue_initial_id = ue_initial_id; temp.ue_initial_id = ue_initial_id;
temp.eNB_ue_s1ap_id = eNB_ue_s1ap_id; temp.eNB_ue_s1ap_id = eNB_ue_s1ap_id;
return RB_FIND(rrc_rnti_tree_s, &rrc_instance_pP->rrc_rnti_head, &temp); return RB_FIND(rrc_rnti_tree_s, &rrc_instance_pP->rrc_rnti_head, &temp);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void void
rrc_eNB_S1AP_remove_ue_ids( rrc_eNB_S1AP_remove_ue_ids(
...@@ -150,7 +150,8 @@ rrc_eNB_S1AP_remove_ue_ids( ...@@ -150,7 +150,8 @@ rrc_eNB_S1AP_remove_ue_ids(
if (rrc_instance_pP == NULL) { if (rrc_instance_pP == NULL) {
LOG_E(RRC, "Bad RRC instance\n"); LOG_E(RRC, "Bad RRC instance\n");
return; return;
} }
if (ue_ids_pP == NULL) { if (ue_ids_pP == NULL) {
LOG_E(RRC, "Trying to free a NULL S1AP UE IDs\n"); LOG_E(RRC, "Trying to free a NULL S1AP UE IDs\n");
return; return;
...@@ -181,7 +182,7 @@ get_next_ue_initial_id( ...@@ -181,7 +182,7 @@ get_next_ue_initial_id(
} }
return ue_initial_id[mod_id]; return ue_initial_id[mod_id];
} }
...@@ -212,7 +213,7 @@ rrc_eNB_get_ue_context_from_s1ap_ids( ...@@ -212,7 +213,7 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
// found by ue_initial_id, fill now eNB_ue_s1ap_idP // found by ue_initial_id, fill now eNB_ue_s1ap_idP
if (temp->eNB_ue_s1ap_id != eNB_ue_s1ap_idP) { if (temp->eNB_ue_s1ap_id != eNB_ue_s1ap_idP) {
temp->eNB_ue_s1ap_id = eNB_ue_s1ap_idP; temp->eNB_ue_s1ap_id = eNB_ue_s1ap_idP;
} }
return rrc_eNB_get_ue_context( return rrc_eNB_get_ue_context(
&eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)], &eNB_rrc_inst[ENB_INSTANCE_TO_MODULE_ID(instanceP)],
...@@ -426,24 +427,25 @@ rrc_pdcp_config_security( ...@@ -426,24 +427,25 @@ rrc_pdcp_config_security(
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
pdcp_config_set_security( pdcp_config_set_security(
ctxt_pP, ctxt_pP,
pdcp_p, pdcp_p,
DCCH, DCCH,
DCCH+2, DCCH+2,
(send_security_mode_command == TRUE) ? (send_security_mode_command == TRUE) ?
0 | (ue_context_pP->ue_context.integrity_algorithm << 4) : 0 | (ue_context_pP->ue_context.integrity_algorithm << 4) :
(ue_context_pP->ue_context.ciphering_algorithm ) | (ue_context_pP->ue_context.ciphering_algorithm ) |
(ue_context_pP->ue_context.integrity_algorithm << 4), (ue_context_pP->ue_context.integrity_algorithm << 4),
kRRCenc, kRRCenc,
kRRCint, kRRCint,
kUPenc); kUPenc);
} else { } else {
LOG_E(RRC, LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT"Could not get PDCP instance for SRB DCCH %u\n", PROTOCOL_RRC_CTXT_UE_FMT"Could not get PDCP instance for SRB DCCH %u\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
DCCH); DCCH);
} }
#endif #endif
} }
...@@ -710,10 +712,10 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ( ...@@ -710,10 +712,10 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
s1ap_eNB_new_data_request ( s1ap_eNB_new_data_request (
ctxt_pP->module_id, ctxt_pP->module_id,
ue_context_pP, ue_context_pP,
rrcConnectionSetupComplete->dedicatedInfoNAS. rrcConnectionSetupComplete->dedicatedInfoNAS.
buf, buf,
rrcConnectionSetupComplete->dedicatedInfoNAS. rrcConnectionSetupComplete->dedicatedInfoNAS.
size); size);
} }
#endif #endif
} }
...@@ -784,6 +786,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS( ...@@ -784,6 +786,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
return (-1); return (-1);
} else { } else {
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0); 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 ? */ /* Is it the first income from S1AP ? */
if (ue_context_p->ue_context.eNB_ue_s1ap_id == 0) { 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; 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( ...@@ -805,8 +808,8 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
instance, instance,
&buffer, &buffer,
rrc_eNB_get_next_transaction_identifier (instance), rrc_eNB_get_next_transaction_identifier (instance),
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length, S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length,
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer); S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer);
#ifdef RRC_MSG_PRINT #ifdef RRC_MSG_PRINT
int i=0; int i=0;
...@@ -894,7 +897,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char ...@@ -894,7 +897,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
/* TODO parameters yet to process ... */ /* 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 ( rrc_eNB_process_security (
...@@ -970,7 +973,7 @@ int rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char ...@@ -970,7 +973,7 @@ int rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char
/* TODO parameters yet to process ... */ /* TODO parameters yet to process ... */
{ {
if (S1AP_UE_CTXT_MODIFICATION_REQ(msg_p).present & S1AP_UE_CONTEXT_MODIFICATION_UE_AMBR) { 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) ...@@ -1903,11 +1903,13 @@ static void get_options (int argc, char **argv)
case LONG_OPTION_RXGAIN: case LONG_OPTION_RXGAIN:
for (i=0; i<4; i++) for (i=0; i<4; i++)
rx_gain[0][i] = atof(optarg); rx_gain[0][i] = atof(optarg);
break; break;
case LONG_OPTION_TXGAIN: case LONG_OPTION_TXGAIN:
for (i=0; i<4; i++) for (i=0; i<4; i++)
tx_gain[0][i] = atof(optarg); tx_gain[0][i] = atof(optarg);
break; break;
case 'M': case 'M':
...@@ -2009,6 +2011,7 @@ static void get_options (int argc, char **argv) ...@@ -2009,6 +2011,7 @@ static void get_options (int argc, char **argv)
case 'r': case 'r':
UE_scan = 0; UE_scan = 0;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
switch(atoi(optarg)) { switch(atoi(optarg)) {
case 6: case 6:
...@@ -2665,7 +2668,7 @@ int main( int argc, char **argv ) ...@@ -2665,7 +2668,7 @@ int main( int argc, char **argv )
#ifdef ETHERNET #ifdef ETHERNET
if (frame_parms[0]->N_RB_DL == 6) openair0_cfg[0].samples_per_packet = 256; 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); printf("HW: samples_per_packet %d\n",openair0_cfg[0].samples_per_packet);
#endif #endif
...@@ -2778,9 +2781,9 @@ int main( int argc, char **argv ) ...@@ -2778,9 +2781,9 @@ int main( int argc, char **argv )
if (UE_flag==1) { if (UE_flag==1) {
fill_ue_band_info(); fill_ue_band_info();
mac_xface->dl_phy_sync_success (0, 0, 0, 1); mac_xface->dl_phy_sync_success (0, 0, 0, 1);
} } else
else
mac_xface->mrbch_phy_sync_failure (0, 0, 0); mac_xface->mrbch_phy_sync_failure (0, 0, 0);
#endif #endif
/* #ifdef OPENAIR2 /* #ifdef OPENAIR2
......
...@@ -231,10 +231,10 @@ static void *UE_thread_synch(void *arg) ...@@ -231,10 +231,10 @@ static void *UE_thread_synch(void *arg)
if (UE->UE_scan == 0) { if (UE->UE_scan == 0) {
do { do {
current_band = eutra_bands[ind].band; current_band = eutra_bands[ind].band;
printf( "Scanning band %d, dl_min %"PRIu32"\n", current_band, eutra_bands[ind].dl_min ); 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 (card=0; card<MAX_NUM_CCs; card++)
for (i=0; i<4; i++) for (i=0; i<4; i++)
uplink_frequency_offset[card][i] = eutra_bands[ind].ul_min - eutra_bands[ind].dl_min; 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) ...@@ -244,24 +244,26 @@ static void *UE_thread_synch(void *arg)
} }
ind++; ind++;
} while (current_band < sizeof(eutra_bands) / sizeof(eutra_bands[0])); } while (current_band < sizeof(eutra_bands) / sizeof(eutra_bands[0]));
if (found == 0) { if (found == 0) {
exit_fun("Can't find EUTRA band for frequency"); exit_fun("Can't find EUTRA band for frequency");
return &UE_thread_synch_retval; return &UE_thread_synch_retval;
} }
#ifdef OAI_USRP #ifdef OAI_USRP
// now we know the uplink_frequency_offset
// set the correct TX frequency // now we know the uplink_frequency_offset
for (i=0; i<openair0_cfg[card].tx_num_channels; i++) { // set the correct TX frequency
openair0_cfg[0].tx_freq[i] = downlink_frequency[0][i] + uplink_frequency_offset[0][i]; 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] ); }
openair0_set_frequencies( &openair0, &openair0_cfg[0] );
#endif #endif
} }
else if (UE->UE_scan == 1) { else if (UE->UE_scan == 1) {
current_band=0; current_band=0;
for (card=0; card<MAX_CARDS; card++) { for (card=0; card<MAX_CARDS; card++) {
...@@ -383,7 +385,7 @@ static void *UE_thread_synch(void *arg) ...@@ -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]); printf("UE synch: setting RX gain (%d,%d) to %f\n",card,i,openair0_cfg[card].rx_gain[i]);
#endif #endif
} }
#ifdef EXMIMO #ifdef EXMIMO
//openair0_config(&openair0_cfg[card],1); //openair0_config(&openair0_cfg[card],1);
...@@ -477,6 +479,7 @@ static void *UE_thread_synch(void *arg) ...@@ -477,6 +479,7 @@ static void *UE_thread_synch(void *arg)
default: default:
break; break;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SYNCH, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SYNCH, 0 );
if (pthread_mutex_lock(&UE->mutex_synch) != 0) { if (pthread_mutex_lock(&UE->mutex_synch) != 0) {
...@@ -996,7 +999,7 @@ void *UE_thread(void *arg) ...@@ -996,7 +999,7 @@ void *UE_thread(void *arg)
UE->PHY_measurements.rx_power_avg_dB[0] - rx_input_level_dBm, UE->PHY_measurements.rx_power_avg_dB[0] - rx_input_level_dBm,
UE->rx_total_gain_dB, UE->rx_total_gain_dB,
openair0_cfg[0].rx_gain[0] openair0_cfg[0].rx_gain[0]
); );
exit_fun("[HW][UE] UE in RX calibration mode, exiting"); exit_fun("[HW][UE] UE in RX calibration mode, exiting");
return &UE_thread_retval; return &UE_thread_retval;
} }
...@@ -1384,7 +1387,7 @@ void *UE_thread(void *arg) ...@@ -1384,7 +1387,7 @@ void *UE_thread(void *arg)
UE->PHY_measurements.rx_power_avg_dB[0] - rx_input_level_dBm, UE->PHY_measurements.rx_power_avg_dB[0] - rx_input_level_dBm,
UE->rx_total_gain_dB, UE->rx_total_gain_dB,
openair0_cfg[0].rx_gain[0] openair0_cfg[0].rx_gain[0]
); );
exit_fun("[HW][UE] UE in RX calibration mode, exiting"); exit_fun("[HW][UE] UE in RX calibration mode, exiting");
} }
} }
...@@ -1420,8 +1423,8 @@ void *UE_thread(void *arg) ...@@ -1420,8 +1423,8 @@ void *UE_thread(void *arg)
} }
/* /*
if ((slot%2000)<10) if ((slot%2000)<10)
LOG_D(HW,"fun0: doing very hard work\n"); LOG_D(HW,"fun0: doing very hard work\n");
*/ */
// now increment slot and frame counters // now increment slot and frame counters
slot++; 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