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
b5aca5fd
Commit
b5aca5fd
authored
Feb 19, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: looks OK in wireshark
parent
cf65bc2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
trx_ecpri.c
trx_ecpri.c
+13
-17
No files found.
trx_ecpri.c
View file @
b5aca5fd
...
@@ -199,7 +199,7 @@ typedef struct {
...
@@ -199,7 +199,7 @@ typedef struct {
uint8_t
seq_id
;
uint8_t
seq_id
;
uint8_t
seq_id_fixed
;
uint8_t
seq_id_fixed
;
uint8_t
oran_header
[
ORAN_HEADER
];
uint8_t
oran_header
[
ORAN_HEADER
];
uint8_t
iq_samples
[
NORMAL
_IQ_PAYLOAD
];
uint8_t
iq_samples
[
LONG
_IQ_PAYLOAD
];
}
ecpri_iq_packet
;
}
ecpri_iq_packet
;
typedef
struct
{
typedef
struct
{
...
@@ -769,7 +769,7 @@ static void *send_thread(void *p) {
...
@@ -769,7 +769,7 @@ static void *send_thread(void *p) {
// Send at most tx_burst packets
// Send at most tx_burst packets
int
to_send
=
s
->
tx_burst
/
s
->
tx_n_channel
;
int
to_send
=
s
->
tx_burst
/
s
->
tx_n_channel
;
for
(
int
k
=
0
;
k
<
s
->
tx_n_channel
;
k
++
)
{
for
(
int
k
=
0
;
k
<
s
->
tx_n_channel
;
k
++
)
{
to_read
=
rbuf_read_amount
(
&
trxw_rbuf
[
k
])
/
NORMAL
_IQ_PAYLOAD
;
to_read
=
rbuf_read_amount
(
&
trxw_rbuf
[
k
])
/
LONG
_IQ_PAYLOAD
;
if
(
to_read
<
to_send
)
if
(
to_read
<
to_send
)
to_send
=
to_read
;
to_send
=
to_read
;
}
}
...
@@ -795,10 +795,10 @@ static void *send_thread(void *p) {
...
@@ -795,10 +795,10 @@ static void *send_thread(void *p) {
encode_oran_header
(
&
o
,
iq_packet
->
oran_header
);
encode_oran_header
(
&
o
,
iq_packet
->
oran_header
);
to_read
=
rbuf_read_amount
(
&
trxw_rbuf
[
antenna_id
]);
to_read
=
rbuf_read_amount
(
&
trxw_rbuf
[
antenna_id
]);
memcpy
(
iq_packet
->
iq_samples
,
rbuf_read
(
&
trxw_rbuf
[
antenna_id
]),
payload_size
-
12
);
memcpy
(
iq_packet
->
iq_samples
,
rbuf_read
(
&
trxw_rbuf
[
antenna_id
]),
payload_size
);
rbuf_increment_read
(
&
trxw_rbuf
[
antenna_id
],
payload_size
-
12
);
rbuf_increment_read
(
&
trxw_rbuf
[
antenna_id
],
payload_size
);
encoded
++
;
encoded
++
;
iq_sent
+=
(
payload_size
-
12
)
/
4
;
iq_sent
+=
(
payload_size
)
/
4
;
tx_buf_index
+=
payload_size
+
PACKET_HEADER
;
tx_buf_index
+=
payload_size
+
PACKET_HEADER
;
}
}
increment_oran_counters
(
&
o
);
increment_oran_counters
(
&
o
);
...
@@ -1209,27 +1209,23 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
...
@@ -1209,27 +1209,23 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
// Drop samples if we don't have enough space in trx write buffer
// Drop samples if we don't have enough space in trx write buffer
if
(
(
count
*
4
)
>
rbuf_write_amount
(
&
trxw_rbuf
[
0
])
)
{
if
(
(
count
*
4
)
>
rbuf_write_amount
(
&
trxw_rbuf
[
0
])
)
{
//log_exit("TRX_ECPRI_WRITE",
// "Not enough space to write in trxw_rbuf (count = %d)", count);
update_counter
(
&
tx_drop_counter
,
count
);
update_counter
(
&
tx_drop_counter
,
count
);
return
;
return
;
}
}
for
(
int
i
=
0
;
i
<
s
->
tx_n_channel
;
i
++
)
{
offset
=
0
;
offset
=
0
;
count_left
=
count
;
count_left
=
count
;
while
((
nc
=
rbuf_contiguous_copy
(
NULL
,
&
trxw_rbuf
[
0
],
count_left
*
4
)))
{
while
((
nc
=
rbuf_contiguous_copy
(
NULL
,
&
trxw_rbuf
[
i
],
count_left
*
4
)))
{
for
(
int
i
=
0
;
i
<
s
->
tx_n_channel
;
i
++
)
{
if
(
__samples
)
if
(
__samples
)
{
memcpy
(
rbuf_write
(
&
trxw_rbuf
[
i
]),
((
uint8_t
*
)
_samples
[
i
])
+
offset
,
nc
);
memcpy
(
rbuf_write
(
&
trxw_rbuf
[
i
]),
((
uint8_t
*
)
_samples
[
i
])
+
offset
,
nc
);
//memset(rbuf_write(&trxw_rbuf[i]), 0x9e, nc);
else
}
else
{
log_exit
(
"TRX_ECPRI_WRITE"
,
"samples empty during FDD mode"
);
log_exit
(
"TRX_ECPRI_WRITE"
,
"samples empty during FDD mode"
);
}
rbuf_increment_write
(
&
trxw_rbuf
[
i
],
nc
);
rbuf_increment_write
(
&
trxw_rbuf
[
i
],
nc
);
}
count_left
-=
nc
/
4
;
count_left
-=
nc
/
4
;
offset
+=
nc
;
offset
+=
nc
;
}
}
}
update_counter
(
&
write_counter
,
(
s
->
tx_n_channel
*
count
));
update_counter
(
&
write_counter
,
(
s
->
tx_n_channel
*
count
));
}
}
...
...
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