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
65f8d8de
Commit
65f8d8de
authored
Dec 26, 2024
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
f602b253
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
805 additions
and
5 deletions
+805
-5
trx_ecpri.c
trx_ecpri.c
+22
-5
trx_ecpri_raw_archive.c
trx_ecpri_raw_archive.c
+783
-0
No files found.
trx_ecpri.c
View file @
65f8d8de
...
...
@@ -48,7 +48,8 @@
#define ETHERNET_HEADER 14
#define ECPRI_COMMON_HEADER 4
#define ECPRI_IQ_HEADER (ECPRI_COMMON_HEADER + 4)
#define PACKET_HEADER (ETHERNET_HEADER + ECPRI_IQ_HEADER)
#define ORAN_HEADER 8
#define PACKET_HEADER (ETHERNET_HEADER + ECPRI_IQ_HEADER + ORAN_HEADER)
/* eCPRI frame structure
...
...
@@ -157,7 +158,7 @@ static volatile int seq_id;
static
int
send_sockfd
;
static
int
recv_sockfd
;
static
struct
sockaddr_ll
connect_sk_addr
;
static
uint8_t
ecpri_iq_header
[
ECPRI_IQ_HEADER
];
static
uint8_t
ecpri_iq_header
[
ECPRI_IQ_HEADER
+
ORAN_HEADER
];
static
uint8_t
packet_header
[
PACKET_HEADER
];
// ethernet + ecpri + iq header
static
void
print_stats
(
FILE
*
f
,
int
print_header
)
{
...
...
@@ -419,6 +420,7 @@ static void *encode_thread(void *p) {
int64_t
target_counter
=
0
;
struct
timespec
next
;
int
reset_encode_counter
=
1
;
uint8_t
*
data
;
// Set thread CPU affinity
CPU_ZERO
(
&
mask
);
...
...
@@ -436,7 +438,13 @@ static void *encode_thread(void *p) {
// If there are frames from trx_write callback to encode
if
(
to_write
&&
to_read
)
{
data
=
rbuf_write
(
&
tx_rbuf
);
memcpy
(
data
,
packet_header
,
PACKET_HEADER
);
// SEQ_ID
*
((
uint16_t
*
)
data
[
ETHERNET_HEADER
+
ECPRI_COMMON_HEADER
+
2
])
=
htons
(
seq_id
++
);
// Frame ID
data
[
ETHERNET_HEADER
+
ECPRI_IQ_HEADER
+
1
]
=
seq_id
;
// TODO
...
...
@@ -735,7 +743,7 @@ int start(TRXEcpriState * s) {
}
memset
((
uint8_t
*
)
packet_header
,
0
,
PACKET_HEADER
);
memset
((
uint8_t
*
)
ecpri_iq_header
,
0
,
ECPRI_IQ_HEADER
);
memset
((
uint8_t
*
)
ecpri_iq_header
,
0
,
ECPRI_IQ_HEADER
+
ORAN_HEADER
);
if
(
sscanf
((
char
*
)
s
->
rrh_mac
,
"%hhx:%hhx:%hhx:%hhx:%hhx:%hhx%*c"
,
&
d_addr
.
addr_bytes
[
0
],
...
...
@@ -787,7 +795,16 @@ int start(TRXEcpriState * s) {
/* IQ message header */
*
((
uint16_t
*
)
(
ecpri_iq_header
+
ECPRI_COMMON_HEADER
))
=
htons
(
s
->
flow_id
);
memcpy
(
packet_header
+
ETHERNET_HEADER
,
ecpri_iq_header
,
ECPRI_IQ_HEADER
);
/* ORAN HEADER */
ecpri_iq_header
[
ECPRI_IQ_HEADER
]
=
0x90
;
ecpri_iq_header
[
ECPRI_IQ_HEADER
+
3
]
=
0x00
;
ecpri_iq_header
[
ECPRI_IQ_HEADER
+
4
]
=
0x00
;
ecpri_iq_header
[
ECPRI_IQ_HEADER
+
5
]
=
0x00
;
ecpri_iq_header
[
ECPRI_IQ_HEADER
+
6
]
=
0x00
;
memcpy
(
packet_header
+
ETHERNET_HEADER
,
ecpri_iq_header
,
ECPRI_IQ_HEADER
+
ORAN_HEADER
);
start_threads
(
s
);
return
0
;
...
...
trx_ecpri_raw_archive.c
0 → 100644
View file @
65f8d8de
This diff is collapsed.
Click to expand it.
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