Commit 329b04dd authored by gauthier's avatar gauthier

patches13/0001-minor.patch

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7047 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4a26a3d3
...@@ -256,7 +256,9 @@ void lte_sync_time_free(void) { ...@@ -256,7 +256,9 @@ void lte_sync_time_free(void) {
sync_corr_ue0 = NULL; sync_corr_ue0 = NULL;
sync_corr_ue1 = NULL; sync_corr_ue1 = NULL;
sync_corr_ue2 = NULL; sync_corr_ue2 = NULL;
primary_synch0_time = NULL;
primary_synch1_time = NULL;
primary_synch2_time = NULL;
} }
static inline int abs32(int x) { static inline int abs32(int x) {
......
...@@ -66,12 +66,12 @@ extern short primary_synch2[144]; ...@@ -66,12 +66,12 @@ extern short primary_synch2[144];
extern unsigned char primary_synch0_tab[72]; extern unsigned char primary_synch0_tab[72];
extern unsigned char primary_synch1_tab[72]; extern unsigned char primary_synch1_tab[72];
extern unsigned char primary_synch2_tab[72]; extern unsigned char primary_synch2_tab[72];
extern int16_t *primary_synch0_time; extern int16_t *primary_synch0_time; //!< index: [0..ofdm_symbol_size*2[
extern int16_t *primary_synch1_time; extern int16_t *primary_synch1_time; //!< index: [0..ofdm_symbol_size*2[
extern int16_t *primary_synch2_time; extern int16_t *primary_synch2_time; //!< index: [0..ofdm_symbol_size*2[
extern int *sync_corr_ue0; extern int *sync_corr_ue0; //!< index [0..10*samples_per_tti[
extern int *sync_corr_ue1; extern int *sync_corr_ue1; //!< index [0..10*samples_per_tti[
extern int *sync_corr_ue2; extern int *sync_corr_ue2; //!< index [0..10*samples_per_tti[
extern int flagMag; extern int flagMag;
//extern short **txdataF_rep_tmp; //extern short **txdataF_rep_tmp;
......
...@@ -52,33 +52,36 @@ typedef enum { ...@@ -52,33 +52,36 @@ typedef enum {
typedef struct { typedef struct {
/* Module ID for this configuration */ //! Module ID for this configuration
int Mod_id; int Mod_id;
/* the sample rate for both transmit and receive. */ //! the sample rate for both transmit and receive.
double sample_rate; double sample_rate;
/* number of samples per RX/TX packet (USRP + Ethernet) */ //! number of samples per RX/TX packet (USRP + Ethernet)
int samples_per_packet; int samples_per_packet;
/* number of RX channels (=RX antennas) */ //! number of RX channels (=RX antennas)
int rx_num_channels; int rx_num_channels;
/* number of TX channels (=TX antennas) */ //! number of TX channels (=TX antennas)
int tx_num_channels; int tx_num_channels;
/* center frequency in Hz for RX */ //! \brief Center frequency in Hz for RX.
//! index: [0..rx_num_channels[
double rx_freq[4]; double rx_freq[4];
/* center frequency in Hz for TX */ //! \brief Center frequency in Hz for TX.
//! index: [0..rx_num_channels[ !!! see lte-ue.c:427 FIXME iterates over rx_num_channels
double tx_freq[4]; double tx_freq[4];
/* mode for rxgain (ExpressMIMO2)*/ //! mode for rxgain (ExpressMIMO2)
rx_gain_t rxg_mode[4]; rx_gain_t rxg_mode[4];
/* gain for RX in dB */ //! \brief Gain for RX in dB.
//! index: [0..rx_num_channels[
double rx_gain[4]; double rx_gain[4];
/* gain for TX in dB */ //! gain for TX in dB
double tx_gain[4]; double tx_gain[4];
/* RX bandwidth in Hz */ //! RX bandwidth in Hz
double rx_bw; double rx_bw;
/* TX bandwidth in Hz */ //! TX bandwidth in Hz
double tx_bw; double tx_bw;
/* 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
int rrh_port; int rrh_port;
} openair0_config_t; } openair0_config_t;
......
...@@ -412,8 +412,8 @@ static void *UE_thread_synch(void *arg) { ...@@ -412,8 +412,8 @@ static void *UE_thread_synch(void *arg) {
if (abs(openair_daq_vars.freq_offset) > 7500) { if (abs(openair_daq_vars.freq_offset) > 7500) {
LOG_I(PHY,"[initial_sync] No cell synchronization found, abandoning\n"); LOG_I(PHY,"[initial_sync] No cell synchronization found, abandoning\n");
mac_xface->macphy_exit("No cell synchronization found, abandoning"); mac_xface->macphy_exit("No cell synchronization found, abandoning");
return; // not reached
} }
else {
LOG_I(PHY,"[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n",openair_daq_vars.freq_offset, LOG_I(PHY,"[initial_sync] trying carrier off %d Hz, rxgain %d (DL %u, UL %u)\n",openair_daq_vars.freq_offset,
UE->rx_total_gain_dB, UE->rx_total_gain_dB,
downlink_frequency[0][0]+openair_daq_vars.freq_offset, downlink_frequency[0][0]+openair_daq_vars.freq_offset,
...@@ -461,7 +461,6 @@ static void *UE_thread_synch(void *arg) { ...@@ -461,7 +461,6 @@ static void *UE_thread_synch(void *arg) {
// rt_sleep_ns(FRAME_PERIOD); // rt_sleep_ns(FRAME_PERIOD);
} // freq_offset
} // initial_sync=0 } // initial_sync=0
break; break;
case si: case si:
...@@ -623,6 +622,9 @@ static void *UE_thread_tx(void *arg) { ...@@ -623,6 +622,9 @@ static void *UE_thread_tx(void *arg) {
return(0); return(0);
} }
//! \brief .
//! This is a pthread.
//! \param arg expects a pointer to \ref PHY_VARS_UE.
static void *UE_thread_rx(void *arg) { static void *UE_thread_rx(void *arg) {
PHY_VARS_UE *UE = (PHY_VARS_UE*)arg; PHY_VARS_UE *UE = (PHY_VARS_UE*)arg;
...@@ -685,15 +687,17 @@ static void *UE_thread_rx(void *arg) { ...@@ -685,15 +687,17 @@ static void *UE_thread_rx(void *arg) {
if (pthread_mutex_lock(&UE->mutex_rx) != 0) { if (pthread_mutex_lock(&UE->mutex_rx) != 0) {
LOG_E(PHY,"[SCHED][eNB] error locking mutex for UE RX\n"); LOG_E(PHY,"[SCHED][eNB] error locking mutex for UE RX\n");
exit_fun("nothing to add"); exit_fun("nothing to add");
break;
} }
else {
while (UE->instance_cnt_rx < 0) { while (UE->instance_cnt_rx < 0) {
pthread_cond_wait(&UE->cond_rx,&UE->mutex_rx); pthread_cond_wait(&UE->cond_rx,&UE->mutex_rx);
} }
if (pthread_mutex_unlock(&UE->mutex_rx) != 0) { if (pthread_mutex_unlock(&UE->mutex_rx) != 0) {
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for UE RX\n"); LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for UE RX\n");
exit_fun("nothing to add"); exit_fun("nothing to add");
break;
} }
for (i=0;i<2;i++) { for (i=0;i<2;i++) {
...@@ -727,7 +731,6 @@ static void *UE_thread_rx(void *arg) { ...@@ -727,7 +731,6 @@ static void *UE_thread_rx(void *arg) {
UE->frame_rx,UE->slot_tx>>1); UE->frame_rx,UE->slot_tx>>1);
UE->UE_mode[0] = RESYNCH; UE->UE_mode[0] = RESYNCH;
// mac_xface->macphy_exit("Connection lost"); // mac_xface->macphy_exit("Connection lost");
//exit(-1);
} }
else if (ret == PHY_HO_PRACH) { else if (ret == PHY_HO_PRACH) {
LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n", LOG_I(PHY,"[UE %d] Frame %d, subframe %d, return to PRACH and perform a contention-free access\n",
...@@ -759,9 +762,10 @@ static void *UE_thread_rx(void *arg) { ...@@ -759,9 +762,10 @@ static void *UE_thread_rx(void *arg) {
} }
} }
// printf("UE_thread_rx done\n"); // printf("UE_thread_rx done\n");
} }
}
return(0); // thread finished
return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment