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
Michael Black
OpenXG-RAN
Commits
808494dd
Commit
808494dd
authored
Jun 24, 2016
by
Sandeep Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unified if4 header
parent
9f0a76e8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
168 deletions
+44
-168
openair1/PHY/LTE_TRANSPORT/if4_tools.c
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+21
-36
openair1/PHY/LTE_TRANSPORT/if4_tools.h
openair1/PHY/LTE_TRANSPORT/if4_tools.h
+6
-117
openair1/SCHED/phy_procedures_lte_eNb.c
openair1/SCHED/phy_procedures_lte_eNb.c
+7
-6
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
+7
-6
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
+3
-3
No files found.
openair1/PHY/LTE_TRANSPORT/if4_tools.c
View file @
808494dd
...
...
@@ -67,9 +67,9 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
slotoffsetF
=
(
subframe
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
tx_buffer
=
malloc
(
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
dl_
header_t
+
db_fulllength
*
sizeof
(
int16_t
));
IF4_
dl_header_t
*
dl_header
=
(
IF4_dl
_header_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
);
data_block
=
(
int16_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
dl_
header_t
);
tx_buffer
=
malloc
(
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
+
db_fulllength
*
sizeof
(
int16_t
));
IF4_
header_t
*
dl_header
=
(
IF4
_header_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
);
data_block
=
(
int16_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
);
gen_IF4_dl_header
(
dl_header
,
frame
,
subframe
);
...
...
@@ -106,9 +106,9 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
slotoffsetF
=
(
subframe
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
tx_buffer
=
malloc
(
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
ul_
header_t
+
db_fulllength
*
sizeof
(
int16_t
));
IF4_
ul_header_t
*
ul_header
=
(
IF4_ul
_header_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
);
data_block
=
(
int16_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
ul_
header_t
);
tx_buffer
=
malloc
(
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
+
db_fulllength
*
sizeof
(
int16_t
));
IF4_
header_t
*
ul_header
=
(
IF4
_header_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
);
data_block
=
(
int16_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
);
gen_IF4_ul_header
(
ul_header
,
frame
,
subframe
);
...
...
@@ -143,9 +143,9 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
// FIX: hard coded prach samples length
db_fulllength
=
839
*
2
;
tx_buffer
=
malloc
(
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
prach_
header_t
+
db_fulllength
*
sizeof
(
int16_t
));
IF4_
prach_header_t
*
prach_header
=
(
IF4_prach
_header_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
);
data_block
=
(
int16_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
prach_
header_t
);
tx_buffer
=
malloc
(
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
+
db_fulllength
*
sizeof
(
int16_t
));
IF4_
header_t
*
prach_header
=
(
IF4
_header_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
);
data_block
=
(
int16_t
*
)(
tx_buffer
+
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
);
gen_IF4_prach_header
(
prach_header
,
frame
,
subframe
);
...
...
@@ -208,10 +208,9 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
*
packet_type
=
(
uint16_t
)
*
ret_type
;
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_header_t
);
if
(
*
packet_type
==
IF4_PDLFFT
)
{
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_dl_header_t
);
// Calculate from received packet
slotoffsetF
=
(
subframe
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
...
...
@@ -226,11 +225,9 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
// Find and return symbol_number
*
symbol_number
=
((((
IF4_
dl_
header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
*
symbol_number
=
((((
IF4_header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
}
else
if
(
*
packet_type
==
IF4_PULFFT
)
{
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_ul_header_t
);
// Calculate from received packet
slotoffsetF
=
(
subframe
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
...
...
@@ -245,11 +242,9 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
// Find and return symbol_number
*
symbol_number
=
((((
IF4_
ul_
header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
*
symbol_number
=
((((
IF4_header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
}
else
if
(
*
packet_type
==
IF4_PRACH
)
{
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_prach_header_t
);
// FIX: hard coded prach samples length
db_fulllength
=
839
*
2
;
...
...
@@ -265,7 +260,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
void
gen_IF4_dl_header
(
IF4_
dl_
header_t
*
dl_packet
,
int
frame
,
int
subframe
)
{
void
gen_IF4_dl_header
(
IF4_header_t
*
dl_packet
,
int
frame
,
int
subframe
)
{
// Set Type and Sub-Type
dl_packet
->
type
=
IF4_PACKET_TYPE
;
dl_packet
->
sub_type
=
IF4_PDLFFT
;
...
...
@@ -281,7 +276,7 @@ void gen_IF4_dl_header(IF4_dl_header_t *dl_packet, int frame, int subframe) {
}
void
gen_IF4_ul_header
(
IF4_
ul_
header_t
*
ul_packet
,
int
frame
,
int
subframe
)
{
void
gen_IF4_ul_header
(
IF4_header_t
*
ul_packet
,
int
frame
,
int
subframe
)
{
// Set Type and Sub-Type
ul_packet
->
type
=
IF4_PACKET_TYPE
;
ul_packet
->
sub_type
=
IF4_PULFFT
;
...
...
@@ -294,20 +289,10 @@ void gen_IF4_ul_header(IF4_ul_header_t *ul_packet, int frame, int subframe) {
ul_packet
->
frame_status
|=
(
frame
&
0xffff
)
<<
6
;
ul_packet
->
frame_status
|=
(
subframe
&
0x000f
)
<<
22
;
// Set antenna specific gain *** set other antenna gain ***
ul_packet
->
gain0
=
0
;
ul_packet
->
gain1
=
0
;
ul_packet
->
gain2
=
0
;
ul_packet
->
gain3
=
0
;
ul_packet
->
gain4
=
0
;
ul_packet
->
gain5
=
0
;
ul_packet
->
gain6
=
0
;
ul_packet
->
gain7
=
0
;
}
void
gen_IF4_prach_header
(
IF4_
prach_
header_t
*
prach_packet
,
int
frame
,
int
subframe
)
{
void
gen_IF4_prach_header
(
IF4_header_t
*
prach_packet
,
int
frame
,
int
subframe
)
{
// Set Type and Sub-Type
prach_packet
->
type
=
IF4_PACKET_TYPE
;
prach_packet
->
sub_type
=
IF4_PRACH
;
...
...
@@ -316,8 +301,8 @@ void gen_IF4_prach_header(IF4_prach_header_t *prach_packet, int frame, int subfr
prach_packet
->
rsvd
=
0
;
// Set LTE Prach configuration
prach_packet
->
prach_conf
=
0
;
prach_packet
->
prach_conf
|=
(
frame
&
0xffff
)
<<
6
;
prach_packet
->
prach_conf
|=
(
subframe
&
0x000f
)
<<
22
;
prach_packet
->
frame_status
=
0
;
prach_packet
->
frame_status
|=
(
frame
&
0xffff
)
<<
6
;
prach_packet
->
frame_status
|=
(
subframe
&
0x000f
)
<<
22
;
}
openair1/PHY/LTE_TRANSPORT/if4_tools.h
View file @
808494dd
...
...
@@ -47,55 +47,7 @@
#define IF4_PDLFFT 0x0020
#define IF4_PRACH 0x0021
/*
Bit-field reference
/// IF4 Frame Status (32 bits)
struct IF4_frame_status {
/// Antenna Numbers
uint32_t ant_num:3;
/// Antenna Start
uint32_t ant_start:3;
/// Radio Frame Number
uint32_t rf_num:16;
/// Sub-frame Number
uint32_t sf_num:4;
/// Symbol Number
uint32_t sym_num:4;
/// Reserved
uint32_t rsvd:2;
};
/// IF4 Antenna Gain (16 bits)
struct IF4_gain {
/// Reserved
uint16_t rsvd:10;
/// FFT Exponent Output
uint16_t exponent:6;
};
/// IF4 LTE PRACH Configuration (32 bits)
struct IF4_lte_prach_conf {
/// Reserved
uint32_t rsvd:3;
/// Antenna Indication
uint32_t ant:3;
/// Radio Frame Number
uint32_t rf_num:16;
/// Sub-frame Number
uint32_t sf_num:4;
/// FFT Exponent Output
uint32_t exponent:6;
};
*/
struct
IF4_dl_header
{
/// Destination Address
/// Source Address
struct
IF4_header
{
/// Type
uint16_t
type
;
/// Sub-Type
...
...
@@ -104,80 +56,17 @@ struct IF4_dl_header {
uint32_t
rsvd
;
/// Frame Status
uint32_t
frame_status
;
/// Data Blocks
/// Frame Check Sequence
};
typedef
struct
IF4_dl_header
IF4_dl_header_t
;
#define sizeof_IF4_dl_header_t 12
struct
IF4_ul_header
{
/// Destination Address
/// Source Address
/// Type
uint16_t
type
;
/// Sub-Type
uint16_t
sub_type
;
/// Reserved
uint32_t
rsvd
;
/// Frame Status
uint32_t
frame_status
;
/// Gain 0
uint16_t
gain0
;
/// Gain 1
uint16_t
gain1
;
/// Gain 2
uint16_t
gain2
;
/// Gain 3
uint16_t
gain3
;
/// Gain 4
uint16_t
gain4
;
/// Gain 5
uint16_t
gain5
;
/// Gain 6
uint16_t
gain6
;
/// Gain 7
uint16_t
gain7
;
/// Data Blocks
/// Frame Check Sequence
};
typedef
struct
IF4_ul_header
IF4_ul_header_t
;
#define sizeof_IF4_ul_header_t 28
struct
IF4_prach_header
{
/// Destination Address
/// Source Address
/// Type
uint16_t
type
;
/// Sub-Type
uint16_t
sub_type
;
/// Reserved
uint32_t
rsvd
;
/// LTE Prach Configuration
uint32_t
prach_conf
;
/// Prach Data Block (one antenna)
/// Frame Check Sequence
};
typedef
struct
IF4_
prach_header
IF4_prach
_header_t
;
#define sizeof_IF4_
prach_header_t 12
typedef
struct
IF4_
header
IF4
_header_t
;
#define sizeof_IF4_
header_t 12
void
gen_IF4_dl_header
(
IF4_
dl_
header_t
*
,
int
,
int
);
void
gen_IF4_dl_header
(
IF4_header_t
*
,
int
,
int
);
void
gen_IF4_ul_header
(
IF4_
ul_
header_t
*
,
int
,
int
);
void
gen_IF4_ul_header
(
IF4_header_t
*
,
int
,
int
);
void
gen_IF4_prach_header
(
IF4_
prach_
header_t
*
,
int
,
int
);
void
gen_IF4_prach_header
(
IF4_header_t
*
,
int
,
int
);
void
send_IF4
(
PHY_VARS_eNB
*
,
int
,
int
,
uint16_t
,
int
);
...
...
openair1/SCHED/phy_procedures_lte_eNb.c
View file @
808494dd
...
...
@@ -2522,7 +2522,7 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
int
prach_rx
;
uint16_t
packet_type
;
uint32_t
symbol_number
;
uint32_t
symbol_number
=
0
;
uint32_t
symbol_mask
,
symbol_mask_full
;
struct
timespec
time_req
,
time_rem
;
...
...
@@ -2649,21 +2649,22 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
}
else
if
(
eNB
->
node_function
==
NGFI_RCC_IF4
)
{
/// **** recv_IF4 of rxdataF from RRU **** ///
/// **** recv_IF4 of
prach
F from RRU **** ///
/// **** recv_IF4 of
rxsig
F from RRU **** ///
// get frame/subframe information from IF4 interface
// timed loop (200 us)
symbol_number
=
0
;
symbol_mask
=
0
;
symbol_mask_full
=
(
1
<<
fp
->
symbols_per_tti
)
-
1
;
prach_rx
=
0
;
// Block from loop while testing
symbol_mask
=
symbol_mask_full
;
nanosleep
(
&
time_req
,
&
time_rem
);
//
symbol_mask = symbol_mask_full;
//
nanosleep(&time_req, &time_rem);
do
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4
,
1
);
//recv_IF4(eNB, frame, subframe
, &packet_type, &symbol_number);
recv_IF4
(
eNB
,
proc
->
frame_rx
,
proc
->
subframe_rx
,
&
packet_type
,
&
symbol_number
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4
,
0
);
if
(
packet_type
==
IF4_PULFFT
)
{
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
View file @
808494dd
...
...
@@ -309,11 +309,11 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp,
eth_state_t
*
eth
=
(
eth_state_t
*
)
device
->
priv
;
int
Mod_id
=
device
->
Mod_id
;
ssize_t
packet_size
=
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_
dl_
header_t
;
ssize_t
packet_size
=
MAC_HEADER_SIZE_BYTES
+
sizeof_IF4_header_t
;
void
*
test_buffer
=
(
void
*
)
malloc
(
packet_size
);
void
*
rx_buffer
=
NULL
;
IF4_
dl_header_t
*
test_header
=
(
IF4_dl
_header_t
*
)(
test_buffer
+
MAC_HEADER_SIZE_BYTES
);
IF4_
header_t
*
test_header
=
(
IF4
_header_t
*
)(
test_buffer
+
MAC_HEADER_SIZE_BYTES
);
bytes_received
=
recv
(
eth
->
sockfd
[
Mod_id
],
test_buffer
,
...
...
@@ -338,10 +338,11 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp,
}
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
"
);
}
memcpy
(
buff
[
0
],
test_header
,
sizeof_IF4_
dl_
header_t
);
rx_buffer
=
(
void
*
)(
buff
[
0
]
+
sizeof_IF4_
dl_
header_t
);
memcpy
(
buff
[
0
],
test_header
,
sizeof_IF4_header_t
);
rx_buffer
=
(
void
*
)(
buff
[
0
]
+
sizeof_IF4_header_t
);
bytes_received
=
0
;
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
View file @
808494dd
...
...
@@ -58,6 +58,6 @@
#define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (sizeof(int16_t)*scaled_nblocks)
#define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*839*2) // FIX hard coded prach size (uncompressed)
#define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_
dl_
header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_
ul_
header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4_
prach_
header_t + PRACH_BLOCK_SIZE_BYTES)
#define RAW_IF4_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4_header_t + DATA_BLOCK_SIZE_BYTES(nblocks))
#define RAW_IF4_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4_header_t + PRACH_BLOCK_SIZE_BYTES)
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