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
canghaiwuhen
OpenXG-RAN
Commits
0ead4bdb
Commit
0ead4bdb
authored
Feb 25, 2019
by
Louis Adrien Dufrene
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some format for eNB_scheduler_RA.c and rar_tools.c + some fix in RAR PDU
parent
a3d3b0cd
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
206 additions
and
135 deletions
+206
-135
openair2/LAYER2/MAC/eNB_scheduler_RA.c
openair2/LAYER2/MAC/eNB_scheduler_RA.c
+131
-86
openair2/LAYER2/MAC/rar_tools.c
openair2/LAYER2/MAC/rar_tools.c
+75
-49
No files found.
openair2/LAYER2/MAC/eNB_scheduler_RA.c
View file @
0ead4bdb
This diff is collapsed.
Click to expand it.
openair2/LAYER2/MAC/rar_tools.c
View file @
0ead4bdb
...
...
@@ -110,98 +110,124 @@ fill_rar(const module_id_t module_idP,
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
//------------------------------------------------------------------------------
/*
* Fill the RAR buffer (header + PDU) for LTE-M devices
*/
unsigned
short
fill_rar_br
(
eNB_MAC_INST
*
eNB
,
int
CC_id
,
RA_t
*
ra
,
const
frame_t
frameP
,
const
sub_frame_t
subframeP
,
uint8_t
*
const
dlsch_buffer
,
const
uint8_t
ce_level
)
int
CC_id
,
RA_t
*
ra
,
const
frame_t
frameP
,
const
sub_frame_t
subframeP
,
uint8_t
*
const
dlsch_buffer
,
const
uint8_t
ce_level
)
//------------------------------------------------------------------------------
{
RA_HEADER_RAPID
*
rarh
=
(
RA_HEADER_RAPID
*
)
dlsch_buffer
;
RA_HEADER_RAPID
*
rarh
=
(
RA_HEADER_RAPID
*
)
dlsch_buffer
;
COMMON_channels_t
*
cc
=
&
eNB
->
common_channels
[
CC_id
];
uint8_t
*
rar
=
(
uint8_t
*
)(
dlsch_buffer
+
1
);
uint32_t
rballoc
,
reps
;
uint32_t
TPC
,
ULdelay
,
cqireq
,
mpdcch_nb_index
;
int
input_buffer_length
;
uint8_t
*
rar
=
(
uint8_t
*
)(
dlsch_buffer
+
1
);
uint32_t
rballoc
=
0
;
uint32_t
reps
=
0
;
uint32_t
ULdelay
=
0
;
uint32_t
cqireq
=
0
;
uint32_t
mpdcch_nb_index
=
0
;
uint32_t
TPC
=
0
;
int
input_buffer_length
=
0
;
int
N_NB_index
=
0
;
AssertFatal
(
ra
!=
NULL
,
"RA is null
\n
"
);
/
/ subheader fixed
/
* Subheader fixed */
rarh
->
E
=
0
;
// First and last RAR
rarh
->
T
=
1
;
// 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader
rarh
->
RAPID
=
ra
->
preamble_index
;
// Respond to Preamble 0 only for the moment
ra
->
timing_offset
/=
16
;
//T_A = N_TA/16, where N_TA should be on a 30.72Msps
rar
[
0
]
=
(
uint8_t
)
(
ra
->
timing_offset
>>
(
2
+
4
));
// 7 MSBs of timing advance + divide by 4
rar
[
1
]
=
(
uint8_t
)
(
ra
->
timing_offset
<<
(
4
-
2
))
&
0xf0
;
// 4 LSBs of timing advance + divide by 4
int
N_NB_index
;
rarh
->
RAPID
=
ra
->
preamble_index
;
// Respond to Preamble
/* RAR PDU */
/* TA Command */
ra
->
timing_offset
/=
16
;
// T_A = N_TA/16, where N_TA should be on a 30.72Msps
rar
[
0
]
=
(
uint8_t
)
(
ra
->
timing_offset
>>
4
)
&
0x7f
;
// 7 MSBs of timing advance
rar
[
1
]
=
(
uint8_t
)
(
ra
->
timing_offset
&
0x0f
)
<<
4
;
// 4 LSBs of timing advance
/
/ Copy the Msg2 narrowband
/
* Copy the Msg2 narrowband */
ra
->
msg34_narrowband
=
ra
->
msg2_narrowband
;
ra
->
msg3_first_rb
=
0
;
ra
->
msg3_nb_rb
=
2
;
if
(
ce_level
<
2
)
{
//CE Level 0,1, CEmodeA
if
(
ce_level
<
2
)
{
// CE Level 0, 1 (CEmodeA)
input_buffer_length
=
6
;
N_NB_index
=
get_numnarrowbandbits
(
cc
->
mib
->
message
.
dl_Bandwidth
);
rar
[
4
]
=
(
uint8_t
)(
ra
->
rnti
>>
8
);
rar
[
5
]
=
(
uint8_t
)(
ra
->
rnti
&
0xff
);
//cc->ra[ra_idx].timing_offset = 0;
/* UL Grant */
reps
=
0
;
ra
->
msg3_mcs
=
7
;
TPC
=
3
;
// no power increase
ULdelay
=
0
;
cqireq
=
0
;
mpdcch_nb_index
=
0
;
rballoc
=
mac_computeRIV
(
6
,
ra
->
msg3_first_rb
,
ra
->
msg3_nb_rb
);
rballoc
=
mac_computeRIV
(
6
,
ra
->
msg3_first_rb
,
ra
->
msg3_nb_rb
);
uint32_t
buffer
=
0
;
buffer
|=
ra
->
msg34_narrowband
<<
(
16
+
(
4
-
N_NB_index
));
buffer
|=
((
rballoc
&
0x
F
F
)
<<
(
12
+
(
4
-
N_NB_index
)));
buffer
|=
((
rballoc
&
0x
0
F
)
<<
(
12
+
(
4
-
N_NB_index
)));
buffer
|=
((
reps
&
0x03
)
<<
(
10
+
(
4
-
N_NB_index
)));
buffer
|=
((
ra
->
msg3_mcs
&
0x07
)
<<
(
7
+
(
4
-
N_NB_index
)));
buffer
|=
((
TPC
&
0x07
)
<<
(
4
+
(
4
-
N_NB_index
)));
buffer
|=
((
cqireq
&
0x01
)
<<
(
3
+
(
4
-
N_NB_index
)));
buffer
|=
((
ULdelay
&
0x01
)
<<
(
2
+
(
4
-
N_NB_index
)));
buffer
|=
(
mpdcch_nb_index
<<
(
4
-
N_NB_index
));
rar
[
1
]
=
(
buffer
>>
16
)
&
0x0F
;
rar
[
2
]
=
(
buffer
>>
8
)
&
0xFF
;
rar
[
3
]
=
buffer
&
0xFF
;
}
else
{
// CE level 2,3 => CEModeB
AssertFatal
(
1
==
0
,
"Shouldn't get here ...
\n
"
);
input_buffer_length
=
5
;
rar
[
1
]
|=
(
uint8_t
)
(
buffer
>>
16
)
&
0x0F
;
rar
[
2
]
=
(
uint8_t
)
(
buffer
>>
8
)
&
0xFF
;
rar
[
3
]
=
(
uint8_t
)
buffer
&
0xFF
;
/* RA CRNTI */
rar
[
4
]
=
(
uint8_t
)(
ra
->
rnti
>>
8
);
rar
[
5
]
=
(
uint8_t
)(
ra
->
rnti
&
0xff
);
}
else
{
// CE level 2, 3 (CEModeB)
rar
[
3
]
=
(
uint8_t
)(
ra
->
rnti
>>
8
);
rar
[
4
]
=
(
uint8_t
)(
ra
->
rnti
&
0xff
);
AssertFatal
(
1
==
0
,
"Shouldn't get here ...
\n
"
);
input_buffer_length
=
5
;
rar
[
3
]
=
(
uint8_t
)(
ra
->
rnti
>>
8
);
rar
[
4
]
=
(
uint8_t
)(
ra
->
rnti
&
0xff
);
}
LOG_I
(
MAC
,
"[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d
\n
"
,
frameP
,
subframeP
,
*
(
uint8_t
*
)
rarh
,
rar
[
0
],
rar
[
1
],
rar
[
2
],
rar
[
3
],
rar
[
4
],
rar
[
5
],
LOG_I
(
MAC
,
"[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x, preamble %d/%d, TIMING OFFSET %d
\n
"
,
frameP
,
subframeP
,
*
(
uint8_t
*
)
rarh
,
rar
[
0
],
rar
[
1
],
rar
[
2
],
rar
[
3
],
rar
[
4
],
rar
[
5
],
ce_level
,
ra
->
rnti
,
rarh
->
RAPID
,
ra
->
preamble_index
,
rarh
->
RAPID
,
ra
->
preamble_index
,
ra
->
timing_offset
);
if
(
opt_enabled
)
{
trace_pdu
(
DIRECTION_DOWNLINK
,
dlsch_buffer
,
input_buffer_length
,
eNB
->
Mod_id
,
WS_RA_RNTI
,
1
,
eNB
->
frame
,
eNB
->
subframe
,
0
,
0
);
LOG_D
(
OPT
,
"[RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d
\n
"
,
frameP
,
ra
->
rnti
,
rarh
->
RAPID
,
input_buffer_length
);
trace_pdu
(
DIRECTION_DOWNLINK
,
dlsch_buffer
,
input_buffer_length
,
eNB
->
Mod_id
,
WS_RA_RNTI
,
1
,
eNB
->
frame
,
eNB
->
subframe
,
0
,
0
);
LOG_D
(
OPT
,
"[RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d
\n
"
,
frameP
,
ra
->
rnti
,
rarh
->
RAPID
,
input_buffer_length
);
}
return
(
ra
->
rnti
);
...
...
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