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
Michael Black
OpenXG-RAN
Commits
c7f083b1
Commit
c7f083b1
authored
Nov 03, 2021
by
David Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated gNB part to handle CI test
parent
bb21c02d
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
303 additions
and
168 deletions
+303
-168
common/utils/LOG/log.h
common/utils/LOG/log.h
+1
-1
executables/nr-ue.c
executables/nr-ue.c
+0
-3
nfapi/oai_integration/nfapi_vnf.c
nfapi/oai_integration/nfapi_vnf.c
+0
-4
openair1/PHY/NR_TRANSPORT/pucch_rx.c
openair1/PHY/NR_TRANSPORT/pucch_rx.c
+6
-0
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
+1
-4
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+7
-0
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+2
-8
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+2
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+48
-4
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+2
-15
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+3
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+9
-1
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+201
-107
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+10
-10
openair2/RRC/LTE/defs_NB_IoT.h
openair2/RRC/LTE/defs_NB_IoT.h
+1
-1
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+1
-0
openair2/RRC/NR/rrc_gNB_reconfig.c
openair2/RRC/NR/rrc_gNB_reconfig.c
+1
-1
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+8
-7
No files found.
common/utils/LOG/log.h
View file @
c7f083b1
...
...
@@ -426,7 +426,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0)
# define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0)
/* logs intended for analysis */
# define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0)
# define LOG_D(COMPONENT, ...) do if (
0
) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
# define LOG_D(COMPONENT, ...) do if (
1
) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
# define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0)
# define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0)
...
...
executables/nr-ue.c
View file @
c7f083b1
...
...
@@ -560,7 +560,6 @@ void processSlotTX(void *arg) {
ul_indication
.
thread_id
=
proc
->
thread_id
;
ul_indication
.
ue_sched_mode
=
rxtxD
->
ue_sched_mode
;
LOG_I
(
PHY
,
"We are here to call ul_indication
\n
"
);
UE
->
if_inst
->
ul_indication
(
&
ul_indication
);
}
...
...
@@ -622,7 +621,6 @@ void processSlotRX(void *arg) {
}
else
{
rxtxD
->
ue_sched_mode
=
SCHED_ALL
;
LOG_I
(
PHY
,
"We are calling processSlotTX in processSlotRX
\n
"
);
processSlotTX
(
rxtxD
);
}
...
...
@@ -641,7 +639,6 @@ void processSlotRX(void *arg) {
}
if
(
UE
->
UE_mode
[
gNB_id
]
>
NOT_SYNCHED
&&
UE
->
UE_mode
[
gNB_id
]
<
PUSCH
)
{
LOG_I
(
PHY
,
"We are calling nr_ue_prach_procedures in processSlotRX
\n
"
);
nr_ue_prach_procedures
(
UE
,
proc
,
gNB_id
);
}
LOG_D
(
PHY
,
"****** end TX-Chain for AbsSubframe %d.%d ******
\n
"
,
proc
->
frame_tx
,
proc
->
nr_slot_tx
);
...
...
nfapi/oai_integration/nfapi_vnf.c
View file @
c7f083b1
...
...
@@ -612,8 +612,6 @@ int phy_sync_indication(struct nfapi_vnf_p7_config *config, uint8_t sync) {
return
(
0
);
}
uint16_t
pnf_frame
;
uint16_t
pnf_slot
;
int
phy_slot_indication
(
struct
nfapi_vnf_p7_config
*
config
,
uint16_t
phy_id
,
uint16_t
sfn
,
uint16_t
slot
)
{
static
uint8_t
first_time
=
1
;
...
...
@@ -626,8 +624,6 @@ int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uin
if
(
RC
.
gNB
&&
RC
.
gNB
[
0
]
->
configured
)
{
// uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
// uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
pnf_frame
=
sfn
;
pnf_slot
=
slot
;
LOG_D
(
PHY
,
"[VNF] slot indication sfn:%d slot:%d
\n
"
,
sfn
,
slot
);
wake_gNB_rxtx
(
RC
.
gNB
[
0
],
sfn
,
slot
);
// DONE: find NR equivalent
}
else
{
...
...
openair1/PHY/NR_TRANSPORT/pucch_rx.c
View file @
c7f083b1
...
...
@@ -413,6 +413,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
if
(
pucch_pdu
->
bit_len_harq
==
0
)
{
uci_pdu
->
harq
=
NULL
;
uci_pdu
->
sr
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
sr
));
AssertFatal
(
uci_pdu
->
sr
!=
NULL
,
"Memory allocation failed when pucch_pdu->bit_len_harq == 0
\n
"
);
uci_pdu
->
sr
->
sr_confidence_level
=
no_conf
?
1
:
0
;
uci_stats
->
pucch0_sr_trials
++
;
if
(
xrtmag_dBtimes10
>
(
10
*
gNB
->
measurements
.
n0_power_tot_dB
))
{
...
...
@@ -421,10 +422,13 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
}
else
{
uci_pdu
->
sr
->
sr_indication
=
0
;
}
LOG_I
(
PHY
,
"uci_01->harq->num_harq == 0
\n
"
);
}
else
if
(
pucch_pdu
->
bit_len_harq
==
1
)
{
uci_pdu
->
harq
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
harq
));
AssertFatal
(
uci_pdu
->
harq
!=
NULL
,
"Memory allocation failed when pucch_pdu->bit_len_harq == 1
\n
"
);
uci_pdu
->
harq
->
num_harq
=
1
;
LOG_I
(
PHY
,
"uci_01->harq->num_harq %u with uci_pdu %p harq %p
\n
"
,
uci_pdu
->
harq
->
num_harq
,
uci_pdu
,
uci_pdu
->
harq
);
uci_pdu
->
harq
->
harq_confidence_level
=
no_conf
?
1
:
0
;
uci_pdu
->
harq
->
harq_list
=
(
nfapi_nr_harq_t
*
)
malloc
(
1
);
uci_pdu
->
harq
->
harq_list
[
0
].
harq_value
=
index
&
0x01
;
...
...
@@ -440,7 +444,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
}
else
{
uci_pdu
->
harq
=
calloc
(
1
,
sizeof
(
*
uci_pdu
->
harq
));
AssertFatal
(
uci_pdu
->
harq
!=
NULL
,
"Memory allocation failed when pucch_pdu->bit_len_harq > 1
\n
"
);
uci_pdu
->
harq
->
num_harq
=
2
;
LOG_I
(
PHY
,
"uci_01->harq->num_harq %u with uci_pdu %p harq %p
\n
"
,
uci_pdu
->
harq
->
num_harq
,
uci_pdu
,
uci_pdu
->
harq
);
uci_pdu
->
harq
->
harq_confidence_level
=
(
no_conf
)
?
1
:
0
;
uci_pdu
->
harq
->
harq_list
=
(
nfapi_nr_harq_t
*
)
malloc
(
2
);
uci_pdu
->
harq
->
harq_list
[
1
].
harq_value
=
index
&
0x01
;
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
View file @
c7f083b1
...
...
@@ -221,11 +221,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
k
+=
kbar
;
k
*=
2
;
LOG_I
(
PHY
,
"PRACH [UE %d] in slot %d,
mu %d, fp->samples_per_subframe %d, prach_sequence_length %d,
placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d
\n
"
,
Mod_id
,
LOG_I
(
PHY
,
"PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d
\n
"
,
Mod_id
,
slot
,
mu
,
fp
->
samples_per_subframe
,
prach_sequence_length
,
k
,
n_ra_prb
,
nrUE_config
->
prach_config
.
num_prach_fd_occasions_list
[
fd_occasion
].
k1
,
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
c7f083b1
...
...
@@ -682,6 +682,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
offset
=
pucch_pdu
->
start_symbol_index
*
gNB
->
frame_parms
.
ofdm_symbol_size
+
(
gNB
->
frame_parms
.
first_carrier_offset
+
pucch_pdu
->
prb_start
*
12
);
power_rxF
=
signal_energy_nodc
(
&
gNB
->
common_vars
.
rxdataF
[
0
][
offset
],
12
);
LOG_D
(
PHY
,
"frame %d, slot %d: PUCCH signal energy %d
\n
"
,
frame_rx
,
slot_rx
,
power_rxF
);
LOG_D
(
PHY
,
"num_ucis = %d *expecting 0 since it is index in array also (case 0)
\n
"
,
num_ucis
);
nr_decode_pucch0
(
gNB
,
frame_rx
,
...
...
@@ -691,6 +692,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB
->
UL_INFO
.
uci_ind
.
num_ucis
+=
1
;
pucch
->
active
=
0
;
if
(((
uci_pdu_format0
->
pduBitmap
>>
1
)
&
0x01
)){
LOG_I
(
NR_PHY
,
"uci_01->harq->num_harq with uci_pdu %p
\n
"
,
uci_pdu_format0
);
LOG_I
(
NR_PHY
,
"uci_01->harq->num_harq with uci_pdu %p harq %p
\n
"
,
uci_pdu_format0
,
uci_pdu_format0
->
harq
);
LOG_I
(
NR_PHY
,
"uci_01->harq->num_harq %u
\n
"
,
uci_pdu_format0
->
harq
->
num_harq
);
}
break
;
case
2
:
num_ucis
=
gNB
->
UL_INFO
.
uci_ind
.
num_ucis
;
...
...
@@ -700,6 +706,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB
->
uci_pdu_list
[
num_ucis
].
pdu_type
=
NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE
;
gNB
->
uci_pdu_list
[
num_ucis
].
pdu_size
=
sizeof
(
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
);
nfapi_nr_uci_pucch_pdu_format_2_3_4_t
*
uci_pdu_format2
=
&
gNB
->
uci_pdu_list
[
num_ucis
].
pucch_pdu_format_2_3_4
;
LOG_D
(
PHY
,
"num_ucis = %d in case 1
\n
"
,
num_ucis
);
nr_decode_pucch2
(
gNB
,
slot_rx
,
...
...
openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
View file @
c7f083b1
...
...
@@ -2079,13 +2079,11 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
prach_resources
->
init_msg1
=
1
;
}
else
{
nr_prach
=
nr_ue_get_rach
(
prach_resources
,
&
ue
->
prach_vars
[
0
]
->
prach_pdu
,
mod_id
,
ue
->
CC_id
,
frame_tx
,
gNB_id
,
nr_slot_tx
);
LOG_D
(
PHY
,
"In %s:[%d.%d] getting PRACH resources : %d
\n
"
,
__FUNCTION__
,
frame_tx
,
nr_slot_tx
,
nr_prach
);
}
if
(
nr_prach
>
0
)
LOG_I
(
PHY
,
"In %s: We are here with nr_prach = %u (GENERATE_PREAMBLE: 1)
\n
"
,
__FUNCTION__
,
nr_prach
);
if
(
nr_prach
==
GENERATE_PREAMBLE
)
{
if
(
ue
->
mac_enabled
==
1
)
{
...
...
@@ -2117,9 +2115,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH
,
VCD_FUNCTION_IN
);
LOG_I
(
PHY
,
"In %s: We are here to call generate_nr_prach
\n
"
,
__FUNCTION__
);
prach_power
=
generate_nr_prach
(
ue
,
gNB_id
,
nr_slot_tx
);
LOG_I
(
PHY
,
"In %s: We are here after calling generate_nr_prach
\n
"
,
__FUNCTION__
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH
,
VCD_FUNCTION_OUT
);
...
...
@@ -2132,10 +2128,8 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
dB_fixed
(
prach_power
),
ue
->
prach_vars
[
gNB_id
]
->
amp
);
if
(
ue
->
mac_enabled
==
1
)
{
if
(
ue
->
mac_enabled
==
1
)
nr_Msg1_transmitted
(
mod_id
,
ue
->
CC_id
,
frame_tx
,
gNB_id
);
LOG_I
(
PHY
,
"In %s: We are here after nr_Msg1_transmitted
\n
"
,
__FUNCTION__
);
}
}
else
if
(
nr_prach
==
WAIT_CONTENTION_RESOLUTION
)
{
LOG_D
(
PHY
,
"In %s: [UE %d] RA waiting contention resolution
\n
"
,
__FUNCTION__
,
mod_id
);
...
...
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
c7f083b1
...
...
@@ -689,7 +689,7 @@ int nr_rrc_mac_config_req_ue(
}
config_control_ue
(
mac
);
if
(
get_softmodem_params
()
->
nsa
)
{
if
(
cell_group_config
->
spCellConfig
->
reconfigurationWithSync
)
{
if
(
cell_group_config
->
spCellConfig
&&
cell_group_config
->
spCellConfig
->
reconfigurationWithSync
)
{
if
(
cell_group_config
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
)
{
ra
->
rach_ConfigDedicated
=
cell_group_config
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
->
choice
.
uplink
;
}
...
...
@@ -707,6 +707,7 @@ int nr_rrc_mac_config_req_ue(
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map
(
mac
);
}
/*
if(mac_cell_group_configP != NULL){
if(mac_cell_group_configP->drx_Config != NULL ){
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
c7f083b1
...
...
@@ -550,7 +550,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
dci_pdu_rel15_t
*
def_dci_pdu_rel15
=
&
mac
->
def_dci_pdu_rel15
[
dci
->
dci_format
];
if
((
dci
->
rnti
!=
mac
->
crnti
)
&&
(
dci
->
rnti
!=
mac
->
ra
.
ra_rnti
)
&&
(
dci
->
rnti
!=
0xFFFF
))
{
if
((
dci
->
rnti
!=
mac
->
crnti
)
&&
(
dci
->
rnti
!=
mac
->
ra
.
ra_rnti
)
&&
(
get_softmodem_params
()
->
nsa
))
{
LOG_D
(
MAC
,
"We skip for the received dci indication rnti %4x != mac->crnti %4x frame slot %4d.%2d RA state %d
\n
"
,
dci
->
rnti
,
mac
->
crnti
,
frame
,
slot
,
mac
->
ra
.
ra_state
);
return
0
;
...
...
@@ -2444,7 +2444,7 @@ void nr_ue_send_sdu(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *u
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU
,
VCD_FUNCTION_IN
);
LOG_
I
(
MAC
,
"In %s [%d.%d] Handling DLSCH PDU...
\n
"
,
__FUNCTION__
,
dl_info
->
frame
,
dl_info
->
slot
);
LOG_
D
(
MAC
,
"In %s [%d.%d] Handling DLSCH PDU...
\n
"
,
__FUNCTION__
,
dl_info
->
frame
,
dl_info
->
slot
);
// Processing MAC PDU
// it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs
...
...
@@ -3422,7 +3422,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
case
DL_SCH_LCID_DCCH1
:
// check if LCID is valid at current time.
default:
{
if
(
get_softmodem_params
()
->
nsa
)
{
// check if LCID is valid at current time.
if
(
pdu_len
<
sizeof
(
NR_MAC_SUBHEADER_SHORT
))
return
;
...
...
@@ -3472,6 +3472,50 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
break
;
}
else
{
// check if LCID is valid at current time.
if
(((
NR_MAC_SUBHEADER_SHORT
*
)
pduP
)
->
F
){
//mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
mac_subheader_len
=
3
;
mac_sdu_len
=
((
uint16_t
)(((
NR_MAC_SUBHEADER_LONG
*
)
pduP
)
->
L1
&
0x7f
)
<<
8
)
|
((
uint16_t
)((
NR_MAC_SUBHEADER_LONG
*
)
pduP
)
->
L2
&
0xff
);
}
else
{
mac_sdu_len
=
(
uint16_t
)((
NR_MAC_SUBHEADER_SHORT
*
)
pduP
)
->
L
;
mac_subheader_len
=
2
;
}
LOG_D
(
MAC
,
"[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)
\n
"
,
module_idP
,
frameP
,
rx_lcid
,
gNB_index
,
mac_sdu_len
);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T
(
MAC
,
"[UE %d] First 32 bytes of DLSCH :
\n
"
,
module_idP
);
for
(
i
=
0
;
i
<
32
;
i
++
)
LOG_T
(
MAC
,
"%x."
,
(
pduP
+
mac_subheader_len
)[
i
]);
LOG_T
(
MAC
,
"
\n
"
);
#endif
if
(
rx_lcid
<
NB_RB_MAX
&&
rx_lcid
>=
DL_SCH_LCID_DCCH
)
{
mac_rlc_data_ind
(
module_idP
,
mac
->
crnti
,
gNB_index
,
frameP
,
ENB_FLAG_NO
,
MBMS_FLAG_NO
,
rx_lcid
,
(
char
*
)
(
pduP
+
mac_subheader_len
),
mac_sdu_len
,
1
,
NULL
);
}
else
{
LOG_E
(
MAC
,
"[UE %d] Frame %d : unknown LCID %d (gNB %d)
\n
"
,
module_idP
,
frameP
,
rx_lcid
,
gNB_index
);
}
break
;
}
}
pduP
+=
(
mac_subheader_len
+
mac_ce_len
+
mac_sdu_len
);
pdu_len
-=
(
mac_subheader_len
+
mac_ce_len
+
mac_sdu_len
);
...
...
@@ -3651,7 +3695,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
if
((
mac
->
crnti
==
ra
->
t_crnti
)
&&
(
get_softmodem_params
()
->
nsa
))
{
LOG_
I
(
MAC
,
"Discarding the received RAR.
\n
"
);
LOG_
D
(
MAC
,
"Discarding the received RAR.
\n
"
);
return
-
1
;
}
while
(
1
)
{
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
c7f083b1
...
...
@@ -1866,7 +1866,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
else
{
ul_config
=
&
mac
->
ul_config_request
[
0
];
}
LOG_I
(
NR_MAC
,
"We are here to check calling nr_ue_prach_scheduler
\n
"
);
fapi_nr_ul_config_prach_pdu
*
prach_config_pdu
;
fapi_nr_config_request_t
*
cfg
=
&
mac
->
phy_config
.
config_req
;
...
...
@@ -1897,8 +1896,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
&
prach_occasion_info_p
);
if
(
is_nr_prach_slot
&&
ra
->
ra_state
==
RA_UE_IDLE
)
{
LOG_I
(
NR_MAC
,
"We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)
\n
"
,
is_nr_prach_slot
,
ra
->
ra_state
);
AssertFatal
(
NULL
!=
prach_occasion_info_p
,
"PRACH Occasion Info not returned in a valid NR Prach Slot
\n
"
);
ra
->
generate_nr_prach
=
GENERATE_PREAMBLE
;
...
...
@@ -1906,8 +1903,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
format
=
prach_occasion_info_p
->
format
;
format0
=
format
&
0xff
;
// single PRACH format
format1
=
(
format
>>
8
)
&
0xff
;
// dual PRACH format
LOG_I
(
NR_MAC
,
"We are here with format0 %u, format1 %u, %s %d
\n
"
,
format0
,
format1
,
__FUNCTION__
,
__LINE__
);
AssertFatal
(
ul_config
->
number_pdus
<
sizeof
(
ul_config
->
ul_config_list
)
/
sizeof
(
ul_config
->
ul_config_list
[
0
]),
"Number of PDUS in ul_config = %d > ul_config_list num elements"
,
ul_config
->
number_pdus
);
...
...
@@ -1932,7 +1927,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
prach_config_pdu
->
restricted_set
=
prach_config
->
restricted_set_config
;
prach_config_pdu
->
freq_msg1
=
prach_config
->
num_prach_fd_occasions_list
[
prach_occasion_info_p
->
fdm
].
k1
;
LOG_
I
(
NR_MAC
,
"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u
\n
"
,
frameP
,
prach_config_pdu
->
prach_slot
,
prach_config_pdu
->
prach_start_symbol
,
prach_config_pdu
->
num_ra
);
LOG_
D
(
NR_MAC
,
"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u
\n
"
,
frameP
,
prach_config_pdu
->
prach_slot
,
prach_config_pdu
->
prach_start_symbol
,
prach_config_pdu
->
num_ra
);
// Search which SSB is mapped in the RO (among all the SSBs mapped to this RO)
for
(
prach_config_pdu
->
ssb_nb_in_ro
=
0
;
prach_config_pdu
->
ssb_nb_in_ro
<
prach_occasion_info_p
->
nb_mapped_ssb
;
prach_config_pdu
->
ssb_nb_in_ro
++
)
{
...
...
@@ -1940,8 +1935,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
break
;
}
AssertFatal
(
prach_config_pdu
->
ssb_nb_in_ro
<
prach_occasion_info_p
->
nb_mapped_ssb
,
"%u not found in the mapped SSBs to the PRACH occasion"
,
selected_gnb_ssb_idx
);
LOG_I
(
NR_MAC
,
"We are here Before set prach_config_pdu->prach_format %x, %s %d
\n
"
,
prach_config_pdu
->
prach_format
,
__FUNCTION__
,
__LINE__
);
if
(
format1
!=
0xff
)
{
switch
(
format0
)
{
// dual PRACH format
case
0xa1
:
...
...
@@ -1995,18 +1989,11 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
AssertFatal
(
1
==
0
,
"Invalid PRACH format"
);
}
}
// if format1
LOG_I
(
NR_MAC
,
"We are here After set prach_config_pdu->prach_format %x, %s %d
\n
"
,
prach_config_pdu
->
prach_format
,
__FUNCTION__
,
__LINE__
);
fill_scheduled_response
(
&
scheduled_response
,
NULL
,
ul_config
,
NULL
,
module_idP
,
0
/*TBR fix*/
,
frameP
,
slotP
,
thread_id
);
if
(
mac
->
if_module
!=
NULL
&&
mac
->
if_module
->
scheduled_response
!=
NULL
)
mac
->
if_module
->
scheduled_response
(
&
scheduled_response
);
}
// is_nr_prach_slot
else
LOG_I
(
NR_MAC
,
"We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)
\n
"
,
is_nr_prach_slot
,
ra
->
ra_state
);
}
// if is_nr_UL_slot
else
LOG_I
(
NR_MAC
,
"We are here It is not is_nr_UL_slot
\n
"
);
}
// This function schedules the reception of SIB1 after initial sync and before going to real time state
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
c7f083b1
...
...
@@ -535,7 +535,9 @@ void nr_initiate_ra_proc(module_id_t module_idP,
if
(
ra
->
state
==
RA_IDLE
)
{
for
(
int
j
=
0
;
j
<
ra
->
preambles
.
num_preambles
;
j
++
)
{
//check if the preamble received correspond to one of the listed or configured preambles
if
(
preamble_index
==
ra
->
preambles
.
preamble_list
[
j
]
&&
ra
->
rnti
!=
0
)
{
if
(
preamble_index
==
ra
->
preambles
.
preamble_list
[
j
])
{
if
(
ra
->
rnti
==
0
&&
get_softmodem_params
()
->
nsa
)
continue
;
pr_found
=
1
;
break
;
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
View file @
c7f083b1
...
...
@@ -1081,6 +1081,11 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
if
(((
uci_01
->
pduBitmap
>>
1
)
&
0x01
))
{
// iterate over received harq bits
LOG_I
(
NR_MAC
,
"uci_01 %p
\n
"
,
uci_01
);
LOG_I
(
NR_MAC
,
"uci_01->harq %p
\n
"
,
uci_01
->
harq
);
LOG_I
(
NR_MAC
,
"uci_01->harq->num_harq %u
\n
"
,
uci_01
->
harq
->
num_harq
);
for
(
int
harq_bit
=
0
;
harq_bit
<
uci_01
->
harq
->
num_harq
;
harq_bit
++
)
{
const
uint8_t
harq_value
=
uci_01
->
harq
->
harq_list
[
harq_bit
].
harq_value
;
const
uint8_t
harq_confidence
=
uci_01
->
harq
->
harq_confidence_level
;
...
...
@@ -1094,7 +1099,10 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
remove_front_nr_list
(
&
sched_ctrl
->
feedback_dl_harq
);
/* According to nfapi_nr_interface_scf.h, harq_value = 0 is a pass
(The check below was for harq_value == 1 in the develop branch) */
handle_dl_harq
(
mod_id
,
UE_id
,
pid
,
harq_value
==
0
&&
harq_confidence
==
0
);
if
(
get_softmodem_params
()
->
nsa
)
handle_dl_harq
(
mod_id
,
UE_id
,
pid
,
harq_value
==
0
&&
harq_confidence
==
0
);
else
handle_dl_harq
(
mod_id
,
UE_id
,
pid
,
harq_value
==
1
&&
harq_confidence
==
0
);
if
(
harq_confidence
==
1
)
UE_info
->
mac_stats
[
UE_id
].
pucch0_DTX
++
;
}
}
...
...
openair2/NR_PHY_INTERFACE/NR_IF_Module.c
View file @
c7f083b1
This diff is collapsed.
Click to expand it.
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
View file @
c7f083b1
...
...
@@ -827,7 +827,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t
// Note: sdu should always be processed because data and timing advance updates are transmitted by the UE
int8_t
handle_dlsch
(
nr_downlink_indication_t
*
dl_info
,
NR_UL_TIME_ALIGNMENT_t
*
ul_time_alignment
,
int
pdu_id
){
dl_info
->
rx_ind
->
rx_indication_body
[
pdu_id
].
pdsch_pdu
.
harq_pid
=
g_harq_pid
;
if
(
get_softmodem_params
()
->
nsa
)
dl_info
->
rx_ind
->
rx_indication_body
[
pdu_id
].
pdsch_pdu
.
harq_pid
=
g_harq_pid
;
update_harq_status
(
dl_info
,
pdu_id
);
if
(
dl_info
->
rx_ind
->
rx_indication_body
[
pdu_id
].
pdsch_pdu
.
ack_nack
)
...
...
@@ -844,7 +845,6 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
if
(
ul_info
->
ue_sched_mode
==
ONLY_PUSCH
)
{
ret
=
nr_ue_scheduler
(
NULL
,
ul_info
);
LOG_I
(
NR_MAC
,
"In nr_ue_ul_indication: We are to return due to ul_info->ue_sched_mode == ONLY_PUSCH
\n
"
);
return
0
;
}
if
(
ul_info
->
ue_sched_mode
==
SCHED_ALL
)
{
...
...
@@ -857,10 +857,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
NR_TDD_UL_DL_ConfigCommon_t
*
tdd_UL_DL_ConfigurationCommon
=
mac
->
scc
!=
NULL
?
mac
->
scc
->
tdd_UL_DL_ConfigurationCommon
:
mac
->
scc_SIB
->
tdd_UL_DL_ConfigurationCommon
;
if
(
is_nr_UL_slot
(
tdd_UL_DL_ConfigurationCommon
,
ul_info
->
slot_tx
,
mac
->
frame_type
)
&&
!
get_softmodem_params
()
->
phy_test
)
{
LOG_I
(
NR_MAC
,
"In nr_ue_ul_indication: We are here to call nr_ue_prach_scheduler
\n
"
);
nr_ue_prach_scheduler
(
module_id
,
ul_info
->
frame_tx
,
ul_info
->
slot_tx
,
ul_info
->
thread_id
);
}
if
(
is_nr_UL_slot
(
tdd_UL_DL_ConfigurationCommon
,
ul_info
->
slot_tx
,
mac
->
frame_type
))
nr_ue_pucch_scheduler
(
module_id
,
ul_info
->
frame_tx
,
ul_info
->
slot_tx
,
ul_info
->
thread_id
);
...
...
@@ -905,11 +902,14 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
dl_info
->
slot
,
dl_info
->
dci_ind
->
dci_list
+
i
);
fapi_nr_dci_indication_pdu_t
*
dci_index
=
dl_info
->
dci_ind
->
dci_list
+
i
;
dci_pdu_rel15_t
*
def_dci_pdu_rel15
=
&
mac
->
def_dci_pdu_rel15
[
dci_index
->
dci_format
];
g_harq_pid
=
def_dci_pdu_rel15
->
harq_pid
;
LOG_D
(
NR_MAC
,
"Setting harq_pid = %d and dci_index = %d (based on format)
\n
"
,
g_harq_pid
,
dci_index
->
dci_format
);
memset
(
def_dci_pdu_rel15
,
0
,
sizeof
(
*
def_dci_pdu_rel15
));
if
(
get_softmodem_params
()
->
nsa
)
{
fapi_nr_dci_indication_pdu_t
*
dci_index
=
dl_info
->
dci_ind
->
dci_list
+
i
;
dci_pdu_rel15_t
*
def_dci_pdu_rel15
=
&
mac
->
def_dci_pdu_rel15
[
dci_index
->
dci_format
];
g_harq_pid
=
def_dci_pdu_rel15
->
harq_pid
;
LOG_D
(
NR_MAC
,
"Setting harq_pid = %d and dci_index = %d (based on format)
\n
"
,
g_harq_pid
,
dci_index
->
dci_format
);
memset
(
def_dci_pdu_rel15
,
0
,
sizeof
(
*
def_dci_pdu_rel15
));
}
ret_mask
|=
(
ret
<<
FAPI_NR_DCI_IND
);
if
(
ret
>=
0
)
{
...
...
openair2/RRC/LTE/defs_NB_IoT.h
View file @
c7f083b1
...
...
@@ -148,7 +148,7 @@ typedef struct UE_RRC_INFO_NB_IoT_s {
//Measurement Report not supported in NB-IoT
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE
51
2
#define RRC_BUF_SIZE
819
2
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
c7f083b1
...
...
@@ -1034,6 +1034,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
NR_PUCCH_Resource_t
*
pucchres0
=
calloc
(
1
,
sizeof
(
*
pucchres0
));
pucchres0
->
pucch_ResourceId
=
0
;
pucchres0
->
startingPRB
=
0
;
//(8+rnti) % curr_bwp;
//pucchres0->startingPRB = (8+rnti) % curr_bwp;
LOG_D
(
NR_RRC
,
"pucchres0->startPRB %ld rnti %d curr_bwp %d
\n
"
,
pucchres0
->
startingPRB
,
rnti
,
curr_bwp
);
pucchres0
->
intraSlotFrequencyHopping
=
NULL
;
pucchres0
->
secondHopPRB
=
NULL
;
...
...
openair2/RRC/NR/rrc_gNB_reconfig.c
View file @
c7f083b1
...
...
@@ -945,7 +945,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
long
*
delay
[
8
];
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
delay
[
i
]
=
calloc
(
1
,
sizeof
(
*
delay
[
i
]));
*
delay
[
i
]
=
i
+
6
;
*
delay
[
i
]
=
(
i
<
6
)
?
(
i
+
2
)
:
0
;
//TODO: Needs to check to use
i + 6;
ASN_SEQUENCE_ADD
(
&
pucch_Config
->
dl_DataToUL_ACK
->
list
,
delay
[
i
]);
}
pucch_Config
->
spatialRelationInfoToAddModList
=
calloc
(
1
,
sizeof
(
*
pucch_Config
->
spatialRelationInfoToAddModList
));
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
c7f083b1
...
...
@@ -248,17 +248,20 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
if
(
NR_UE_rrc_inst
[
module_id
].
radio_bearer_config
==
NULL
){
NR_UE_rrc_inst
[
module_id
].
radio_bearer_config
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
radioBearerConfig
;
}
else
{
protocol_ctxt_t
ctxt
;
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
module_id
,
ENB_FLAG_YES
,
mac
->
crnti
,
0
,
0
,
0
);
//
protocol_ctxt_t ctxt;
//
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
//
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0);
struct
NR_RadioBearerConfig
*
RadioBearerConfig
=
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
radioBearerConfig
;
xer_fprint
(
stdout
,
&
asn_DEF_NR_RadioBearerConfig
,
(
const
void
*
)
RadioBearerConfig
);
//
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
LOG_D
(
NR_RRC
,
"Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld
\n
"
,
__LINE__
,
RadioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
0
]
->
cnAssociation
->
choice
.
eps_BearerIdentity
,
RadioBearerConfig
->
drb_ToAddModList
->
list
.
array
[
0
]
->
drb_Identity
,
RadioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
->
cipheringAlgorithm
,
*
RadioBearerConfig
->
securityConfig
->
keyToUse
);
nr_rrc_ue_process_RadioBearerConfig
(
&
ctxt
,
0
,
RadioBearerConfig
);
//nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_RadioBearerConfig
,
(
const
void
*
)
RadioBearerConfig
);
}
}
}
if
(
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
->
secondaryCellGroup
!=
NULL
){
...
...
@@ -408,11 +411,9 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
SEQUENCE_free
(
&
asn_DEF_NR_RadioBearerConfig
,
RadioBearerConfig
,
1
);
return
;
}
#if 0
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_RadioBearerConfig
,
(
const
void
*
)
RadioBearerConfig
);
}
#endif
#if 0
protocol_ctxt_t ctxt;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
...
...
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