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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
6a16fe9e
Commit
6a16fe9e
authored
Feb 25, 2021
by
rmagueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues caused by merge of branch develop
parent
cf70265b
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
119 additions
and
110 deletions
+119
-110
openair1/PHY/defs_gNB.h
openair1/PHY/defs_gNB.h
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+1
-0
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+3
-3
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+107
-100
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+3
-2
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+1
-1
No files found.
openair1/PHY/defs_gNB.h
View file @
6a16fe9e
...
...
@@ -655,7 +655,7 @@ typedef struct {
int
prach_I0
;
}
PHY_MEASUREMENTS_gNB
;
#define
TOTAL
_NUM_NR_PRACH_PREAMBLES 64
#define
MAX
_NUM_NR_PRACH_PREAMBLES 64
#define MAX_NUM_NR_RX_RACH_PDUS 4
#define MAX_NUM_NR_RX_PRACH_PREAMBLES 4
#define MAX_UL_PDUS_PER_SLOT 8
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
6a16fe9e
...
...
@@ -783,7 +783,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
// FIXME: Remove this
if
(
ra
->
ra_state
==
WAIT_CONTENTION_RESOLUTION
&&
rnti
==
ra
->
t_crnti
){
LOG_I
(
NR_MAC
,
"RA-Msg4
was
received
\n
"
);
LOG_I
(
NR_MAC
,
"RA-Msg4 received
\n
"
);
nr_ra_succeeded
(
module_id
,
frame
,
slot
);
}
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
6a16fe9e
...
...
@@ -895,6 +895,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
for
(
int
k
=
0
;
k
<
TBS_bytes
;
k
++
)
{
LOG_D
(
NR_MAC
,
"(%i): 0x%x
\n
"
,
k
,
mac
->
ulsch_pdu
.
payload
[
k
]);
}
LOG_I
(
NR_MAC
,
"[RAPROC] RA-Msg3 transmitted
\n
"
);
}
else
{
if
(
IS_SOFTMODEM_NOS1
&&
(
mac
->
UL_ndi
[
ulcfg_pdu
->
pusch_config_pdu
.
pusch_data
.
harq_process_id
]
!=
ulcfg_pdu
->
pusch_config_pdu
.
pusch_data
.
new_data_indicator
)){
// Getting IP traffic to be transmitted
...
...
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
6a16fe9e
...
...
@@ -436,9 +436,9 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
}
else
{
ra
->
cfra
=
false
;
ra
->
rnti
=
rnti
;
ra
->
preambles
.
num_preambles
=
TOTAL
_NUM_NR_PRACH_PREAMBLES
;
ra
->
preambles
.
preamble_list
=
(
uint8_t
*
)
malloc
(
TOTAL
_NUM_NR_PRACH_PREAMBLES
*
sizeof
(
uint8_t
));
for
(
int
i
=
0
;
i
<
TOTAL
_NUM_NR_PRACH_PREAMBLES
;
i
++
)
ra
->
preambles
.
num_preambles
=
MAX
_NUM_NR_PRACH_PREAMBLES
;
ra
->
preambles
.
preamble_list
=
(
uint8_t
*
)
malloc
(
MAX
_NUM_NR_PRACH_PREAMBLES
*
sizeof
(
uint8_t
));
for
(
int
i
=
0
;
i
<
MAX
_NUM_NR_PRACH_PREAMBLES
;
i
++
)
ra
->
preambles
.
preamble_list
[
i
]
=
i
;
}
LOG_I
(
PHY
,
"Added new RA process for UE RNTI %04x with initial secondaryCellGroup
\n
"
,
rnti
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
6a16fe9e
...
...
@@ -65,7 +65,7 @@ int16_t ssb_index_from_prach(module_id_t module_idP,
uint8_t
config_index
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
->
choice
.
setup
->
rach_ConfigGeneric
.
prach_ConfigurationIndex
;
uint8_t
fdm
=
cfg
->
prach_config
.
num_prach_fd_occasions
.
value
;
uint8_t
total_RApreambles
=
64
;
uint8_t
total_RApreambles
=
MAX_NUM_NR_PRACH_PREAMBLES
;
if
(
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
->
choice
.
setup
->
totalNumberOfRA_Preambles
!=
NULL
)
total_RApreambles
=
*
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
rach_ConfigCommon
->
choice
.
setup
->
totalNumberOfRA_Preambles
;
...
...
@@ -520,7 +520,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC
,
1
);
LOG_
I
(
MAC
,
LOG_
D
(
MAC
,
"[gNB %d][RAPROC] CC_id %d Frame %d, Slot %d Initiating RA procedure for preamble index %d
\n
"
,
module_idP
,
CC_id
,
...
...
@@ -542,7 +542,6 @@ void nr_initiate_ra_proc(module_id_t module_idP,
continue
;
// if the PRACH preamble does not correspond to any of the ones sent through RRC abort RA proc
}
}
int
loop
=
0
;
LOG_D
(
MAC
,
"Frame %d, Slot %d: Activating RA process
\n
"
,
frameP
,
slotP
);
ra
->
state
=
Msg2
;
ra
->
timing_offset
=
timing_offset
;
...
...
@@ -574,7 +573,11 @@ void nr_initiate_ra_proc(module_id_t module_idP,
ra
->
Msg2_frame
=
msg2_frame
;
ra
->
Msg2_slot
=
msg2_slot
;
LOG_I
(
MAC
,
"%s() Msg2[%04d%d] SFN/SF:%04d%d
\n
"
,
__FUNCTION__
,
ra
->
Msg2_frame
,
ra
->
Msg2_slot
,
frameP
,
slotP
);
LOG_D
(
MAC
,
"%s() Msg2[%04d%d] SFN/SF:%04d%d
\n
"
,
__FUNCTION__
,
ra
->
Msg2_frame
,
ra
->
Msg2_slot
,
frameP
,
slotP
);
// TODO: Configure RRC with the new RNTI of the following commented lines
/*
int loop = 0;
if (!ra->cfra) {
do {
ra->rnti = (taus() % 65518) + 1;
...
...
@@ -587,11 +590,13 @@ void nr_initiate_ra_proc(module_id_t module_idP,
abort();
}
}
*/
ra
->
RA_rnti
=
ra_rnti
;
ra
->
preamble_index
=
preamble_index
;
ra
->
beam_id
=
beam_index
;
LOG_
I
(
MAC
,
LOG_
D
(
MAC
,
"[gNB %d][RAPROC] CC_id %d Frame %d Activating Msg2 generation in frame %d, slot %d using RA rnti %x SSB "
"index %u
\n
"
,
module_idP
,
...
...
@@ -610,8 +615,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC
,
0
);
}
void
nr_schedule_RA
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
slotP
)
{
void
nr_schedule_RA
(
module_id_t
module_idP
,
frame_t
frameP
,
sub_frame_t
slotP
)
{
gNB_MAC_INST
*
mac
=
RC
.
nrmac
[
module_idP
];
start_meas
(
&
mac
->
schedule_ra
);
...
...
@@ -636,9 +641,9 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
}
}
stop_meas
(
&
mac
->
schedule_ra
);
}
}
void
nr_get_Msg3alloc
(
module_id_t
module_id
,
void
nr_get_Msg3alloc
(
module_id_t
module_id
,
int
CC_id
,
NR_ServingCellConfigCommon_t
*
scc
,
NR_BWP_Uplink_t
*
ubwp
,
...
...
@@ -674,7 +679,7 @@ void nr_get_Msg3alloc(module_id_t module_id,
else
ra
->
Msg3_frame
=
current_frame
+
(
temp_slot
/
nr_slots_per_frame
[
mu
]);
LOG_I
(
MAC
,
"[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u start symbol index %u
\n
"
,
ra
->
Msg3_slot
,
current_slot
,
ra
->
Msg3_frame
,
k2
,
ra
->
Msg3_tda_id
,
StartSymbolIndex
);
LOG_D
(
MAC
,
"[RAPROC] Msg3 slot %d: current slot %u Msg3 frame %u k2 %u Msg3_tda_id %u start symbol index %u
\n
"
,
ra
->
Msg3_slot
,
current_slot
,
ra
->
Msg3_frame
,
k2
,
ra
->
Msg3_tda_id
,
StartSymbolIndex
);
uint16_t
*
vrb_map_UL
=
&
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
vrb_map_UL
[
ra
->
Msg3_slot
*
MAX_BWP_SIZE
];
const
uint16_t
bwpSize
=
NRRIV2BW
(
ubwp
->
bwp_Common
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
...
...
@@ -824,7 +829,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
gNB_MAC_INST
*
nr_mac
=
RC
.
nrmac
[
module_idP
];
NR_COMMON_channels_t
*
cc
=
&
nr_mac
->
common_channels
[
CC_id
];
NR_RA_t
*
ra
=
&
cc
->
ra
[
0
];
if
((
ra
->
Msg2_frame
==
frameP
)
&&
(
ra
->
Msg2_slot
==
slotP
))
{
...
...
@@ -838,14 +842,31 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
int
time_domain_assignment
=
0
;
uint8_t
nr_of_candidates
=
0
;
uint8_t
aggregation_level
=
0
;
int
rbStart
=
0
;
int
rbSize
=
6
;
uint16_t
*
vrb_map
=
cc
[
CC_id
].
vrb_map
;
NR_SearchSpace_t
*
ss
=
nr_mac
->
sched_ctrlCommon
->
search_space
;
NR_BWP_Downlink_t
*
bwp
=
nr_mac
->
sched_ctrlCommon
->
active_bwp
;
NR_ControlResourceSet_t
*
coreset
=
nr_mac
->
sched_ctrlCommon
->
coreset
;
NR_ServingCellConfigCommon_t
*
scc
=
cc
->
ServingCellConfigCommon
;
long
BWPSize
=
NRRIV2BW
(
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
long
BWPStart
=
NRRIV2PRBOFFSET
(
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
nfapi_nr_dl_tti_request_body_t
*
dl_req
=
&
nr_mac
->
DL_req
[
CC_id
].
dl_tti_request_body
;
for
(
int
i
=
0
;
(
i
<
rbSize
)
&&
(
rbStart
<=
(
BWPSize
-
rbSize
));
i
++
)
{
if
(
vrb_map
[
rbStart
+
i
])
{
rbStart
+=
i
;
i
=
0
;
}
}
if
(
rbStart
>
(
BWPSize
-
rbSize
))
{
LOG_E
(
MAC
,
"%s(): cannot find free vrb_map for RA RNTI %04x!
\n
"
,
__func__
,
ra
->
RA_rnti
);
return
;
}
// Checking if the DCI allocation is feasible in current subframe
if
(
dl_req
->
nPDUs
>
NFAPI_NR_MAX_DL_TTI_PDUS
-
2
)
{
LOG_I
(
MAC
,
"[RAPROC] Subframe %d: FAPI DL structure is full, skip scheduling UE %d
\n
"
,
slotP
,
ra
->
RA_rnti
);
...
...
@@ -866,8 +887,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
return
;
}
nfapi_nr_pdu_t
*
tx_req
=
&
nr_mac
->
TX_req
[
CC_id
].
pdu_list
[
nr_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
];
// look up the PDCCH PDU for this CC, BWP, and CORESET. If it does not exist, create it. This is especially
// important if we have multiple RAs, and the DLSCH has to reuse them, so we need to mark them
const
int
bwpid
=
bwp
->
bwp_Id
;
...
...
@@ -894,14 +913,9 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
dl_req
->
nPDUs
+=
1
;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t
*
pdsch_pdu_rel15
=
&
dl_tti_pdsch_pdu
->
pdsch_pdu
.
pdsch_pdu_rel15
;
LOG_I
(
NR_MAC
,
"[gNB %d] [RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, state %d
\n
"
,
module_idP
,
CC_id
,
frameP
,
slotP
,
ra
->
state
);
// This code from this point on will not work on initialBWP or CORESET0
AssertFatal
(
ra
->
bwp_id
>
0
,
"cannot work on initialBWP for now
\n
"
);
LOG_I
(
NR_MAC
,
"[gNB %d][RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg2 DCI, rnti 0x%x, state %d
\n
"
,
module_idP
,
CC_id
,
frameP
,
slotP
,
ra
->
RA_rnti
,
ra
->
state
);
AssertFatal
(
ra
->
secondaryCellGroup
,
"no secondaryCellGroup for RNTI %04x
\n
"
,
ra
->
crnti
);
AssertFatal
(
ra
->
secondaryCellGroup
,
"no secondaryCellGroup for RNTI %04x
\n
"
,
ra
->
crnti
);
AssertFatal
(
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
==
1
,
"downlinkBWP_ToAddModList has %d BWP!
\n
"
,
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
);
...
...
@@ -912,15 +926,14 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
// information to data and is reset every slot.
const
int
pduindex
=
nr_mac
->
pdu_index
[
CC_id
]
++
;
pdsch_pdu_rel15
->
pduIndex
=
pduindex
;
pdsch_pdu_rel15
->
BWPSize
=
NRRIV2BW
(
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
)
;
pdsch_pdu_rel15
->
BWPStart
=
NRRIV2PRBOFFSET
(
scc
->
downlinkConfigCommon
->
initialDownlinkBWP
->
genericParameters
.
locationAndBandwidth
,
MAX_BWP_SIZE
)
;
pdsch_pdu_rel15
->
BWPSize
=
BWPSize
;
pdsch_pdu_rel15
->
BWPStart
=
BWPStart
;
pdsch_pdu_rel15
->
SubcarrierSpacing
=
bwp
->
bwp_Common
->
genericParameters
.
subcarrierSpacing
;
pdsch_pdu_rel15
->
CyclicPrefix
=
0
;
pdsch_pdu_rel15
->
NrOfCodewords
=
1
;
pdsch_pdu_rel15
->
targetCodeRate
[
0
]
=
nr_get_code_rate_dl
(
mcsIndex
,
0
);
pdsch_pdu_rel15
->
qamModOrder
[
0
]
=
2
;
pdsch_pdu_rel15
->
mcsIndex
[
0
]
=
mcsIndex
;
if
(
bwp
->
bwp_Dedicated
->
pdsch_Config
->
choice
.
setup
->
mcs_Table
==
NULL
)
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
0
;
else
{
...
...
@@ -929,7 +942,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
else
pdsch_pdu_rel15
->
mcsTable
[
0
]
=
2
;
}
pdsch_pdu_rel15
->
rvIndex
[
0
]
=
0
;
pdsch_pdu_rel15
->
dataScramblingId
=
*
scc
->
physCellId
;
pdsch_pdu_rel15
->
nrOfLayers
=
1
;
...
...
@@ -941,8 +953,8 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
=
2
;
pdsch_pdu_rel15
->
dmrsPorts
=
1
;
pdsch_pdu_rel15
->
resourceAlloc
=
1
;
pdsch_pdu_rel15
->
rbStart
=
0
;
pdsch_pdu_rel15
->
rbSize
=
6
;
pdsch_pdu_rel15
->
rbStart
=
rbStart
;
pdsch_pdu_rel15
->
rbSize
=
rbSize
;
pdsch_pdu_rel15
->
VRBtoPRBMapping
=
0
;
for
(
int
i
=
0
;
i
<
bwp
->
bwp_Common
->
pdsch_ConfigCommon
->
choice
.
setup
->
pdsch_TimeDomainAllocationList
->
list
.
count
;
i
++
)
{
...
...
@@ -1011,17 +1023,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
pdsch_pdu_rel15
->
BWPSize
,
nr_mac
->
sched_ctrlCommon
->
active_bwp
->
bwp_Id
);
// Program UL processing for Msg3
NR_BWP_Uplink_t
*
ubwp
=
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
uplinkBWP_ToAddModList
->
list
.
array
[
ra
->
bwp_id
-
1
];
nr_get_Msg3alloc
(
module_idP
,
CC_id
,
scc
,
ubwp
,
slotP
,
frameP
,
ra
);
LOG_I
(
MAC
,
"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d
\n
"
,
frameP
,
slotP
,
ra
->
Msg3_frame
,
ra
->
Msg3_slot
);
nr_add_msg3
(
module_idP
,
CC_id
,
frameP
,
slotP
);
ra
->
state
=
WAIT_Msg3
;
LOG_I
(
MAC
,
"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d
\n
"
,
module_idP
,
frameP
,
slotP
,
ra
->
state
);
x_Overhead
=
0
;
nr_get_tbs_dl
(
&
dl_tti_pdsch_pdu
->
pdsch_pdu
,
x_Overhead
,
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
,
dci_payload
.
tb_scaling
);
// DL TX request
nfapi_nr_pdu_t
*
tx_req
=
&
nr_mac
->
TX_req
[
CC_id
].
pdu_list
[
nr_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
];
tx_req
->
PDU_length
=
pdsch_pdu_rel15
->
TBSize
[
0
];
...
...
@@ -1031,16 +1032,25 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
nr_mac
->
TX_req
[
CC_id
].
SFN
=
frameP
;
nr_mac
->
TX_req
[
CC_id
].
Number_of_PDUs
++
;
nr_mac
->
TX_req
[
CC_id
].
Slot
=
slotP
;
memcpy
((
void
*
)
&
tx_req
->
TLVs
[
0
].
value
.
direct
[
0
],
(
void
*
)
&
cc
[
CC_id
].
RAR_pdu
.
payload
[
0
],
tx_req
->
TLVs
[
0
].
length
);
// Program UL processing for Msg3
NR_BWP_Uplink_t
*
ubwp
=
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
uplinkConfig
->
uplinkBWP_ToAddModList
->
list
.
array
[
ra
->
bwp_id
-
1
];
nr_get_Msg3alloc
(
module_idP
,
CC_id
,
scc
,
ubwp
,
slotP
,
frameP
,
ra
);
LOG_I
(
MAC
,
"Frame %d, Subframe %d: Setting RA-Msg3 reception for Frame %d Subframe %d
\n
"
,
frameP
,
slotP
,
ra
->
Msg3_frame
,
ra
->
Msg3_slot
);
nr_add_msg3
(
module_idP
,
CC_id
,
frameP
,
slotP
,
ra
,
(
uint8_t
*
)
&
tx_req
->
TLVs
[
0
].
value
.
direct
[
0
]);
ra
->
state
=
WAIT_Msg3
;
LOG_I
(
MAC
,
"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d
\n
"
,
module_idP
,
frameP
,
slotP
,
ra
->
state
);
x_Overhead
=
0
;
nr_get_tbs_dl
(
&
dl_tti_pdsch_pdu
->
pdsch_pdu
,
x_Overhead
,
pdsch_pdu_rel15
->
numDmrsCdmGrpsNoData
,
dci_payload
.
tb_scaling
);
T
(
T_GNB_MAC_DL_RAR_PDU_WITH_DATA
,
T_INT
(
module_idP
),
T_INT
(
CC_id
),
T_INT
(
ra
->
RA_rnti
),
T_INT
(
frameP
),
T_INT
(
slotP
),
T_INT
(
0
)
/* harq pid, meaningful? */
,
T_BUFFER
(
&
cc
[
CC_id
].
RAR_pdu
.
payload
[
0
],
tx_req
->
TLVs
[
0
].
length
));
T_INT
(
ra
->
RA_rnti
),
T_INT
(
frameP
),
T_INT
(
slotP
),
T_INT
(
0
),
T_BUFFER
(
&
tx_req
->
TLVs
[
0
].
value
.
direct
[
0
],
tx_req
->
TLVs
[
0
].
length
));
// mark the corresponding RBs as used
uint16_t
*
vrb_map
=
cc
[
CC_id
].
vrb_map
;
for
(
int
rb
=
0
;
rb
<
pdsch_pdu_rel15
->
rbSize
;
rb
++
)
{
vrb_map
[
rb
+
pdsch_pdu_rel15
->
rbStart
]
=
1
;
// Mark the corresponding RBs as used
for
(
int
rb
=
0
;
rb
<
rbSize
;
rb
++
)
{
vrb_map
[
rb
+
rbStart
]
=
1
;
}
}
}
...
...
@@ -1124,10 +1134,7 @@ void nr_generate_Msg4(module_id_t module_idP,
LOG_I
(
NR_MAC
,
"[gNB %d] [RAPROC] CC_id %d Frame %d, slotP %d: Generating RA-Msg4 DCI, state %d
\n
"
,
module_idP
,
CC_id
,
frameP
,
slotP
,
ra
->
state
);
// This code from this point on will not work on initialBWP or CORESET0
AssertFatal
(
ra
->
bwp_id
>
0
,
"cannot work on initialBWP for now
\n
"
);
AssertFatal
(
ra
->
secondaryCellGroup
,
"no secondaryCellGroup for RNTI %04x
\n
"
,
ra
->
rnti
);
AssertFatal
(
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
==
1
,
"downlinkBWP_ToAddModList has %d BWP!
\n
"
,
ra
->
secondaryCellGroup
->
spCellConfig
->
spCellConfigDedicated
->
downlinkBWP_ToAddModList
->
list
.
count
);
...
...
@@ -1254,7 +1261,7 @@ void nr_generate_Msg4(module_id_t module_idP,
nr_mac
->
TX_req
[
CC_id
].
Slot
=
slotP
;
memcpy
(
tx_req
->
TLVs
[
0
].
value
.
direct
,
payload
,
tx_req
->
TLVs
[
0
].
length
);
//
m
ark the corresponding RBs as used
//
M
ark the corresponding RBs as used
uint16_t
*
vrb_map
=
cc
[
CC_id
].
vrb_map
;
for
(
int
rb
=
0
;
rb
<
pdsch_pdu_rel15
->
rbSize
;
rb
++
)
{
vrb_map
[
rb
+
pdsch_pdu_rel15
->
rbStart
]
=
1
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
6a16fe9e
...
...
@@ -1698,7 +1698,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
add_tail_nr_list
(
&
sched_ctrl
->
available_ul_harq
,
harq
);
create_nr_list
(
&
sched_ctrl
->
feedback_ul_harq
,
16
);
create_nr_list
(
&
sched_ctrl
->
retrans_ul_harq
,
16
);
LOG_I
(
MAC
,
"gNB %d] Add NR UE_id %d : rnti %x
\n
"
,
LOG_I
(
MAC
,
"
[
gNB %d] Add NR UE_id %d : rnti %x
\n
"
,
mod_idP
,
UE_id
,
rntiP
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
6a16fe9e
...
...
@@ -164,7 +164,7 @@ void compute_csi_bitlen (NR_CellGroupConfig_t *secondaryCellGroup, NR_UE_info_t
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_report_bitlen
[
0
].
diff_rsrp_bitlen
=
0
;
}
LOG_
I
(
MAC
,
"UCI: CSI_bit len : ssbri %d, rsrp: %d, diff_rsrp: %d
\n
"
,
LOG_
D
(
MAC
,
"UCI: CSI_bit len : ssbri %d, rsrp: %d, diff_rsrp: %d
\n
"
,
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_report_bitlen
[
0
].
cri_ssbri_bitlen
,
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_report_bitlen
[
0
].
rsrp_bitlen
,
UE_info
->
csi_report_template
[
UE_id
][
csi_report_id
].
CSI_report_bitlen
[
0
].
diff_rsrp_bitlen
);
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
6a16fe9e
...
...
@@ -476,13 +476,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
const
int
UE_id
=
add_new_nr_ue
(
gnb_mod_idP
,
ra
->
rnti
,
ra
->
secondaryCellGroup
);
UE_info
->
UE_beam_index
[
UE_id
]
=
ra
->
beam_id
;
LOG_I
(
NR_MAC
,
"[gNB %d][RAPROC] PUSCH with TC
_
RNTI %x received correctly, "
"[gNB %d][RAPROC] PUSCH with TC
-
RNTI %x received correctly, "
"adding UE MAC Context UE_id %d/RNTI %04x
\n
"
,
gnb_mod_idP
,
current_rnti
,
UE_id
,
ra
->
rnti
);
LOG_I
(
NR_MAC
,
"[RAPROC] RA-Msg3 received
\n
"
);
LOG_D
(
NR_MAC
,
"[RAPROC] Received Msg3:
\n
"
);
for
(
int
k
=
0
;
k
<
sdu_lenP
;
k
++
)
{
LOG_D
(
NR_MAC
,
"(%i): 0x%x
\n
"
,
k
,
sduP
[
k
]);
...
...
@@ -496,7 +497,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
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
);
LOG_I
(
MAC
,
"
Scheduling RA-Msg4 for TC-RNTI %04x (state %d, frame %d, slot %d)
\n
"
,
ra
->
rnti
,
ra
->
state
,
ra
->
Msg4_frame
,
ra
->
Msg4_slot
);
return
;
}
}
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
View file @
6a16fe9e
...
...
@@ -56,7 +56,7 @@ extern uint16_t sl_ahead;
void
handle_nr_rach
(
NR_UL_IND_t
*
UL_info
)
{
if
(
UL_info
->
rach_ind
.
number_of_pdus
>
0
)
{
LOG_
I
(
MAC
,
"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d
\n
"
,
UL_info
->
frame
,
UL_info
->
slot
,
UL_info
->
rach_ind
.
sfn
,
UL_info
->
rach_ind
.
slot
);
LOG_
D
(
MAC
,
"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d
\n
"
,
UL_info
->
frame
,
UL_info
->
slot
,
UL_info
->
rach_ind
.
sfn
,
UL_info
->
rach_ind
.
slot
);
int
npdus
=
UL_info
->
rach_ind
.
number_of_pdus
;
for
(
int
i
=
0
;
i
<
npdus
;
i
++
)
{
UL_info
->
rach_ind
.
number_of_pdus
--
;
...
...
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