Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
zzha zzha
OpenXG-RAN
Commits
19922715
Commit
19922715
authored
Jun 24, 2016
by
Sandeep Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rcc recv and send work (not sync with rru yet)
parent
808494dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
29 deletions
+19
-29
openair1/PHY/LTE_TRANSPORT/if4_tools.c
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+7
-8
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
+12
-21
No files found.
openair1/PHY/LTE_TRANSPORT/if4_tools.c
View file @
19922715
...
...
@@ -193,22 +193,21 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
db_halflength
=
db_fulllength
>>
1
;
int64_t
*
ret_type
=
(
int64_t
*
)
malloc
(
sizeof
(
int64_t
));
void
*
rx_buffer
=
NULL
;
IF4_header_t
*
packet_header
=
NULL
;
int16_t
*
data_block
=
NULL
;
// Read packet(s) from the fronthaul
if
(
eNB
->
ifdevice
.
trx_read_func
(
&
eNB
->
ifdevice
,
r
et_type
,
(
int64_t
*
)
pack
et_type
,
&
rx_buffer
,
db_fulllength
,
0
)
<
0
)
{
perror
(
"ETHERNET read"
);
}
*
packet_type
=
(
uint16_t
)
*
ret_type
;
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_header_t
);
packet_header
=
(
IF4_header_t
*
)
(
rx_buffer
+
MAC_HEADER_SIZE_BYTES
)
;
data_block
=
(
int16_t
*
)
(
rx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
);
if
(
*
packet_type
==
IF4_PDLFFT
)
{
// Calculate from received packet
...
...
@@ -225,7 +224,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
// Find and return symbol_number
*
symbol_number
=
((
((
IF4_header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
*
symbol_number
=
((
packet_header
->
frame_status
)
>>
26
)
&
0x000f
;
}
else
if
(
*
packet_type
==
IF4_PULFFT
)
{
// Calculate from received packet
...
...
@@ -242,7 +241,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
// Find and return symbol_number
*
symbol_number
=
((
((
IF4_header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
*
symbol_number
=
((
packet_header
->
frame_status
)
>>
26
)
&
0x000f
;
}
else
if
(
*
packet_type
==
IF4_PRACH
)
{
// FIX: hard coded prach samples length
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
View file @
19922715
...
...
@@ -312,13 +312,12 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp,
ssize_t
packet_size
=
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
;
void
*
test_buffer
=
(
void
*
)
malloc
(
packet_size
);
void
*
rx_buffer
=
NULL
;
IF4_header_t
*
test_header
=
(
IF4_header_t
*
)(
test_buffer
+
MAC_HEADER_SIZE_BYTES
);
bytes_received
=
recv
(
eth
->
sockfd
[
Mod_id
],
test_buffer
,
packet_size
,
0
);
MSG_PEEK
);
if
(
bytes_received
==-
1
)
{
eth
->
num_rx_errors
++
;
perror
(
"ETHERNET READ: "
);
...
...
@@ -328,29 +327,22 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp,
*
timestamp
=
test_header
->
sub_type
;
if
(
test_header
->
sub_type
==
IF4_PDLFFT
)
{
buff
[
0
]
=
(
void
*
)
malloc
(
RAW_IF4_PDLFFT_SIZE_BYTES
(
nblocks
)
-
MAC_HEADER_SIZE_BYTES
);
packet_size
=
RAW_IF4_PDLFFT_SIZE_BYTES
(
nblocks
)
-
packet_size
;
packet_size
=
RAW_IF4_PDLFFT_SIZE_BYTES
(
nblocks
);
}
else
if
(
test_header
->
sub_type
==
IF4_PULFFT
)
{
buff
[
0
]
=
(
void
*
)
malloc
(
RAW_IF4_PULFFT_SIZE_BYTES
(
nblocks
)
-
MAC_HEADER_SIZE_BYTES
);
packet_size
=
RAW_IF4_PULFFT_SIZE_BYTES
(
nblocks
)
-
packet_size
;
packet_size
=
RAW_IF4_PULFFT_SIZE_BYTES
(
nblocks
);
}
else
{
buff
[
0
]
=
(
void
*
)
malloc
(
RAW_IF4_PRACH_SIZE_BYTES
-
MAC_HEADER_SIZE_BYTES
);
packet_size
=
RAW_IF4_PRACH_SIZE_BYTES
-
packet_size
;
printf
(
" Came for prach
\n
"
);
packet_size
=
RAW_IF4_PRACH_SIZE_BYTES
;
}
memcpy
(
buff
[
0
],
test_header
,
sizeof_IF4_header_t
);
rx_buffer
=
(
void
*
)(
buff
[
0
]
+
sizeof_IF4_header_t
);
buff
[
0
]
=
(
void
*
)
malloc
(
packet_size
);
bytes_received
=
0
;
while
(
bytes_received
<
packet_size
)
{
bytes_received
+
=
recv
(
eth
->
sockfd
[
Mod_id
],
rx_buffer
,
packet_size
-
bytes_received
,
0
);
bytes_received
=
recv
(
eth
->
sockfd
[
Mod_id
],
buff
[
0
]
,
packet_size
,
0
);
if
(
bytes_received
==-
1
)
{
eth
->
num_rx_errors
++
;
perror
(
"ETHERNET READ: "
);
...
...
@@ -361,10 +353,9 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp,
}
}
eth
->
rx_nsamps
=
nsamps
;
eth
->
rx_nsamps
=
nsamps
;
free
(
test_buffer
);
return
(
bytes_received
-
MAC_HEADER_SIZE_BYTES
)
>>
1
;
return
(
bytes_received
)
;
}
...
...
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