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
Michael Black
OpenXG-RAN
Commits
7c37d6d3
Commit
7c37d6d3
authored
Jun 12, 2020
by
Melissa Elkadi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compilation issues with standalone rach function
parent
4d98e76d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
13 deletions
+39
-13
openair2/PHY_INTERFACE/phy_stub_UE.c
openair2/PHY_INTERFACE/phy_stub_UE.c
+33
-12
openair2/PHY_INTERFACE/phy_stub_UE.h
openair2/PHY_INTERFACE/phy_stub_UE.h
+2
-1
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+4
-0
No files found.
openair2/PHY_INTERFACE/phy_stub_UE.c
View file @
7c37d6d3
...
@@ -38,7 +38,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr,
...
@@ -38,7 +38,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr,
char
*
pnf_ip_addr
,
char
*
pnf_ip_addr
,
int
pnf_p7_port
,
int
pnf_p7_port
,
int
vnf_p7_port
);
int
vnf_p7_port
);
void
send_standalone_rach
(
nfapi_rach_indication_t
*
ind
);
UL_IND_t
*
UL_INFO
=
NULL
;
UL_IND_t
*
UL_INFO
=
NULL
;
nfapi_ul_config_request_t
*
ul_config_req
=
NULL
;
nfapi_ul_config_request_t
*
ul_config_req
=
NULL
;
...
@@ -53,6 +53,8 @@ queue_t hi_dci0_req_queue;
...
@@ -53,6 +53,8 @@ queue_t hi_dci0_req_queue;
int
subframe_sf
=
0
;
int
subframe_sf
=
0
;
int
frame_sfn
=
0
;
int
frame_sfn
=
0
;
static
int
ue_sock_descriptor
=
-
1
;
void
init_queue
(
queue_t
*
q
)
{
void
init_queue
(
queue_t
*
q
)
{
memset
(
q
,
0
,
sizeof
(
*
q
));
memset
(
q
,
0
,
sizeof
(
*
q
));
pthread_mutex_init
(
&
q
->
mutex
,
NULL
);
pthread_mutex_init
(
&
q
->
mutex
,
NULL
);
...
@@ -283,7 +285,12 @@ void fill_rach_indication_UE_MAC(int Mod_id,
...
@@ -283,7 +285,12 @@ void fill_rach_indication_UE_MAC(int Mod_id,
// should call it when we merge with that branch.
// should call it when we merge with that branch.
// Andrew - send proxy specific socket instead of oai_nfapi_rach_ind Send the whole UL_INFO struct
// Andrew - send proxy specific socket instead of oai_nfapi_rach_ind Send the whole UL_INFO struct
// as soon as numberof preambles
// as soon as numberof preambles
if
(
NFAPI_MODE
==
NFAPI_MODE_STANDALONE_PNF
)
{
send_standalone_rach
(
&
UL_INFO
->
rach_ind
);
}
else
{
oai_nfapi_rach_ind
(
&
UL_INFO
->
rach_ind
);
oai_nfapi_rach_ind
(
&
UL_INFO
->
rach_ind
);
}
free
(
UL_INFO
->
rach_ind
.
rach_indication_body
.
preamble_list
);
free
(
UL_INFO
->
rach_ind
.
rach_indication_body
.
preamble_list
);
pthread_mutex_unlock
(
&
fill_ul_mutex
.
rach_mutex
);
pthread_mutex_unlock
(
&
fill_ul_mutex
.
rach_mutex
);
...
@@ -1108,9 +1115,8 @@ void UE_config_stub_pnf(void) {
...
@@ -1108,9 +1115,8 @@ void UE_config_stub_pnf(void) {
}
}
}
}
int
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
)
void
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
)
{
{
struct
sockaddr_in
server_address
;
struct
sockaddr_in
server_address
;
int
addr_len
=
sizeof
(
server_address
);
int
addr_len
=
sizeof
(
server_address
);
memset
(
&
server_address
,
0
,
addr_len
);
memset
(
&
server_address
,
0
,
addr_len
);
...
@@ -1120,13 +1126,13 @@ int ue_init_standalone_socket(const char *addr, int port)
...
@@ -1120,13 +1126,13 @@ int ue_init_standalone_socket(const char *addr, int port)
int
sd
=
socket
(
server_address
.
sin_family
,
SOCK_STREAM
,
IPPROTO_SCTP
);
int
sd
=
socket
(
server_address
.
sin_family
,
SOCK_STREAM
,
IPPROTO_SCTP
);
if
(
sd
<
0
)
{
if
(
sd
<
0
)
{
LOG_E
(
MAC
,
"Socket creation error standalone PNF
\n
"
);
LOG_E
(
MAC
,
"Socket creation error standalone PNF
\n
"
);
return
-
1
;
return
;
}
}
if
(
inet_pton
(
server_address
.
sin_family
,
addr
,
&
server_address
.
sin_addr
)
<=
0
)
{
if
(
inet_pton
(
server_address
.
sin_family
,
addr
,
&
server_address
.
sin_addr
)
<=
0
)
{
LOG_E
(
MAC
,
"Invalid standalone PNF Address
\n
"
);
LOG_E
(
MAC
,
"Invalid standalone PNF Address
\n
"
);
close
(
sd
);
close
(
sd
);
return
-
1
;
return
;
}
}
while
(
connect
(
sd
,
(
struct
sockaddr
*
)
&
server_address
,
addr_len
)
<
0
)
{
while
(
connect
(
sd
,
(
struct
sockaddr
*
)
&
server_address
,
addr_len
)
<
0
)
{
...
@@ -1134,18 +1140,17 @@ int ue_init_standalone_socket(const char *addr, int port)
...
@@ -1134,18 +1140,17 @@ int ue_init_standalone_socket(const char *addr, int port)
sleep
(
1
);
sleep
(
1
);
}
}
LOG_I
(
MAC
,
"Succeeded Now
\n
"
);
LOG_I
(
MAC
,
"Succeeded Now
\n
"
);
return
sd
;
assert
(
ue_sock_descriptor
==
-
1
);
ue_sock_descriptor
=
sd
;
}
}
void
*
ue_standalone_pnf_task
(
void
*
context
)
void
*
ue_standalone_pnf_task
(
void
*
context
)
{
{
uint16_t
sfn_sf
=
0
;
uint16_t
sfn_sf
=
0
;
const
char
*
standalone_addr
=
"127.0.0.1"
;
int
standalone_port
=
3289
;
char
buffer
[
1024
];
char
buffer
[
1024
];
int
sd
=
ue_
init_standalone_socket
(
standalone_addr
,
standalone_port
)
;
int
sd
=
ue_
sock_descriptor
;
assert
(
sd
>
0
);
while
(
true
)
while
(
true
)
{
{
ssize_t
len
=
read
(
sd
,
buffer
,
sizeof
(
buffer
));
ssize_t
len
=
read
(
sd
,
buffer
,
sizeof
(
buffer
));
...
@@ -1214,6 +1219,22 @@ void *ue_standalone_pnf_task(void *context)
...
@@ -1214,6 +1219,22 @@ void *ue_standalone_pnf_task(void *context)
}
}
}
}
void
send_standalone_rach
(
nfapi_rach_indication_t
*
ind
)
{
char
buffer
[
1024
];
int
encoded_size
=
nfapi_p7_message_pack
(
ind
,
buffer
,
sizeof
(
buffer
),
NULL
);
if
(
encoded_size
<
0
)
{
LOG_E
(
MAC
,
"standalone rach pack failed
\n
"
);
return
;
}
if
(
send
(
ue_sock_descriptor
,
buffer
,
encoded_size
,
0
)
<
0
)
{
LOG_E
(
MAC
,
"Send NFAPI_DL_CONFIG_REQUEST to OAI UE failed
\n
"
);
return
;
}
}
/* Dummy functions*/
/* Dummy functions*/
void
handle_nfapi_hi_dci0_dci_pdu
(
void
handle_nfapi_hi_dci0_dci_pdu
(
...
...
openair2/PHY_INTERFACE/phy_stub_UE.h
View file @
7c37d6d3
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "nfapi_interface.h"
#include "nfapi_interface.h"
#include "nfapi_pnf_interface.h"
#include "nfapi_pnf_interface.h"
#include <pthread.h>
#include <pthread.h>
#include "nfapi/oai_integration/vendor_ext.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/defs.h"
//#include "openair1/PHY/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
...
@@ -128,7 +129,7 @@ int memcpy_hi_dci0_req (L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t* pnf_p7, nfa
...
@@ -128,7 +129,7 @@ int memcpy_hi_dci0_req (L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t* pnf_p7, nfa
void
UE_config_stub_pnf
(
void
);
void
UE_config_stub_pnf
(
void
);
// This function is used to open an SCTP socket with a standalone PNF module
// This function is used to open an SCTP socket with a standalone PNF module
int
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
);
void
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
);
// This function is used to read from standalone pnf socket call corresponding memcpy functions
// This function is used to read from standalone pnf socket call corresponding memcpy functions
void
*
ue_standalone_pnf_task
(
void
*
context
);
void
*
ue_standalone_pnf_task
(
void
*
context
);
...
...
targets/RT/USER/lte-ue.c
View file @
7c37d6d3
...
@@ -426,6 +426,10 @@ void init_UE_stub_single_thread(int nb_inst,
...
@@ -426,6 +426,10 @@ void init_UE_stub_single_thread(int nb_inst,
void
init_UE_standalone_thread
()
void
init_UE_standalone_thread
()
{
{
const
char
*
standalone_addr
=
"127.0.0.1"
;
// these two lines go into init
int
standalone_port
=
3289
;
ue_init_standalone_socket
(
standalone_addr
,
standalone_port
);
pthread_t
thread
;
pthread_t
thread
;
if
(
pthread_create
(
&
thread
,
NULL
,
ue_standalone_pnf_task
,
NULL
)
!=
0
)
{
if
(
pthread_create
(
&
thread
,
NULL
,
ue_standalone_pnf_task
,
NULL
)
!=
0
)
{
LOG_E
(
MAC
,
"pthread_create failed for calling ue_standalone_pnf_task"
);
LOG_E
(
MAC
,
"pthread_create failed for calling ue_standalone_pnf_task"
);
...
...
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