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
b784e6bd
Commit
b784e6bd
authored
Feb 04, 2016
by
Xenofon Foukas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored code to improve readability in fill_oai_dci function
parent
e3aa8400
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
130 deletions
+134
-130
openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c
openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c
+75
-130
openair2/LAYER2/MAC/progran_dci_conversions.h
openair2/LAYER2/MAC/progran_dci_conversions.h
+59
-0
No files found.
openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c
View file @
b784e6bd
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/progran_dci_conversions.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
...
@@ -104,6 +105,7 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
...
@@ -104,6 +105,7 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
unsigned
char
aggregation
;
unsigned
char
aggregation
;
mac_rlc_status_resp_t
rlc_status
;
mac_rlc_status_resp_t
rlc_status
;
unsigned
char
header_len_dcch
=
0
,
header_len_dcch_tmp
=
0
,
header_len_dtch
=
0
,
header_len_dtch_tmp
=
0
,
ta_len
=
0
;
unsigned
char
header_len_dcch
=
0
,
header_len_dcch_tmp
=
0
,
header_len_dtch
=
0
,
header_len_dtch_tmp
=
0
,
ta_len
=
0
;
unsigned
char
header_len
=
0
,
header_len_tmp
=
0
;
unsigned
char
sdu_lcids
[
11
],
offset
,
num_sdus
=
0
;
unsigned
char
sdu_lcids
[
11
],
offset
,
num_sdus
=
0
;
uint16_t
nb_rb
,
nb_rb_temp
,
total_nb_available_rb
[
MAX_NUM_CCs
],
nb_available_rb
;
uint16_t
nb_rb
,
nb_rb_temp
,
total_nb_available_rb
[
MAX_NUM_CCs
],
nb_available_rb
;
uint16_t
TBS
,
j
,
sdu_lengths
[
11
],
rnti
,
padding
=
0
,
post_padding
=
0
;
uint16_t
TBS
,
j
,
sdu_lengths
[
11
],
rnti
,
padding
=
0
,
post_padding
=
0
;
...
@@ -156,27 +158,18 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
...
@@ -156,27 +158,18 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
rlc_status
.
bytes_in_buffer
=
0
;
rlc_status
.
bytes_in_buffer
=
0
;
TBS
=
dl_dci
->
tbs_size
[
0
];
TBS
=
dl_dci
->
tbs_size
[
0
];
LOG_D
(
MAC
,
"[TEST] The TBS during the creation process is %d
\n
"
,
TBS
);
if
(
dl_data
->
n_ce_bitmap
>
0
)
{
if
(
dl_data
->
n_ce_bitmap
>
0
)
{
//Check if there is TA command
//Check if there is TA command and set the length appropriately
if
(
dl_data
->
ce_bitmap
[
0
]
&
PROTOCOL__PRP_CE_TYPE__PRPCET_TA
)
{
ta_len
=
(
dl_data
->
ce_bitmap
[
0
]
&
PROTOCOL__PRP_CE_TYPE__PRPCET_TA
)
?
2
:
0
;
ta_len
=
2
;
LOG_D
(
MAC
,
"[TEST] Need to send timing advance
\n
"
);
}
else
{
ta_len
=
0
;
LOG_D
(
MAC
,
"[TEST] No timing advance
\n
"
);
}
}
}
n_lc
=
dl_data
->
n_rlc_pdu
;
n_lc
=
dl_data
->
n_rlc_pdu
;
num_sdus
=
0
;
num_sdus
=
0
;
sdu_length_total
=
0
;
sdu_length_total
=
0
;
// Go through each one of the channel commands and create SDUs
// Go through each one of the channel commands and create SDUs
for
(
i
=
0
;
i
<
n_lc
;
i
++
)
{
for
(
i
=
0
;
i
<
n_lc
;
i
++
)
{
lcid
=
dl_data
->
rlc_pdu
[
i
]
->
rlc_pdu_tb
[
0
]
->
logical_channel_id
;
lcid
=
dl_data
->
rlc_pdu
[
i
]
->
rlc_pdu_tb
[
0
]
->
logical_channel_id
;
LOG_D
(
MAC
,
"[TEST] Going through SDU of channel %d
\n
"
,
lcid
);
rlc_size
=
dl_data
->
rlc_pdu
[
i
]
->
rlc_pdu_tb
[
0
]
->
size
;
rlc_size
=
dl_data
->
rlc_pdu
[
i
]
->
rlc_pdu_tb
[
0
]
->
size
;
LOG_D
(
MAC
,
"[TEST] [eNB %d] Frame %d, LCID %d, CC_id %d, Requesting %d bytes from RLC (RRC message)
\n
"
,
LOG_D
(
MAC
,
"[TEST] [eNB %d] Frame %d, LCID %d, CC_id %d, Requesting %d bytes from RLC (RRC message)
\n
"
,
mod_id
,
frame
,
lcid
,
CC_id
,
rlc_size
);
mod_id
,
frame
,
lcid
,
CC_id
,
rlc_size
);
...
@@ -204,24 +197,17 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
...
@@ -204,24 +197,17 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
lcid
,
lcid
,
(
char
*
)
&
dlsch_buffer
[
sdu_length_total
]);
(
char
*
)
&
dlsch_buffer
[
sdu_length_total
]);
LOG_D
(
MAC
,
"[TEST] RLC gave %d bytes in LCID %d
\n
"
,
sdu_lengths
[
i
],
lcid
);
LOG_D
(
MAC
,
"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC
\n
"
,
mod_id
,
lcid
,
CC_id
,
sdu_lengths
[
i
]);
LOG_D
(
MAC
,
"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC
\n
"
,
mod_id
,
lcid
,
CC_id
,
sdu_lengths
[
i
]);
sdu_length_total
+=
sdu_lengths
[
i
];
sdu_length_total
+=
sdu_lengths
[
i
];
LOG_D
(
MAC
,
"[TEST] Total sdu size became %d
\n
"
,
sdu_length_total
);
sdu_lcids
[
i
]
=
lcid
;
sdu_lcids
[
i
]
=
lcid
;
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
].
num_pdu_tx
[
lcid
]
+=
1
;
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
].
num_pdu_tx
[
lcid
]
+=
1
;
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
].
num_bytes_tx
[
lcid
]
+=
sdu_lengths
[
i
];
UE_list
->
eNB_UE_stats
[
CC_id
][
UE_id
].
num_bytes_tx
[
lcid
]
+=
sdu_lengths
[
i
];
if
(
lcid
==
DCCH
||
lcid
==
DCCH1
)
{
header_len_dcch
+=
2
;
}
else
if
(
lcid
==
DTCH
)
{
if
(
sdu_lengths
[
i
]
<
128
)
{
if
(
sdu_lengths
[
i
]
<
128
)
{
header_len_dtch
=
2
;
header_len
+
=
2
;
}
else
{
}
else
{
header_len_dtch
=
3
;
header_len
+=
3
;
}
}
}
num_sdus
++
;
num_sdus
++
;
...
@@ -229,46 +215,34 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
...
@@ -229,46 +215,34 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id,
}
// SDU creation end
}
// SDU creation end
if
(((
sdu_length_total
+
header_len
_dcch
+
header_len_dtch
)
>
0
))
{
if
(((
sdu_length_total
+
header_len
)
>
0
))
{
header_len_dcch_tmp
=
header_len_dcch
;
header_len_tmp
=
header_len
;
header_len_dtch_tmp
=
header_len_dtch
;
if
(
header_len_dtch
==
0
)
{
// If we have only a single SDU, header length becomes 1
header_len_dcch
=
(
header_len_dcch
>
0
)
?
(
header_len_dcch
-
1
)
:
header_len_dcch
;
// remove length field
if
(
header_len
==
2
||
header_len
==
3
)
{
header_len
=
1
;
}
else
{
}
else
{
header_len
_dtch
=
(
header_len_dtch
>
0
)
?
1
:
header_len_dtch
;
// remove length field for the last SDU
header_len
--
;
}
}
// there is a payload
// there is a payload
if
(((
sdu_length_total
+
header_len_dcch
+
header_len_dtch
)
>
0
))
{
if
(((
sdu_length_total
+
header_len
)
>
0
))
{
if
((
TBS
-
header_len_dcch
-
header_len_dtch
-
sdu_length_total
-
ta_len
)
<=
2
// If we need a 1 or 2 bit padding or no padding at all
||
(
TBS
-
header_len_dcch
-
header_len_dtch
-
sdu_length_total
-
ta_len
)
>
TBS
)
{
//protect from overflow
if
((
TBS
-
header_len
-
sdu_length_total
-
ta_len
)
<=
2
padding
=
(
TBS
-
header_len_dcch
-
header_len_dtch
-
sdu_length_total
-
ta_len
);
||
(
TBS
-
header_len
-
sdu_length_total
-
ta_len
)
>
TBS
)
{
//protect from overflow
padding
=
(
TBS
-
header_len
-
sdu_length_total
-
ta_len
);
post_padding
=
0
;
post_padding
=
0
;
}
else
{
}
else
{
// The last sdu needs to have a length field, since we add padding
padding
=
0
;
padding
=
0
;
header_len
=
header_len_tmp
;
// adjust the header len
post_padding
=
TBS
-
sdu_length_total
-
header_len
-
ta_len
-
1
;
// 1 is for the postpadding header
if
(
header_len_dtch
==
0
)
{
header_len_dcch
=
header_len_dcch_tmp
;
}
else
{
header_len_dtch
=
header_len_dtch_tmp
;
}
}
post_padding
=
TBS
-
sdu_length_total
-
header_len_dcch
-
header_len_dtch
-
ta_len
-
1
;
// 1 is for the postpadding header
}
}
}
if
(
ta_len
>
0
)
{
ta_update
=
(
ta_len
>
0
)
?
ue_sched_ctl
->
ta_update
:
0
;
ta_update
=
ue_sched_ctl
->
ta_update
;
}
else
{
ta_update
=
0
;
}
offset
=
generate_dlsch_header
((
unsigned
char
*
)
UE_list
->
DLSCH_pdu
[
CC_id
][
0
][
UE_id
].
payload
[
0
],
offset
=
generate_dlsch_header
((
unsigned
char
*
)
UE_list
->
DLSCH_pdu
[
CC_id
][
0
][
UE_id
].
payload
[
0
],
// offset = generate_dlsch_header((unsigned char*)eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0],
num_sdus
,
//num_sdus
num_sdus
,
//num_sdus
sdu_lengths
,
//
sdu_lengths
,
//
sdu_lcids
,
sdu_lcids
,
...
@@ -364,6 +338,8 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -364,6 +338,8 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
int
UE_id
=
find_ue
(
rnti
,
PHY_vars_eNB_g
[
mod_id
][
CC_id
]);
int
UE_id
=
find_ue
(
rnti
,
PHY_vars_eNB_g
[
mod_id
][
CC_id
]);
uint32_t
format
;
harq_pid
=
dl_dci
->
harq_process
;
harq_pid
=
dl_dci
->
harq_process
;
round
=
dl_dci
->
rv
[
0
];
round
=
dl_dci
->
rv
[
0
];
...
@@ -377,14 +353,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -377,14 +353,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
case
6
:
case
6
:
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_TDD_1
(
DCI1_1_5MHz_TDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
dai
=
dl_dci
->
dai
;
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_1_5MHz_TDD_t
);
size_bytes
=
sizeof
(
DCI1_1_5MHz_TDD_t
);
size_bits
=
sizeof_DCI1_1_5MHz_TDD_t
;
size_bits
=
sizeof_DCI1_1_5MHz_TDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -394,14 +363,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -394,14 +363,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
}
}
}
else
{
}
else
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
LOG_D
(
MAC
,
"[TEST] Setting DCI format 1
\n
"
);
FILL_DCI_FDD_1
(
DCI1_1_5MHz_FDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_1_5MHz_FDD_t
);
size_bytes
=
sizeof
(
DCI1_1_5MHz_FDD_t
);
size_bits
=
sizeof_DCI1_1_5MHz_FDD_t
;
size_bits
=
sizeof_DCI1_1_5MHz_FDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -414,14 +376,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -414,14 +376,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
case
25
:
case
25
:
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_TDD_1
(
DCI1_5MHz_TDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
dai
=
dl_dci
->
dai
;
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_5MHz_TDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_5MHz_TDD_t
);
size_bytes
=
sizeof
(
DCI1_5MHz_TDD_t
);
size_bits
=
sizeof_DCI1_5MHz_TDD_t
;
size_bits
=
sizeof_DCI1_5MHz_TDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -431,13 +386,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -431,13 +386,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
}
}
}
else
{
}
else
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_FDD_1
(
DCI1_5MHz_FDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_5MHz_FDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_5MHz_FDD_t
);
size_bytes
=
sizeof
(
DCI1_5MHz_FDD_t
);
size_bits
=
sizeof_DCI1_5MHz_FDD_t
;
size_bits
=
sizeof_DCI1_5MHz_FDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -450,14 +399,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -450,14 +399,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
case
50
:
case
50
:
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_TDD_1
(
DCI1_10MHz_TDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
dai
=
dl_dci
->
dai
;
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_10MHz_TDD_t
);
size_bytes
=
sizeof
(
DCI1_10MHz_TDD_t
);
size_bits
=
sizeof_DCI1_10MHz_TDD_t
;
size_bits
=
sizeof_DCI1_10MHz_TDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -467,13 +409,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -467,13 +409,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
}
}
}
else
{
}
else
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_10MHz_FDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_FDD_1
(
DCI1_10MHz_FDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_10MHz_FDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_10MHz_FDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_10MHz_FDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_10MHz_FDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_10MHz_FDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_10MHz_TDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_10MHz_FDD_t
);
size_bytes
=
sizeof
(
DCI1_10MHz_FDD_t
);
size_bits
=
sizeof_DCI1_10MHz_FDD_t
;
size_bits
=
sizeof_DCI1_10MHz_FDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -486,14 +422,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -486,14 +422,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
case
100
:
case
100
:
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
frame_parms
[
CC_id
]
->
frame_type
==
TDD
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_TDD_1
(
DCI1_20MHz_TDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
dai
=
dl_dci
->
dai
;
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_20MHz_TDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_20MHz_TDD_t
);
size_bytes
=
sizeof
(
DCI1_20MHz_TDD_t
);
size_bits
=
sizeof_DCI1_20MHz_TDD_t
;
size_bits
=
sizeof_DCI1_20MHz_TDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -503,13 +432,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -503,13 +432,7 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
}
}
}
else
{
}
else
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
harq_pid
=
harq_pid
;
FILL_DCI_FDD_1
(
DCI1_20MHz_FDD_t
,
DLSCH_dci
,
dl_dci
);
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
rv
=
round
;
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
rballoc
=
dl_dci
->
rb_bitmap
;
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
rah
=
dl_dci
->
res_alloc
;
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
mcs
=
dl_dci
->
mcs
[
0
];
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
TPC
=
dl_dci
->
tpc
;
((
DCI1_20MHz_FDD_t
*
)
DLSCH_dci
)
->
ndi
=
dl_dci
->
ndi
[
0
];
size_bytes
=
sizeof
(
DCI1_20MHz_FDD_t
);
size_bytes
=
sizeof
(
DCI1_20MHz_FDD_t
);
size_bits
=
sizeof_DCI1_20MHz_FDD_t
;
size_bits
=
sizeof_DCI1_20MHz_FDD_t
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
...
@@ -521,24 +444,46 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
...
@@ -521,24 +444,46 @@ void fill_oai_dci(mid_t mod_id, uint32_t CC_id, uint32_t rnti,
break
;
break
;
}
}
//Add DCI based on format
//Set format to the proper type
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
)
{
switch
(
dl_dci
->
format
)
{
add_ue_spec_dci
(
DCI_pdu
,
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1
:
DLSCH_dci
,
format
=
format1
;
rnti
,
break
;
size_bytes
,
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1A
:
dl_dci
->
aggr_level
,
//aggregation
format
=
format1A
;
size_bits
,
break
;
format1
,
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1B
:
0
);
format
=
format1B
;
}
else
if
(
dl_dci
->
format
==
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
)
{
break
;
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1C
:
format
=
format1C
;
break
;
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_1D
:
format
=
format1E_2A_M10PRB
;
break
;
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2
:
format
=
format2
;
break
;
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2A
:
format
=
format2A
;
break
;
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_2B
:
format
=
format2B
;
break
;
case
PROTOCOL__PRP_DCI_FORMAT__PRDCIF_3
:
format
=
3
;
break
;
default:
/*TODO: Need to deal with unsupported DCI type*/
return
;
}
add_ue_spec_dci
(
DCI_pdu
,
add_ue_spec_dci
(
DCI_pdu
,
DLSCH_dci
,
DLSCH_dci
,
rnti
,
rnti
,
size_bytes
,
size_bytes
,
dl_dci
->
aggr_level
,
//aggregation
dl_dci
->
aggr_level
,
size_bits
,
size_bits
,
format2A
,
format
,
0
);
0
);
}
}
}
openair2/LAYER2/MAC/progran_dci_conversions.h
0 → 100644
View file @
b784e6bd
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file dci_conversions.h
* \brief Conversion helpers from progran messages to OAI formats DCI
* \author Xenofon Foukas
* \date 2016
* \version 0.1
*/
#ifndef LAYER2_MAC_PROGRAN_DCI_CONVERISIONS_H__
#define LAYER2_MAC_DCI_PROGRAN_CONVERISIONS_H__
#define FILL_DCI_FDD_1(TYPE, DCI, PROGRAN_DCI) \
((TYPE*)DCI)->harq_pid = PROGRAN_DCI->harq_process; \
((TYPE*)DCI)->rv = PROGRAN_DCI->rv[0]; \
((TYPE*)DCI)->rballoc = PROGRAN_DCI->rb_bitmap; \
((TYPE*)DCI)->rah = PROGRAN_DCI->res_alloc; \
((TYPE*)DCI)->mcs = PROGRAN_DCI->mcs[0]; \
((TYPE*)DCI)->TPC = PROGRAN_DCI->tpc; \
((TYPE*)DCI)->ndi = PROGRAN_DCI->ndi[0];
#define FILL_DCI_TDD_1(TYPE, DCI, PROGRAN_DCI) \
((TYPE*)DCI)->harq_pid = PROGRAN_DCI->harq_process; \
((TYPE*)DCI)->rv = PROGRAN_DCI->rv[0]; \
((TYPE*)DCI)->dai = PROGRAN_DCI->dai; \
((TYPE*)DCI)->rballoc = PROGRAN_DCI->rb_bitmap; \
((TYPE*)DCI)->rah = PROGRAN_DCI->res_alloc; \
((TYPE*)DCI)->mcs = PROGRAN_DCI->mcs[0]; \
((TYPE*)DCI)->TPC = PROGRAN_DCI->tpc; \
((TYPE*)DCI)->ndi = PROGRAN_DCI->ndi[0];
#endif
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