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
8390977e
Commit
8390977e
authored
Jun 23, 2016
by
Sandeep Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getting rid of bit-fields
parent
89052325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
56 deletions
+52
-56
openair1/PHY/LTE_TRANSPORT/if4_tools.c
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+35
-36
openair1/PHY/LTE_TRANSPORT/if4_tools.h
openair1/PHY/LTE_TRANSPORT/if4_tools.h
+17
-20
No files found.
openair1/PHY/LTE_TRANSPORT/if4_tools.c
View file @
8390977e
...
@@ -84,7 +84,8 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
...
@@ -84,7 +84,8 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
}
}
// Update information in generated packet
// Update information in generated packet
dl_header
->
frame_status
.
sym_num
=
symbol_id
;
dl_header
->
frame_status
&=
~
(
0x000f
<<
26
);
dl_header
->
frame_status
|=
(
symbol_id
&
0x000f
)
<<
26
;
// Write the packet to the fronthaul
// Write the packet to the fronthaul
if
((
eNB
->
ifdevice
.
trx_write_func
(
&
eNB
->
ifdevice
,
if
((
eNB
->
ifdevice
.
trx_write_func
(
&
eNB
->
ifdevice
,
...
@@ -122,7 +123,8 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
...
@@ -122,7 +123,8 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
}
}
// Update information in generated packet
// Update information in generated packet
ul_header
->
frame_status
.
sym_num
=
symbol_id
;
ul_header
->
frame_status
&=
~
(
0x000f
<<
26
);
ul_header
->
frame_status
|=
(
symbol_id
&
0x000f
)
<<
26
;
// Write the packet(s) to the fronthaul
// Write the packet(s) to the fronthaul
if
((
eNB
->
ifdevice
.
trx_write_func
(
&
eNB
->
ifdevice
,
if
((
eNB
->
ifdevice
.
trx_write_func
(
&
eNB
->
ifdevice
,
...
@@ -174,7 +176,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
...
@@ -174,7 +176,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type,
}
}
void
recv_IF4
(
PHY_VARS_eNB
*
eNB
,
int
frame
,
int
subframe
,
uint16_t
*
packet_type
,
uint32_t
*
symbol_number
,
uint16_t
expected_packet
)
{
void
recv_IF4
(
PHY_VARS_eNB
*
eNB
,
int
frame
,
int
subframe
,
uint16_t
*
packet_type
,
uint32_t
*
symbol_number
)
{
LTE_DL_FRAME_PARMS
*
fp
=
&
eNB
->
frame_parms
;
LTE_DL_FRAME_PARMS
*
fp
=
&
eNB
->
frame_parms
;
int32_t
**
txdataF
=
eNB
->
common_vars
.
txdataF
[
0
];
int32_t
**
txdataF
=
eNB
->
common_vars
.
txdataF
[
0
];
int32_t
**
rxdataF
=
eNB
->
common_vars
.
rxdataF
[
0
];
int32_t
**
rxdataF
=
eNB
->
common_vars
.
rxdataF
[
0
];
...
@@ -182,9 +184,9 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
...
@@ -182,9 +184,9 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
uint16_t
element_id
;
uint16_t
element_id
;
uint16_t
db_fulllength
,
db_halflength
;
uint16_t
db_fulllength
,
db_halflength
;
int
slotoffsetF
,
blockoffsetF
;
int
slotoffsetF
=
0
,
blockoffsetF
=
0
;
if
(
e
xpected_packet
==
IF4_PDLFFT
)
{
if
(
e
NB
->
node_function
==
NGFI_RRU_IF4
)
{
db_fulllength
=
(
12
*
fp
->
N_RB_DL
);
db_fulllength
=
(
12
*
fp
->
N_RB_DL
);
}
else
{
}
else
{
db_fulllength
=
(
12
*
fp
->
N_RB_UL
);
db_fulllength
=
(
12
*
fp
->
N_RB_UL
);
...
@@ -194,6 +196,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
...
@@ -194,6 +196,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
int64_t
*
ret_type
=
(
int64_t
*
)
malloc
(
sizeof
(
int64_t
));
int64_t
*
ret_type
=
(
int64_t
*
)
malloc
(
sizeof
(
int64_t
));
void
*
rx_buffer
=
NULL
;
void
*
rx_buffer
=
NULL
;
int16_t
*
data_block
=
NULL
;
int16_t
*
data_block
=
NULL
;
// Read packet(s) from the fronthaul
// Read packet(s) from the fronthaul
if
(
eNB
->
ifdevice
.
trx_read_func
(
&
eNB
->
ifdevice
,
if
(
eNB
->
ifdevice
.
trx_read_func
(
&
eNB
->
ifdevice
,
...
@@ -204,7 +207,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
...
@@ -204,7 +207,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
perror
(
"ETHERNET read"
);
perror
(
"ETHERNET read"
);
}
}
*
packet_type
=
*
ret_type
;
*
packet_type
=
(
uint16_t
)
*
ret_type
;
if
(
*
packet_type
==
IF4_PDLFFT
)
{
if
(
*
packet_type
==
IF4_PDLFFT
)
{
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_dl_header_t
);
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_dl_header_t
);
...
@@ -223,7 +226,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
...
@@ -223,7 +226,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
}
// Find and return symbol_number
// Find and return symbol_number
*
symbol_number
=
((
IF4_dl_header_t
*
)(
rx_buffer
))
->
frame_status
.
sym_num
;
*
symbol_number
=
((
((
IF4_dl_header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
}
else
if
(
*
packet_type
==
IF4_PULFFT
)
{
}
else
if
(
*
packet_type
==
IF4_PULFFT
)
{
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_ul_header_t
);
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_ul_header_t
);
...
@@ -242,12 +245,16 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
...
@@ -242,12 +245,16 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
}
}
// Find and return symbol_number
// Find and return symbol_number
*
symbol_number
=
((
IF4_ul_header_t
*
)(
rx_buffer
))
->
frame_status
.
sym_num
;
*
symbol_number
=
((
((
IF4_ul_header_t
*
)(
rx_buffer
))
->
frame_status
)
>>
26
)
&
0x000f
;
}
else
if
(
*
packet_type
==
IF4_PRACH
)
{
}
else
if
(
*
packet_type
==
IF4_PRACH
)
{
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_prach_header_t
);
data_block
=
(
int16_t
*
)
(
rx_buffer
+
sizeof_IF4_prach_header_t
);
db_fulllength
=
839
;
// hard coded
// FIX: hard coded prach samples length
db_fulllength
=
839
*
2
;
// Generate uncompressed data blocks
memcpy
((
rxsigF
[
0
]
+
slotoffsetF
),
data_block
,
db_fulllength
*
sizeof
(
int16_t
));
}
else
{
}
else
{
AssertFatal
(
1
==
0
,
"recv_IF4 - Unknown packet_type %x"
,
*
packet_type
);
AssertFatal
(
1
==
0
,
"recv_IF4 - Unknown packet_type %x"
,
*
packet_type
);
...
@@ -263,18 +270,13 @@ void gen_IF4_dl_header(IF4_dl_header_t *dl_packet, int frame, int subframe) {
...
@@ -263,18 +270,13 @@ void gen_IF4_dl_header(IF4_dl_header_t *dl_packet, int frame, int subframe) {
dl_packet
->
type
=
IF4_PACKET_TYPE
;
dl_packet
->
type
=
IF4_PACKET_TYPE
;
dl_packet
->
sub_type
=
IF4_PDLFFT
;
dl_packet
->
sub_type
=
IF4_PDLFFT
;
//
Leave reserved as it i
s
//
Reset frame statu
s
dl_packet
->
rsvd
=
0
;
dl_packet
->
rsvd
=
0
;
// Set frame status
// Set frame status
dl_packet
->
frame_status
.
ant_num
=
0
;
dl_packet
->
frame_status
=
0
;
dl_packet
->
frame_status
.
ant_start
=
0
;
dl_packet
->
frame_status
|=
(
frame
&
0xffff
)
<<
6
;
dl_packet
->
frame_status
.
rf_num
=
frame
;
dl_packet
->
frame_status
|=
(
subframe
&
0x000f
)
<<
22
;
dl_packet
->
frame_status
.
sf_num
=
subframe
;
dl_packet
->
frame_status
.
sym_num
=
0
;
dl_packet
->
frame_status
.
rsvd
=
0
;
// Set frame check sequence
}
}
...
@@ -288,19 +290,20 @@ void gen_IF4_ul_header(IF4_ul_header_t *ul_packet, int frame, int subframe) {
...
@@ -288,19 +290,20 @@ void gen_IF4_ul_header(IF4_ul_header_t *ul_packet, int frame, int subframe) {
ul_packet
->
rsvd
=
0
;
ul_packet
->
rsvd
=
0
;
// Set frame status
// Set frame status
ul_packet
->
frame_status
.
ant_num
=
0
;
ul_packet
->
frame_status
=
0
;
ul_packet
->
frame_status
.
ant_start
=
0
;
ul_packet
->
frame_status
|=
(
frame
&
0xffff
)
<<
6
;
ul_packet
->
frame_status
.
rf_num
=
frame
;
ul_packet
->
frame_status
|=
(
subframe
&
0x000f
)
<<
22
;
ul_packet
->
frame_status
.
sf_num
=
subframe
;
ul_packet
->
frame_status
.
sym_num
=
0
;
ul_packet
->
frame_status
.
rsvd
=
0
;
// Set antenna specific gain *** set other antenna gain ***
// Set antenna specific gain *** set other antenna gain ***
ul_packet
->
gain0
.
exponent
=
0
;
ul_packet
->
gain0
=
0
;
ul_packet
->
gain0
.
rsvd
=
0
;
ul_packet
->
gain1
=
0
;
ul_packet
->
gain2
=
0
;
// Set frame check sequence
ul_packet
->
gain3
=
0
;
ul_packet
->
gain4
=
0
;
ul_packet
->
gain5
=
0
;
ul_packet
->
gain6
=
0
;
ul_packet
->
gain7
=
0
;
}
}
...
@@ -313,12 +316,8 @@ void gen_IF4_prach_header(IF4_prach_header_t *prach_packet, int frame, int subfr
...
@@ -313,12 +316,8 @@ void gen_IF4_prach_header(IF4_prach_header_t *prach_packet, int frame, int subfr
prach_packet
->
rsvd
=
0
;
prach_packet
->
rsvd
=
0
;
// Set LTE Prach configuration
// Set LTE Prach configuration
prach_packet
->
prach_conf
.
rsvd
=
0
;
prach_packet
->
prach_conf
=
0
;
prach_packet
->
prach_conf
.
ant
=
0
;
prach_packet
->
prach_conf
|=
(
frame
&
0xffff
)
<<
6
;
prach_packet
->
prach_conf
.
rf_num
=
frame
;
prach_packet
->
prach_conf
|=
(
subframe
&
0x000f
)
<<
22
;
prach_packet
->
prach_conf
.
sf_num
=
subframe
;
prach_packet
->
prach_conf
.
exponent
=
0
;
// Set frame check sequence
}
}
openair1/PHY/LTE_TRANSPORT/if4_tools.h
View file @
8390977e
...
@@ -47,6 +47,10 @@
...
@@ -47,6 +47,10 @@
#define IF4_PDLFFT 0x0020
#define IF4_PDLFFT 0x0020
#define IF4_PRACH 0x0021
#define IF4_PRACH 0x0021
/*
Bit-field reference
/// IF4 Frame Status (32 bits)
/// IF4 Frame Status (32 bits)
struct IF4_frame_status {
struct IF4_frame_status {
/// Antenna Numbers
/// Antenna Numbers
...
@@ -63,9 +67,6 @@ struct IF4_frame_status {
...
@@ -63,9 +67,6 @@ struct IF4_frame_status {
uint32_t rsvd:2;
uint32_t rsvd:2;
};
};
typedef
struct
IF4_frame_status
IF4_frame_status_t
;
#define sizeof_IF4_frame_status_t 4
/// IF4 Antenna Gain (16 bits)
/// IF4 Antenna Gain (16 bits)
struct IF4_gain {
struct IF4_gain {
/// Reserved
/// Reserved
...
@@ -74,9 +75,6 @@ struct IF4_gain {
...
@@ -74,9 +75,6 @@ struct IF4_gain {
uint16_t exponent:6;
uint16_t exponent:6;
};
};
typedef
struct
IF4_gain
IF4_gain_t
;
#define sizeof_IF_gain_t 2
/// IF4 LTE PRACH Configuration (32 bits)
/// IF4 LTE PRACH Configuration (32 bits)
struct IF4_lte_prach_conf {
struct IF4_lte_prach_conf {
/// Reserved
/// Reserved
...
@@ -91,8 +89,7 @@ struct IF4_lte_prach_conf {
...
@@ -91,8 +89,7 @@ struct IF4_lte_prach_conf {
uint32_t exponent:6;
uint32_t exponent:6;
};
};
typedef
struct
IF4_lte_prach_conf
IF4_lte_prach_conf_t
;
*/
#define sizeof_IF4_lte_prach_conf_t 4
struct
IF4_dl_header
{
struct
IF4_dl_header
{
/// Destination Address
/// Destination Address
...
@@ -106,7 +103,7 @@ struct IF4_dl_header {
...
@@ -106,7 +103,7 @@ struct IF4_dl_header {
/// Reserved
/// Reserved
uint32_t
rsvd
;
uint32_t
rsvd
;
/// Frame Status
/// Frame Status
IF4_frame_status
_t
frame_status
;
uint32
_t
frame_status
;
/// Data Blocks
/// Data Blocks
/// Frame Check Sequence
/// Frame Check Sequence
...
@@ -128,23 +125,23 @@ struct IF4_ul_header {
...
@@ -128,23 +125,23 @@ struct IF4_ul_header {
/// Reserved
/// Reserved
uint32_t
rsvd
;
uint32_t
rsvd
;
/// Frame Status
/// Frame Status
IF4_frame_status
_t
frame_status
;
uint32
_t
frame_status
;
/// Gain 0
/// Gain 0
IF4_gain
_t
gain0
;
uint16
_t
gain0
;
/// Gain 1
/// Gain 1
IF4_gain
_t
gain1
;
uint16
_t
gain1
;
/// Gain 2
/// Gain 2
IF4_gain
_t
gain2
;
uint16
_t
gain2
;
/// Gain 3
/// Gain 3
IF4_gain
_t
gain3
;
uint16
_t
gain3
;
/// Gain 4
/// Gain 4
IF4_gain
_t
gain4
;
uint16
_t
gain4
;
/// Gain 5
/// Gain 5
IF4_gain
_t
gain5
;
uint16
_t
gain5
;
/// Gain 6
/// Gain 6
IF4_gain
_t
gain6
;
uint16
_t
gain6
;
/// Gain 7
/// Gain 7
IF4_gain
_t
gain7
;
uint16
_t
gain7
;
/// Data Blocks
/// Data Blocks
/// Frame Check Sequence
/// Frame Check Sequence
...
@@ -166,7 +163,7 @@ struct IF4_prach_header {
...
@@ -166,7 +163,7 @@ struct IF4_prach_header {
/// Reserved
/// Reserved
uint32_t
rsvd
;
uint32_t
rsvd
;
/// LTE Prach Configuration
/// LTE Prach Configuration
IF4_lte_prach_conf
_t
prach_conf
;
uint32
_t
prach_conf
;
/// Prach Data Block (one antenna)
/// Prach Data Block (one antenna)
/// Frame Check Sequence
/// Frame Check Sequence
...
@@ -184,4 +181,4 @@ void gen_IF4_prach_header(IF4_prach_header_t*, int, int);
...
@@ -184,4 +181,4 @@ void gen_IF4_prach_header(IF4_prach_header_t*, int, int);
void
send_IF4
(
PHY_VARS_eNB
*
,
int
,
int
,
uint16_t
,
int
);
void
send_IF4
(
PHY_VARS_eNB
*
,
int
,
int
,
uint16_t
,
int
);
void
recv_IF4
(
PHY_VARS_eNB
*
,
int
,
int
,
uint16_t
*
,
uint32_t
*
,
uint16_t
);
void
recv_IF4
(
PHY_VARS_eNB
*
,
int
,
int
,
uint16_t
*
,
uint32_t
*
);
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