Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
1a3548e5
Commit
1a3548e5
authored
Jan 22, 2015
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@6421
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
b4635ac4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
75 deletions
+72
-75
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+72
-75
No files found.
targets/RT/USER/lte-softmodem.c
View file @
1a3548e5
...
@@ -1870,99 +1870,96 @@ static void *UE_thread_synch(void *arg) {
...
@@ -1870,99 +1870,96 @@ static void *UE_thread_synch(void *arg) {
openair0_cfg
[
card
].
rx_gain
[
i
]
=
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
-
USRP_GAIN_OFFSET
;
openair0_cfg
[
card
].
rx_gain
[
i
]
=
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
-
USRP_GAIN_OFFSET
;
#ifdef USRP
#ifdef USRP
#ifndef USRP_DEBUG
#ifndef USRP_DEBUG
openair0_set_frequencies
(
&
openair0
,
&
openair0_cfg
[
0
]);
openair0_set_
rx_
frequencies
(
&
openair0
,
&
openair0_cfg
[
0
]);
//
openair0_set_gains(&openair0,&openair0_cfg[0]);
openair0_set_gains
(
&
openair0
,
&
openair0_cfg
[
0
]);
#endif
#endif
#endif
#endif
}
}
}
}
LOG_D
(
PHY
,
"[SCHED][UE] Scanning band %d, freq %u
\n
"
,
bands_to_scan
.
band_info
[
0
].
band
,
bands_to_scan
.
band_info
[
0
].
dl_min
);
LOG_D
(
PHY
,
"[SCHED][UE] Scanning band %d, freq %u
\n
"
,
bands_to_scan
.
band_info
[
0
].
band
,
bands_to_scan
.
band_info
[
0
].
dl_min
);
}
}
else
{
else
{
LOG_D
(
PHY
,
"[SCHED][UE] Check absolute frequency %u
\n
"
,
downlink_frequency
[
0
][
0
]);
LOG_D
(
PHY
,
"[SCHED][UE] Check absolute frequency %u
\n
"
,
downlink_frequency
[
0
][
0
]);
}
}
while
(
!
oai_exit
)
{
while
(
!
oai_exit
)
{
if
(
pthread_mutex_lock
(
&
UE
->
mutex_synch
)
!=
0
)
{
if
(
pthread_mutex_lock
(
&
UE
->
mutex_synch
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE initial synch thread
\n
"
);
LOG_E
(
PHY
,
"[SCHED][UE] error locking mutex for UE initial synch thread
\n
"
);
oai_exit
=
1
;
oai_exit
=
1
;
}
}
else
{
else
{
while
(
UE
->
instance_cnt_synch
<
0
)
{
while
(
UE
->
instance_cnt_synch
<
0
)
{
pthread_cond_wait
(
&
UE
->
cond_synch
,
&
UE
->
mutex_synch
);
pthread_cond_wait
(
&
UE
->
cond_synch
,
&
UE
->
mutex_synch
);
}
}
if
(
pthread_mutex_unlock
(
&
UE
->
mutex_synch
)
!=
0
)
{
if
(
pthread_mutex_unlock
(
&
UE
->
mutex_synch
)
!=
0
)
{
LOG_E
(
PHY
,
"[SCHED][eNB] error unlocking mutex for UE Initial Synch thread
\n
"
);
LOG_E
(
PHY
,
"[SCHED][eNB] error unlocking mutex for UE Initial Synch thread
\n
"
);
oai_exit
=
1
;
oai_exit
=
1
;
}
}
}
// mutex_lock
}
// mutex_lock
vcd_signal_dumper_dump_function_by_name
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SYNCH
,
1
);
switch
(
sync_mode
)
{
switch
(
sync_mode
)
{
case
rssi
:
case
rssi
:
rssi_min
=
1
<<
31
;
rssi_min
=
(
1
<<
31
)
-
1
;
rssi_max
=
0
;
rssi_max
=
0
;
rssi_avg
=
0
;
rssi_avg
=
0
;
memset
(
power_dBm_max
,
0
,
1024
);
for
(
i
=
0
;
i
<
76800
;
i
+=
7680
)
{
for
(
i
=
0
;
i
<
76800
*
4
;
i
+=
1024
)
{
//compute frequency-domain representation of 1024-sample chunk
dft1024
(
&
PHY_vars_UE_g
[
0
][
0
]
->
lte_ue_common_vars
.
rxdata
[
0
][
i
],
spectrum
,
1
);
compute_spectrum_stats
(
spectrum
,
power_avg
,
power_max
,
power_min
,
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
);
}
/*
rssi_lin
=
signal_energy
(
&
PHY_vars_UE_g
[
0
][
0
]
->
lte_ue_common_vars
.
rxdata
[
0
][
i
],
7680
);
rssi_lin
=
signal_energy
(
&
PHY_vars_UE_g
[
0
][
0
]
->
lte_ue_common_vars
.
rxdata
[
0
][
i
],
7680
);
if
(
PHY_vars_UE_g
[
0
][
0
]
->
lte_frame_parms
.
nb_antennas_rx
>
1
)
if
(
PHY_vars_UE_g
[
0
][
0
]
->
lte_frame_parms
.
nb_antennas_rx
>
1
)
rssi_lin
+=
signal_energy
(
&
PHY_vars_UE_g
[
0
][
0
]
->
lte_ue_common_vars
.
rxdata
[
1
][
i
],
7680
);
rssi_lin
+=
signal_energy
(
&
PHY_vars_UE_g
[
0
][
0
]
->
lte_ue_common_vars
.
rxdata
[
1
][
i
],
7680
);
rssi_avg += rssi;
rssi_avg
+=
rssi
_lin
;
rssi_min = (rssi
< rssi_min) ? rssi
: rssi_min;
rssi_min
=
(
rssi
_lin
<
rssi_min
)
?
rssi_lin
:
rssi_min
;
rssi_max = (rssi
> rssi_max) ? rssi
: rssi_max;
rssi_max
=
(
rssi
_lin
>
rssi_max
)
?
rssi_lin
:
rssi_max
;
}
}
rssi_dBm = dB_fixed_times10(rssi_avg/10)/10.0 - PHY_vars_UE_g[0][0]->rx_total_gain_dB;
rssi_dBm
=
dB_fixed_times10
(
rssi_avg
/
10
)
/
10
.
0
-
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
;
rssi_max_dBm = dB_fixed_times10(rssi_max)/10.0 - PHY_vars_UE_g[0][0]->rx_total_gain_dB;
rssi_max_dBm
=
dB_fixed_times10
(
rssi_max
)
/
10
.
0
-
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
;
rssi_min_dBm = dB_fixed_times10(rssi_min)/10.0 - PHY_vars_UE_g[0][0]->rx_total_gain_dB;
rssi_min_dBm
=
dB_fixed_times10
(
rssi_min
)
/
10
.
0
-
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
;
LOG_D(PHY,"Band %d, DL Freq %u: RSSI (avg, min, max) %f,%f,%f dBm\n",
LOG_D
(
PHY
,
"Band %d, DL Freq %u: RSSI (%d,%d,%d) (avg, min, max) %f,%f,%f dBm
\n
"
,
bands_to_scan.band_info[current_band].band,
bands_to_scan
.
band_info
[
current_band
].
band
,
downlink_frequency[0][0],
downlink_frequency
[
0
][
0
],
rssi_dBm,
rssi_avg
/
10
,
rssi_min_dBm,
rssi_min
,
rssi_max_dBm);
rssi_max
,
rssi_dBm
,
current_offset += 100000; // increase by 1 EARFCN (100kHz)
rssi_min_dBm
,
if (current_offset+5000000 > bands_to_scan.band_info[current_band].dl_max-bands_to_scan.band_info[current_band].dl_min) {
rssi_max_dBm
);
current_band++;
current_offset=0;
current_offset
+=
100000
;
// increase by 1 EARFCN (100kHz)
if
(
current_offset
+
5000000
>
bands_to_scan
.
band_info
[
current_band
].
dl_max
-
bands_to_scan
.
band_info
[
current_band
].
dl_min
)
{
current_band
++
;
current_offset
=
0
;
}
}
if (current_band==bands_to_scan.nbands) {
if
(
current_band
==
bands_to_scan
.
nbands
)
{
current_band=0;
current_band
=
0
;
oai_exit
=
1
;
}
}
for (card=0;card<MAX_CARDS;card++) {
for
(
card
=
0
;
card
<
MAX_CARDS
;
card
++
)
{
for
(
i
=
0
;
i
<
openair0_cfg
[
card
].
rx_num_channels
;
i
++
)
{
for
(
i
=
0
;
i
<
openair0_cfg
[
card
].
rx_num_channels
;
i
++
)
{
openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+openair_daq_vars.freq_offset;
downlink_frequency
[
card
][
i
]
=
bands_to_scan
.
band_info
[
current_band
].
dl_min
+
current_offset
;
openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+openair_daq_vars.freq_offset;
uplink_frequency_offset
[
card
][
i
]
=
bands_to_scan
.
band_info
[
current_band
].
ul_min
-
bands_to_scan
.
band_info
[
0
].
dl_min
+
current_offset
;
openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB-USRP_GAIN_OFFSET; // 65 calibrated for USRP B210 @ 2.6 GHz
openair0_cfg
[
card
].
rx_freq
[
i
]
=
downlink_frequency
[
card
][
i
]
+
openair_daq_vars
.
freq_offset
;
openair0_cfg
[
card
].
tx_freq
[
i
]
=
downlink_frequency
[
card
][
i
]
+
uplink_frequency_offset
[
card
][
i
]
+
openair_daq_vars
.
freq_offset
;
openair0_cfg
[
card
].
rx_gain
[
i
]
=
PHY_vars_UE_g
[
0
][
0
]
->
rx_total_gain_dB
-
USRP_GAIN_OFFSET
;
// 65 calibrated for USRP B210 @ 2.6 GHz
#ifdef USRP
#ifdef USRP
#ifndef USRP_DEBUG
#ifndef USRP_DEBUG
openair0_set_frequencies(&openair0,&openair0_cfg[0]);
openair0_set_
rx_
frequencies
(
&
openair0
,
&
openair0_cfg
[
0
]);
//
openair0_set_gains(&openair0,&openair0_cfg[0]);
// openair0_set_gains(&openair0,&openair0_cfg[0]);
#endif
#endif
#endif
#endif
}
}
}
}
*/
break
;
break
;
case
pbch
:
case
pbch
:
if
(
initial_sync
(
PHY_vars_UE_g
[
0
][
0
],
mode
)
==
0
)
{
if
(
initial_sync
(
PHY_vars_UE_g
[
0
][
0
],
mode
)
==
0
)
{
/*
/*
lte_adjust_synch(&PHY_vars_UE_g[0]->lte_frame_parms,
lte_adjust_synch(&PHY_vars_UE_g[0]->lte_frame_parms,
PHY_vars_UE_g[0],
PHY_vars_UE_g[0],
...
@@ -1976,9 +1973,9 @@ static void *UE_thread_synch(void *arg) {
...
@@ -1976,9 +1973,9 @@ static void *UE_thread_synch(void *arg) {
memset(PHY_vars_UE_g[0]->lte_ue_common_vars.rxdata[aa],0,
memset(PHY_vars_UE_g[0]->lte_ue_common_vars.rxdata[aa],0,
PHY_vars_UE_g[0]->lte_frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int));
PHY_vars_UE_g[0]->lte_frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int));
*/
*/
T0
=
rt_get_time_ns
();
T0
=
rt_get_time_ns
();
is_synchronized
=
1
;
is_synchronized
=
1
;
PHY_vars_UE_g
[
0
][
0
]
->
slot_rx
=
0
;
PHY_vars_UE_g
[
0
][
0
]
->
slot_rx
=
0
;
//oai_exit=1;
//oai_exit=1;
...
@@ -2030,7 +2027,7 @@ static void *UE_thread_synch(void *arg) {
...
@@ -2030,7 +2027,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
);
if
(
pthread_mutex_lock
(
&
PHY_vars_UE_g
[
0
][
0
]
->
mutex_synch
)
!=
0
)
{
if
(
pthread_mutex_lock
(
&
PHY_vars_UE_g
[
0
][
0
]
->
mutex_synch
)
!=
0
)
{
printf
(
"[openair][SCHED][eNB] error locking mutex for UE synch
\n
"
);
printf
(
"[openair][SCHED][eNB] error locking mutex for UE synch
\n
"
);
}
}
...
@@ -2041,7 +2038,7 @@ if (pthread_mutex_lock(&PHY_vars_UE_g[0][0]->mutex_synch) != 0) {
...
@@ -2041,7 +2038,7 @@ if (pthread_mutex_lock(&PHY_vars_UE_g[0][0]->mutex_synch) != 0) {
printf
(
"[openair][SCHED][eNB] error unlocking mutex for UE synch
\n
"
);
printf
(
"[openair][SCHED][eNB] error unlocking mutex for UE synch
\n
"
);
}
}
}
}
vcd_signal_dumper_dump_function_by_name
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SYNCH
,
0
);
}
// while !oai_exit
}
// while !oai_exit
return
(
0
);
return
(
0
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment