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
canghaiwuhen
OpenXG-RAN
Commits
9d4479fb
Commit
9d4479fb
authored
Jun 06, 2017
by
vettel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync
parent
83b3d708
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
336 additions
and
94 deletions
+336
-94
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+2
-1
openair2/RRC/LITE/rrc_eNB.c
openair2/RRC/LITE/rrc_eNB.c
+121
-72
openair2/X2AP/x2ap_eNB.c
openair2/X2AP/x2ap_eNB.c
+2
-2
openair2/X2AP/x2ap_eNB_handler.c
openair2/X2AP/x2ap_eNB_handler.c
+1
-1
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+198
-7
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.x2ho.usrpb210.conf
...CTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.x2ho.usrpb210.conf
+11
-11
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+1
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
9d4479fb
...
@@ -522,6 +522,7 @@ set(HWLIB_EXMIMO_SOURCE
...
@@ -522,6 +522,7 @@ set(HWLIB_EXMIMO_SOURCE
add_library
(
oai_exmimodevif MODULE
${
HWLIB_EXMIMO_SOURCE
}
)
add_library
(
oai_exmimodevif MODULE
${
HWLIB_EXMIMO_SOURCE
}
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/USRP/USERSPACE/LIB/"
)
include_directories
(
"
${
OPENAIR_TARGETS
}
/ARCH/USRP/USERSPACE/LIB/"
)
#set (option_HWUSRPLIB_lib "-l uhd -lboost_thread -lboost_filesystem -lboost_system")
set
(
HWLIB_USRP_SOURCE
set
(
HWLIB_USRP_SOURCE
${
OPENAIR_TARGETS
}
/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
${
OPENAIR_TARGETS
}
/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
)
)
...
@@ -1744,7 +1745,7 @@ add_executable(lte-softmodem
...
@@ -1744,7 +1745,7 @@ add_executable(lte-softmodem
target_link_libraries
(
lte-softmodem -ldl
target_link_libraries
(
lte-softmodem -ldl
-Wl,--start-group
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB
${
X2AP_LIB
}
${
X2AP_ENB
}
GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITTI_LIB
}
${
MIH_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
RRC_LIB S1AP_LIB S1AP_ENB
${
X2AP_LIB
}
${
X2AP_ENB
}
GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
${
ITTI_LIB
}
${
MIH_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
-lboost_thread -lboost_filesystem -lboost_system
-Wl,--end-group
)
-Wl,--end-group
)
target_link_libraries
(
lte-softmodem
${
LIBXML2_LIBRARIES
}
)
target_link_libraries
(
lte-softmodem
${
LIBXML2_LIBRARIES
}
)
...
...
openair2/RRC/LITE/rrc_eNB.c
View file @
9d4479fb
...
@@ -1826,7 +1826,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -1826,7 +1826,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
MeasObj
->
measObjectId
=
1
;
MeasObj
->
measObjectId
=
1
;
MeasObj
->
measObject
.
present
=
MeasObjectToAddMod__measObject_PR_measObjectEUTRA
;
MeasObj
->
measObject
.
present
=
MeasObjectToAddMod__measObject_PR_measObjectEUTRA
;
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
carrierFreq
=
3
3
50
;
//band 7, 2.68GHz
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
carrierFreq
=
3
1
50
;
//band 7, 2.68GHz
//MeasObj->measObject.choice.measObjectEUTRA.carrierFreq = 36090; //band 33, 1.909GHz
//MeasObj->measObject.choice.measObjectEUTRA.carrierFreq = 36090; //band 33, 1.909GHz
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
allowedMeasBandwidth
=
AllowedMeasBandwidth_mbw25
;
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
allowedMeasBandwidth
=
AllowedMeasBandwidth_mbw25
;
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
presenceAntennaPort1
=
1
;
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
presenceAntennaPort1
=
1
;
...
@@ -1842,14 +1842,15 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -1842,14 +1842,15 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
CellsToAddModList
=
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
cellsToAddModList
;
CellsToAddModList
=
MeasObj
->
measObject
.
choice
.
measObjectEUTRA
.
cellsToAddModList
;
// Add adjacent cell lists (6 per eNB)
// Add adjacent cell lists (6 per eNB)
for
(
i
=
0
;
i
<
6
;
i
++
)
{
//
for (i = 0; i < 6; i++) {
CellToAdd
=
(
CellsToAddMod_t
*
)
CALLOC
(
1
,
sizeof
(
*
CellToAdd
));
CellToAdd
=
(
CellsToAddMod_t
*
)
CALLOC
(
1
,
sizeof
(
*
CellToAdd
));
CellToAdd
->
cellIndex
=
i
+
1
;
// CellToAdd->cellIndex = i + 1;
CellToAdd
->
physCellId
=
get_adjacent_cell_id
(
ctxt_pP
->
module_id
,
i
);
CellToAdd
->
cellIndex
=
1
;
CellToAdd
->
physCellId
=
1
;
//get_adjacent_cell_id(ctxt_pP->module_id, i);
CellToAdd
->
cellIndividualOffset
=
Q_OffsetRange_dB0
;
CellToAdd
->
cellIndividualOffset
=
Q_OffsetRange_dB0
;
ASN_SEQUENCE_ADD
(
&
CellsToAddModList
->
list
,
CellToAdd
);
ASN_SEQUENCE_ADD
(
&
CellsToAddModList
->
list
,
CellToAdd
);
}
//
}
ASN_SEQUENCE_ADD
(
&
MeasObj_list
->
list
,
MeasObj
);
ASN_SEQUENCE_ADD
(
&
MeasObj_list
->
list
,
MeasObj
);
// rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list;
// rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.measConfig->measObjectToAddModList = MeasObj_list;
...
@@ -1902,7 +1903,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -1902,7 +1903,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
ASN_SEQUENCE_ADD
(
&
ReportConfig_list
->
list
,
ReportConfig_A1
);
ASN_SEQUENCE_ADD
(
&
ReportConfig_list
->
list
,
ReportConfig_A1
);
if
(
ho_state
==
1
/*HO_MEASURMENT */
)
{
//
if (ho_state == 1 /*HO_MEASURMENT */ ) {
LOG_I
(
RRC
,
"[eNB %d] frame %d: requesting A2, A3, A4, A5, and A6 event reporting
\n
"
,
LOG_I
(
RRC
,
"[eNB %d] frame %d: requesting A2, A3, A4, A5, and A6 event reporting
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
);
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
);
ReportConfig_A2
->
reportConfigId
=
3
;
ReportConfig_A2
->
reportConfigId
=
3
;
...
@@ -1932,7 +1933,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -1932,7 +1933,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
eventId
.
present
=
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
eventId
.
present
=
ReportConfigEUTRA__triggerType__event__eventId_PR_eventA3
;
ReportConfigEUTRA__triggerType__event__eventId_PR_eventA3
;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
eventId
.
choice
.
eventA3
.
a3_Offset
=
1
;
//10;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
eventId
.
choice
.
eventA3
.
a3_Offset
=
0
;
//10;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
eventId
.
choice
.
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
eventId
.
choice
.
eventA3
.
reportOnLeave
=
1
;
eventA3
.
reportOnLeave
=
1
;
...
@@ -1943,7 +1944,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -1943,7 +1944,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
reportInterval
=
ReportInterval_ms120
;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
reportInterval
=
ReportInterval_ms120
;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
reportAmount
=
ReportConfigEUTRA__reportAmount_infinity
;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
reportAmount
=
ReportConfigEUTRA__reportAmount_infinity
;
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
hysteresis
=
0
.
5
;
// FIXME ...hysteresis is of type long!
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
hysteresis
=
0
;
// FIXME ...hysteresis is of type long!
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
timeToTrigger
=
ReportConfig_A3
->
reportConfig
.
choice
.
reportConfigEUTRA
.
triggerType
.
choice
.
event
.
timeToTrigger
=
TimeToTrigger_ms40
;
TimeToTrigger_ms40
;
ASN_SEQUENCE_ADD
(
&
ReportConfig_list
->
list
,
ReportConfig_A3
);
ASN_SEQUENCE_ADD
(
&
ReportConfig_list
->
list
,
ReportConfig_A3
);
...
@@ -2005,20 +2006,22 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -2005,20 +2006,22 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
Sparams
->
choice
.
setup
.
mobilityStateParameters
.
t_Evaluation
=
MobilityStateParameters__t_Evaluation_s60
;
Sparams
->
choice
.
setup
.
mobilityStateParameters
.
t_Evaluation
=
MobilityStateParameters__t_Evaluation_s60
;
Sparams
->
choice
.
setup
.
mobilityStateParameters
.
t_HystNormal
=
MobilityStateParameters__t_HystNormal_s120
;
Sparams
->
choice
.
setup
.
mobilityStateParameters
.
t_HystNormal
=
MobilityStateParameters__t_HystNormal_s120
;
quantityConfig
=
CALLOC
(
1
,
sizeof
(
*
quantityConfig
));
//
quantityConfig = CALLOC(1, sizeof(*quantityConfig));
memset
((
void
*
)
quantityConfig
,
0
,
sizeof
(
*
quantityConfig
));
//
memset((void *)quantityConfig, 0, sizeof(*quantityConfig));
quantityConfig
->
quantityConfigEUTRA
=
CALLOC
(
1
,
sizeof
(
struct
QuantityConfigEUTRA
));
//
quantityConfig->quantityConfigEUTRA = CALLOC(1, sizeof(struct QuantityConfigEUTRA));
memset
((
void
*
)
quantityConfig
->
quantityConfigEUTRA
,
0
,
sizeof
(
*
quantityConfig
->
quantityConfigEUTRA
));
//
memset((void *)quantityConfig->quantityConfigEUTRA, 0, sizeof(*quantityConfig->quantityConfigEUTRA));
quantityConfig
->
quantityConfigCDMA2000
=
NULL
;
//
quantityConfig->quantityConfigCDMA2000 = NULL;
quantityConfig
->
quantityConfigGERAN
=
NULL
;
//
quantityConfig->quantityConfigGERAN = NULL;
quantityConfig
->
quantityConfigUTRA
=
NULL
;
//
quantityConfig->quantityConfigUTRA = NULL;
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRP
=
//
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP =
CALLOC
(
1
,
sizeof
(
*
(
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRP
)));
//
CALLOC(1, sizeof(*(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP)));
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRQ
=
//
quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ =
CALLOC
(
1
,
sizeof
(
*
(
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRQ
)));
//
CALLOC(1, sizeof(*(quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ)));
*
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRP
=
FilterCoefficient_fc4
;
//
*quantityConfig->quantityConfigEUTRA->filterCoefficientRSRP = FilterCoefficient_fc4;
*
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRQ
=
FilterCoefficient_fc4
;
//
*quantityConfig->quantityConfigEUTRA->filterCoefficientRSRQ = FilterCoefficient_fc4;
#if 0
// if (ho_state == 1 /*HO_MEASUREMENT */ ) {
LOG_I(RRC,
LOG_I(RRC,
"[eNB %d] Frame %d: potential handover preparation: store the information in an intermediate structure in case of failure\n",
"[eNB %d] Frame %d: potential handover preparation: store the information in an intermediate structure in case of failure\n",
ctxt_pP->module_id, ctxt_pP->frame);
ctxt_pP->module_id, ctxt_pP->frame);
...
@@ -2041,7 +2044,25 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -2041,7 +2044,25 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.sps_Config = NULL;
ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.sps_Config = NULL;
//memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.sps_Config,(void *)rrc_inst->sps_Config[ue_mod_idP],sizeof(SPS_Config_t));
//memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.sps_Config,(void *)rrc_inst->sps_Config[ue_mod_idP],sizeof(SPS_Config_t));
}
// }
#endif
// Add quantity configuration
quantityConfig
=
CALLOC
(
1
,
sizeof
(
*
quantityConfig
));
memset
((
void
*
)
quantityConfig
,
0
,
sizeof
(
*
quantityConfig
));
quantityConfig
->
quantityConfigEUTRA
=
CALLOC
(
1
,
sizeof
(
struct
QuantityConfigEUTRA
));
memset
((
void
*
)
quantityConfig
->
quantityConfigEUTRA
,
0
,
sizeof
(
*
quantityConfig
->
quantityConfigEUTRA
));
quantityConfig
->
quantityConfigCDMA2000
=
NULL
;
quantityConfig
->
quantityConfigGERAN
=
NULL
;
quantityConfig
->
quantityConfigUTRA
=
NULL
;
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRP
=
CALLOC
(
1
,
sizeof
(
*
(
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRP
)));
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRQ
=
CALLOC
(
1
,
sizeof
(
*
(
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRQ
)));
*
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRP
=
FilterCoefficient_fc4
;
*
quantityConfig
->
quantityConfigEUTRA
->
filterCoefficientRSRQ
=
FilterCoefficient_fc4
;
#if defined(ENABLE_ITTI)
#if defined(ENABLE_ITTI)
/* Initialize NAS list */
/* Initialize NAS list */
...
@@ -2089,14 +2110,14 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
...
@@ -2089,14 +2110,14 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
(
DRB_ToReleaseList_t
*
)
NULL
,
// DRB2_list,
(
DRB_ToReleaseList_t
*
)
NULL
,
// DRB2_list,
(
struct
SPS_Config
*
)
NULL
,
// *sps_Config,
(
struct
SPS_Config
*
)
NULL
,
// *sps_Config,
(
struct
PhysicalConfigDedicated
*
)
*
physicalConfigDedicated
,
(
struct
PhysicalConfigDedicated
*
)
*
physicalConfigDedicated
,
#ifdef EXMIMO_IOT
//
#ifdef EXMIMO_IOT
NULL
,
NULL
,
NULL
,
NULL
,
//
NULL, NULL, NULL,NULL,
#else
//
#else
(
MeasObjectToAddModList_t
*
)
MeasObj_list
,
(
MeasObjectToAddModList_t
*
)
MeasObj_list
,
(
ReportConfigToAddModList_t
*
)
ReportConfig_list
,
(
ReportConfigToAddModList_t
*
)
ReportConfig_list
,
(
QuantityConfig_t
*
)
quantityConfig
,
(
QuantityConfig_t
*
)
quantityConfig
,
(
MeasIdToAddModList_t
*
)
MeasId_list
,
(
MeasIdToAddModList_t
*
)
MeasId_list
,
#endif
//
#endif
(
MAC_MainConfig_t
*
)
mac_MainConfig
,
(
MAC_MainConfig_t
*
)
mac_MainConfig
,
(
MeasGapConfig_t
*
)
NULL
,
(
MeasGapConfig_t
*
)
NULL
,
(
MobilityControlInfo_t
*
)
NULL
,
(
MobilityControlInfo_t
*
)
NULL
,
...
@@ -2361,7 +2382,28 @@ rrc_eNB_process_MeasurementReport(
...
@@ -2361,7 +2382,28 @@ rrc_eNB_process_MeasurementReport(
LOG_I
(
RRC
,
"[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)
\n
"
,
LOG_I
(
RRC
,
"[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
rnti
,
(
int
)
measResults2
->
measId
);
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
rnti
,
(
int
)
measResults2
->
measId
);
if
(
measResults2
->
measResultNeighCells
==
NULL
)
{
LOG_I
(
RRC
,
"Cells are not discovered
\n
"
);
}
else
{
if
(
measResults2
->
measId
==
1
){
LOG_I
(
RRC
,
"Cells are discovered
\n
"
);
if
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
count
>
0
)
{
LOG_I
(
RRC
,
"Physical Cell Id %d
\n
"
,
(
int
)
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
physCellId
);
LOG_I
(
RRC
,
"RSRP of Target %d
\n
"
,
(
int
)
*
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
measResult
.
rsrpResult
));
LOG_I
(
RRC
,
"RSRQ of Target %d
\n
"
,
(
int
)
*
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
measResult
.
rsrqResult
));
}
}
else
if
(
measResults2
->
measId
==
4
)
{
LOG_I
(
RRC
,
"A3 event happened...
\n
"
);
if
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
count
>
0
)
{
if
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
count
>
0
)
{
LOG_I
(
RRC
,
"RSRP of Source %ld
\n
"
,
measResults2
->
measResultPCell
.
rsrpResult
);
LOG_I
(
RRC
,
"RSRQ of Source %ld
\n
"
,
measResults2
->
measResultPCell
.
rsrqResult
);
LOG_I
(
RRC
,
"Physical Cell Id %d
\n
"
,
LOG_I
(
RRC
,
"Physical Cell Id %d
\n
"
,
(
int
)
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
physCellId
);
(
int
)
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
physCellId
);
LOG_I
(
RRC
,
"RSRP of Target %d
\n
"
,
LOG_I
(
RRC
,
"RSRP of Target %d
\n
"
,
...
@@ -2371,6 +2413,12 @@ rrc_eNB_process_MeasurementReport(
...
@@ -2371,6 +2413,12 @@ rrc_eNB_process_MeasurementReport(
(
int
)
*
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
(
int
)
*
(
measResults2
->
measResultNeighCells
->
choice
.
measResultListEUTRA
.
list
.
array
[
0
]
->
measResult
.
rsrqResult
));
measResult
.
rsrqResult
));
}
}
exit
(
0
);
}
else
{
LOG_I
(
RRC
,
"Other events happened...
\n
"
);
}
}
#if defined(Rel10) || defined(Rel14)
#if defined(Rel10) || defined(Rel14)
LOG_I
(
RRC
,
"RSRP of Source %ld
\n
"
,
measResults2
->
measResultPCell
.
rsrpResult
);
LOG_I
(
RRC
,
"RSRP of Source %ld
\n
"
,
measResults2
->
measResultPCell
.
rsrpResult
);
...
@@ -2424,7 +2472,7 @@ rrc_eNB_process_MeasurementReport(
...
@@ -2424,7 +2472,7 @@ rrc_eNB_process_MeasurementReport(
// X2AP_HANDOVER_REQ(msg).e_rabs_tobesetu=;
// X2AP_HANDOVER_REQ(msg).e_rabs_tobesetu=;
/* TODO: don't do that, X2AP should find the target by itself */
/* TODO: don't do that, X2AP should find the target by itself */
X2AP_HANDOVER_REQ
(
msg
).
target_mod_id
=
get_adjacent_cell_mod_id
(
X2AP_HANDOVER_REQ
(
msg
).
target_physCellId
);
X2AP_HANDOVER_REQ
(
msg
).
target_mod_id
=
0
;
//
get_adjacent_cell_mod_id(X2AP_HANDOVER_REQ(msg).target_physCellId);
LOG_I
(
RRC
,
LOG_I
(
RRC
,
"[eNB %d] Frame %d: potential handover preparation: store the information in an intermediate structure in case of failure
\n
"
,
"[eNB %d] Frame %d: potential handover preparation: store the information in an intermediate structure in case of failure
\n
"
,
...
@@ -2538,45 +2586,45 @@ rrc_eNB_generate_HandoverPreparationInformation(
...
@@ -2538,45 +2586,45 @@ rrc_eNB_generate_HandoverPreparationInformation(
/* simulation related logic */
/* simulation related logic */
if
(
mod_id_target
!=
0xFF
)
{
if
(
mod_id_target
!=
0xFF
)
{
//UE_id_target = rrc_find_free_ue_index(modid_target);
//UE_id_target = rrc_find_free_ue_index(modid_target);
ue_context_target_p
=
//
ue_context_target_p =
rrc_eNB_get_ue_context
(
//
rrc_eNB_get_ue_context(
&
eNB_rrc_inst
[
mod_id_target
],
//
&eNB_rrc_inst[mod_id_target],
ue_context_pP
->
ue_context
.
rnti
);
//
ue_context_pP->ue_context.rnti);
/*UE_id_target = rrc_eNB_get_next_free_UE_index(
/*UE_id_target = rrc_eNB_get_next_free_UE_index(
mod_id_target,
mod_id_target,
eNB_rrc_inst[ctxt_pP->module_id].Info.UE_list[ue_mod_idP]); //this should return a new index*/
eNB_rrc_inst[ctxt_pP->module_id].Info.UE_list[ue_mod_idP]); //this should return a new index*/
if
(
ue_context_target_p
==
NULL
)
{
// if not already in target cell
if
(
ue_context_target_p
==
NULL
)
{
// if not already in target cell
ue_context_target_p
=
rrc_eNB_allocate_new_UE_context
(
&
eNB_rrc_inst
[
ctxt_pP
->
module_id
]);
//
ue_context_target_p = rrc_eNB_allocate_new_UE_context(&eNB_rrc_inst[ctxt_pP->module_id]);
ue_context_target_p
->
ue_id_rnti
=
ue_context_pP
->
ue_context
.
rnti
;
// LG: should not be the same
//
ue_context_target_p->ue_id_rnti = ue_context_pP->ue_context.rnti; // LG: should not be the same
ue_context_target_p
->
ue_context
.
rnti
=
ue_context_target_p
->
ue_id_rnti
;
// idem
//
ue_context_target_p->ue_context.rnti = ue_context_target_p->ue_id_rnti; // idem
LOG_N
(
RRC
,
//
LOG_N(RRC,
"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %ld: source UE_id %x target UE_id %x source_modId: %d target_modId: %d
\n
"
,
//
"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %ld: source UE_id %x target UE_id %x source_modId: %d target_modId: %d\n",
ctxt_pP
->
module_id
,
//
ctxt_pP->module_id,
ctxt_pP
->
frame
,
//
ctxt_pP->frame,
eNB_rrc_inst
[
ctxt_pP
->
module_id
].
carrier
[
0
]
/* CROUX TBC */
.
physCellId
,
//
eNB_rrc_inst[ctxt_pP->module_id].carrier[0] /* CROUX TBC */.physCellId,
targetPhyId
,
//
targetPhyId,
ue_context_pP
->
ue_context
.
rnti
,
//
ue_context_pP->ue_context.rnti,
ue_context_target_p
->
ue_id_rnti
,
//
ue_context_target_p->ue_id_rnti,
ctxt_pP
->
module_id
,
//
ctxt_pP->module_id,
mod_id_target
);
//
mod_id_target);
ue_context_target_p
->
ue_context
.
handover_info
=
//
ue_context_target_p->ue_context.handover_info =
CALLOC
(
1
,
sizeof
(
*
(
ue_context_target_p
->
ue_context
.
handover_info
)));
//
CALLOC(1, sizeof(*(ue_context_target_p->ue_context.handover_info)));
memcpy
((
void
*
)
&
ue_context_target_p
->
ue_context
.
handover_info
->
as_context
,
//
memcpy((void*)&ue_context_target_p->ue_context.handover_info->as_context,
(
void
*
)
&
ue_context_pP
->
ue_context
.
handover_info
->
as_context
,
//
(void*)&ue_context_pP->ue_context.handover_info->as_context,
sizeof
(
AS_Context_t
));
//
sizeof(AS_Context_t));
memcpy
((
void
*
)
&
ue_context_target_p
->
ue_context
.
handover_info
->
as_config
,
//
memcpy((void*)&ue_context_target_p->ue_context.handover_info->as_config,
(
void
*
)
&
ue_context_pP
->
ue_context
.
handover_info
->
as_config
,
//
(void*)&ue_context_pP->ue_context.handover_info->as_config,
sizeof
(
AS_Config_t
));
//
sizeof(AS_Config_t));
ue_context_target_p
->
ue_context
.
handover_info
->
ho_prepare
=
0x00
;
// 0xFF;
//
ue_context_target_p->ue_context.handover_info->ho_prepare = 0x00;// 0xFF;
ue_context_target_p
->
ue_context
.
handover_info
->
ho_complete
=
0
;
//
ue_context_target_p->ue_context.handover_info->ho_complete = 0;
ue_context_pP
->
ue_context
.
handover_info
->
modid_t
=
mod_id_target
;
ue_context_pP
->
ue_context
.
handover_info
->
modid_t
=
mod_id_target
;
ue_context_pP
->
ue_context
.
handover_info
->
ueid_s
=
ue_context_pP
->
ue_context
.
rnti
;
ue_context_pP
->
ue_context
.
handover_info
->
ueid_s
=
ue_context_pP
->
ue_context
.
rnti
;
ue_context_pP
->
ue_context
.
handover_info
->
modid_s
=
ctxt_pP
->
module_id
;
ue_context_pP
->
ue_context
.
handover_info
->
modid_s
=
ctxt_pP
->
module_id
;
ue_context_target_p
->
ue_context
.
handover_info
->
modid_t
=
mod_id_target
;
//
ue_context_target_p->ue_context.handover_info->modid_t = mod_id_target;
ue_context_target_p
->
ue_context
.
handover_info
->
modid_s
=
ctxt_pP
->
module_id
;
//
ue_context_target_p->ue_context.handover_info->modid_s = ctxt_pP->module_id;
ue_context_target_p
->
ue_context
.
handover_info
->
ueid_t
=
ue_context_target_p
->
ue_context
.
rnti
;
//
ue_context_target_p->ue_context.handover_info->ueid_t = ue_context_target_p->ue_context.rnti;
}
else
{
}
else
{
LOG_E
(
RRC
,
"
\n
Error in obtaining free UE id in target eNB %ld for handover
\n
"
,
targetPhyId
);
LOG_E
(
RRC
,
"
\n
Error in obtaining free UE id in target eNB %ld for handover
\n
"
,
targetPhyId
);
...
@@ -2780,9 +2828,9 @@ check_handovers(
...
@@ -2780,9 +2828,9 @@ check_handovers(
ue_context_p
->
ue_context
.
handover_info
->
state
=
HO_CONFIGURED
;
ue_context_p
->
ue_context
.
handover_info
->
state
=
HO_CONFIGURED
;
/* HACK HACK!! "works" only for one UE */
/* HACK HACK!! "works" only for one UE */
memcpy
(
UE_rrc_inst
[
0
].
sib1
[
0
]
->
cellAccessRelatedInfo
.
cellIdentity
.
buf
,
//
memcpy(UE_rrc_inst[0].sib1[0]->cellAccessRelatedInfo.cellIdentity.buf,
eNB_rrc_inst
[
ctxt_pP
->
module_id
].
carrier
[
0
].
sib1
->
cellAccessRelatedInfo
.
cellIdentity
.
buf
,
//
eNB_rrc_inst[ctxt_pP->module_id].carrier[0].sib1->cellAccessRelatedInfo.cellIdentity.buf,
4
);
//
4);
msg
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
X2AP_HANDOVER_REQ_ACK
);
msg
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
X2AP_HANDOVER_REQ_ACK
);
/* TODO: remove this hack */
/* TODO: remove this hack */
X2AP_HANDOVER_REQ_ACK
(
msg
).
target_mod_id
=
1
-
ctxt_pP
->
module_id
;
X2AP_HANDOVER_REQ_ACK
(
msg
).
target_mod_id
=
1
-
ctxt_pP
->
module_id
;
...
@@ -2822,6 +2870,8 @@ rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s* ue_context_p, protoc
...
@@ -2822,6 +2870,8 @@ rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s* ue_context_p, protoc
struct
rrc_eNB_ue_context_s
*
ue_source_context
;
struct
rrc_eNB_ue_context_s
*
ue_source_context
;
uint16_t
Idx
;
uint16_t
Idx
;
return
;
ue_source_context
=
ue_source_context
=
rrc_eNB_get_ue_context
(
rrc_eNB_get_ue_context
(
&
eNB_rrc_inst
[
ue_context_p
->
ue_context
.
handover_info
->
modid_s
],
&
eNB_rrc_inst
[
ue_context_p
->
ue_context
.
handover_info
->
modid_s
],
...
@@ -4976,7 +5026,7 @@ rrc_eNB_decode_dcch(
...
@@ -4976,7 +5026,7 @@ rrc_eNB_decode_dcch(
break
;
break
;
case
UL_DCCH_MessageType__c1_PR_measurementReport
:
case
UL_DCCH_MessageType__c1_PR_measurementReport
:
LOG_
D
(
RRC
,
LOG_
I
(
RRC
,
PROTOCOL_RRC_CTXT_UE_FMT
" RLC RB %02d --- RLC_DATA_IND "
PROTOCOL_RRC_CTXT_UE_FMT
" RLC RB %02d --- RLC_DATA_IND "
"%d bytes (measurementReport) ---> RRC_eNB
\n
"
,
"%d bytes (measurementReport) ---> RRC_eNB
\n
"
,
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
PROTOCOL_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
...
@@ -5307,10 +5357,9 @@ rrc_eNB_decode_dcch(
...
@@ -5307,10 +5357,9 @@ rrc_eNB_decode_dcch(
}
}
ue_context_p
->
ue_context
.
setup_e_rabs
=
ue_context_p
->
ue_context
.
nb_of_e_rabs
;
ue_context_p
->
ue_context
.
setup_e_rabs
=
ue_context_p
->
ue_context
.
nb_of_e_rabs
;
#endif
#endif
rrc_eNB_generate_defaultRRCConnectionReconfiguration
(
ctxt_pP
,
rrc_eNB_generate_defaultRRCConnectionReconfiguration
(
ctxt_pP
,
ue_context_p
,
ue_context_p
,
eNB_rrc_inst
[
ctxt_pP
->
module_id
].
HO_flag
);
0
);
//eNB_rrc_inst[ctxt_pP->module_id].HO_flag
break
;
break
;
case
UL_DCCH_MessageType__c1_PR_ulHandoverPreparationTransfer
:
case
UL_DCCH_MessageType__c1_PR_ulHandoverPreparationTransfer
:
...
...
openair2/X2AP/x2ap_eNB.c
View file @
9d4479fb
...
@@ -407,7 +407,7 @@ void x2ap_eNB_handle_handover_req(instance_t instance,
...
@@ -407,7 +407,7 @@ void x2ap_eNB_handle_handover_req(instance_t instance,
x2ap_eNB_instance_t
*
instance_p
;
x2ap_eNB_instance_t
*
instance_p
;
x2ap_eNB_data_t
*
target
;
x2ap_eNB_data_t
*
target
;
const
Enb_properties_array_t
*
enb_properties
=
enb_config_get
();
const
Enb_properties_array_t
*
enb_properties
=
enb_config_get
();
int
target_enb_id
=
enb_properties
->
properties
[
x2ap_handover_req
->
target_mod_id
]
->
eNB_id
;
int
target_enb_id
=
0xe00
+
x2ap_handover_req
->
target_physCellId
;
//
enb_properties->properties[x2ap_handover_req->target_mod_id]->eNB_id;
instance_p
=
x2ap_eNB_get_instance
(
instance
);
instance_p
=
x2ap_eNB_get_instance
(
instance
);
DevAssert
(
instance_p
!=
NULL
);
DevAssert
(
instance_p
!=
NULL
);
...
@@ -434,7 +434,7 @@ void x2ap_eNB_handle_handover_req_ack(instance_t instance,
...
@@ -434,7 +434,7 @@ void x2ap_eNB_handle_handover_req_ack(instance_t instance,
x2ap_eNB_instance_t
*
instance_p
;
x2ap_eNB_instance_t
*
instance_p
;
x2ap_eNB_data_t
*
target
;
x2ap_eNB_data_t
*
target
;
const
Enb_properties_array_t
*
enb_properties
=
enb_config_get
();
const
Enb_properties_array_t
*
enb_properties
=
enb_config_get
();
int
target_enb_id
=
enb_properties
->
properties
[
x2ap_handover_req_ack
->
target_mod_id
]
->
eNB_id
;
int
target_enb_id
=
3584
;
//
enb_properties->properties[x2ap_handover_req_ack->target_mod_id]->eNB_id;
instance_p
=
x2ap_eNB_get_instance
(
instance
);
instance_p
=
x2ap_eNB_get_instance
(
instance
);
DevAssert
(
instance_p
!=
NULL
);
DevAssert
(
instance_p
!=
NULL
);
...
...
openair2/X2AP/x2ap_eNB_handler.c
View file @
9d4479fb
...
@@ -235,7 +235,7 @@ x2ap_eNB_handle_handover_preparation(uint32_t assoc_id,
...
@@ -235,7 +235,7 @@ x2ap_eNB_handle_handover_preparation(uint32_t assoc_id,
X2AP_HANDOVER_REQ
(
m
).
source_x2id
=
x2HandoverRequest
->
old_eNB_UE_X2AP_ID
;
X2AP_HANDOVER_REQ
(
m
).
source_x2id
=
x2HandoverRequest
->
old_eNB_UE_X2AP_ID
;
X2AP_HANDOVER_REQ
(
m
).
source_rnti
=
x2id_to_source_rnti
[
x2HandoverRequest
->
old_eNB_UE_X2AP_ID
];
X2AP_HANDOVER_REQ
(
m
).
source_rnti
=
x2id_to_source_rnti
[
x2HandoverRequest
->
old_eNB_UE_X2AP_ID
];
if
((
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
key_eNodeB_star
.
buf
)
&&
if
((
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
key_eNodeB_star
.
buf
)
&&
(
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
key_eNodeB_star
.
size
==
256
))
{
(
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
key_eNodeB_star
.
size
==
32
))
{
memcpy
(
X2AP_HANDOVER_REQ
(
m
).
kenb
,
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
key_eNodeB_star
.
buf
,
32
);
memcpy
(
X2AP_HANDOVER_REQ
(
m
).
kenb
,
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
key_eNodeB_star
.
buf
,
32
);
X2AP_HANDOVER_REQ
(
m
).
kenb_ncc
=
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
nextHopChainingCount
;
X2AP_HANDOVER_REQ
(
m
).
kenb_ncc
=
x2HandoverRequest
->
uE_ContextInformation
.
aS_SecurityInformation
.
nextHopChainingCount
;
itti_send_msg_to_task
(
TASK_RRC_ENB
,
x2ap_eNB_data
->
x2ap_eNB_instance
->
instance
,
m
);
itti_send_msg_to_task
(
TASK_RRC_ENB
,
x2ap_eNB_data
->
x2ap_eNB_instance
->
instance
,
m
);
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
9d4479fb
...
@@ -33,6 +33,8 @@
...
@@ -33,6 +33,8 @@
#include <uhd/version.hpp>
#include <uhd/version.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/thread.hpp>
#include <boost/format.hpp>
#include <iostream>
#include <iostream>
#include <complex>
#include <complex>
#include <fstream>
#include <fstream>
...
@@ -92,12 +94,181 @@ typedef struct {
...
@@ -92,12 +94,181 @@ typedef struct {
int
num_seq_errors
;
int
num_seq_errors
;
int64_t
tx_count
;
int64_t
tx_count
;
int64_t
rx_count
;
int64_t
rx_count
;
int
wait_for_first_pps
;
int
use_gps
;
//! timestamp of RX packet
//! timestamp of RX packet
openair0_timestamp
rx_timestamp
;
openair0_timestamp
rx_timestamp
;
}
usrp_state_t
;
}
usrp_state_t
;
//void print_notes(void)
//{
// Helpful notes
// std::cout << boost::format("**************************************Helpful Notes on Clock/PPS Selection**************************************\n");
// std::cout << boost::format("As you can see, the default 10 MHz Reference and 1 PPS signals are now from the GPSDO.\n");
// std::cout << boost::format("If you would like to use the internal reference(TCXO) in other applications, you must configure that explicitly.\n");
// std::cout << boost::format("You can no longer select the external SMAs for 10 MHz or 1 PPS signaling.\n");
// std::cout << boost::format("****************************************************************************************************************\n");
//}
static
int
sync_to_gps
(
openair0_device
*
device
)
{
uhd
::
set_thread_priority_safe
();
//std::string args;
//Set up program options
//po::options_description desc("Allowed options");
//desc.add_options()
//("help", "help message")
//("args", po::value<std::string>(&args)->default_value(""), "USRP device arguments")
//;
//po::variables_map vm;
//po::store(po::parse_command_line(argc, argv, desc), vm);
//po::notify(vm);
//Print the help message
//if (vm.count("help"))
//{
// std::cout << boost::format("Synchronize USRP to GPS %s") % desc << std::endl;
// return EXIT_FAILURE;
//}
//Create a USRP device
//std::cout << boost::format("\nCreating the USRP device with: %s...\n") % args;
//uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
//std::cout << boost::format("Using Device: %s\n") % usrp->get_pp_string();
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
try
{
size_t
num_mboards
=
s
->
usrp
->
get_num_mboards
();
size_t
num_gps_locked
=
0
;
for
(
size_t
mboard
=
0
;
mboard
<
num_mboards
;
mboard
++
)
{
std
::
cout
<<
"Synchronizing mboard "
<<
mboard
<<
": "
<<
s
->
usrp
->
get_mboard_name
(
mboard
)
<<
std
::
endl
;
//Set references to GPSDO
s
->
usrp
->
set_clock_source
(
"gpsdo"
,
mboard
);
s
->
usrp
->
set_time_source
(
"gpsdo"
,
mboard
);
//std::cout << std::endl;
//print_notes();
//std::cout << std::endl;
//Check for 10 MHz lock
std
::
vector
<
std
::
string
>
sensor_names
=
s
->
usrp
->
get_mboard_sensor_names
(
mboard
);
if
(
std
::
find
(
sensor_names
.
begin
(),
sensor_names
.
end
(),
"ref_locked"
)
!=
sensor_names
.
end
())
{
std
::
cout
<<
"Waiting for reference lock..."
<<
std
::
flush
;
bool
ref_locked
=
false
;
for
(
int
i
=
0
;
i
<
30
and
not
ref_locked
;
i
++
)
{
ref_locked
=
s
->
usrp
->
get_mboard_sensor
(
"ref_locked"
,
mboard
).
to_bool
();
if
(
not
ref_locked
)
{
std
::
cout
<<
"."
<<
std
::
flush
;
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
seconds
(
1
));
}
}
if
(
ref_locked
)
{
std
::
cout
<<
"LOCKED"
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"FAILED"
<<
std
::
endl
;
std
::
cout
<<
"Failed to lock to GPSDO 10 MHz Reference. Exiting."
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
}
else
{
std
::
cout
<<
boost
::
format
(
"ref_locked sensor not present on this board.
\n
"
);
}
//Wait for GPS lock
bool
gps_locked
=
s
->
usrp
->
get_mboard_sensor
(
"gps_locked"
,
mboard
).
to_bool
();
if
(
gps_locked
)
{
num_gps_locked
++
;
std
::
cout
<<
boost
::
format
(
"GPS Locked
\n
"
);
}
else
{
std
::
cerr
<<
"WARNING: GPS not locked - time will not be accurate until locked"
<<
std
::
endl
;
}
//Set to GPS time
uhd
::
time_spec_t
gps_time
=
uhd
::
time_spec_t
(
time_t
(
s
->
usrp
->
get_mboard_sensor
(
"gps_time"
,
mboard
).
to_int
()));
//s->usrp->set_time_next_pps(gps_time+1.0, mboard);
s
->
usrp
->
set_time_next_pps
(
uhd
::
time_spec_t
(
0.0
));
//Wait for it to apply
//The wait is 2 seconds because N-Series has a known issue where
//the time at the last PPS does not properly update at the PPS edge
//when the time is actually set.
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
seconds
(
2
));
//Check times
gps_time
=
uhd
::
time_spec_t
(
time_t
(
s
->
usrp
->
get_mboard_sensor
(
"gps_time"
,
mboard
).
to_int
()));
uhd
::
time_spec_t
time_last_pps
=
s
->
usrp
->
get_time_last_pps
(
mboard
);
std
::
cout
<<
"USRP time: "
<<
(
boost
::
format
(
"%0.9f"
)
%
time_last_pps
.
get_real_secs
())
<<
std
::
endl
;
std
::
cout
<<
"GPSDO time: "
<<
(
boost
::
format
(
"%0.9f"
)
%
gps_time
.
get_real_secs
())
<<
std
::
endl
;
//if (gps_time.get_real_secs() == time_last_pps.get_real_secs())
// std::cout << std::endl << "SUCCESS: USRP time synchronized to GPS time" << std::endl << std::endl;
//else
// std::cerr << std::endl << "ERROR: Failed to synchronize USRP time to GPS time" << std::endl << std::endl;
}
if
(
num_gps_locked
==
num_mboards
and
num_mboards
>
1
)
{
//Check to see if all USRP times are aligned
//First, wait for PPS.
uhd
::
time_spec_t
time_last_pps
=
s
->
usrp
->
get_time_last_pps
();
while
(
time_last_pps
==
s
->
usrp
->
get_time_last_pps
())
{
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
milliseconds
(
1
));
}
//Sleep a little to make sure all devices have seen a PPS edge
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
milliseconds
(
200
));
//Compare times across all mboards
bool
all_matched
=
true
;
uhd
::
time_spec_t
mboard0_time
=
s
->
usrp
->
get_time_last_pps
(
0
);
for
(
size_t
mboard
=
1
;
mboard
<
num_mboards
;
mboard
++
)
{
uhd
::
time_spec_t
mboard_time
=
s
->
usrp
->
get_time_last_pps
(
mboard
);
if
(
mboard_time
!=
mboard0_time
)
{
all_matched
=
false
;
std
::
cerr
<<
(
boost
::
format
(
"ERROR: Times are not aligned: USRP 0=%0.9f, USRP %d=%0.9f"
)
%
mboard0_time
.
get_real_secs
()
%
mboard
%
mboard_time
.
get_real_secs
())
<<
std
::
endl
;
}
}
if
(
all_matched
)
{
std
::
cout
<<
"SUCCESS: USRP times aligned"
<<
std
::
endl
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"ERROR: USRP times are not aligned"
<<
std
::
endl
<<
std
::
endl
;
}
}
}
catch
(
std
::
exception
&
e
)
{
std
::
cout
<<
boost
::
format
(
"
\n
Error: %s"
)
%
e
.
what
();
std
::
cout
<<
boost
::
format
(
"This could mean that you have not installed the GPSDO correctly.
\n\n
"
);
std
::
cout
<<
boost
::
format
(
"Visit one of these pages if the problem persists:
\n
"
);
std
::
cout
<<
boost
::
format
(
" * N2X0/E1X0: http://files.ettus.com/manual/page_gpsdo.html"
);
std
::
cout
<<
boost
::
format
(
" * X3X0: http://files.ettus.com/manual/page_gpsdo_x3x0.html
\n\n
"
);
std
::
cout
<<
boost
::
format
(
" * E3X0: http://files.ettus.com/manual/page_usrp_e3x0.html#e3x0_hw_gps
\n\n
"
);
exit
(
EXIT_FAILURE
);
}
return
EXIT_SUCCESS
;
}
/*! \brief Called to start the USRP transceiver. Return 0 if OK, < 0 if error
/*! \brief Called to start the USRP transceiver. Return 0 if OK, < 0 if error
@param device pointer to the device structure specific to the RF hardware target
@param device pointer to the device structure specific to the RF hardware target
...
@@ -108,10 +279,17 @@ static int trx_usrp_start(openair0_device *device) {
...
@@ -108,10 +279,17 @@ static int trx_usrp_start(openair0_device *device) {
// init recv and send streaming
// init recv and send streaming
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
cmd
.
time_spec
=
s
->
usrp
->
get_time_now
()
+
uhd
::
time_spec_t
(
0.05
);
// should be s->usrp->get_time_next_pps(&cmd.time_spec);
//cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.05);
LOG_I
(
PHY
,
"Time in secs now: %llu
\n
"
,
s
->
usrp
->
get_time_now
().
to_ticks
(
s
->
sample_rate
));
LOG_I
(
PHY
,
"Time in secs last pps: %llu
\n
"
,
s
->
usrp
->
get_time_last_pps
().
to_ticks
(
s
->
sample_rate
));
cmd
.
time_spec
=
s
->
usrp
->
get_time_last_pps
()
+
uhd
::
time_spec_t
(
1.0
);
cmd
.
stream_now
=
false
;
// start at constant delay
cmd
.
stream_now
=
false
;
// start at constant delay
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
if
(
s
->
use_gps
==
1
)
s
->
wait_for_first_pps
=
1
;
else
s
->
wait_for_first_pps
=
0
;
s
->
tx_md
.
time_spec
=
cmd
.
time_spec
+
uhd
::
time_spec_t
(
1
-
(
double
)
s
->
tx_forward_nsamps
/
s
->
sample_rate
);
s
->
tx_md
.
time_spec
=
cmd
.
time_spec
+
uhd
::
time_spec_t
(
1
-
(
double
)
s
->
tx_forward_nsamps
/
s
->
sample_rate
);
s
->
tx_md
.
has_time_spec
=
true
;
s
->
tx_md
.
has_time_spec
=
true
;
s
->
tx_md
.
start_of_burst
=
true
;
s
->
tx_md
.
start_of_burst
=
true
;
...
@@ -227,9 +405,11 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
...
@@ -227,9 +405,11 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
while
(
samples_received
!=
nsamps
)
{
while
(
samples_received
!=
nsamps
)
{
samples_received
+=
s
->
rx_stream
->
recv
(
buff_tmp
[
0
]
+
samples_received
,
samples_received
+=
s
->
rx_stream
->
recv
(
buff_tmp
[
0
]
+
samples_received
,
nsamps
-
samples_received
,
s
->
rx_md
);
nsamps
-
samples_received
,
s
->
rx_md
);
if
(
s
->
rx_md
.
error_code
!=
uhd
::
rx_metadata_t
::
ERROR_CODE_NONE
)
if
((
s
->
wait_for_first_pps
==
0
)
&&
(
s
->
rx_md
.
error_code
!=
uhd
::
rx_metadata_t
::
ERROR_CODE_NONE
)
)
break
;
break
;
if
((
s
->
wait_for_first_pps
==
1
)
&&
(
samples_received
!=
nsamps
))
{
printf
(
"sleep...
\n
"
);}
//usleep(100);
}
}
if
(
samples_received
==
nsamps
)
s
->
wait_for_first_pps
=
0
;
}
}
// bring RX data into 12 LSBs for softmodem RX
// bring RX data into 12 LSBs for softmodem RX
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
...
@@ -468,6 +648,8 @@ extern "C" {
...
@@ -468,6 +648,8 @@ extern "C" {
int
device_init
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
int
device_init
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
)
{
uhd
::
set_thread_priority_safe
(
1.0
);
uhd
::
set_thread_priority_safe
(
1.0
);
usrp_state_t
*
s
=
(
usrp_state_t
*
)
calloc
(
sizeof
(
usrp_state_t
),
1
);
usrp_state_t
*
s
=
(
usrp_state_t
*
)
calloc
(
sizeof
(
usrp_state_t
),
1
);
s
->
use_gps
=
1
;
// Initialize USRP device
// Initialize USRP device
device
->
openair0_cfg
=
openair0_cfg
;
device
->
openair0_cfg
=
openair0_cfg
;
...
@@ -561,10 +743,13 @@ extern "C" {
...
@@ -561,10 +743,13 @@ extern "C" {
// set master clock rate and sample rate for tx & rx for streaming
// set master clock rate and sample rate for tx & rx for streaming
// lock mboard clocks
// lock mboard clocks
if
(
openair0_cfg
[
0
].
clock_source
==
internal
)
if
(
openair0_cfg
[
0
].
clock_source
==
internal
){
s
->
usrp
->
set_clock_source
(
"internal"
);
//s->usrp->set_clock_source("internal");
else
}
else
{
s
->
usrp
->
set_clock_source
(
"external"
);
s
->
usrp
->
set_clock_source
(
"external"
);
s
->
usrp
->
set_time_source
(
"external"
);
}
device
->
type
=
USRP_B200_DEV
;
device
->
type
=
USRP_B200_DEV
;
if
((
vers
==
3
)
&&
(
subvers
==
9
)
&&
(
subsubvers
>=
2
))
{
if
((
vers
==
3
)
&&
(
subvers
==
9
)
&&
(
subsubvers
>=
2
))
{
...
@@ -683,8 +868,6 @@ extern "C" {
...
@@ -683,8 +868,6 @@ extern "C" {
for
(
int
i
=
0
;
i
<
s
->
usrp
->
get_rx_num_channels
()
&&
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
for
(
int
i
=
0
;
i
<
s
->
usrp
->
get_rx_num_channels
()
&&
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
s
->
usrp
->
set_rx_bandwidth
(
openair0_cfg
[
0
].
rx_bw
,
i
);
s
->
usrp
->
set_rx_bandwidth
(
openair0_cfg
[
0
].
rx_bw
,
i
);
s
->
usrp
->
set_time_now
(
uhd
::
time_spec_t
(
0.0
));
for
(
int
i
=
0
;
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
{
for
(
int
i
=
0
;
i
<
openair0_cfg
[
0
].
rx_num_channels
;
i
++
)
{
LOG_I
(
PHY
,
"RX Channel %d
\n
"
,
i
);
LOG_I
(
PHY
,
"RX Channel %d
\n
"
,
i
);
LOG_I
(
PHY
,
" Actual RX sample rate: %fMSps...
\n
"
,
s
->
usrp
->
get_rx_rate
(
i
)
/
1e6
);
LOG_I
(
PHY
,
" Actual RX sample rate: %fMSps...
\n
"
,
s
->
usrp
->
get_rx_rate
(
i
)
/
1e6
);
...
@@ -726,6 +909,14 @@ extern "C" {
...
@@ -726,6 +909,14 @@ extern "C" {
s
->
tx_forward_nsamps
=
90
;
s
->
tx_forward_nsamps
=
90
;
if
(
is_equal
(
s
->
sample_rate
,
(
double
)
7.68e6
))
if
(
is_equal
(
s
->
sample_rate
,
(
double
)
7.68e6
))
s
->
tx_forward_nsamps
=
50
;
s
->
tx_forward_nsamps
=
50
;
if
(
s
->
use_gps
==
1
)
{
if
(
sync_to_gps
(
device
))
{
LOG_I
(
PHY
,
"USRP fails to sync with GPS...
\n
"
);
exit
(
0
);
}
}
return
0
;
return
0
;
}
}
}
}
...
...
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.x2ho.usrpb210.conf
View file @
9d4479fb
Active_eNBs
= (
"eNB_Eurecom_LTEBox"
);
Active_eNBs
= (
"eNB_Eurecom_
X2HO_
LTEBox"
);
# Asn1_verbosity, choice in: none, info, annoying
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity
=
"none"
;
Asn1_verbosity
=
"none"
;
...
@@ -6,7 +6,7 @@ eNBs =
...
@@ -6,7 +6,7 @@ eNBs =
(
(
{
{
//////////
Identification
parameters
:
//////////
Identification
parameters
:
eNB_ID
=
0
xe0
0
;
eNB_ID
=
0
xe0
1
;
cell_type
=
"CELL_MACRO_ENB"
;
cell_type
=
"CELL_MACRO_ENB"
;
...
@@ -33,7 +33,7 @@ eNBs =
...
@@ -33,7 +33,7 @@ eNBs =
eutra_band
=
7
;
eutra_band
=
7
;
downlink_frequency
=
2660000000
L
;
downlink_frequency
=
2660000000
L
;
uplink_frequency_offset
= -
120000000
;
uplink_frequency_offset
= -
120000000
;
Nid_cell
=
0
;
Nid_cell
=
1
;
N_RB_DL
=
25
;
N_RB_DL
=
25
;
Nid_cell_mbsfn
=
0
;
Nid_cell_mbsfn
=
0
;
nb_antenna_ports
=
1
;
nb_antenna_ports
=
1
;
...
@@ -137,14 +137,14 @@ eNBs =
...
@@ -137,14 +137,14 @@ eNBs =
//////////
MME
parameters
:
//////////
MME
parameters
:
mme_ip_address
= ( {
ipv4
=
"192.168.1
2.26
"
;
mme_ip_address
= ( {
ipv4
=
"192.168.1
17.104
"
;
ipv6
=
"192:168:30::17"
;
ipv6
=
"192:168:30::17"
;
active
=
"yes"
;
active
=
"yes"
;
preference
=
"ipv4"
;
preference
=
"ipv4"
;
}
}
);
);
///
X2
///
X2
target_enb_x2_ip_address
= ( {
ipv4
=
"1
27.0.0.10
"
;
target_enb_x2_ip_address
= ( {
ipv4
=
"1
92.168.117.103
"
;
ipv6
=
"192:168:30::17"
;
ipv6
=
"192:168:30::17"
;
active
=
"yes"
;
active
=
"yes"
;
preference
=
"ipv4"
;
preference
=
"ipv4"
;
...
@@ -154,14 +154,14 @@ eNBs =
...
@@ -154,14 +154,14 @@ eNBs =
NETWORK_INTERFACES
:
NETWORK_INTERFACES
:
{
{
ENB_INTERFACE_NAME_FOR_S1_MME
=
"eth
6
"
;
ENB_INTERFACE_NAME_FOR_S1_MME
=
"eth
3
"
;
ENB_IPV4_ADDRESS_FOR_S1_MME
=
"192.168.1
2.82
/24"
;
ENB_IPV4_ADDRESS_FOR_S1_MME
=
"192.168.1
17.107
/24"
;
ENB_INTERFACE_NAME_FOR_S1U
=
"eth
6
"
;
ENB_INTERFACE_NAME_FOR_S1U
=
"eth
3
"
;
ENB_IPV4_ADDRESS_FOR_S1U
=
"192.168.1
2.82
/24"
;
ENB_IPV4_ADDRESS_FOR_S1U
=
"192.168.1
17.107
/24"
;
ENB_PORT_FOR_S1U
=
2152
;
# Spec 2152
ENB_PORT_FOR_S1U
=
2152
;
# Spec 2152
ENB_INTERFACE_NAME_FOR_X2C
=
"
lo
"
;
ENB_INTERFACE_NAME_FOR_X2C
=
"
eth3
"
;
ENB_IPV4_ADDRESS_FOR_X2C
=
"1
27.0.0.11
/24"
;
ENB_IPV4_ADDRESS_FOR_X2C
=
"1
92.168.117.107
/24"
;
ENB_PORT_FOR_X2C
=
36422
;
# Spec ?
ENB_PORT_FOR_X2C
=
36422
;
# Spec ?
ENB_INTERFACE_NAME_FOR_X2U
=
"eth0"
;
ENB_INTERFACE_NAME_FOR_X2U
=
"eth0"
;
...
...
targets/RT/USER/lte-enb.c
View file @
9d4479fb
...
@@ -1047,6 +1047,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
...
@@ -1047,6 +1047,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
exit_fun
(
"Exiting"
);
exit_fun
(
"Exiting"
);
}
}
}
else
{
}
else
{
LOG_I
(
PHY
,
"First Frame: %d , First Subframe: %d Timestamp: %"
PRId64
"
\n
"
,
proc
->
frame_rx
,
proc
->
subframe_rx
,
proc
->
timestamp_rx
);
proc
->
first_rx
--
;
proc
->
first_rx
--
;
*
frame
=
proc
->
frame_rx
;
*
frame
=
proc
->
frame_rx
;
*
subframe
=
proc
->
subframe_rx
;
*
subframe
=
proc
->
subframe_rx
;
...
...
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