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
05f63dea
Commit
05f63dea
authored
Jan 28, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: structs
parent
9b28bca2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
trx_ecpri.c
trx_ecpri.c
+10
-7
No files found.
trx_ecpri.c
View file @
05f63dea
...
...
@@ -399,6 +399,7 @@ static void *recv_thread(void *p) {
cpu_set_t
mask
;
int
stop
=
0
;
int
prev_seq_id
=
-
1
;
uint16_t
antenna_id
;
struct
mmsghdr
msgh
[
MAX_RX_BURST
];
struct
iovec
msgv
[
MAX_RX_BURST
];
ecpri_header
*
header
;
...
...
@@ -471,21 +472,22 @@ static void *recv_thread(void *p) {
stop
=
1
;
break
;
}
// Exit if antenna ID is not in range
if
(
header
->
antenna_id
>
s
->
rx_n_channel
||
header
->
antenna_id
<
0
)
{
log_info
(
"DECODE_THREAD"
,
"Wrong Antenna ID: %d
\n
"
,
header
->
antenna_id
);
antenna_id
=
ntohs
(
header
->
antenna_id
);
if
(
antenna_id
>
s
->
rx_n_channel
||
antenna_id
<
0
)
{
log_info
(
"DECODE_THREAD"
,
"Wrong Antenna ID: %d
\n
"
,
antenna_id
);
stop
=
1
;
break
;
}
// Exit if there is no more space in the buffer
if
(
!
rbuf_write_amount
(
&
trxr_rbuf
[
header
->
antenna_id
]))
if
(
!
rbuf_write_amount
(
&
trxr_rbuf
[
antenna_id
]))
log_exit
(
"DECODE_THREAD"
,
"No more space in %s buffer"
,
trxr_rbuf
[
header
->
antenna_id
].
name
);
trxr_rbuf
[
antenna_id
].
name
);
prev_seq_id
=
header
->
seq_id
;
iq_packet
=
(
ecpri_iq_packet
*
)
(
rx_buf
+
j
*
PACKET_SIZE
);
memcpy
(
trxr_rbuf
[
header
->
antenna_id
].
buffer
,
memcpy
(
trxr_rbuf
[
antenna_id
].
buffer
,
iq_packet
->
iq_samples
,
IQ_PAYLOAD
);
rbuf_increment_write
(
&
trxr_rbuf
[
header
->
antenna_id
],
IQ_PAYLOAD
);
rbuf_increment_write
(
&
trxr_rbuf
[
antenna_id
],
IQ_PAYLOAD
);
update_counter
(
&
recv_counter
,
1
);
}
if
(
stop
)
{
...
...
@@ -548,7 +550,7 @@ static void *send_thread(void *p) {
iq_packet
=
(
ecpri_iq_packet
*
)
(
tx_buf
+
encoded
*
PACKET_SIZE
);
// PC_ID
iq_packet
->
antenna_id
=
ntoh
s
(
antenna_id
);
iq_packet
->
antenna_id
=
hton
s
(
antenna_id
);
// SEQ_ID
iq_packet
->
seq_id
=
(
uint8_t
)
tx_seq_id
;
tx_seq_id
=
(
tx_seq_id
+
1
)
%
256
;
...
...
@@ -796,6 +798,7 @@ int start(TRXEcpriState * s) {
/* Common Header */
iq_packet
.
ecpri_version
=
0x10
;
// Version 0x1, Reserved = 0, C = 0
iq_packet
.
ecpri_type
=
0x00
;
// Message type (IQ data)
iq_packet
.
payload_size
=
(
uint16_t
)
IQ_PAYLOAD
;
iq_packet
.
seq_id_fixed
=
0x80
;
/* ORAN HEADER */
...
...
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