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
alex037yang
OpenXG-RAN
Commits
aacf75b2
Commit
aacf75b2
authored
Feb 24, 2021
by
rmagueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transmission and reception of a fake RA-Msg4
parent
48811d0f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
756 additions
and
35 deletions
+756
-35
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
+3
-2
openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
+21
-7
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+61
-19
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+633
-2
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+19
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+4
-5
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+15
-0
No files found.
openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c
View file @
aacf75b2
...
@@ -481,6 +481,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
...
@@ -481,6 +481,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
// start contention resolution timer
// start contention resolution timer
ra
->
RA_contention_resolution_cnt
=
(
nr_rach_ConfigCommon
->
ra_ContentionResolutionTimer
+
1
)
*
8
;
ra
->
RA_contention_resolution_cnt
=
(
nr_rach_ConfigCommon
->
ra_ContentionResolutionTimer
+
1
)
*
8
;
ra
->
RA_contention_resolution_timer_active
=
1
;
ra
->
RA_contention_resolution_timer_active
=
1
;
ra
->
ra_state
=
WAIT_CONTENTION_RESOLUTION
;
}
}
...
@@ -536,7 +537,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
...
@@ -536,7 +537,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
}
}
}
}
if
(
prach_resources
->
init_msg1
)
{
if
(
prach_resources
->
init_msg1
&&
ra
->
ra_state
!=
RA_SUCCEEDED
)
{
if
(
ra
->
RA_active
==
0
)
{
if
(
ra
->
RA_active
==
0
)
{
/* RA not active - checking if RRC is ready to initiate the RA procedure */
/* RA not active - checking if RRC is ready to initiate the RA procedure */
...
@@ -625,7 +626,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
...
@@ -625,7 +626,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
if
(
ra
->
RA_window_cnt
>=
0
&&
ra
->
RA_RAPID_found
==
1
)
{
if
(
ra
->
RA_window_cnt
>=
0
&&
ra
->
RA_RAPID_found
==
1
)
{
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
nr_ra_succeeded
(
mod_id
,
frame
,
nr_slot_tx
);
//
nr_ra_succeeded(mod_id, frame, nr_slot_tx);
}
else
if
(
ra
->
RA_window_cnt
==
0
&&
!
ra
->
RA_RAPID_found
)
{
}
else
if
(
ra
->
RA_window_cnt
==
0
&&
!
ra
->
RA_RAPID_found
)
{
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
View file @
aacf75b2
...
@@ -153,6 +153,16 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
...
@@ -153,6 +153,16 @@ void config_dci_pdu(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_dci_dl_pdu_rel15_t
case
NR_RNTI_CS
:
case
NR_RNTI_CS
:
break
;
break
;
case
NR_RNTI_TC
:
case
NR_RNTI_TC
:
// we use the initial DL BWP
sps
=
initialDownlinkBWP
->
genericParameters
.
cyclicPrefix
==
NULL
?
14
:
12
;
monitoringSymbolsWithinSlot
=
(
ss
->
monitoringSymbolsWithinSlot
->
buf
[
0
]
<<
(
sps
-
8
))
|
(
ss
->
monitoringSymbolsWithinSlot
->
buf
[
1
]
>>
(
16
-
sps
));
rel15
->
rnti
=
ra
->
t_crnti
;
//rel15->BWPSize = NRRIV2BW(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
//rel15->BWPStart = NRRIV2PRBOFFSET(initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
rel15
->
BWPSize
=
NRRIV2BW
(
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
rel15
->
BWPStart
=
NRRIV2PRBOFFSET
(
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
rel15
->
SubcarrierSpacing
=
initialDownlinkBWP
->
genericParameters
.
subcarrierSpacing
;
rel15
->
dci_length_options
[
0
]
=
nr_dci_size
(
scc
,
mac
->
scg
,
def_dci_pdu_rel15
,
rel15
->
dci_format_options
[
0
],
NR_RNTI_TC
,
rel15
->
BWPSize
,
bwp_id
);
break
;
break
;
case
NR_RNTI_SP_CSI
:
case
NR_RNTI_SP_CSI
:
break
;
break
;
...
@@ -245,14 +255,18 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
...
@@ -245,14 +255,18 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
if
(
ss
->
searchSpaceId
==
*
pdcch_ConfigCommon
->
choice
.
setup
->
ra_SearchSpace
){
if
(
ss
->
searchSpaceId
==
*
pdcch_ConfigCommon
->
choice
.
setup
->
ra_SearchSpace
){
switch
(
ra
->
ra_state
){
switch
(
ra
->
ra_state
){
case
WAIT_RAR
:
case
WAIT_RAR
:
LOG_D
(
MAC
,
"[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space
\n
"
);
LOG_D
(
NR_MAC
,
"[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg2)
\n
"
);
rel15
->
num_dci_options
=
1
;
rel15
->
num_dci_options
=
1
;
rel15
->
dci_format_options
[
0
]
=
NR_DL_DCI_FORMAT_1_0
;
rel15
->
dci_format_options
[
0
]
=
NR_DL_DCI_FORMAT_1_0
;
config_dci_pdu
(
mac
,
rel15
,
dl_config
,
NR_RNTI_RA
,
ss_id
);
config_dci_pdu
(
mac
,
rel15
,
dl_config
,
NR_RNTI_RA
,
ss_id
);
fill_dci_search_candidates
(
ss
,
rel15
);
fill_dci_search_candidates
(
ss
,
rel15
);
break
;
break
;
case
WAIT_CONTENTION_RESOLUTION
:
case
WAIT_CONTENTION_RESOLUTION
:
LOG_E
(
MAC
,
"In %s: CB-RA not implemented yet. Should not have fallen in this case.
\n
"
,
__FUNCTION__
);
LOG_D
(
NR_MAC
,
"[DCI_CONFIG] Configure monitoring of PDCCH candidates in Type1-PDCCH common random access search space (RA-Msg4)
\n
"
);
rel15
->
num_dci_options
=
1
;
rel15
->
dci_format_options
[
0
]
=
NR_DL_DCI_FORMAT_1_0
;
config_dci_pdu
(
mac
,
rel15
,
dl_config
,
NR_RNTI_TC
,
ss_id
);
fill_dci_search_candidates
(
ss
,
rel15
);
break
;
break
;
default:
default:
break
;
break
;
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
aacf75b2
...
@@ -73,10 +73,10 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){
...
@@ -73,10 +73,10 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){
if
(
rnti
==
ra
->
ra_rnti
)
{
if
(
rnti
==
ra
->
ra_rnti
)
{
rnti_type
=
NR_RNTI_RA
;
rnti_type
=
NR_RNTI_RA
;
}
else
if
(
rnti
==
ra
->
t_crnti
&&
ra
->
ra_state
==
WAIT_CONTENTION_RESOLUTION
)
{
rnti_type
=
NR_RNTI_TC
;
}
else
if
(
rnti
==
mac
->
crnti
)
{
}
else
if
(
rnti
==
mac
->
crnti
)
{
rnti_type
=
NR_RNTI_C
;
rnti_type
=
NR_RNTI_C
;
}
else
if
(
rnti
==
ra
->
t_crnti
)
{
rnti_type
=
NR_RNTI_TC
;
}
else
if
(
rnti
==
0xFFFE
)
{
}
else
if
(
rnti
==
0xFFFE
)
{
rnti_type
=
NR_RNTI_P
;
rnti_type
=
NR_RNTI_P
;
}
else
if
(
rnti
==
0xFFFF
)
{
}
else
if
(
rnti
==
0xFFFF
)
{
...
@@ -515,9 +515,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -515,9 +515,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
// Config PUSCH PDU
// Config PUSCH PDU
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
if
(
ret
!=
-
1
&&
ra
->
RA_active
&&
mac
->
crnti
){
//
if (ret != -1 && ra->RA_active && mac->crnti){
nr_ra_succeeded
(
module_id
,
frame
,
slot
);
//
nr_ra_succeeded(module_id, frame, slot);
}
//
}
}
}
...
@@ -578,9 +578,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -578,9 +578,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
// Config PUSCH PDU
// Config PUSCH PDU
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
ret
=
nr_config_pusch_pdu
(
mac
,
pusch_config_pdu
,
dci
,
NULL
,
rnti
,
&
dci_format
);
if
(
ret
!=
-
1
&&
ra
->
RA_active
&&
mac
->
crnti
){
//
if (ret != -1 && ra->RA_active && mac->crnti){
nr_ra_succeeded
(
module_id
,
frame
,
slot
);
//
nr_ra_succeeded(module_id, frame, slot);
}
//
}
}
}
...
@@ -661,6 +661,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -661,6 +661,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
dlsch_config_pdu_1_0
->
BWPStart
=
NRRIV2PRBOFFSET
(
mac
->
DLbwp
[
0
]
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
dlsch_config_pdu_1_0
->
BWPStart
=
NRRIV2PRBOFFSET
(
mac
->
DLbwp
[
0
]
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
dlsch_config_pdu_1_0
->
SubcarrierSpacing
=
mac
->
DLbwp
[
0
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
dlsch_config_pdu_1_0
->
SubcarrierSpacing
=
mac
->
DLbwp
[
0
]
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
BWPSize
=
n_RB_DLBWP
;
BWPSize
=
n_RB_DLBWP
;
if
(
pdsch_config
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_AdditionalPosition
==
NULL
)
pdsch_config
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_AdditionalPosition
=
calloc
(
1
,
sizeof
(
*
pdsch_config
->
dmrs_DownlinkForPDSCH_MappingTypeA
->
choice
.
setup
->
dmrs_AdditionalPosition
));
}
}
/* IDENTIFIER_DCI_FORMATS */
/* IDENTIFIER_DCI_FORMATS */
...
@@ -770,6 +773,13 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
...
@@ -770,6 +773,13 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
LOG_D
(
MAC
,
"(nr_ue_procedures.c) pdu_type=%d
\n\n
"
,
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
);
LOG_D
(
MAC
,
"(nr_ue_procedures.c) pdu_type=%d
\n\n
"
,
dl_config
->
dl_config_list
[
dl_config
->
number_pdus
].
pdu_type
);
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
dl_config
->
number_pdus
=
dl_config
->
number_pdus
+
1
;
// FIXME: Remove this
if
(
ra
->
ra_state
==
WAIT_CONTENTION_RESOLUTION
&&
rnti
==
ra
->
t_crnti
){
LOG_I
(
NR_MAC
,
"RA-Msg4 was received
\n
"
);
nr_ra_succeeded
(
module_id
,
frame
,
slot
);
}
break
;
break
;
}
}
...
@@ -1105,7 +1115,6 @@ int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){
...
@@ -1105,7 +1115,6 @@ int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){
int
N_RB
=
0
,
start_RB
;
int
N_RB
=
0
,
start_RB
;
switch
(
rnti_type
)
{
switch
(
rnti_type
)
{
case
NR_RNTI_RA
:
case
NR_RNTI_RA
:
case
NR_RNTI_TC
:
case
NR_RNTI_P
:
{
case
NR_RNTI_P
:
{
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
NR_BWP_Id_t
dl_bwp_id
=
mac
->
DL_BWP_Id
;
if
(
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
pdcch_ConfigCommon
->
choice
.
setup
->
controlResourceSetZero
)
{
if
(
mac
->
DLbwp
[
dl_bwp_id
-
1
]
->
bwp_Common
->
pdcch_ConfigCommon
->
choice
.
setup
->
controlResourceSetZero
)
{
...
@@ -1120,6 +1129,7 @@ int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){
...
@@ -1120,6 +1129,7 @@ int get_n_rb(NR_UE_MAC_INST_t *mac, int rnti_type){
case
NR_RNTI_SI
:
case
NR_RNTI_SI
:
N_RB
=
mac
->
type0_PDCCH_CSS_config
.
num_rbs
;
N_RB
=
mac
->
type0_PDCCH_CSS_config
.
num_rbs
;
break
;
break
;
case
NR_RNTI_TC
:
case
NR_RNTI_C
:
case
NR_RNTI_C
:
N_RB
=
NRRIV2BW
(
mac
->
DLbwp
[
0
]
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
N_RB
=
NRRIV2BW
(
mac
->
DLbwp
[
0
]
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
break
;
break
;
...
@@ -1392,39 +1402,71 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
...
@@ -1392,39 +1402,71 @@ uint8_t nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
break
;
break
;
case
NR_RNTI_TC
:
case
NR_RNTI_TC
:
// indicating a DL DCI format 1bit
// indicating a DL DCI format - 1 bit
pos
++
;
pos
++
;
dci_pdu_rel15
->
format_indicator
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
1
;
dci_pdu_rel15
->
format_indicator
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
1
;
// Freq domain assignment 0-16 bit
// Freq domain assignment 0-16 bit
fsize
=
(
int
)
ceil
(
log2
(
(
N_RB
*
(
N_RB
+
1
))
>>
1
)
);
fsize
=
(
int
)
ceil
(
log2
(
(
N_RB
*
(
N_RB
+
1
))
>>
1
)
);
pos
+=
fsize
;
pos
+=
fsize
;
dci_pdu_rel15
->
frequency_domain_assignment
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
((
1
<<
fsize
)
-
1
);
dci_pdu_rel15
->
frequency_domain_assignment
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
((
1
<<
fsize
)
-
1
);
// Time domain assignment 4 bit
// Time domain assignment - 4 bits
pos
+=
4
;
pos
+=
4
;
dci_pdu_rel15
->
time_domain_assignment
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
0xf
;
dci_pdu_rel15
->
time_domain_assignment
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
0xf
;
// VRB to PRB mapping 1 bit
// VRB to PRB mapping - 1 bit
pos
++
;
dci_pdu_rel15
->
vrb_to_prb_mapping
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
1
;
dci_pdu_rel15
->
vrb_to_prb_mapping
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
1
;
// MCS 5bit //bit over 32, so dci_pdu ++
// MCS 5bit //bit over 32, so dci_pdu ++
pos
+=
5
;
pos
+=
5
;
dci_pdu_rel15
->
mcs
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
0x1f
;
dci_pdu_rel15
->
mcs
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
0x1f
;
// New data indicator 1bit
// New data indicator - 1 bit
pos
++
;
dci_pdu_rel15
->
ndi
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
1
;
dci_pdu_rel15
->
ndi
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
1
;
// Redundancy version 2bit
// Redundancy version - 2 bits
pos
+=
2
;
pos
+=
2
;
dci_pdu_rel15
->
rv
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
3
;
dci_pdu_rel15
->
rv
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
3
;
// HARQ process number 4bit
// HARQ process number - 4 bits
pos
+=
4
;
pos
+=
4
;
dci_pdu_rel15
->
harq_pid
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
0xf
;
dci_pdu_rel15
->
harq_pid
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
0xf
;
// Downlink assignment index E2 bits
// Downlink assignment index - 2 bits
pos
+=
2
;
pos
+=
2
;
dci_pdu_rel15
->
dai
[
0
].
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
3
;
dci_pdu_rel15
->
dai
[
0
].
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
3
;
// TPC command for scheduled PUCCH E2 bits
// TPC command for scheduled PUCCH - 2 bits
pos
+=
2
;
pos
+=
2
;
dci_pdu_rel15
->
tpc
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
3
;
dci_pdu_rel15
->
tpc
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
3
;
// PDSCH-to-HARQ_feedback timing indicator E3 bits
// PUCCH resource indicator - 3 bits
pos
+=
3
;
dci_pdu_rel15
->
pucch_resource_indicator
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
7
;
// PDSCH-to-HARQ_feedback timing indicator - 3 bits
pos
+=
3
;
pos
+=
3
;
dci_pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
7
;
dci_pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
.
val
=
(
*
dci_pdu
>>
(
dci_size
-
pos
))
&
7
;
LOG_D
(
NR_MAC
,
"N_RB = %i
\n
"
,
N_RB
);
LOG_D
(
NR_MAC
,
"dci_size = %i
\n
"
,
dci_size
);
LOG_D
(
NR_MAC
,
"fsize = %i
\n
"
,
fsize
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->format_indicator = %i
\n
"
,
dci_pdu_rel15
->
format_indicator
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->frequency_domain_assignment.val = %i
\n
"
,
dci_pdu_rel15
->
frequency_domain_assignment
.
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->time_domain_assignment.val = %i
\n
"
,
dci_pdu_rel15
->
time_domain_assignment
.
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->vrb_to_prb_mapping.val = %i
\n
"
,
dci_pdu_rel15
->
vrb_to_prb_mapping
.
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->mcs = %i
\n
"
,
dci_pdu_rel15
->
mcs
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->rv = %i
\n
"
,
dci_pdu_rel15
->
rv
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->harq_pid = %i
\n
"
,
dci_pdu_rel15
->
harq_pid
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->dai[0].val = %i
\n
"
,
dci_pdu_rel15
->
dai
[
0
].
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->tpc = %i
\n
"
,
dci_pdu_rel15
->
tpc
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->pucch_resource_indicator = %i
\n
"
,
dci_pdu_rel15
->
pucch_resource_indicator
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val = %i
\n
"
,
dci_pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
.
val
);
break
;
break
;
}
}
break
;
break
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
aacf75b2
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
aacf75b2
...
@@ -1131,6 +1131,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
...
@@ -1131,6 +1131,7 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
break
;
break
;
case
NR_RNTI_TC
:
case
NR_RNTI_TC
:
pos
=
1
;
// indicating a DL DCI format 1bit
// indicating a DL DCI format 1bit
*
dci_pdu
|=
((
uint64_t
)
dci_pdu_rel15
->
format_indicator
&
1
)
<<
(
dci_size
-
pos
++
);
*
dci_pdu
|=
((
uint64_t
)
dci_pdu_rel15
->
format_indicator
&
1
)
<<
(
dci_size
-
pos
++
);
// Freq domain assignment 0-16 bit
// Freq domain assignment 0-16 bit
...
@@ -1159,9 +1160,27 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
...
@@ -1159,9 +1160,27 @@ void fill_dci_pdu_rel15(const NR_ServingCellConfigCommon_t *scc,
// TPC command for scheduled PUCCH – 2 bits
// TPC command for scheduled PUCCH – 2 bits
for
(
int
i
=
0
;
i
<
2
;
i
++
)
for
(
int
i
=
0
;
i
<
2
;
i
++
)
*
dci_pdu
|=
(((
uint64_t
)
dci_pdu_rel15
->
tpc
>>
(
1
-
i
))
&
1
)
<<
(
dci_size
-
pos
++
);
*
dci_pdu
|=
(((
uint64_t
)
dci_pdu_rel15
->
tpc
>>
(
1
-
i
))
&
1
)
<<
(
dci_size
-
pos
++
);
// PUCCH resource indicator – 3 bits
for
(
int
i
=
0
;
i
<
3
;
i
++
)
*
dci_pdu
|=
(((
uint64_t
)
dci_pdu_rel15
->
pucch_resource_indicator
>>
(
2
-
i
))
&
1
)
<<
(
dci_size
-
pos
++
);
// PDSCH-to-HARQ_feedback timing indicator – 3 bits
// PDSCH-to-HARQ_feedback timing indicator – 3 bits
for
(
int
i
=
0
;
i
<
3
;
i
++
)
for
(
int
i
=
0
;
i
<
3
;
i
++
)
*
dci_pdu
|=
(((
uint64_t
)
dci_pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
.
val
>>
(
2
-
i
))
&
1
)
<<
(
dci_size
-
pos
++
);
*
dci_pdu
|=
(((
uint64_t
)
dci_pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
.
val
>>
(
2
-
i
))
&
1
)
<<
(
dci_size
-
pos
++
);
LOG_D
(
NR_MAC
,
"N_RB = %i
\n
"
,
N_RB
);
LOG_D
(
NR_MAC
,
"dci_size = %i
\n
"
,
dci_size
);
LOG_D
(
NR_MAC
,
"fsize = %i
\n
"
,
fsize
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->format_indicator = %i
\n
"
,
dci_pdu_rel15
->
format_indicator
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->frequency_domain_assignment.val = %i
\n
"
,
dci_pdu_rel15
->
frequency_domain_assignment
.
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->time_domain_assignment.val = %i
\n
"
,
dci_pdu_rel15
->
time_domain_assignment
.
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->vrb_to_prb_mapping.val = %i
\n
"
,
dci_pdu_rel15
->
vrb_to_prb_mapping
.
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->mcs = %i
\n
"
,
dci_pdu_rel15
->
mcs
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->rv = %i
\n
"
,
dci_pdu_rel15
->
rv
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->harq_pid = %i
\n
"
,
dci_pdu_rel15
->
harq_pid
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->dai[0].val = %i
\n
"
,
dci_pdu_rel15
->
dai
[
0
].
val
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->tpc = %i
\n
"
,
dci_pdu_rel15
->
tpc
);
LOG_D
(
NR_MAC
,
"dci_pdu_rel15->pdsch_to_harq_feedback_timing_indicator.val = %i
\n
"
,
dci_pdu_rel15
->
pdsch_to_harq_feedback_timing_indicator
.
val
);
break
;
break
;
}
}
break
;
break
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
aacf75b2
...
@@ -490,12 +490,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
...
@@ -490,12 +490,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
UE_info
->
UE_sched_ctrl
[
UE_id
].
ta_frame
=
frameP
;
UE_info
->
UE_sched_ctrl
[
UE_id
].
ta_frame
=
frameP
;
free
(
ra
->
preambles
.
preamble_list
);
free
(
ra
->
preambles
.
preamble_list
);
ra
->
state
=
RA_IDLE
;
LOG_I
(
NR_MAC
,
"reset RA state information for RA-RNTI %04x/index %d
\n
"
,
ra
->
rnti
,
i
);
ra
->
state
=
Msg4
;
ra
->
Msg4_frame
=
(
frameP
+
2
)
%
1024
;
ra
->
Msg4_slot
=
1
;
LOG_I
(
MAC
,
"set RA state to Msg4 for RA-RNTI %04x, msg4 frame %d %d
\n
"
,
ra
->
rnti
,
ra
->
Msg4_frame
,
ra
->
Msg4_slot
);
return
;
return
;
}
}
}
}
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
aacf75b2
...
@@ -347,12 +347,27 @@ void config_nr_mib(int Mod_idP,
...
@@ -347,12 +347,27 @@ void config_nr_mib(int Mod_idP,
int
cellBarred
,
int
cellBarred
,
int
intraFreqReselection
);
int
intraFreqReselection
);
int
nr_write_ce_dlsch_pdu
(
module_id_t
module_idP
,
const
NR_UE_sched_ctrl_t
*
ue_sched_ctl
,
unsigned
char
*
mac_pdu
,
unsigned
char
drx_cmd
,
unsigned
char
*
ue_cont_res_id
);
void
nr_generate_Msg2
(
module_id_t
module_idP
,
void
nr_generate_Msg2
(
module_id_t
module_idP
,
int
CC_id
,
int
CC_id
,
frame_t
frameP
,
frame_t
frameP
,
sub_frame_t
slotP
);
sub_frame_t
slotP
);
void
nr_generate_Msg4
(
module_id_t
module_idP
,
int
CC_id
,
frame_t
frameP
,
sub_frame_t
slotP
);
void
nr_check_Msg4_Ack
(
module_id_t
module_id
,
int
CC_id
,
frame_t
frame
,
sub_frame_t
slot
);
void
nr_process_mac_pdu
(
void
nr_process_mac_pdu
(
module_id_t
module_idP
,
module_id_t
module_idP
,
rnti_t
rnti
,
rnti_t
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