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
promise
OpenXG-RAN
Commits
fc13e200
Commit
fc13e200
authored
Jun 20, 2016
by
Sandeep Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if header and data blocks seperated
parent
5541cafd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
52 deletions
+65
-52
openair1/PHY/LTE_TRANSPORT/if4_tools.c
openair1/PHY/LTE_TRANSPORT/if4_tools.c
+47
-34
openair1/PHY/LTE_TRANSPORT/if4_tools.h
openair1/PHY/LTE_TRANSPORT/if4_tools.h
+18
-18
No files found.
openair1/PHY/LTE_TRANSPORT/if4_tools.c
View file @
fc13e200
...
@@ -48,21 +48,29 @@
...
@@ -48,21 +48,29 @@
void
send_IF4
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint16_t
packet_type
)
{
void
send_IF4
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint16_t
packet_type
)
{
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
];
IF4_dl_header_t
*
dl_header
=
NULL
;
IF4_ul_header_t
*
ul_header
=
NULL
;
IF4_prach_header_t
*
prach_header
=
NULL
;
uint16_t
symbol_id
,
element_id
;
uint16_t
symbol_id
,
element_id
;
uint16_t
db_fulllength
=
12
*
fp
->
N_RB_DL
;
uint16_t
db_halflength
;
uint16_t
db_halflength
=
db_fulllength
>>
1
;
int
slotoffsetF
,
blockoffsetF
;
int
slotoffsetF
=
(
proc
->
subframe_tx
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
int
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
int16_t
*
data_block
=
(
int16_t
*
)
malloc
(
db_fulllength
*
sizeof
(
int16_t
));
int16_t
*
data_block
=
NULL
;
// int16_t *txbuffer = (int16_t*)malloc(db_halflength*sizeof(int16_t));
// Caller: RCC - DL *** handle RRU case - UL and PRACH ***
if
(
packet_type
==
IF4_PDLFFT
)
{
if
(
packet_type
==
IF4_PDLFFT
)
{
IF4_dl_packet_t
*
dl_packet
=
(
IF4_dl_packet_t
*
)
malloc
(
sizeof_IF4_dl_packet_t
);
dl_header
=
(
IF4_dl_header_t
*
)
malloc
(
sizeof_IF4_dl_header_t
);
gen_IF4_dl_packet
(
dl_packet
,
proc
);
gen_IF4_dl_header
(
dl_header
,
proc
);
db_halflength
=
(
12
*
fp
->
N_RB_DL
)
>>
1
;
slotoffsetF
=
(
proc
->
subframe_tx
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
dl_packet
->
data_block
=
data_block
;
printf
(
"Problem here - db_half %d
\n
"
,
db_halflength
);
data_block
=
(
int16_t
*
)
malloc
(
db_halflength
*
sizeof
(
int16_t
));
for
(
symbol_id
=
0
;
symbol_id
<
fp
->
symbols_per_tti
;
symbol_id
++
)
{
for
(
symbol_id
=
0
;
symbol_id
<
fp
->
symbols_per_tti
;
symbol_id
++
)
{
...
@@ -78,40 +86,45 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
...
@@ -78,40 +86,45 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
}
}
// Update information in generated packet
// Update information in generated packet
dl_
packet
->
frame_status
.
sym_num
=
symbol_id
;
dl_
header
->
frame_status
.
sym_num
=
symbol_id
;
printf
(
"
\n
Not even here !!
\n
"
);
// Write the packet(s) to the fronthaul
// Write the packet(s) to the fronthaul
// if ((bytes_sent =
eNB->ifdevice.trx_write_func(&eNB->ifdevice,
if
((
eNB
->
ifdevice
.
trx_write_func
(
&
eNB
->
ifdevice
,
// (proc->timestamp_tx-eNB->ifdevice.openair0_cfg.tx_sample_advance)
,
symbol_id
,
// dl_packet
,
&
data_block
,
// eNB->frame_parms.samples_per_tti
,
1
,
// eNB->frame_parms.nb_antennas_tx
,
1
,
//
0)) < 0) {
0
))
<
0
)
{
//
perror("RCC : ETHERNET write");
perror
(
"RCC : ETHERNET write"
);
//
}
}
slotoffsetF
+=
fp
->
ofdm_symbol_size
;
slotoffsetF
+=
fp
->
ofdm_symbol_size
;
blockoffsetF
+=
fp
->
ofdm_symbol_size
;
blockoffsetF
+=
fp
->
ofdm_symbol_size
;
}
}
}
else
if
(
packet_type
==
IF4_PULFFT
)
{
}
else
if
(
packet_type
==
IF4_PULFFT
)
{
IF4_ul_packet_t
*
ul_packet
=
(
IF4_ul_packet_t
*
)
malloc
(
sizeof_IF4_ul_packet_t
);
ul_header
=
(
IF4_ul_header_t
*
)
malloc
(
sizeof_IF4_ul_header_t
);
gen_IF4_ul_packet
(
ul_packet
,
proc
);
gen_IF4_ul_header
(
ul_header
,
proc
);
db_halflength
=
(
12
*
fp
->
N_RB_UL
)
>>
1
;
slotoffsetF
=
(
proc
->
subframe_rx
)
*
(
fp
->
ofdm_symbol_size
)
*
((
fp
->
Ncp
==
1
)
?
12
:
14
)
+
1
;
blockoffsetF
=
slotoffsetF
+
fp
->
ofdm_symbol_size
-
db_halflength
;
ul_packet
->
data_block
=
data_block
;
data_block
=
(
int16_t
*
)
malloc
(
db_halflength
*
sizeof
(
int16_t
))
;
for
(
symbol_id
=
0
;
symbol_id
<
fp
->
symbols_per_tti
;
symbol_id
++
)
{
for
(
symbol_id
=
0
;
symbol_id
<
fp
->
symbols_per_tti
;
symbol_id
++
)
{
// Do compression of the two parts and generate data blocks - rxdataF
// Do compression of the two parts and generate data blocks - rxdataF
for
(
element_id
=
0
;
element_id
<
db_halflength
;
element_id
++
)
{
for
(
element_id
=
0
;
element_id
<
db_halflength
;
element_id
++
)
{
//
data_block[element_id] = lin2alaw[ (rxdataF[0][blockoffsetF+element_id] & 0xffff) + 32768 ];
data_block
[
element_id
]
=
lin2alaw
[
(
rxdataF
[
0
][
blockoffsetF
+
element_id
]
&
0xffff
)
+
32768
];
//
data_block[element_id] |= lin2alaw[ (rxdataF[0][blockoffsetF+element_id]>>16) + 32768 ]<<8;
data_block
[
element_id
]
|=
lin2alaw
[
(
rxdataF
[
0
][
blockoffsetF
+
element_id
]
>>
16
)
+
32768
]
<<
8
;
//data_block[element_id+db_halflength] = lin2alaw[ (t
xdataF[0][slotoffsetF+element_id] & 0xffff) + 32768 ];
data_block
[
element_id
+
db_halflength
]
=
lin2alaw
[
(
r
xdataF
[
0
][
slotoffsetF
+
element_id
]
&
0xffff
)
+
32768
];
//data_block[element_id+db_halflength] |= lin2alaw[ (t
xdataF[0][slotoffsetF+element_id]>>16) + 32768 ]<<8;
data_block
[
element_id
+
db_halflength
]
|=
lin2alaw
[
(
r
xdataF
[
0
][
slotoffsetF
+
element_id
]
>>
16
)
+
32768
]
<<
8
;
}
}
// Update information in generated packet
// Update information in generated packet
ul_
packet
->
frame_status
.
sym_num
=
symbol_id
;
ul_
header
->
frame_status
.
sym_num
=
symbol_id
;
// Write the packet(s) to the fronthaul
// Write the packet(s) to the fronthaul
...
@@ -131,7 +144,7 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
...
@@ -131,7 +144,7 @@ void send_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t packet_type) {
void
recv_IF4
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint16_t
*
packet_type
,
uint32_t
*
symbol_number
)
{
void
recv_IF4
(
PHY_VARS_eNB
*
eNB
,
eNB_rxtx_proc_t
*
proc
,
uint16_t
*
packet_type
,
uint32_t
*
symbol_number
)
{
*
packet_type
=
0
;
*
packet_type
=
0
;
int16_t
*
data_block
=
NULL
;
//
int16_t *data_block=NULL;
// Read packet(s) from the fronthaul
// Read packet(s) from the fronthaul
// for(i=0; i<fp->symbols_per_tti; i++) {
// for(i=0; i<fp->symbols_per_tti; i++) {
...
@@ -166,7 +179,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t *packet_type, u
...
@@ -166,7 +179,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, uint16_t *packet_type, u
return
;
return
;
}
}
void
gen_IF4_dl_
packet
(
IF4_dl_packet
_t
*
dl_packet
,
eNB_rxtx_proc_t
*
proc
)
{
void
gen_IF4_dl_
header
(
IF4_dl_header
_t
*
dl_packet
,
eNB_rxtx_proc_t
*
proc
)
{
// Set Type and Sub-Type
// Set Type and Sub-Type
dl_packet
->
type
=
IF4_PACKET_TYPE
;
dl_packet
->
type
=
IF4_PACKET_TYPE
;
dl_packet
->
sub_type
=
IF4_PDLFFT
;
dl_packet
->
sub_type
=
IF4_PDLFFT
;
...
@@ -183,10 +196,10 @@ void gen_IF4_dl_packet(IF4_dl_packet_t *dl_packet, eNB_rxtx_proc_t *proc) {
...
@@ -183,10 +196,10 @@ void gen_IF4_dl_packet(IF4_dl_packet_t *dl_packet, eNB_rxtx_proc_t *proc) {
dl_packet
->
frame_status
.
rsvd
=
0
;
dl_packet
->
frame_status
.
rsvd
=
0
;
// Set frame check sequence
// Set frame check sequence
dl_packet
->
fcs
=
0
;
}
}
void
gen_IF4_ul_
packet
(
IF4_ul_packet
_t
*
ul_packet
,
eNB_rxtx_proc_t
*
proc
)
{
void
gen_IF4_ul_
header
(
IF4_ul_header
_t
*
ul_packet
,
eNB_rxtx_proc_t
*
proc
)
{
// Set Type and Sub-Type
// Set Type and Sub-Type
ul_packet
->
type
=
IF4_PACKET_TYPE
;
ul_packet
->
type
=
IF4_PACKET_TYPE
;
ul_packet
->
sub_type
=
IF4_PULFFT
;
ul_packet
->
sub_type
=
IF4_PULFFT
;
...
@@ -207,10 +220,10 @@ void gen_IF4_ul_packet(IF4_ul_packet_t *ul_packet, eNB_rxtx_proc_t *proc) {
...
@@ -207,10 +220,10 @@ void gen_IF4_ul_packet(IF4_ul_packet_t *ul_packet, eNB_rxtx_proc_t *proc) {
ul_packet
->
gain0
.
rsvd
=
0
;
ul_packet
->
gain0
.
rsvd
=
0
;
// Set frame check sequence
// Set frame check sequence
ul_packet
->
fcs
=
0
;
}
}
void
gen_IF4_prach_
packet
(
IF4_prach_packet
_t
*
prach_packet
,
eNB_rxtx_proc_t
*
proc
)
{
void
gen_IF4_prach_
header
(
IF4_prach_header
_t
*
prach_packet
,
eNB_rxtx_proc_t
*
proc
)
{
// Set Type and Sub-Type
// Set Type and Sub-Type
prach_packet
->
type
=
IF4_PACKET_TYPE
;
prach_packet
->
type
=
IF4_PACKET_TYPE
;
prach_packet
->
sub_type
=
IF4_PRACH
;
prach_packet
->
sub_type
=
IF4_PRACH
;
...
@@ -226,5 +239,5 @@ void gen_IF4_prach_packet(IF4_prach_packet_t *prach_packet, eNB_rxtx_proc_t *pro
...
@@ -226,5 +239,5 @@ void gen_IF4_prach_packet(IF4_prach_packet_t *prach_packet, eNB_rxtx_proc_t *pro
prach_packet
->
prach_conf
.
exponent
=
0
;
prach_packet
->
prach_conf
.
exponent
=
0
;
// Set frame check sequence
// Set frame check sequence
prach_packet
->
fcs
=
0
;
}
}
openair1/PHY/LTE_TRANSPORT/if4_tools.h
View file @
fc13e200
...
@@ -93,7 +93,7 @@ struct IF4_lte_prach_conf {
...
@@ -93,7 +93,7 @@ struct IF4_lte_prach_conf {
typedef
struct
IF4_lte_prach_conf
IF4_lte_prach_conf_t
;
typedef
struct
IF4_lte_prach_conf
IF4_lte_prach_conf_t
;
#define sizeof_IF4_lte_prach_conf_t 4
#define sizeof_IF4_lte_prach_conf_t 4
struct
IF4_dl_
packet
{
struct
IF4_dl_
header
{
/// Destination Address
/// Destination Address
/// Source Address
/// Source Address
...
@@ -107,15 +107,15 @@ struct IF4_dl_packet {
...
@@ -107,15 +107,15 @@ struct IF4_dl_packet {
/// Frame Status
/// Frame Status
IF4_frame_status_t
frame_status
;
IF4_frame_status_t
frame_status
;
/// Data Blocks
/// Data Blocks
int16_t
*
data_block
;
/// Frame Check Sequence
/// Frame Check Sequence
uint32_t
fcs
;
};
};
typedef
struct
IF4_dl_
packet
IF4_dl_packet
_t
;
typedef
struct
IF4_dl_
header
IF4_dl_header
_t
;
#define sizeof_IF4_dl_
packet_t 18
#define sizeof_IF4_dl_
header_t 12
struct
IF4_ul_
packet
{
struct
IF4_ul_
header
{
/// Destination Address
/// Destination Address
/// Source Address
/// Source Address
...
@@ -145,15 +145,15 @@ struct IF4_ul_packet {
...
@@ -145,15 +145,15 @@ struct IF4_ul_packet {
/// Gain 7
/// Gain 7
IF4_gain_t
gain7
;
IF4_gain_t
gain7
;
/// Data Blocks
/// Data Blocks
int16_t
*
data_block
;
/// Frame Check Sequence
/// Frame Check Sequence
uint32_t
fcs
;
};
};
typedef
struct
IF4_ul_
packet
IF4_ul_packet
_t
;
typedef
struct
IF4_ul_
header
IF4_ul_header
_t
;
#define sizeof_IF4_ul_
packet_t 34
#define sizeof_IF4_ul_
header_t 28
struct
IF4_prach_
packet
{
struct
IF4_prach_
header
{
/// Destination Address
/// Destination Address
/// Source Address
/// Source Address
...
@@ -167,19 +167,19 @@ struct IF4_prach_packet {
...
@@ -167,19 +167,19 @@ struct IF4_prach_packet {
/// LTE Prach Configuration
/// LTE Prach Configuration
IF4_lte_prach_conf_t
prach_conf
;
IF4_lte_prach_conf_t
prach_conf
;
/// Prach Data Block (one antenna)
/// Prach Data Block (one antenna)
int16_t
*
data_block
;
/// Frame Check Sequence
/// Frame Check Sequence
uint32_t
fcs
;
};
};
typedef
struct
IF4_prach_
packet
IF4_prach_packet
_t
;
typedef
struct
IF4_prach_
header
IF4_prach_header
_t
;
#define sizeof_IF4_prach_
packet_t 18
#define sizeof_IF4_prach_
header_t 12
void
gen_IF4_dl_
packet
(
IF4_dl_packet
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_dl_
header
(
IF4_dl_header
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_ul_
packet
(
IF4_ul_packet
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_ul_
header
(
IF4_ul_header
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_prach_
packet
(
IF4_prach_packet
_t
*
,
eNB_rxtx_proc_t
*
);
void
gen_IF4_prach_
header
(
IF4_prach_header
_t
*
,
eNB_rxtx_proc_t
*
);
void
send_IF4
(
PHY_VARS_eNB
*
,
eNB_rxtx_proc_t
*
,
uint16_t
);
void
send_IF4
(
PHY_VARS_eNB
*
,
eNB_rxtx_proc_t
*
,
uint16_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