Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
trx-ecpri
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
nexedi
trx-ecpri
Commits
f1379f2b
Commit
f1379f2b
authored
Jan 23, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recv and decode works
parent
2499d195
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
trx_ecpri.c
trx_ecpri.c
+17
-8
No files found.
trx_ecpri.c
View file @
f1379f2b
...
...
@@ -172,6 +172,7 @@ static uint8_t symbol_id;
static
int
send_sockfd
;
static
int
recv_sockfd
;
static
struct
sockaddr_ll
connect_sk_addr
;
static
struct
sockaddr_ll
recv_connect_sk_addr
;
static
uint8_t
ecpri_iq_header
[
ECPRI_IQ_HEADER
+
ORAN_HEADER
];
static
uint8_t
packet_header
[
PACKET_HEADER
];
// ethernet + ecpri + iq header
...
...
@@ -358,7 +359,7 @@ static void update_counter(counter_stat_t * c, int64_t v) {
c
->
counter
+=
v
;
}
#define RX_BURST_SIZE
400
0
#define RX_BURST_SIZE
1
0
static
void
*
recv_thread
(
void
*
p
)
{
#ifdef DISABLE_RECV
pthread_exit
(
EXIT_SUCCESS
);
...
...
@@ -401,7 +402,7 @@ static void *recv_thread(void *p) {
error
(
EXIT_FAILURE
,
errno
,
"recvmmsg error"
);
for
(
int
l
=
0
;
l
<
ret
;
l
++
)
if
((
msgh
+
j
+
l
)
->
msg_len
!=
PACKET_SIZE
)
log_
info
(
"RECV_THREAD"
,
"Received message has len %d instead of %d"
,
(
msgh
+
j
+
l
)
->
msg_len
,
PACKET_SIZE
);
log_
exit
(
"RECV_THREAD"
,
"Received message has len %d instead of %d"
,
(
msgh
+
j
+
l
)
->
msg_len
,
PACKET_SIZE
);
j
+=
ret
;
update_counter
(
&
recv_counter
,
ret
);
}
...
...
@@ -563,12 +564,6 @@ static void *decode_thread(void *p) {
data
=
rbuf_read
(
&
rx_rbuf
);
printf
(
"data =
\n
"
);
for
(
int
l
=
0
;
l
<
IQ_PAYLOAD
;
l
++
)
printf
(
"%X"
,
data
[
l
]);
printf
(
"
\n
"
);
log_exit
(
""
,
""
);
int
j
=
ETHERNET_HEADER
+
ECPRI_COMMON_HEADER
;
uint16_t
antenna_id
=
ntohs
(
*
((
uint16_t
*
)
(
data
+
j
+
0
)));
uint8_t
seq_id
=
((
uint8_t
)
(
*
((
uint16_t
*
)
(
data
+
j
+
2
))
>>
8
));
...
...
@@ -819,6 +814,20 @@ int start(TRXEcpriState * s) {
perror
(
"Socket Error"
);
return
1
;
}
const
int
len
=
strnlen
(
s
->
bbu_if
,
IFNAMSIZ
);
if
(
len
==
IFNAMSIZ
)
{
fprintf
(
stderr
,
"Too long iface name"
);
return
1
;
}
recv_connect_sk_addr
.
sll_ifindex
=
if_index
;
recv_connect_sk_addr
.
sll_family
=
AF_PACKET
;
recv_connect_sk_addr
.
sll_protocol
=
htons
(
ETH_P_ALL
);
recv_connect_sk_addr
.
sll_halen
=
ETH_ALEN
;
if
((
bind
(
recv_sockfd
,
(
struct
sockaddr
*
)
&
recv_connect_sk_addr
,
sizeof
(
recv_connect_sk_addr
)))
==-
1
)
{
perror
(
"bind: "
);
return
1
;
}
connect_sk_addr
.
sll_ifindex
=
if_index
;
connect_sk_addr
.
sll_halen
=
ETH_ALEN
;
...
...
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