Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
d23bb098
Commit
d23bb098
authored
10 years ago
by
ghaddab
Browse files
Options
Downloads
Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@6398
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
cbd92893
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+21
-8
21 additions, 8 deletions
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
with
21 additions
and
8 deletions
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+
21
−
8
View file @
d23bb098
...
...
@@ -109,12 +109,12 @@ int ethernet_write_data(int Mod_id, openair0_timestamp timestamp, const void **b
// printf("Timestamp TX sent : %d\n",timestamp);
// printf("buffer head : %d %d %d %d \n",((int16_t *)buff2)[0],((int16_t *)buff2)[1],((int16_t *)buff2)[2],((int16_t *)buff2)[3]);
while
(
n_written
<
(
nsamps
<<
2
)
)
{
while
(
n_written
<
nsamps
)
{
/* Send packet */
if
((
n_written
+=
sendto
(
sockfd
[
Mod_id
],
buff2
,
(
nsamps
<<
2
)
+
sizeof
(
openair0_timestamp
)
+
(
2
*
sizeof
(
int16_t
)),
MSG_DONTWAIT
,
0
,
(
struct
sockaddr
*
)
&
dest_addr
[
Mod_id
],
dest_addr_len
[
Mod_id
]))
<
0
)
{
printf
(
"Send failed for Mod_id %d
\n
"
,
Mod_id
);
...
...
@@ -137,14 +137,16 @@ int ethernet_read_data(int Mod_id,openair0_timestamp *timestamp,void **buff, int
int
ret
;
openair0_timestamp
temp
=
*
(
openair0_timestamp
*
)(
buff2
);
int16_t
mesg
[
2
];
char
str
[
INET_ADDRSTRLEN
];
mesg
[
0
]
=
0
+
(
antenna_id
<<
1
);
mesg
[
1
]
=
nsamps
;
//mesg[0] = 0+(antenna_id<<1);
//mesg[1] = nsamps;
inet_ntop
(
AF_INET
,
&
(
dest_addr
[
Mod_id
].
sin_addr
),
str
,
INET_ADDRSTRLEN
);
// send command RX for nsamps samples
// printf("requesting %d samples from (%s:%d)\n",nsamps,str,ntohs(dest_addr[Mod_id].sin_port));
sendto
(
sockfd
[
Mod_id
],
mesg
,
4
,
MSG_DONTWAIT
,(
struct
sockaddr
*
)
&
dest_addr
[
Mod_id
],
dest_addr_len
[
Mod_id
]);
//
sendto(sockfd[Mod_id],mesg,4,
0
,(struct sockaddr *)&dest_addr[Mod_id],dest_addr_len[Mod_id]);
bytes_received
=
0
;
block_cnt
=
0
;
...
...
@@ -185,8 +187,19 @@ int ethernet_read_data(int Mod_id,openair0_timestamp *timestamp,void **buff, int
int
trx_eth_start
(
openair0_device
*
openair0
)
{
return
(
ethernet_socket_init
(
openair0
->
openair0_cfg
.
Mod_id
,
openair0
->
openair0_cfg
.
rrh_ip
,
openair0
->
openair0_cfg
.
rrh_port
));
int16_t
mesg
[
2
];
int
Mod_id
;
Mod_id
=
openair0
->
openair0_cfg
.
Mod_id
;
ethernet_socket_init
(
openair0
->
openair0_cfg
.
Mod_id
,
openair0
->
openair0_cfg
.
rrh_ip
,
openair0
->
openair0_cfg
.
rrh_port
);
mesg
[
0
]
=
1
+
0
;
//antenna index is 0, to be replaced by the number of active antennas
mesg
[
1
]
=
openair0
->
openair0_cfg
.
samples_per_packet
;
sendto
(
sockfd
[
Mod_id
],
mesg
,
4
,
0
,(
struct
sockaddr
*
)
&
dest_addr
[
Mod_id
],
dest_addr_len
[
Mod_id
]);
return
(
0
);
}
void
trx_eth_write
(
openair0_device
*
device
,
openair0_timestamp
timestamp
,
const
void
**
buff
,
int
nsamps
,
int
cc
,
int
flags
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment