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
lizhongxiao
OpenXG-RAN
Commits
1d7925c6
Commit
1d7925c6
authored
Oct 17, 2022
by
Swetank Srivastava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cell Config API Support for 5G SA
parent
5fee4dc4
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
739 additions
and
266 deletions
+739
-266
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-0
executables/nr-softmodem.c
executables/nr-softmodem.c
+15
-6
openair2/GNB_APP/gnb_app.c
openair2/GNB_APP/gnb_app.c
+204
-179
openair2/GNB_APP/gnb_paramdef.h
openair2/GNB_APP/gnb_paramdef.h
+1
-0
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+13
-1
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+1
-0
openair3/SS/ss_eNB_sys_task.c
openair3/SS/ss_eNB_sys_task.c
+1
-1
openair3/SS/ss_gNB_port_man_task.c
openair3/SS/ss_gNB_port_man_task.c
+27
-9
openair3/SS/ss_gNB_srb_task.c
openair3/SS/ss_gNB_srb_task.c
+4
-2
openair3/SS/ss_gNB_sys_task.c
openair3/SS/ss_gNB_sys_task.c
+452
-67
openair3/SS/ss_gNB_sys_task.h
openair3/SS/ss_gNB_sys_task.h
+16
-0
openair3/UDP/udp_eNB_task.c
openair3/UDP/udp_eNB_task.c
+4
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
1d7925c6
...
...
@@ -2814,6 +2814,7 @@ target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries
(
nr-softmodem pthread m CONFIG_LIB rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
sctp
${
XFORMS_LIBRARIES
}
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
${
ATLAS_LIBRARIES
}
)
target_link_libraries
(
nr-softmodem
${
LIB_LMS_LIBRARIES
}
)
target_link_libraries
(
nr-softmodem
${
T_LIB
}
)
target_link_libraries
(
nr-softmodem UDP
)
add_dependencies
(
nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc
)
...
...
executables/nr-softmodem.c
View file @
1d7925c6
...
...
@@ -83,6 +83,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "ss_gNB_sys_task.h"
#include "ss_gNB_port_man_task.h"
#include "ss_gNB_srb_task.h"
#include "udp_eNB_task.h"
pthread_cond_t
nfapi_sync_cond
;
pthread_mutex_t
nfapi_sync_mutex
;
...
...
@@ -170,7 +171,7 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *
extern
void
reset_opp_meas
(
void
);
extern
void
print_opp_meas
(
void
);
extern
void
*
udp_eNB_task
(
void
*
args_p
);
//
extern void *udp_eNB_task(void *args_p);
int
transmission_mode
=
1
;
int
emulate_rf
=
0
;
...
...
@@ -350,6 +351,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
if
(
gnb_nb
>
0
)
{
RCconfig_nr_ssparam
();
if
(
itti_create_task
(
TASK_GNB_APP
,
gNB_app_task
,
NULL
)
<
0
)
{
LOG_E
(
GNB_APP
,
"Create task for gNB APP failed
\n
"
);
return
-
1
;
...
...
@@ -388,6 +390,13 @@ int create_gNB_tasks(uint32_t gnb_nb) {
return
-
1
;
}
}
if
(
itti_create_task
(
TASK_UDP
,
udp_eNB_task
,
NULL
)
<
0
)
{
LOG_E
(
GTPU
,
"Create task for UDP failed
\n
"
);
return
-
1
;
}
}
return
0
;
...
...
openair2/GNB_APP/gnb_app.c
View file @
1d7925c6
...
...
@@ -55,9 +55,15 @@
extern
unsigned
char
NB_gNB_INST
;
extern
RAN_CONTEXT_t
RC
;
extern
int
cell_config_5G_done
;
#define GNB_REGISTER_RETRY_DELAY 10
pthread_cond_t
cell_config_5G_done_cond
;
pthread_mutex_t
cell_config_5G_done_mutex
;
static
void
wait_cell_config_5G
(
char
*
thread_name
);
/*------------------------------------------------------------------------------*/
static
void
configure_nr_rrc
(
uint32_t
gnb_id
)
{
...
...
@@ -66,13 +72,19 @@ static void configure_nr_rrc(uint32_t gnb_id)
msg_p
=
itti_alloc_new_message
(
TASK_GNB_APP
,
0
,
NRRRC_CONFIGURATION_REQ
);
if
(
RC
.
nrrrc
[
gnb_id
])
{
RCconfig_NRRRC
(
msg_p
,
gnb_id
,
RC
.
nrrrc
[
gnb_id
]);
if
(
RC
.
nrrrc
[
gnb_id
])
{
if
(
RC
.
ss
.
mode
==
SS_SOFTMODEM
)
{
/** wait for signal */
wait_cell_config_5G
(
"TASK_SYS_GNB"
);
LOG_I
(
GNB_APP
,
"fxn:%s: Received Cell Config 5G SA
\n
"
,
__FUNCTION__
);
}
LOG_I
(
GNB_APP
,
"RRC starting with node type %d
\n
"
,
RC
.
nrrrc
[
gnb_id
]
->
node_type
);
LOG_I
(
GNB_APP
,
"Sending configuration message to NR_RRC task
\n
"
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
GNB_MODULE_ID_TO_INSTANCE
(
gnb_id
),
msg_p
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
GNB_MODULE_ID_TO_INSTANCE
(
gnb_id
),
msg_p
);
}
else
AssertFatal
(
0
,
"NRRRC context for gNB %d not allocated
\n
"
,
gnb_id
);
}
...
...
@@ -158,7 +170,7 @@ void *gNB_app_task(void *args_p)
if
(
RC
.
nb_nr_macrlc_inst
>
0
)
RCconfig_nr_macrlc
();
RCconfig_nr_ssparam
();
//
RCconfig_nr_ssparam();
LOG_I
(
PHY
,
"%s() RC.nb_nr_L1_inst:%d
\n
"
,
__FUNCTION__
,
RC
.
nb_nr_L1_inst
);
...
...
@@ -172,6 +184,7 @@ void *gNB_app_task(void *args_p)
RC
.
nrrrc
=
(
gNB_RRC_INST
**
)
malloc
(
RC
.
nb_nr_inst
*
sizeof
(
gNB_RRC_INST
*
));
LOG_I
(
PHY
,
"%s() RC.nb_nr_inst:%d RC.nrrrc:%p
\n
"
,
__FUNCTION__
,
RC
.
nb_nr_inst
,
RC
.
nrrrc
);
for
(
gnb_id
=
gnb_id_start
;
(
gnb_id
<
gnb_id_end
)
;
gnb_id
++
)
{
RC
.
nrrrc
[
gnb_id
]
=
(
gNB_RRC_INST
*
)
calloc
(
1
,
sizeof
(
gNB_RRC_INST
));
LOG_I
(
PHY
,
"%s() Creating RRC instance RC.nrrrc[%d]:%p (%d of %d)
\n
"
,
__FUNCTION__
,
gnb_id
,
RC
.
nrrrc
[
gnb_id
],
gnb_id
+
1
,
gnb_id_end
);
...
...
@@ -189,7 +202,7 @@ void *gNB_app_task(void *args_p)
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
* can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/
if
((
AMF_MODE_ENABLED
||
is_x2ap_enabled
())
&&
!
NODE_IS_DU
(
RC
.
nrrrc
[
0
]
->
node_type
)
)
{
//&& !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
if
((
AMF_MODE_ENABLED
||
is_x2ap_enabled
())
&&
!
NODE_IS_DU
(
RC
.
nrrrc
[
0
]
->
node_type
)
)
{
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__
((
unused
))
uint32_t
register_gnb_pending
=
gNB_app_register
(
gnb_id_start
,
gnb_id_end
);
...
...
@@ -240,7 +253,7 @@ void *gNB_app_task(void *args_p)
case
NGAP_REGISTER_GNB_CNF
:
LOG_I
(
GNB_APP
,
"[gNB %ld] Received %s: associated AMF %d
\n
"
,
instance
,
msg_name
,
NGAP_REGISTER_GNB_CNF
(
msg_p
).
nb_amf
);
/*
/*
DevAssert(register_gnb_pending > 0);
register_gnb_pending--;
...
...
@@ -276,7 +289,7 @@ void *gNB_app_task(void *args_p)
}
}
}
*/
*/
break
;
case
F1AP_SETUP_RESP
:
...
...
@@ -329,6 +342,18 @@ void *gNB_app_task(void *args_p)
AssertFatal
(
result
==
EXIT_SUCCESS
,
"Failed to free memory (%d)!
\n
"
,
result
);
}
while
(
1
);
return
NULL
;
}
static
void
wait_cell_config_5G
(
char
*
thread_name
)
{
printf
(
"waiting for [SYS 5G] CELL CONFIG Indication (%s)
\n
"
,
thread_name
);
pthread_mutex_lock
(
&
cell_config_5G_done_mutex
);
while
(
cell_config_5G_done
<
0
)
pthread_cond_wait
(
&
cell_config_5G_done_cond
,
&
cell_config_5G_done_mutex
);
pthread_mutex_unlock
(
&
cell_config_5G_done_mutex
);
printf
(
"[SYS 5G]: got cell config (%s)
\n
"
,
thread_name
);
}
openair2/GNB_APP/gnb_paramdef.h
View file @
1d7925c6
...
...
@@ -244,6 +244,7 @@ typedef enum {
#define GNB_CONFIG_SS_SRBPORT_IDX 2
#define GNB_CONFIG_SS_VNGPORT_IDX 3
#define GNB_CONFIG_SS_MODE_IDX 4
//#define GNB_CONFIG_SS_NR_MODE_IDX 5
#define GNB_SSPARAMS_DESC { \
{GNB_CONFIG_SS_HOSTIP , NULL, 0, uptr:NULL, defstrval:"0.0.0.0", TYPE_STRING, 0}, \
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
1d7925c6
...
...
@@ -415,9 +415,21 @@ uint8_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
scs_scaling
=
scs_scaling0
>>
2
;
scs_scaling2
=
scs_scaling0
>>
2
;
}
uint32_t
absolute_diff
=
(
*
configuration
->
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
-
NR_ARFCN_ValueNR_t
absoluteFrequencySSB
=
0
;
uint32_t
absolute_diff
=
0
;
if
(
RC
.
ss
.
mode
==
SS_SOFTMODEM
)
{
LOG_A
(
NR_RRC
,
"fxn:%s absoluteFrequencySSB:%d "
,
__FUNCTION__
,
absoluteFrequencySSB
);
absoluteFrequencySSB
=
*
RC
.
nrrrc
[
0
]
->
configuration
.
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
;
absolute_diff
=
absoluteFrequencySSB
-
configuration
->
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencyPointA
;
}
else
{
absolute_diff
=
(
*
configuration
->
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencySSB
-
configuration
->
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
absoluteFrequencyPointA
);
}
/*TODO: */
sib1
->
servingCellConfigCommon
->
downlinkConfigCommon
.
frequencyInfoDL
.
offsetToPointA
=
scs_scaling2
*
(
absolute_diff
/
(
12
*
scs_scaling
)
-
10
);
LOG_I
(
NR_RRC
,
"SIB1 freq: absoluteFrequencySSB %ld, absoluteFrequencyPointA %ld
\n
"
,
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
1d7925c6
...
...
@@ -224,6 +224,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
rrc
->
carrier
.
sib1_tda
=
configuration
->
sib1_tda
;
rrc
->
carrier
.
do_CSIRS
=
configuration
->
do_CSIRS
;
rrc
->
carrier
.
do_SRS
=
configuration
->
do_SRS
;
LOG_A
(
NR_RRC
,
"fxn:%s rrc->carrier:pci:%d rrc->configuration:pci:%d gnb_mod_idP:%d"
,
__FUNCTION__
,
rrc
->
carrier
.
physCellId
,
*
rrc
->
configuration
.
scc
->
physCellId
,
gnb_mod_idP
);
nr_rrc_config_ul_tda
(
configuration
->
scc
,
configuration
->
minRXTXTIME
);
/// System Information INIT
pthread_mutex_init
(
&
rrc
->
cell_info_mutex
,
NULL
);
...
...
openair3/SS/ss_eNB_sys_task.c
View file @
1d7925c6
...
...
@@ -194,7 +194,7 @@ static int sys_send_udp_msg(
if
(
message_p
)
{
LOG_A
(
ENB_SS
,
"Sending UDP_DATA_REQ length %u offset %u buffer %d %d %d
\n
"
,
buffer_len
,
buffer_offset
,
buffer
[
0
],
buffer
[
1
],
buffer
[
2
]
);
LOG_A
(
ENB_SS
,
"Sending UDP_DATA_REQ length %u offset %u buffer %d %d %d
to address peerIpAddr:%s and peer port:peerPort
\n
"
,
buffer_len
,
buffer_offset
,
buffer
[
0
],
buffer
[
1
],
buffer
[
2
],
peerIpAddr
,
peerPort
);
udp_data_req_p
=
&
message_p
->
ittiMsg
.
udp_data_req
;
udp_data_req_p
->
peer_address
=
peerIpAddr
;
udp_data_req_p
->
peer_port
=
peerPort
;
...
...
openair3/SS/ss_gNB_port_man_task.c
View file @
1d7925c6
...
...
@@ -77,7 +77,12 @@ void ss_nr_port_man_send_cnf(struct NR_SYSTEM_CTRL_CNF recvCnf)
case
NR_SystemConfirm_Type_Cell
:
cnf
.
Confirm
.
v
.
Cell
=
true
;
break
;
case
NR_SystemConfirm_Type_RadioBearerList
:
cnf
.
Confirm
.
v
.
RadioBearerList
=
true
;
break
;
case
NR_SystemConfirm_Type_CellAttenuationList
:
cnf
.
Confirm
.
v
.
CellAttenuationList
=
true
;
break
;
default:
LOG_A
(
GNB_APP
,
"[SYS] Error not handled CNF TYPE to [SS-PORTMAN] %d
\n
"
,
recvCnf
.
Confirm
.
d
);
}
...
...
@@ -232,14 +237,17 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
// Error handling
if
(
userId
<
0
)
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s userId:%d
\n
"
,
__FUNCTION__
,
userId
);
if
(
userId
==
-
ACP_ERR_SERVICE_NOT_MAPPED
)
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s userId:-ACP_ERR_SERVICE_NOT_MAPPED
\n
"
,
__FUNCTION__
);
// Message not mapped to user id,
// this error should not appear on server side for the messages
// received from clients
}
else
if
(
userId
==
-
ACP_ERR_SIDL_FAILURE
)
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s userId:-ACP_ERR_SIDL_FAILURE
\n
"
,
__FUNCTION__
);
// Server returned service error,
// this error should not appear on server side for the messages
// received from clients
...
...
@@ -248,29 +256,36 @@ static inline void ss_gNB_read_from_socket(acpCtx_t ctx)
}
else
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s line:%d
\n
"
,
__FUNCTION__
,
__LINE__
);
return
;
}
}
else
if
(
userId
==
0
)
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s userId:0
\n
"
,
__FUNCTION__
);
// No message (timeout on socket)
}
else
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] received msg %d from the client.
\n
"
,
userId
);
if
(
acpNrSysProcessDecSrv
(
ctx
,
buffer
,
msgSize
,
&
req
)
!=
0
)
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s line:%d
\n
"
,
__FUNCTION__
,
__LINE__
);
return
;
}
ss_dumpReqMsg
(
req
);
if
(
userId
==
MSG_NrSysProcess_userId
)
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s userId: MSG_NrSysProcess_userId
\n
"
,
__FUNCTION__
);
MessageDef
*
message_p
=
itti_alloc_new_message
(
TASK_SS_PORTMAN_GNB
,
INSTANCE_DEFAULT
,
SS_NR_SYS_PORT_MSG_IND
);
if
(
message_p
)
{
SS_NR_SYS_PORT_MSG_IND
(
message_p
).
req
=
req
;
SS_NR_SYS_PORT_MSG_IND
(
message_p
).
userId
=
userId
;
itti_send_msg_to_task
(
TASK_SYS_GNB
,
INSTANCE_DEFAULT
,
message_p
);
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] fxn:%s line:%d Msg sent to
\n
"
,
__FUNCTION__
,
__LINE__
,
TASK_SYS_GNB
);
}
}
}
...
...
@@ -309,7 +324,10 @@ void *ss_port_man_5G_NR_process_itti_msg(void *notUsed)
}
break
;
case
TERMINATE_MESSAGE
:
{
LOG_A
(
GNB_APP
,
"[SS-PORTMAN-GNB] Received TERMINATE_MESSAGE
\n
"
);
itti_exit_task
();
}
break
;
default:
...
...
openair3/SS/ss_gNB_srb_task.c
View file @
1d7925c6
...
...
@@ -361,9 +361,11 @@ void ss_gNB_srb_init(void)
buffer
=
(
unsigned
char
*
)
acpMalloc
(
size
);
assert
(
buffer
);
if
(
RC
.
ss
.
mode
==
SS_SOFTMODEM_SRB
)
{
RC
.
ss
.
State
=
SS_STATE_CELL_ACTIVE
;
}
itti_subscribe_event_fd
(
TASK_SS_SRB
,
fd1
);
itti_mark_task_ready
(
TASK_SS_SRB
);
}
...
...
openair3/SS/ss_gNB_sys_task.c
View file @
1d7925c6
This diff is collapsed.
Click to expand it.
openair3/SS/ss_gNB_sys_task.h
View file @
1d7925c6
...
...
@@ -2,6 +2,7 @@
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include "ss_eNB_proxy_iface.h"
#ifndef SS_GNB_TASK_H_
#define SS_GNB_TASK_H_
...
...
@@ -23,4 +24,19 @@ typedef struct udpSockReq_s
char
*
address
;
}
udpSockReq_t
;
typedef
struct
CellConfig5GReq_s
{
proxy_ss_header_t
header
;
int16_t
maxRefPower
;
uint8_t
initialAttenuation
;
long
absoluteFrequencySSB
;
}
CellConfig5GReq_t
;
typedef
enum
_sys_Type
{
SYS_TYPE_LTE
,
SYS_TYPE_NR
,
SYS_TYPE_ENDC
}
sys_Type
;
#endif
/* SS_ENB_TASK_H_ */
openair3/UDP/udp_eNB_task.c
View file @
1d7925c6
...
...
@@ -308,8 +308,10 @@ void *udp_eNB_task(void *args_p)
itti_mark_task_ready
(
TASK_UDP
);
MSC_START_USE
();
LOG_I
(
UDP_
,
" Entry in %s
\n
"
,
__FUNCTION__
);
while
(
1
)
{
LOG_I
(
UDP_
,
" Fxn:%s line:%d
\n
"
,
__FUNCTION__
,
__LINE__
);
itti_receive_msg
(
TASK_UDP
,
&
received_message_p
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UDP_ENB_TASK
,
VCD_FUNCTION_IN
);
#if defined(LOG_UDP) && LOG_UDP > 0
...
...
@@ -343,7 +345,7 @@ void *udp_eNB_task(void *args_p)
struct
udp_socket_desc_s
*
udp_sock_p
=
NULL
;
udp_data_req_t
*
udp_data_req_p
;
struct
sockaddr_in
peer_addr
;
char
buffer
[
INET_ADDRSTRLEN
];
udp_data_req_p
=
&
received_message_p
->
ittiMsg
.
udp_data_req
;
memset
(
&
peer_addr
,
0
,
sizeof
(
struct
sockaddr_in
));
...
...
@@ -351,6 +353,7 @@ void *udp_eNB_task(void *args_p)
peer_addr
.
sin_family
=
AF_INET
;
peer_addr
.
sin_port
=
htons
(
udp_data_req_p
->
peer_port
);
peer_addr
.
sin_addr
.
s_addr
=
udp_data_req_p
->
peer_address
;
inet_ntop
(
AF_INET
,
&
peer_addr
.
sin_addr
,
buffer
,
sizeof
(
buffer
));
pthread_mutex_lock
(
&
udp_socket_list_mutex
);
udp_sock_p
=
udp_eNB_get_socket_desc
(
ITTI_MSG_ORIGIN_ID
(
received_message_p
));
...
...
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