Commit 6e76ecdd authored by Raymond Knopp's avatar Raymond Knopp

Applied S. Held's patches 16, additional modifications for UE frequency...

Applied S. Held's patches 16, additional modifications for UE frequency scanning and RSRP/RSSI calibration for ExpressMIMO2 and USRP B210

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7536 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent ea655773
...@@ -389,7 +389,6 @@ add_boolean_option(USER_MODE True "????") ...@@ -389,7 +389,6 @@ add_boolean_option(USER_MODE True "????")
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????") add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
add_boolean_option(DISABLE_USE_NAS False "???") add_boolean_option(DISABLE_USE_NAS False "???")
add_boolean_option(ENABLE_PDCP_NETLINK_FIFO False "????")
add_boolean_option(ENABLE_STANDALONE_EPC True "Compile MME, SGW and PGW in a single executable") add_boolean_option(ENABLE_STANDALONE_EPC True "Compile MME, SGW and PGW in a single executable")
add_boolean_option(ENABLE_USE_GTPU_IN_KERNEL True "as per name") add_boolean_option(ENABLE_USE_GTPU_IN_KERNEL True "as per name")
add_boolean_option(ENABLE_USE_NETFILTER_FOR_SGI False "SGI option") add_boolean_option(ENABLE_USE_NETFILTER_FOR_SGI False "SGI option")
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI False ) set ( ENABLE_ITTI False )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI False ) set ( ENABLE_ITTI False )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI False ) set ( ENABLE_ITTI False )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False ) set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT False ) set ( ENABLE_PGM_TRANSPORT False )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -8,7 +8,6 @@ set(ENABLE_FXP True) ...@@ -8,7 +8,6 @@ set(ENABLE_FXP True)
set(ENABLE_ITTI True) set(ENABLE_ITTI True)
set(ENABLE_NAS_UE_LOGGING False) set(ENABLE_NAS_UE_LOGGING False)
set(ENABLE_NEW_MULTICAST True) set(ENABLE_NEW_MULTICAST True)
set(ENABLE_PDCP_NETLINK_FIFO False)
set(ENABLE_PGM_TRANSPORT True) set(ENABLE_PGM_TRANSPORT True)
set(ENABLE_RAL False) set(ENABLE_RAL False)
set(ENABLE_SECURITY False) set(ENABLE_SECURITY False)
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI False ) set ( ENABLE_ITTI False )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -8,7 +8,6 @@ set(ENABLE_FXP True) ...@@ -8,7 +8,6 @@ set(ENABLE_FXP True)
set(ENABLE_ITTI True) set(ENABLE_ITTI True)
set(ENABLE_NAS_UE_LOGGING False) set(ENABLE_NAS_UE_LOGGING False)
set(ENABLE_NEW_MULTICAST True) set(ENABLE_NEW_MULTICAST True)
set(ENABLE_PDCP_NETLINK_FIFO False)
set(ENABLE_PGM_TRANSPORT True) set(ENABLE_PGM_TRANSPORT True)
set(ENABLE_RAL False) set(ENABLE_RAL False)
set(ENABLE_SECURITY False) set(ENABLE_SECURITY False)
......
...@@ -8,7 +8,6 @@ set(ENABLE_FXP True) ...@@ -8,7 +8,6 @@ set(ENABLE_FXP True)
set(ENABLE_ITTI True) set(ENABLE_ITTI True)
set(ENABLE_NAS_UE_LOGGING False) set(ENABLE_NAS_UE_LOGGING False)
set(ENABLE_NEW_MULTICAST True) set(ENABLE_NEW_MULTICAST True)
set(ENABLE_PDCP_NETLINK_FIFO True)
set(ENABLE_PGM_TRANSPORT True) set(ENABLE_PGM_TRANSPORT True)
set(ENABLE_RAL True) set(ENABLE_RAL True)
set(ENABLE_SECURITY False) set(ENABLE_SECURITY False)
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL True ) set ( ENABLE_RAL True )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI False ) set ( ENABLE_ITTI False )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -12,7 +12,6 @@ set ( ENABLE_FXP False ) ...@@ -12,7 +12,6 @@ set ( ENABLE_FXP False )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False ) set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT False ) set ( ENABLE_PGM_TRANSPORT False )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8) ...@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
set(XFORMS 1 ) set(XFORMS 1 )
set(RRC_ASN1_VERSION "Rel10") set(RRC_ASN1_VERSION "Rel10")
set(ENABLE_VCD_FIFO False ) set(ENABLE_VCD_FIFO False )
set(RF_BOARD "EXMIMO") set(RF_BOARD "OAI_USRP")
set(NAS 1) set(NAS 1)
set(ENABLE_ITTI False) set(ENABLE_ITTI False)
set(ENABLE_USE_MME False) set(ENABLE_USE_MME False)
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True ) set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True ) set ( ENABLE_SECURITY True )
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP False ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP False )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False ) set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT False ) set ( ENABLE_PGM_TRANSPORT False )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True ) ...@@ -10,7 +10,6 @@ set ( ENABLE_FXP True )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False ) set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True ) set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True ) set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False ) set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False ) set ( ENABLE_SECURITY False )
......
...@@ -33,6 +33,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf) ...@@ -33,6 +33,8 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
uint8_t log2_osf; uint8_t log2_osf;
LOG_I(PHY,"Initializing frame parms for N_RB_DL %d, Ncp %d, osf %d\n",frame_parms->N_RB_DL,frame_parms->Ncp,osf);
if (frame_parms->Ncp==1) { if (frame_parms->Ncp==1) {
frame_parms->nb_prefix_samples0=512; frame_parms->nb_prefix_samples0=512;
frame_parms->nb_prefix_samples = 512; frame_parms->nb_prefix_samples = 512;
......
...@@ -156,11 +156,13 @@ We estimate the frequency offset by calculating the phase difference between cha ...@@ -156,11 +156,13 @@ We estimate the frequency offset by calculating the phase difference between cha
\param frame_parms pointer to LTE frame parameters \param frame_parms pointer to LTE frame parameters
\param l symbol within slot \param l symbol within slot
\param freq_offset pointer to the returned frequency offset \param freq_offset pointer to the returned frequency offset
\param reset When non-zer it resets the filter to the initial value (set whenever tuning has been changed or for a one-shot estimate)
*/ */
int lte_est_freq_offset(int **dl_ch_estimates, int lte_est_freq_offset(int **dl_ch_estimates,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int l, int l,
int* freq_offset); int* freq_offset,
int reset);
int lte_mbsfn_est_freq_offset(int **dl_ch_estimates, int lte_mbsfn_est_freq_offset(int **dl_ch_estimates,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
......
...@@ -60,6 +60,7 @@ int dl_channel_level(int16_t *dl_ch, ...@@ -60,6 +60,7 @@ int dl_channel_level(int16_t *dl_ch,
} }
DevAssert( frame_parms->N_RB_DL );
avg = (((int*)&avg128F)[0] + avg = (((int*)&avg128F)[0] +
((int*)&avg128F)[1] + ((int*)&avg128F)[1] +
((int*)&avg128F)[2] + ((int*)&avg128F)[2] +
...@@ -76,7 +77,8 @@ int dl_channel_level(int16_t *dl_ch, ...@@ -76,7 +77,8 @@ int dl_channel_level(int16_t *dl_ch,
int lte_est_freq_offset(int **dl_ch_estimates, int lte_est_freq_offset(int **dl_ch_estimates,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int l, int l,
int* freq_offset) int* freq_offset,
int reset)
{ {
int ch_offset, omega, dl_ch_shift; int ch_offset, omega, dl_ch_shift;
...@@ -89,6 +91,9 @@ int lte_est_freq_offset(int **dl_ch_estimates, ...@@ -89,6 +91,9 @@ int lte_est_freq_offset(int **dl_ch_estimates,
int coef = 1<<10; int coef = 1<<10;
int ncoef = 32767 - coef; int ncoef = 32767 - coef;
// initialize the averaging filter to initial value
if (reset!=0)
first_run=1;
ch_offset = (l*(frame_parms->ofdm_symbol_size)); ch_offset = (l*(frame_parms->ofdm_symbol_size));
...@@ -134,13 +139,13 @@ int lte_est_freq_offset(int **dl_ch_estimates, ...@@ -134,13 +139,13 @@ int lte_est_freq_offset(int **dl_ch_estimates,
omega_cpx->i += ((struct complex16*) &omega)->i; omega_cpx->i += ((struct complex16*) &omega)->i;
// phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); // phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r);
phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r);
// LOG_D(PHY,"omega (%d,%d) -> %f\n",omega_cpx->r,omega_cpx->i,phase_offset); // LOG_I(PHY,"omega (%d,%d) -> %f\n",omega_cpx->r,omega_cpx->i,phase_offset);
} }
// phase_offset /= (frame_parms->nb_antennas_rx*frame_parms->nb_antennas_tx); // phase_offset /= (frame_parms->nb_antennas_rx*frame_parms->nb_antennas_tx);
freq_offset_est = (int) (phase_offset/(2*M_PI)/(frame_parms->Ncp==NORMAL ? (285.8e-6):(2.5e-4))); //2.5e-4 is the time between pilot symbols freq_offset_est = (int) (phase_offset/(2*M_PI)/(frame_parms->Ncp==NORMAL ? (285.8e-6):(2.5e-4))); //2.5e-4 is the time between pilot symbols
// LOG_D(PHY,"symbol %d : freq_offset_est %d\n",l,freq_offset_est); // LOG_I(PHY,"symbol %d : freq_offset_est %d\n",l,freq_offset_est);
// update freq_offset with phase_offset using a moving average filter // update freq_offset with phase_offset using a moving average filter
if (first_run == 1) { if (first_run == 1) {
......
...@@ -504,12 +504,12 @@ int lte_sync_time(int **rxdata, ///rx data in time domain ...@@ -504,12 +504,12 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
#ifdef USER_MODE #ifdef USER_MODE
if (debug_cnt == 5) { if (debug_cnt == 0) {
write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2); write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2); write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
write_output("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2); write_output("sync_corr2_ue.m","synccorr2",sync_corr_ue2,2*length,1,2);
write_output("rxdata0.m","rxd0",rxdata[0],length<<1,1,1); write_output("rxdata0.m","rxd0",rxdata[0],length<<1,1,1);
exit(-1); // exit(-1);
} else { } else {
debug_cnt++; debug_cnt++;
} }
......
...@@ -675,6 +675,7 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext, ...@@ -675,6 +675,7 @@ void pdcch_channel_level(int32_t **dl_ch_estimates_ext,
*/ */
} }
DevAssert( nb_rb );
avg[(aatx<<1)+aarx] = (((int32_t*)&avg128P)[0] + avg[(aatx<<1)+aarx] = (((int32_t*)&avg128P)[0] +
((int32_t*)&avg128P)[1] + ((int32_t*)&avg128P)[1] +
((int32_t*)&avg128P)[2] + ((int32_t*)&avg128P)[2] +
...@@ -2542,6 +2543,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,int do_common,uint ...@@ -2542,6 +2543,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,int do_common,uint
else { else {
LOG_E(PHY,"Illegal CCEind %d (Yk %d, m %d, nCCE %d, L2 %d\n",CCEind,Yk,m,nCCE,L2); LOG_E(PHY,"Illegal CCEind %d (Yk %d, m %d, nCCE %d, L2 %d\n",CCEind,Yk,m,nCCE,L2);
mac_xface->macphy_exit("Illegal CCEind\n"); mac_xface->macphy_exit("Illegal CCEind\n");
return; // not reached
} }
switch (L2) { switch (L2) {
...@@ -2560,6 +2562,11 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,int do_common,uint ...@@ -2560,6 +2562,11 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,int do_common,uint
case 8: case 8:
CCEmap_mask = (0xff<<(CCEind&0x1f)); CCEmap_mask = (0xff<<(CCEind&0x1f));
break; break;
default:
LOG_E( PHY, "Illegal L2 value %d\n", L2 );
mac_xface->macphy_exit( "Illegal L2\n" );
return; // not reached
} }
CCEmap_cand = (*CCEmap)&CCEmap_mask; CCEmap_cand = (*CCEmap)&CCEmap_mask;
......
...@@ -248,8 +248,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -248,8 +248,8 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
// printf("nb_rb = %d, eNB_id %d\n",nb_rb,eNB_id); // printf("nb_rb = %d, eNB_id %d\n",nb_rb,eNB_id);
if (nb_rb==0) { if (nb_rb==0) {
LOG_W(PHY,"dlsch_demodulation.c: nb_rb=0\n"); //LOG_W(PHY,"dlsch_demodulation.c: nb_rb=0\n");
return(-1); return(0);
} }
/* /*
......
...@@ -48,14 +48,18 @@ ...@@ -48,14 +48,18 @@
#include "gain_control.h" #include "gain_control.h"
#endif #endif
#define DEBUG_INITIAL_SYNCH #if defined(OAI_USRP) || defined(EXMIMO)
#include "common_lib.h"
extern openair0_config_t openair0_cfg[];
#endif
//#define DEBUG_INITIAL_SYNCH
int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
{ {
uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy; uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy;
LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms;
char phich_resource[6]; char phich_resource[6];
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",phy_vars_ue->Mod_id, LOG_I(PHY,"[UE%d] Initial sync: starting PBCH detection (rx_offset %d)\n",phy_vars_ue->Mod_id,
...@@ -65,25 +69,46 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -65,25 +69,46 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
for (l=0; l<frame_parms->symbols_per_tti/2; l++) { for (l=0; l<frame_parms->symbols_per_tti/2; l++) {
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
l, l,
1, 0,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
} 1);
}
for (l=0; l<frame_parms->symbols_per_tti/2; l++) {
slot_fep(phy_vars_ue,
l,
1,
phy_vars_ue->rx_offset,
0,
1);
}
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
0, 0,
2, 2,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
lte_ue_measurements(phy_vars_ue, lte_ue_measurements(phy_vars_ue,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0, 0,
0); 0);
if (phy_vars_ue->lte_frame_parms.frame_type == TDD) {
ue_rrc_measurements(phy_vars_ue,
1,
0);
}
else {
ue_rrc_measurements(phy_vars_ue,
0,
0);
}
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE %d][initial sync] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n", LOG_I(PHY,"[UE %d] RX RSSI %d dBm, digital (%d, %d) dB, linear (%d, %d), avg rx power %d dB (%d lin), RX gain %d dB\n",
phy_vars_ue->Mod_id, phy_vars_ue->Mod_id,
phy_vars_ue->PHY_measurements.rx_rssi_dBm[0] - ((phy_vars_ue->lte_frame_parms.nb_antennas_rx==2) ? 3 : 0), phy_vars_ue->PHY_measurements.rx_rssi_dBm[0] - ((phy_vars_ue->lte_frame_parms.nb_antennas_rx==2) ? 3 : 0),
phy_vars_ue->PHY_measurements.rx_power_dB[0][0], phy_vars_ue->PHY_measurements.rx_power_dB[0][0],
...@@ -94,7 +119,7 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -94,7 +119,7 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
phy_vars_ue->PHY_measurements.rx_power_avg[0], phy_vars_ue->PHY_measurements.rx_power_avg[0],
phy_vars_ue->rx_total_gain_dB); phy_vars_ue->rx_total_gain_dB);
LOG_I(PHY,"[UE %d][initial sync] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n", LOG_I(PHY,"[UE %d] N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n",
phy_vars_ue->Mod_id, phy_vars_ue->Mod_id,
phy_vars_ue->PHY_measurements.n0_power_tot_dBm, phy_vars_ue->PHY_measurements.n0_power_tot_dBm,
phy_vars_ue->PHY_measurements.n0_power_dB[0], phy_vars_ue->PHY_measurements.n0_power_dB[0],
...@@ -242,6 +267,10 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -242,6 +267,10 @@ int pbch_detection(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
} }
char phich_string[13][4] = {"","1/6","","1/2","","","one","","","","","","two"};
char duplex_string[2][4] = {"FDD","TDD"};
char prefix_string[2][9] = {"NORMAL","EXTENDED"};
int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
{ {
...@@ -251,16 +280,26 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -251,16 +280,26 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
uint8_t flip_fdd_ncp,flip_fdd_ecp,flip_tdd_ncp,flip_tdd_ecp; uint8_t flip_fdd_ncp,flip_fdd_ecp,flip_tdd_ncp,flip_tdd_ecp;
// uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0; // uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
// uint8_t i; int i;
int ret=-1; int ret=-1;
int aarx,rx_power=0; int aarx,rx_power=0;
#ifdef OAI_USRP
__m128i *rxdata128;
#endif
// LOG_I(PHY,"**************************************************************\n"); // LOG_I(PHY,"**************************************************************\n");
// First try FDD normal prefix // First try FDD normal prefix
frame_parms->Ncp=NORMAL; frame_parms->Ncp=NORMAL;
frame_parms->frame_type=FDD; frame_parms->frame_type=FDD;
init_frame_parms(frame_parms,1); init_frame_parms(frame_parms,1);
#ifdef OAI_USRP
for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) {
rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx];
for (i=0; i<(frame_parms->samples_per_tti*10)>>2; i++) {
rxdata128[i] = _mm_srai_epi16(rxdata128[i],4);
}
}
#endif
sync_pos = lte_sync_time(phy_vars_ue->lte_ue_common_vars.rxdata, sync_pos = lte_sync_time(phy_vars_ue->lte_ue_common_vars.rxdata,
frame_parms, frame_parms,
(int *)&phy_vars_ue->lte_ue_common_vars.eNb_id); (int *)&phy_vars_ue->lte_ue_common_vars.eNb_id);
...@@ -480,26 +519,56 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -480,26 +519,56 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters if (ret==0) { // PBCH found so indicate sync to higher layers and configure frame parameters
#ifdef DEBUG_INITIAL_SYNCH #ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[PHY][UE%d] In synch, rx_offset %d samples\n",phy_vars_ue->Mod_id, phy_vars_ue->rx_offset); LOG_I(PHY,"[UE%d] In synch, rx_offset %d samples\n",phy_vars_ue->Mod_id, phy_vars_ue->rx_offset);
#endif #endif
if (phy_vars_ue->UE_scan_carrier == 0) {
#ifdef OPENAIR2 #ifdef OPENAIR2
LOG_I(PHY,"[PHY][UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
//mac_resynch(); //mac_resynch();
mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id); mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
#endif //OPENAIR2 #endif //OPENAIR2
generate_pcfich_reg_mapping(frame_parms); generate_pcfich_reg_mapping(frame_parms);
generate_phich_reg_mapping(frame_parms); generate_phich_reg_mapping(frame_parms);
// init_prach625(frame_parms); // init_prach625(frame_parms);
#ifndef OPENAIR2 #ifndef OPENAIR2
phy_vars_ue->UE_mode[0] = PUSCH; phy_vars_ue->UE_mode[0] = PUSCH;
#else #else
phy_vars_ue->UE_mode[0] = PRACH; phy_vars_ue->UE_mode[0] = PRACH;
#endif #endif
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0; //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0;
phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0; phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0;
//phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0; //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0;
}
LOG_I(PHY,"[UE %d] Frame %d RRC Measurements => rssi %3.1f dBm (dig %3.1f dB, gain %d), N0 %d dBm, rsrp %3.1f dBm/RE, rsrq %3.1f dB\n",phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,
10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi),
phy_vars_ue->rx_total_gain_dB,
phy_vars_ue->PHY_measurements.n0_power_tot_dBm,
10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB,
(10*log10(phy_vars_ue->PHY_measurements.rsrq[0])));
LOG_I(PHY,"[UE %d] Frame %d MIB Information => %s, %s, NidCell %d, N_RB_DL %d, PHICH DURATION %d, PHICH RESOURCE %s, TX_ANT %d\n",
phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,
duplex_string[phy_vars_ue->lte_frame_parms.frame_type],
prefix_string[phy_vars_ue->lte_frame_parms.Ncp],
phy_vars_ue->lte_frame_parms.Nid_cell,
phy_vars_ue->lte_frame_parms.N_RB_DL,
phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration,
phich_string[phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource],
phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB);
#if defined(OAI_USRP) || defined(EXMIMO)
LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
phy_vars_ue->Mod_id,
phy_vars_ue->frame_rx,
openair0_cfg[0].rx_freq[0]-phy_vars_ue->lte_ue_common_vars.freq_offset,
phy_vars_ue->lte_ue_common_vars.freq_offset);
#endif
} else { } else {
#ifdef DEBUG_INITIAL_SYNC #ifdef DEBUG_INITIAL_SYNC
LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",phy_vars_ue->Mod_id); LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",phy_vars_ue->Mod_id);
...@@ -523,3 +592,4 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode) ...@@ -523,3 +592,4 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
return ret; return ret;
} }
...@@ -67,8 +67,15 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t ...@@ -67,8 +67,15 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
if ((mode == normal_txrx) || (mode == no_L2_connect)) { if ((mode == normal_txrx) || (mode == no_L2_connect)) {
len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti); len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti);
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE\n",
10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rsrq[0]),
phy_vars_ue->PHY_measurements.n0_power_tot_dBm);
/*
len += sprintf(&buffer[len], len += sprintf(&buffer[len],
"[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)\neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n", "[UE PROC] Frame count: %d\neNB0 RSSI %d dBm/RE (%d dB, %d dB)\neNB1 RSSI %d dBm/RE (%d dB, %d dB)neNB2 RSSI %d dBm/RE (%d dB, %d dB)\nN0 %d dBm/RE, %f dBm/%dPRB (%d dB, %d dB)\n",
phy_vars_ue->frame_rx, phy_vars_ue->frame_rx,
phy_vars_ue->PHY_measurements.rx_rssi_dBm[0], phy_vars_ue->PHY_measurements.rx_rssi_dBm[0],
phy_vars_ue->PHY_measurements.rx_power_dB[0][0], phy_vars_ue->PHY_measurements.rx_power_dB[0][0],
...@@ -84,14 +91,17 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t ...@@ -84,14 +91,17 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
phy_vars_ue->lte_frame_parms.N_RB_DL, phy_vars_ue->lte_frame_parms.N_RB_DL,
phy_vars_ue->PHY_measurements.n0_power_dB[0], phy_vars_ue->PHY_measurements.n0_power_dB[0],
phy_vars_ue->PHY_measurements.n0_power_dB[1]); phy_vars_ue->PHY_measurements.n0_power_dB[1]);
*/
#ifdef EXMIMO #ifdef EXMIMO
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]); len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]);
#endif #endif
#ifdef OAI_USRP #ifdef OAI_USRP
len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB); len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB);
#endif #endif
#if defined(EXMIMO) || defined(OAI_USRP)
len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz (%d)\n",phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset); len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz (%d), estimated carrier frequency %f Hz\n",phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset,openair0_cfg[0].rx_freq[0]-phy_vars_ue->lte_ue_common_vars.freq_offset);
#endif
len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[phy_vars_ue->UE_mode[0]],phy_vars_ue->UE_mode[0]); len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[phy_vars_ue->UE_mode[0]],phy_vars_ue->UE_mode[0]);
len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance); len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance);
len += sprintf(&buffer[len], "[UE PROC] UE tx power = %d\n", PHY_vars_UE_g[0][0]->tx_power_dBm); len += sprintf(&buffer[len], "[UE PROC] UE tx power = %d\n", PHY_vars_UE_g[0][0]->tx_power_dBm);
...@@ -455,10 +465,8 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t ...@@ -455,10 +465,8 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
RRC_status = mac_UE_get_rrc_status(phy_vars_ue->Mod_id, 0); RRC_status = mac_UE_get_rrc_status(phy_vars_ue->Mod_id, 0);
len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status); len += sprintf(&buffer[len],"[UE PROC] RRC status = %d\n",RRC_status);
#endif #endif
len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f, RSRQ[0] %.2f\n",
10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB, 10*log10(phy_vars_ue->PHY_measurements.rsrq[0]));
len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d (mode1_flag %d)\n",phy_vars_ue->transmission_mode[eNB],phy_vars_ue->lte_frame_parms.mode1_flag); len += sprintf(&buffer[len], "[UE PROC] Transmission Mode %d (mode1_flag %d)\n",phy_vars_ue->transmission_mode[eNB],phy_vars_ue->lte_frame_parms.mode1_flag);
len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n", len += sprintf(&buffer[len], "[UE PROC] PBCH err conseq %d, PBCH error total %d, PBCH FER %d\n",
phy_vars_ue->lte_ue_pbch_vars[eNB]->pdu_errors_conseq, phy_vars_ue->lte_ue_pbch_vars[eNB]->pdu_errors_conseq,
......
...@@ -248,13 +248,15 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_ ...@@ -248,13 +248,15 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_
(frame_parms->symbols_per_tti/2)-2, // second to last symbol of (frame_parms->symbols_per_tti/2)-2, // second to last symbol of
0, // slot 0 0, // slot 0
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
// PSS // PSS
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
(frame_parms->symbols_per_tti/2)-1, // last symbol of (frame_parms->symbols_per_tti/2)-1, // last symbol of
0, // slot 0 0, // slot 0
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
} else { // TDD } else { // TDD
#ifdef DEBUG_SSS #ifdef DEBUG_SSS
if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL) if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL)
...@@ -268,13 +270,15 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_ ...@@ -268,13 +270,15 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_
(frame_parms->symbols_per_tti>>1)-1, // last symbol of (frame_parms->symbols_per_tti>>1)-1, // last symbol of
1, // slot 1 1, // slot 1
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
// PSS // PSS
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
2, // symbol 2 of 2, // symbol 2 of
2, // slot 2 2, // slot 2
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
} }
pss_sss_extract(phy_vars_ue, pss_sss_extract(phy_vars_ue,
...@@ -303,26 +307,28 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_ ...@@ -303,26 +307,28 @@ int rx_sss(PHY_VARS_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uint8_
(frame_parms->symbols_per_tti/2)-2, (frame_parms->symbols_per_tti/2)-2,
10, 10,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,1);
// PSS // PSS
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
(frame_parms->symbols_per_tti/2)-1, (frame_parms->symbols_per_tti/2)-1,
10, 10,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,1);
} else { // TDD } else { // TDD
// SSS // SSS
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
(frame_parms->symbols_per_tti>>1)-1, (frame_parms->symbols_per_tti>>1)-1,
11, 11,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
// PSS // PSS
slot_fep(phy_vars_ue, slot_fep(phy_vars_ue,
2, 2,
12, 12,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
1);
} }
pss_sss_extract(phy_vars_ue, pss_sss_extract(phy_vars_ue,
......
...@@ -363,6 +363,10 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) ...@@ -363,6 +363,10 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH)
dft1200(idft_in2,idft_out2,1); dft1200(idft_in2,idft_out2,1);
break; break;
default:
// should not be reached
LOG_E( PHY, "Unsupported Msc_PUSCH value of %"PRIu16"\n", Msc_PUSCH );
return;
} }
...@@ -1267,6 +1271,7 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext, ...@@ -1267,6 +1271,7 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext,
} }
DevAssert( nb_rb );
avg[aarx] = (((int*)&avg128U)[0] + avg[aarx] = (((int*)&avg128U)[0] +
((int*)&avg128U)[1] + ((int*)&avg128U)[1] +
((int*)&avg128U)[2] + ((int*)&avg128U)[2] +
......
...@@ -62,13 +62,15 @@ void PHY_ofdm_mod(int *input, ...@@ -62,13 +62,15 @@ void PHY_ofdm_mod(int *input,
\param Ns Slot number (0..19) \param Ns Slot number (0..19)
\param sample_offset offset within rxdata (points to beginning of subframe) \param sample_offset offset within rxdata (points to beginning of subframe)
\param no_prefix if 1 prefix is removed by HW \param no_prefix if 1 prefix is removed by HW
\param reset_freq_est if non-zero it resets the frequency offset estimation loop
*/ */
int slot_fep(PHY_VARS_UE *phy_vars_ue, int slot_fep(PHY_VARS_UE *phy_vars_ue,
unsigned char l, unsigned char l,
unsigned char Ns, unsigned char Ns,
int sample_offset, int sample_offset,
int no_prefix); int no_prefix,
int reset_freq_est);
int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue, int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
unsigned char l, unsigned char l,
......
...@@ -48,7 +48,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, ...@@ -48,7 +48,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
unsigned char l, unsigned char l,
unsigned char Ns, unsigned char Ns,
int sample_offset, int sample_offset,
int no_prefix) int no_prefix,
int reset_freq_est)
{ {
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
...@@ -236,7 +237,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue, ...@@ -236,7 +237,8 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
lte_est_freq_offset(ue_common_vars->dl_ch_estimates[0], lte_est_freq_offset(ue_common_vars->dl_ch_estimates[0],
frame_parms, frame_parms,
l, l,
&ue_common_vars->freq_offset); &ue_common_vars->freq_offset,
reset_freq_est);
stop_meas(&phy_vars_ue->dlsch_freq_offset_estimation_stats); stop_meas(&phy_vars_ue->dlsch_freq_offset_estimation_stats);
} }
......
...@@ -209,7 +209,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -209,7 +209,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
} }
} }
// Channel Impulse Response // Channel Impulse Response
if (chest_t != NULL) { if (chest_t != NULL) {
ymax = 0; ymax = 0;
...@@ -697,8 +697,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -697,8 +697,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
} }
// PDSCH Throughput // PDSCH Throughput
memcpy((void*)tput_time_ue[UE_id],(void*)&tput_time_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float)); memmove( tput_time_ue[UE_id], &tput_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
memcpy((void*)tput_ue[UE_id],(void*)&tput_ue[UE_id][1],(TPUT_WINDOW_LENGTH-1)*sizeof(float)); memmove( tput_ue[UE_id], &tput_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
tput_time_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame; tput_time_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
tput_ue[UE_id][TPUT_WINDOW_LENGTH-1] = ((float) total_dlsch_bitrate)/1000.0; tput_ue[UE_id][TPUT_WINDOW_LENGTH-1] = ((float) total_dlsch_bitrate)/1000.0;
......
...@@ -415,6 +415,8 @@ typedef struct { ...@@ -415,6 +415,8 @@ typedef struct {
runmode_t mode; runmode_t mode;
/// \brief Indicator that UE should perform band scanning /// \brief Indicator that UE should perform band scanning
int UE_scan; int UE_scan;
/// \brief Indicator that UE should perform coarse scanning around carrier
int UE_scan_carrier;
/// \brief Indicator that UE is synchronized to an eNB /// \brief Indicator that UE is synchronized to an eNB
int is_synchronized; int is_synchronized;
/// \brief Instance count of TX processing thread (-1 means ready, 0 means busy) /// \brief Instance count of TX processing thread (-1 means ready, 0 means busy)
......
...@@ -1456,28 +1456,8 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t ...@@ -1456,28 +1456,8 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_MEASUREMENT_PROCEDURES, VCD_FUNCTION_IN);
#ifdef EMOS
/*
uint8_t aa;
// first slot in frame is special
if (((slot_rx==0) || (slot_rx==1) || (slot_rx==12) || (slot_rx==13)) &&
((l==0) || (l==4-frame_parms->Ncp))) {
for (eNB_id=0; eNB_id<3; eNB_id++)
for (aa=0;aa<frame_parms->nb_antennas_tx_eNB;aa++)
lte_dl_channel_estimation_emos(emos_dump_UE.channel[eNB_id],
phy_vars_ue->lte_ue_common_vars->rxdataF,
&phy_vars_ue->lte_frame_parms,
slot_rx,
aa,
l,
eNB_id);
}
*/
#endif
if (l==0) { if (l==0) {
// UE measurements // UE measurements on symbol 0
if (abstraction_flag==0) { if (abstraction_flag==0) {
LOG_D(PHY,"Calling measurements subframe %d, rxdata %p\n",subframe_rx,phy_vars_ue->lte_ue_common_vars.rxdata); LOG_D(PHY,"Calling measurements subframe %d, rxdata %p\n",subframe_rx,phy_vars_ue->lte_ue_common_vars.rxdata);
...@@ -1491,47 +1471,11 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t ...@@ -1491,47 +1471,11 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
0, 0,
1); 1);
} }
#ifdef DEBUG_PHY_PROC
if (slot_rx == 2) { // && (phy_vars_ue->frame%100==0)) {
LOG_D(PHY,"[UE %d] frame %d, slot %d, freq_offset_filt = %d \n",Mod_id,phy_vars_ue->frame_tx, slot_rx, phy_vars_ue->lte_ue_common_vars.freq_offset);
/*
LOG_I(PHY,"[UE %d] frame %d, slot %d, RX RSSI (%d,%d,%d) dBm, digital (%d,%d)(%d,%d)(%d,%d) dB, linear (%d,%d), avg rx power %d dB (%d lin), N0 %d dB (%d lin), RX gain %d dB\n",
Mod_id,phy_vars_ue->frame, slot_rx,
phy_vars_ue->PHY_measurements.rx_rssi_dBm[0],
phy_vars_ue->PHY_measurements.rx_rssi_dBm[1],
phy_vars_ue->PHY_measurements.rx_rssi_dBm[2],
phy_vars_ue->PHY_measurements.rx_power_dB[0][0],
phy_vars_ue->PHY_measurements.rx_power_dB[0][1],
phy_vars_ue->PHY_measurements.rx_power_dB[1][0],
phy_vars_ue->PHY_measurements.rx_power_dB[1][1],
phy_vars_ue->PHY_measurements.rx_power_dB[2][0],
phy_vars_ue->PHY_measurements.rx_power_dB[2][1],
phy_vars_ue->PHY_measurements.rx_power[0][0],
phy_vars_ue->PHY_measurements.rx_power[0][1],
phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],
phy_vars_ue->PHY_measurements.rx_power_avg[0],
phy_vars_ue->PHY_measurements.n0_power_avg_dB,
phy_vars_ue->PHY_measurements.n0_power_avg,
phy_vars_ue->rx_total_gain_dB);
LOG_I(PHY,"[UE %d] frame %d, slot %d, N0 %d dBm digital (%d, %d) dB, linear (%d, %d), avg noise power %d dB (%d lin)\n",
Mod_id,phy_vars_ue->frame, slot_rx,
phy_vars_ue->PHY_measurements.n0_power_tot_dBm,
phy_vars_ue->PHY_measurements.n0_power_dB[0],
phy_vars_ue->PHY_measurements.n0_power_dB[1],
phy_vars_ue->PHY_measurements.n0_power[0],
phy_vars_ue->PHY_measurements.n0_power[1],
phy_vars_ue->PHY_measurements.n0_power_avg_dB,
phy_vars_ue->PHY_measurements.n0_power_avg); */
}
#endif
} }
if (l==(4-frame_parms->Ncp)) { if (l==(6-phy_vars_ue->lte_frame_parms.Ncp)) {
// make sure we have signal from PSS/SSS for N0 measurement
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN);
ue_rrc_measurements(phy_vars_ue, ue_rrc_measurements(phy_vars_ue,
...@@ -1882,7 +1826,7 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst ...@@ -1882,7 +1826,7 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
phy_vars_ue->lte_frame_parms.N_RB_DL, phy_vars_ue->lte_frame_parms.N_RB_DL,
phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration, phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration,
phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource); phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource);
/*
if (frame_rx%100 == 0) { if (frame_rx%100 == 0) {
LOG_I(PHY,"[UE %d] frame %d, slot %d, PBCH: mode1_flag %d, tx_ant %d, frame_tx %d, phase %d. N_RB_DL %d, phich_duration %d, phich_resource %d/6,Frequency offset %d Hz (%d)\n", LOG_I(PHY,"[UE %d] frame %d, slot %d, PBCH: mode1_flag %d, tx_ant %d, frame_tx %d, phase %d. N_RB_DL %d, phich_duration %d, phich_resource %d/6,Frequency offset %d Hz (%d)\n",
phy_vars_ue->Mod_id, phy_vars_ue->Mod_id,
...@@ -1897,8 +1841,9 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst ...@@ -1897,8 +1841,9 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource, phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource,
phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset); phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset);
//dump_frame_parms(&phy_vars_ue->lte_frame_parms); //dump_frame_parms(&phy_vars_ue->lte_frame_parms);
}
}
*/
#endif #endif
} else { } else {
...@@ -2485,7 +2430,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac ...@@ -2485,7 +2430,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
l, l,
slot_rx, slot_rx,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
0); 0,
0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
stop_meas(&phy_vars_ue->ofdm_demod_stats); stop_meas(&phy_vars_ue->ofdm_demod_stats);
} }
...@@ -3240,10 +3186,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac ...@@ -3240,10 +3186,11 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n", LOG_D(PHY,"[UE %d] Calculating bitrate Frame %d: total_TBS = %d, total_TBS_last = %d, bitrate %f kbits\n",
phy_vars_ue->Mod_id,frame_rx,phy_vars_ue->total_TBS[eNB_id], phy_vars_ue->Mod_id,frame_rx,phy_vars_ue->total_TBS[eNB_id],
phy_vars_ue->total_TBS_last[eNB_id],(float) phy_vars_ue->bitrate[eNB_id]/1000.0); phy_vars_ue->total_TBS_last[eNB_id],(float) phy_vars_ue->bitrate[eNB_id]/1000.0);
/*
if ((frame_rx % 100 == 0)) { if ((frame_rx % 100 == 0)) {
LOG_I(PHY,"Throughput %5.1f kbps\n",(float) phy_vars_ue->bitrate[eNB_id]/1000.0); LOG_I(PHY,"Throughput %5.1f kbps\n",(float) phy_vars_ue->bitrate[eNB_id]/1000.0);
} }
*/
} }
if (is_pmch_subframe((subframe_rx==9?-1:0)+frame_rx,subframe_rx,&phy_vars_ue->lte_frame_parms)) { if (is_pmch_subframe((subframe_rx==9?-1:0)+frame_rx,subframe_rx,&phy_vars_ue->lte_frame_parms)) {
......
This diff is collapsed.
...@@ -146,7 +146,6 @@ void get_prach_resources(module_id_t module_idP, ...@@ -146,7 +146,6 @@ void get_prach_resources(module_id_t module_idP,
if (!rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) { if (!rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) {
noGroupB = 1; noGroupB = 1;
} else { } else {
if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA == if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA ==
rach_ConfigCommon->preambleInfo.numberOfRA_Preambles) { rach_ConfigCommon->preambleInfo.numberOfRA_Preambles) {
...@@ -186,6 +185,7 @@ void get_prach_resources(module_id_t module_idP, ...@@ -186,6 +185,7 @@ void get_prach_resources(module_id_t module_idP,
UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0; UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0;
} else { } else {
// FIXME rach_ConfigCommon->preambleInfo.preamblesGroupAConfig may be zero
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex =
rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA + rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA +
(taus())%(rach_ConfigCommon->preambleInfo.numberOfRA_Preambles - (taus())%(rach_ConfigCommon->preambleInfo.numberOfRA_Preambles -
...@@ -363,7 +363,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -363,7 +363,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
module_idP,frameP, rlc_status.bytes_in_buffer,dcch_header_len); module_idP,frameP, rlc_status.bytes_in_buffer,dcch_header_len);
sdu_lengths[0] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti, sdu_lengths[0] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti,
eNB_indexP, frameP,ENB_FLAG_NO, MBMS_FLAG_NO, eNB_indexP, frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
(char *)&ulsch_buff[0]); (char *)&ulsch_buff[0]);
......
...@@ -195,10 +195,10 @@ typedef struct UE_RRC_INFO_s { ...@@ -195,10 +195,10 @@ typedef struct UE_RRC_INFO_s {
#ifdef Rel10 #ifdef Rel10
uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA uint8_t MCCHStatus[8]; // MAX_MBSFN_AREA
#endif #endif
uint8_t SIwindowsize; uint8_t SIwindowsize; //!< Corresponds to the SIB1 si-WindowLength parameter. The unit is ms. Possible values are (final): 1,2,5,10,15,20,40
uint8_t handoverTarget; uint8_t handoverTarget;
HO_STATE_t ho_state; HO_STATE_t ho_state;
uint16_t SIperiod; uint16_t SIperiod; //!< Corresponds to the SIB1 si-Periodicity parameter (multiplied by 10). Possible values are (final): 80,160,320,640,1280,2560,5120
unsigned short UE_index; unsigned short UE_index;
uint32_t T300_active; uint32_t T300_active;
uint32_t T300_cnt; uint32_t T300_cnt;
...@@ -460,7 +460,7 @@ typedef struct UE_RRC_INST_s { ...@@ -460,7 +460,7 @@ typedef struct UE_RRC_INST_s {
uint8_t SIB1Status[NB_CNX_UE]; uint8_t SIB1Status[NB_CNX_UE];
uint8_t SIStatus[NB_CNX_UE]; uint8_t SIStatus[NB_CNX_UE];
SystemInformationBlockType1_t *sib1[NB_CNX_UE]; SystemInformationBlockType1_t *sib1[NB_CNX_UE];
SystemInformation_t *si[NB_CNX_UE][8]; SystemInformation_t *si[NB_CNX_UE]; //!< Temporary storage for an SI message. Decoding happens in decode_SI().
SystemInformationBlockType2_t *sib2[NB_CNX_UE]; SystemInformationBlockType2_t *sib2[NB_CNX_UE];
SystemInformationBlockType3_t *sib3[NB_CNX_UE]; SystemInformationBlockType3_t *sib3[NB_CNX_UE];
SystemInformationBlockType4_t *sib4[NB_CNX_UE]; SystemInformationBlockType4_t *sib4[NB_CNX_UE];
......
...@@ -77,12 +77,7 @@ rrc_rx_tx( ...@@ -77,12 +77,7 @@ rrc_rx_tx(
\param ctxt_pP Running context \param ctxt_pP Running context
\param Srb_info Pointer to SRB_INFO structure (SRB0) \param Srb_info Pointer to SRB_INFO structure (SRB0)
\param eNB_index Index of corresponding eNB/CH*/ \param eNB_index Index of corresponding eNB/CH*/
int int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* const Srb_info, const uint8_t eNB_index );
rrc_ue_decode_ccch(
const protocol_ctxt_t* const ctxt_pP,
const SRB_INFO* const Srb_info,
const uint8_t eNB_index
);
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message /** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
\param ctxt_pP Running context \param ctxt_pP Running context
...@@ -106,17 +101,6 @@ rrc_ue_generate_RRCConnectionRequest( ...@@ -106,17 +101,6 @@ rrc_ue_generate_RRCConnectionRequest(
const uint8_t eNB_index const uint8_t eNB_index
); );
/** \brief Generates/Encodes RRCConnnectionSetupComplete message at UE
\param ctxt_pP Running context
\param eNB_index Index of corresponding eNB/CH
\param Transaction_id Transaction identifier*/
void
rrc_ue_generate_RRCConnectionSetupComplete(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
const uint8_t Transaction_id
);
/** \brief process the received rrcConnectionReconfiguration message at UE /** \brief process the received rrcConnectionReconfiguration message at UE
\param ctxt_pP Running context \param ctxt_pP Running context
\param *rrcConnectionReconfiguration pointer to the sturcture \param *rrcConnectionReconfiguration pointer to the sturcture
...@@ -128,17 +112,6 @@ rrc_ue_process_rrcConnectionReconfiguration( ...@@ -128,17 +112,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
uint8_t eNB_index uint8_t eNB_index
); );
/** \brief Generates/Encodes RRCConnectionReconfigurationComplete message at UE
\param ctxt_pP Running context
\param eNB_index Index of corresponding eNB/CH
\param Transaction_id RRC transaction identifier */
void
rrc_ue_generate_RRCConnectionReconfigurationComplete(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
const uint8_t Transaction_id
);
/** \brief Establish SRB1 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly /** \brief Establish SRB1 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly
\param module_idP Instance ID of UE \param module_idP Instance ID of UE
\param frame Frame index \param frame Frame index
...@@ -347,41 +320,15 @@ void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_i ...@@ -347,41 +320,15 @@ void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_i
void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index); void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
int int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area );
decode_MCCH_Message(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
const uint8_t* const Sdu,
const uint8_t Sdu_len,
const uint8_t mbsfn_sync_area
);
void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area);
int int decode_BCCH_DLSCH_Message(
decode_BCCH_DLSCH_Message(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index, const uint8_t eNB_index,
uint8_t* const Sdu, uint8_t* const Sdu,
const uint8_t Sdu_len, const uint8_t Sdu_len,
const uint8_t rsrq, const uint8_t rsrq,
const uint8_t rsrp const uint8_t rsrp );
);
int
decode_SIB1(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
const uint8_t rsrq,
const uint8_t rsrp
);
int
decode_SI(
const protocol_ctxt_t* const ctxt_pP,
const uint8_t eNB_index,
const uint8_t si_window
);
void void
ue_meas_filtering( ue_meas_filtering(
...@@ -426,12 +373,6 @@ rrc_eNB_process_MeasurementReport( ...@@ -426,12 +373,6 @@ rrc_eNB_process_MeasurementReport(
const MeasResults_t* const measResults2 const MeasResults_t* const measResults2
); );
void
rrc_ue_generate_MeasurementReport(
const protocol_ctxt_t* const ctxt_pP,
uint8_t eNB_index
);
void void
rrc_eNB_generate_HandoverPreparationInformation( rrc_eNB_generate_HandoverPreparationInformation(
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t* const ctxt_pP,
...@@ -444,15 +385,6 @@ check_handovers( ...@@ -444,15 +385,6 @@ check_handovers(
protocol_ctxt_t* const ctxt_pP protocol_ctxt_t* const ctxt_pP
); );
uint8_t check_trigger_meas_event(
uint8_t module_idP,
frame_t frameP,
uint8_t eNB_index,
uint8_t ue_cnx_index,
uint8_t meas_index,
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
//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
rrc_ue_process_securityModeCommand( rrc_ue_process_securityModeCommand(
......
This diff is collapsed.
...@@ -378,7 +378,7 @@ init_MCCH( ...@@ -378,7 +378,7 @@ init_MCCH(
int sync_area = 0; int sync_area = 0;
// initialize RRC_eNB_INST MCCH entry // initialize RRC_eNB_INST MCCH entry
eNB_rrc_inst[enb_mod_idP].carrier[CC_id].MCCH_MESSAGE = eNB_rrc_inst[enb_mod_idP].carrier[CC_id].MCCH_MESSAGE =
malloc(eNB_rrc_inst[enb_mod_idP].carrier[CC_id].num_mbsfn_sync_area * sizeof(uint32_t *)); malloc(eNB_rrc_inst[enb_mod_idP].carrier[CC_id].num_mbsfn_sync_area * sizeof(uint8_t*));
for (sync_area = 0; sync_area < eNB_rrc_inst[enb_mod_idP].carrier[CC_id].num_mbsfn_sync_area; sync_area++) { for (sync_area = 0; sync_area < eNB_rrc_inst[enb_mod_idP].carrier[CC_id].num_mbsfn_sync_area; sync_area++) {
...@@ -3289,9 +3289,11 @@ openair_rrc_lite_eNB_init( ...@@ -3289,9 +3289,11 @@ openair_rrc_lite_eNB_init(
// } // }
// } // }
eNB_rrc_inst[ctxt.module_id].Nb_ue = 0; eNB_rrc_inst[ctxt.module_id].Nb_ue = 0;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
eNB_rrc_inst[ctxt.module_id].carrier[CC_id].Srb0.Active = 0; eNB_rrc_inst[ctxt.module_id].carrier[CC_id].Srb0.Active = 0;
} }
uid_linear_allocator_init(&eNB_rrc_inst[ctxt.module_id].uid_allocator); uid_linear_allocator_init(&eNB_rrc_inst[ctxt.module_id].uid_allocator);
RB_INIT(&eNB_rrc_inst[ctxt.module_id].rrc_ue_head); RB_INIT(&eNB_rrc_inst[ctxt.module_id].rrc_ue_head);
RB_INIT(&eNB_rrc_inst[ctxt.module_id].rrc_rnti_head); RB_INIT(&eNB_rrc_inst[ctxt.module_id].rrc_rnti_head);
...@@ -3334,6 +3336,7 @@ openair_rrc_lite_eNB_init( ...@@ -3334,6 +3336,7 @@ openair_rrc_lite_eNB_init(
eNB_rrc_inst[ctxt.module_id].carrier[CC_id].cba_rnti[3], eNB_rrc_inst[ctxt.module_id].carrier[CC_id].cba_rnti[3],
eNB_rrc_inst[ctxt.module_id].carrier[CC_id].num_active_cba_groups); eNB_rrc_inst[ctxt.module_id].carrier[CC_id].num_active_cba_groups);
} }
#endif #endif
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
......
...@@ -94,6 +94,7 @@ const char* eurecomVariablesNames[] = { ...@@ -94,6 +94,7 @@ const char* eurecomVariablesNames[] = {
"rxcnt", "rxcnt",
"trx_ts", "trx_ts",
"trx_tst", "trx_tst",
"dummy_dump",
"itti_send_msg", "itti_send_msg",
"itti_poll_msg", "itti_poll_msg",
"itti_recv_msg", "itti_recv_msg",
......
...@@ -66,6 +66,7 @@ typedef enum { ...@@ -66,6 +66,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_RXCNT, VCD_SIGNAL_DUMPER_VARIABLES_RXCNT,
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS,
VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST,
VCD_SIGNAL_DUMPER_VARIABLES_DUMMY_DUMP,
VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG, VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG, VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG,
VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG, VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
......
...@@ -44,7 +44,7 @@ typedef struct openair0_device_t openair0_device; ...@@ -44,7 +44,7 @@ typedef struct openair0_device_t openair0_device;
#define MAX_CARDS 1 #define MAX_CARDS 1
#endif #endif
#define USRP_GAIN_OFFSET (86.0) // 86 calibrated for USRP B210 @ 2.6 GHz to get equivalent RS EPRE in OAI to SMBV100 output #define USRP_GAIN_OFFSET (56.0) // 86 calibrated for USRP B210 @ 2.6 GHz to get equivalent RS EPRE in OAI to SMBV100 output
typedef enum { typedef enum {
max_gain=0,med_gain,byp_gain max_gain=0,med_gain,byp_gain
...@@ -81,6 +81,8 @@ typedef struct { ...@@ -81,6 +81,8 @@ typedef struct {
double rx_bw; double rx_bw;
//! TX bandwidth in Hz //! TX bandwidth in Hz
double tx_bw; double tx_bw;
//! Auto calibration flag
int autocal[4];
//! RRH IP addr for Ethernet interface //! RRH IP addr for Ethernet interface
char *rrh_ip; char *rrh_ip;
//! RRH port number for Ethernet interface //! RRH port number for Ethernet interface
...@@ -141,13 +143,14 @@ extern "C" ...@@ -141,13 +143,14 @@ extern "C"
#endif #endif
/* return 0 if OK, < 0 if error */ /* return 0 if OK, < 0 if error */
int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg); int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
openair0_timestamp get_usrp_time(openair0_device *device); openair0_timestamp get_usrp_time(openair0_device *device);
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg); int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg); int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg); int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg);
int openair0_stop(int card);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -250,7 +250,7 @@ int openair0_stop_without_reset(int card) ...@@ -250,7 +250,7 @@ int openair0_stop_without_reset(int card)
int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
// Initialize card // Initialize card
exmimo_config_t *p_exmimo_config; // exmimo_config_t *p_exmimo_config;
exmimo_id_t *p_exmimo_id; exmimo_id_t *p_exmimo_id;
int ret; int ret;
...@@ -276,7 +276,7 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf ...@@ -276,7 +276,7 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf
printf ("Detected %d number of cards, %d number of antennas.\n", openair0_num_detected_cards, openair0_num_antennas[0]); printf ("Detected %d number of cards, %d number of antennas.\n", openair0_num_detected_cards, openair0_num_antennas[0]);
} }
p_exmimo_config = openair0_exmimo_pci[0].exmimo_config_ptr; // p_exmimo_config = openair0_exmimo_pci[0].exmimo_config_ptr;
p_exmimo_id = openair0_exmimo_pci[0].exmimo_id_ptr; p_exmimo_id = openair0_exmimo_pci[0].exmimo_id_ptr;
printf("Card %d: ExpressMIMO %d, HW Rev %d, SW Rev 0x%d\n", 0, p_exmimo_id->board_exmimoversion, p_exmimo_id->board_hwrev, p_exmimo_id->board_swrev); printf("Card %d: ExpressMIMO %d, HW Rev %d, SW Rev 0x%d\n", 0, p_exmimo_id->board_exmimoversion, p_exmimo_id->board_hwrev, p_exmimo_id->board_swrev);
...@@ -356,14 +356,15 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -356,14 +356,15 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
for (ant=0; ant<4; ant++) { for (ant=0; ant<4; ant++) {
if (openair0_cfg[card].rx_freq[ant] || openair0_cfg[card].tx_freq[ant]) { if (openair0_cfg[card].rx_freq[ant] || openair0_cfg[card].tx_freq[ant]) {
p_exmimo_config->rf.rf_mode[ant] = RF_MODE_BASE; p_exmimo_config->rf.rf_mode[ant] = RF_MODE_BASE;
p_exmimo_config->rf.do_autocal[ant] = 1; p_exmimo_config->rf.do_autocal[ant] = 1;//openair0_cfg[card].autocal[ant];
printf("card %d, antenna %d, autocal %d\n",card,ant,openair0_cfg[card].autocal[ant]);
} }
if (openair0_cfg[card].tx_freq[ant]) { if (openair0_cfg[card].tx_freq[ant]) {
p_exmimo_config->rf.rf_mode[ant] += (TXEN + DMAMODE_TX + TXLPFNORM + TXLPFEN + tx_filter); p_exmimo_config->rf.rf_mode[ant] += (TXEN + DMAMODE_TX + TXLPFNORM + TXLPFEN + tx_filter);
p_exmimo_config->rf.rf_freq_tx[ant] = (unsigned int)openair0_cfg[card].tx_freq[ant]; p_exmimo_config->rf.rf_freq_tx[ant] = (unsigned int)openair0_cfg[card].tx_freq[ant];
p_exmimo_config->rf.tx_gain[ant][0] = (unsigned int)openair0_cfg[card].tx_gain[ant]; p_exmimo_config->rf.tx_gain[ant][0] = (unsigned int)openair0_cfg[card].tx_gain[ant];
printf("openair0 : programming card %d TX antenna %d (freq %u, gain %d)\n",card,ant,p_exmimo_config->rf.rf_freq_tx[ant],p_exmimo_config->rf.tx_gain[ant][0]);
} }
if (openair0_cfg[card].rx_freq[ant]) { if (openair0_cfg[card].rx_freq[ant]) {
...@@ -419,11 +420,11 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -419,11 +420,11 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
int openair0_reconfig(openair0_config_t *openair0_cfg) int openair0_reconfig(openair0_config_t *openair0_cfg)
{ {
int ret;
int ant, card; int ant, card;
exmimo_config_t *p_exmimo_config; exmimo_config_t *p_exmimo_config;
exmimo_id_t *p_exmimo_id; // exmimo_id_t *p_exmimo_id;
if (!openair0_cfg) { if (!openair0_cfg) {
printf("Error, openair0_cfg is null!!\n"); printf("Error, openair0_cfg is null!!\n");
...@@ -433,7 +434,7 @@ int openair0_reconfig(openair0_config_t *openair0_cfg) ...@@ -433,7 +434,7 @@ int openair0_reconfig(openair0_config_t *openair0_cfg)
for (card=0; card<openair0_num_detected_cards; card++) { for (card=0; card<openair0_num_detected_cards; card++) {
p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr; p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
p_exmimo_id = openair0_exmimo_pci[card].exmimo_id_ptr; // p_exmimo_id = openair0_exmimo_pci[card].exmimo_id_ptr;
for (ant=0; ant<4; ant++) { for (ant=0; ant<4; ant++) {
if (openair0_cfg[card].tx_freq[ant]) { if (openair0_cfg[card].tx_freq[ant]) {
...@@ -468,6 +469,18 @@ int openair0_reconfig(openair0_config_t *openair0_cfg) ...@@ -468,6 +469,18 @@ int openair0_reconfig(openair0_config_t *openair0_cfg)
return(0); return(0);
} }
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) {
if (exmimo_dump_config > 0) {
// do a full configuration
openair0_config(openair0_cfg,0);
}
else { // just change the frequencies in pci descriptor
openair0_reconfig(openair0_cfg);
}
return(0);
}
unsigned int *openair0_daq_cnt(void) { unsigned int *openair0_daq_cnt(void) {
......
...@@ -95,4 +95,7 @@ int openair0_stop_without_reset(int card); ...@@ -95,4 +95,7 @@ int openair0_stop_without_reset(int card);
// return the DAQ block counter // return the DAQ block counter
unsigned int *openair0_daq_cnt(void); unsigned int *openair0_daq_cnt(void);
// set the TX and RX frequencies (card 0 only for now, to retain USRP compatibility)
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
#endif #endif
...@@ -195,7 +195,7 @@ static bool is_equal(double a, double b) ...@@ -195,7 +195,7 @@ static bool is_equal(double a, double b)
return std::fabs(a-b) < std::numeric_limits<double>::epsilon(); return std::fabs(a-b) < std::numeric_limits<double>::epsilon();
} }
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) { int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int dummy) {
usrp_state_t *s = (usrp_state_t*)device->priv; usrp_state_t *s = (usrp_state_t*)device->priv;
...@@ -231,7 +231,13 @@ int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) ...@@ -231,7 +231,13 @@ int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg)
s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[0]); s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[0]);
return(0); return(0);
} }
int openair0_stop(int card) {
return(0);
}
int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg) int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg)
{ {
uhd::set_thread_priority_safe(1.0); uhd::set_thread_priority_safe(1.0);
......
...@@ -247,6 +247,7 @@ static char *itti_dump_file = NULL; ...@@ -247,6 +247,7 @@ static char *itti_dump_file = NULL;
#endif #endif
int UE_scan = 1; int UE_scan = 1;
int UE_scan_carrier = 0;
runmode_t mode = normal_txrx; runmode_t mode = normal_txrx;
...@@ -430,7 +431,7 @@ void help (void) { ...@@ -430,7 +431,7 @@ void help (void) {
printf(" --no-L2-connect bypass L2 and upper layers\n"); printf(" --no-L2-connect bypass L2 and upper layers\n");
printf(" --ue_rxgain set UE RX gain\n"); printf(" --ue_rxgain set UE RX gain\n");
printf(" --ue_txgain set UE tx gain\n"); printf(" --ue_txgain set UE tx gain\n");
printf(" --ue_scan_carrier set UE to scan around carrier\n");
printf(" -C Set the downlink frequecny for all Component carrier\n"); printf(" -C Set the downlink frequecny for all Component carrier\n");
printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n"); printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n");
printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"); printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n");
...@@ -598,7 +599,7 @@ static void *scope_thread(void *arg) ...@@ -598,7 +599,7 @@ static void *scope_thread(void *arg)
sleep(1); sleep(1);
} }
printf("%s",stats_buffer); // printf("%s",stats_buffer);
# ifdef ENABLE_XFORMS_WRITE_STATS # ifdef ENABLE_XFORMS_WRITE_STATS
...@@ -1934,6 +1935,7 @@ static void get_options (int argc, char **argv) ...@@ -1934,6 +1935,7 @@ static void get_options (int argc, char **argv)
LONG_OPTION_NO_L2_CONNECT, LONG_OPTION_NO_L2_CONNECT,
LONG_OPTION_RXGAIN, LONG_OPTION_RXGAIN,
LONG_OPTION_TXGAIN, LONG_OPTION_TXGAIN,
LONG_OPTION_SCANCARRIER
}; };
static const struct option long_options[] = { static const struct option long_options[] = {
...@@ -1945,6 +1947,7 @@ static void get_options (int argc, char **argv) ...@@ -1945,6 +1947,7 @@ static void get_options (int argc, char **argv)
{"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT}, {"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT},
{"ue_rxgain", required_argument, NULL, LONG_OPTION_RXGAIN}, {"ue_rxgain", required_argument, NULL, LONG_OPTION_RXGAIN},
{"ue_txgain", required_argument, NULL, LONG_OPTION_TXGAIN}, {"ue_txgain", required_argument, NULL, LONG_OPTION_TXGAIN},
{"ue_scan_carrier", no_argument, NULL, LONG_OPTION_SCANCARRIER},
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
...@@ -1993,6 +1996,11 @@ static void get_options (int argc, char **argv) ...@@ -1993,6 +1996,11 @@ static void get_options (int argc, char **argv)
break; break;
case LONG_OPTION_SCANCARRIER:
UE_scan_carrier=1;
break;
case 'M': case 'M':
#ifdef ETHERNET #ifdef ETHERNET
strcpy(rrh_eNB_ip,optarg); strcpy(rrh_eNB_ip,optarg);
...@@ -2009,6 +2017,7 @@ static void get_options (int argc, char **argv) ...@@ -2009,6 +2017,7 @@ static void get_options (int argc, char **argv)
} }
UE_scan=0; UE_scan=0;
break; break;
case 'd': case 'd':
...@@ -2564,6 +2573,7 @@ int main( int argc, char **argv ) ...@@ -2564,6 +2573,7 @@ int main( int argc, char **argv )
UE[CC_id]->UE_scan = UE_scan; UE[CC_id]->UE_scan = UE_scan;
UE[CC_id]->UE_scan_carrier = UE_scan_carrier;
UE[CC_id]->mode = mode; UE[CC_id]->mode = mode;
compute_prach_seq(&UE[CC_id]->lte_frame_parms.prach_config_common, compute_prach_seq(&UE[CC_id]->lte_frame_parms.prach_config_common,
...@@ -2794,6 +2804,7 @@ int main( int argc, char **argv ) ...@@ -2794,6 +2804,7 @@ int main( int argc, char **argv )
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
openair0_cfg[card].autocal[i] = 1;
openair0_cfg[card].tx_gain[i] = tx_gain[0][i]; openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
openair0_cfg[card].rx_gain[i] = ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->rx_total_gain_eNB_dB : openair0_cfg[card].rx_gain[i] = ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->rx_total_gain_eNB_dB :
PHY_vars_UE_g[0][0]->rx_total_gain_dB) - USRP_GAIN_OFFSET; // calibrated for USRP B210 @ 2.6 GHz, 30.72 MS/s PHY_vars_UE_g[0][0]->rx_total_gain_dB) - USRP_GAIN_OFFSET; // calibrated for USRP B210 @ 2.6 GHz, 30.72 MS/s
...@@ -2830,6 +2841,7 @@ int main( int argc, char **argv ) ...@@ -2830,6 +2841,7 @@ int main( int argc, char **argv )
printf("Initializing openair0 ..."); printf("Initializing openair0 ...");
openair0_cfg[0].log_level = glog_level; openair0_cfg[0].log_level = glog_level;
if (openair0_device_init(&openair0, &openair0_cfg[0]) <0) { if (openair0_device_init(&openair0, &openair0_cfg[0]) <0) {
printf("Exiting, cannot initialize device\n"); printf("Exiting, cannot initialize device\n");
exit(-1); exit(-1);
...@@ -3387,15 +3399,15 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c ...@@ -3387,15 +3399,15 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
for (i=0; i<frame_parms->nb_antennas_rx; i++) { for (i=0; i<frame_parms->nb_antennas_rx; i++) {
free(phy_vars_eNB[CC_id]->lte_eNB_common_vars.rxdata[0][i]); free(phy_vars_eNB[CC_id]->lte_eNB_common_vars.rxdata[0][i]);
rxdata[i] = (int32_t*)(16 + malloc16(16+samples_per_frame*sizeof(int32_t))); rxdata[i] = (int32_t*)(16 + malloc16(16+samples_per_frame*sizeof(int32_t))); // FIXME broken memory allocation
phy_vars_eNB[CC_id]->lte_eNB_common_vars.rxdata[0][i] = rxdata[i]-N_TA_offset; // N_TA offset for TDD phy_vars_eNB[CC_id]->lte_eNB_common_vars.rxdata[0][i] = rxdata[i]-N_TA_offset; // N_TA offset for TDD FIXME! N_TA_offset > 16 => access of unallocated memory
memset(rxdata[i], 0, samples_per_frame*sizeof(int32_t)); memset(rxdata[i], 0, samples_per_frame*sizeof(int32_t));
printf("rxdata[%d] @ %p (%p) (N_TA_OFFSET %d)\n", i, phy_vars_eNB[CC_id]->lte_eNB_common_vars.rxdata[0][i],rxdata[i],N_TA_offset); printf("rxdata[%d] @ %p (%p) (N_TA_OFFSET %d)\n", i, phy_vars_eNB[CC_id]->lte_eNB_common_vars.rxdata[0][i],rxdata[i],N_TA_offset);
} }
for (i=0; i<frame_parms->nb_antennas_tx; i++) { for (i=0; i<frame_parms->nb_antennas_tx; i++) {
free(phy_vars_eNB[CC_id]->lte_eNB_common_vars.txdata[0][i]); free(phy_vars_eNB[CC_id]->lte_eNB_common_vars.txdata[0][i]);
txdata[i] = (int32_t*)(16 + malloc16(16 + samples_per_frame*sizeof(int32_t))); txdata[i] = (int32_t*)(16 + malloc16(16 + samples_per_frame*sizeof(int32_t))); // FIXME broken memory allocation
phy_vars_eNB[CC_id]->lte_eNB_common_vars.txdata[0][i] = txdata[i]; phy_vars_eNB[CC_id]->lte_eNB_common_vars.txdata[0][i] = txdata[i];
memset(txdata[i], 0, samples_per_frame*sizeof(int32_t)); memset(txdata[i], 0, samples_per_frame*sizeof(int32_t));
printf("txdata[%d] @ %p\n", i, phy_vars_eNB[CC_id]->lte_eNB_common_vars.txdata[0][i]); printf("txdata[%d] @ %p\n", i, phy_vars_eNB[CC_id]->lte_eNB_common_vars.txdata[0][i]);
......
This diff is collapsed.
...@@ -249,22 +249,30 @@ static void * dlsch_thread(void *param) ...@@ -249,22 +249,30 @@ static void * dlsch_thread(void *param)
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: PDSCH/DLSCH decoding iter %d (mcs %d, rv %d, TBS %d)\n",
phy_vars_ue->Mod_id, if (phy_vars_ue->dlsch_ue[eNB_id][0]) {
phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,harq_pid, LOG_I(PHY,"[UE %d][PDSCH %x/%d] Frame %d subframe %d: PDSCH/DLSCH decoding iter %d (mcs %d, rv %d, TBS %d)\n",
phy_vars_ue->frame_rx,dlsch_subframe[dlsch_thread_index],ret, phy_vars_ue->Mod_id,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs, phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,harq_pid,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx, phy_vars_ue->frame_rx,dlsch_subframe[dlsch_thread_index],ret,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS); phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
if (phy_vars_ue->frame_rx%100==0) { phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d dlsch_errors %d, dlsch_received %d, dlsch_fer %d, current_dlsch_cqi %d\n",
phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti, if (phy_vars_ue->frame_rx%100==0) {
phy_vars_ue->frame_rx,dlsch_subframe[dlsch_thread_index], LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d dlsch_errors %d, dlsch_received %d, dlsch_fer %d, current_dlsch_cqi %d\n",
phy_vars_ue->dlsch_errors[eNB_id], phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
phy_vars_ue->dlsch_received[eNB_id], phy_vars_ue->frame_rx,dlsch_subframe[dlsch_thread_index],
phy_vars_ue->dlsch_fer[eNB_id], phy_vars_ue->dlsch_errors[eNB_id],
phy_vars_ue->PHY_measurements.wideband_cqi_tot[eNB_id]); phy_vars_ue->dlsch_received[eNB_id],
phy_vars_ue->dlsch_fer[eNB_id],
phy_vars_ue->PHY_measurements.wideband_cqi_tot[eNB_id]);
}
} else {
LOG_I( PHY,"[UE %d][PDSCH ?/%d] Frame %d subframe %d: PDSCH/DLSCH decoding iter %d (phy_vars_ue->dlsch_ue[eNB_id][0] == 0)\n",
phy_vars_ue->Mod_id,
harq_pid,
phy_vars_ue->frame_rx, dlsch_subframe[dlsch_thread_index], ret );
} }
#endif #endif
......
...@@ -803,7 +803,7 @@ void check_and_adjust_params(void) ...@@ -803,7 +803,7 @@ void check_and_adjust_params(void)
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote; NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote; NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
#if defined(ENABLE_PDCP_NETLINK_FIFO) && defined(OPENAIR2) #if defined(USE_PDCP_NETLINK_QUEUES) && defined(OPENAIR2)
pdcp_netlink_init(); pdcp_netlink_init();
#endif #endif
...@@ -1317,64 +1317,65 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) ...@@ -1317,64 +1317,65 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
// MBSM multicast traffic // MBSM multicast traffic
if (ctime >= 500 ) {// only generate when UE can receive MTCH (need to control this value) if (ctime >= 500 ) {// only generate when UE can receive MTCH (need to control this value)
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
if (pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].instanciated_instance == TRUE) { // this service/session is configured if (pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].instanciated_instance == TRUE) { // this service/session is configured
otg_pkt = malloc (sizeof(Packet_otg_elt_t)); otg_pkt = malloc (sizeof(Packet_otg_elt_t));
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n", service_id, session_id, service_id*maxSessionPerPMCH + session_id); // LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n", service_id, session_id, service_id*maxSessionPerPMCH + session_id);
rb_id = pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].rb_id; rb_id = pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].rb_id;
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen_multicast(enb_module_idP, session_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size)); (otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen_multicast(enb_module_idP, session_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) { if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = rb_id; (otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = enb_module_idP; (otg_pkt->otg_pkt).module_id = enb_module_idP;
(otg_pkt->otg_pkt).dst_id = session_id; (otg_pkt->otg_pkt).dst_id = session_id;
(otg_pkt->otg_pkt).is_ue = FALSE; (otg_pkt->otg_pkt).is_ue = FALSE;
//Adding the packet to the OTG-PDCP buffer //Adding the packet to the OTG-PDCP buffer
(otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_TRANSPARENT; (otg_pkt->otg_pkt).mode = PDCP_TRANSMISSION_MODE_TRANSPARENT;
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[enb_module_idP])); pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[enb_module_idP]));
LOG_I(EMU, "[eNB %d] ADD packet (%p) multicast to OTG buffer for dst %d on rb_id %d\n", LOG_I(EMU, "[eNB %d] ADD packet (%p) multicast to OTG buffer for dst %d on rb_id %d\n",
(otg_pkt->otg_pkt).module_id, otg_pkt, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id); (otg_pkt->otg_pkt).module_id, otg_pkt, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
} else { } else {
//LOG_I(EMU, "OTG returns null \n"); //LOG_I(EMU, "OTG returns null \n");
free(otg_pkt);
otg_pkt=NULL;
}
// old version
/* // MBSM multicast traffic
#ifdef Rel10
if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
// LOG_I(OTG,"DUY:frame %d, pdcp_mbms_array[module_id][rb_id].instanciated_instance is %d\n",frame,pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance);
if ((pdcp_mbms_array[module_idP][service_id*maxSessionPerPMCH + session_id].instanciated_instance== module_idP + 1) && (eNB_flag == 1)){ // this service/session is configured
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d)\n", service_id, session_id);
// Duy add
LOG_I(OTG, "frame %d, multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n",frame, service_id, session_id,service_id*maxSessionPerPMCH + session_id);
// end Duy add
rb_id = pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].rb_id;
otg_pkt=(uint8_t*) packet_gen_multicast(module_idP, session_id, ctime, &pkt_size);
if (otg_pkt != NULL) {
LOG_D(OTG,"[eNB %d] sending a multicast packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", eNB_index, module_idP, rb_id, module_idP, session_id, pkt_size);
pdcp_data_req(module_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,PDCP_TM);
free(otg_pkt); free(otg_pkt);
otg_pkt=NULL; }
} }
}
}
// old version } // end multicast traffic
/* // MBSM multicast traffic #endif
#ifdef Rel10 */
if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
// LOG_I(OTG,"DUY:frame %d, pdcp_mbms_array[module_id][rb_id].instanciated_instance is %d\n",frame,pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance);
if ((pdcp_mbms_array[module_idP][service_id*maxSessionPerPMCH + session_id].instanciated_instance== module_idP + 1) && (eNB_flag == 1)){ // this service/session is configured
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d)\n", service_id, session_id);
// Duy add
LOG_I(OTG, "frame %d, multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n",frame, service_id, session_id,service_id*maxSessionPerPMCH + session_id);
// end Duy add
rb_id = pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].rb_id;
otg_pkt=(uint8_t*) packet_gen_multicast(module_idP, session_id, ctime, &pkt_size);
if (otg_pkt != NULL) {
LOG_D(OTG,"[eNB %d] sending a multicast packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", eNB_index, module_idP, rb_id, module_idP, session_id, pkt_size);
pdcp_data_req(module_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,PDCP_TM);
free(otg_pkt);
}
}
}
}
} // end multicast traffic
#endif
*/
}
} }
} }
}
} // end multicast traffic } // end multicast traffic
#endif #endif
} }
......
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