Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dyyu
openairinterface5G
Commits
19922715
Commit
19922715
authored
Jun 24, 2016
by
Sandeep Kumar
Browse files
rcc recv and send work (not sync with rru yet)
parent
808494dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
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_
buff
er
,
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
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment