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
08f0283c
Commit
08f0283c
authored
1 year ago
by
francescomani
Committed by
Jaroslava Fiedlerova
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvements in initializing multiple instances of MAC and RRC
parent
82e323ee
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
64 additions
and
79 deletions
+64
-79
executables/nr-ue.c
executables/nr-ue.c
+11
-11
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+3
-2
openair1/SIMULATION/NR_PHY/dlsim.c
openair1/SIMULATION/NR_PHY/dlsim.c
+1
-1
openair1/SIMULATION/NR_PHY/ulsim.c
openair1/SIMULATION/NR_PHY/ulsim.c
+1
-2
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+1
-1
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+3
-3
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+12
-6
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+0
-1
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+2
-3
openair2/RRC/NR_UE/main_ue.c
openair2/RRC/NR_UE/main_ue.c
+0
-5
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+28
-31
openair2/RRC/NR_UE/rrc_defs.h
openair2/RRC/NR_UE/rrc_defs.h
+0
-1
openair2/RRC/NR_UE/rrc_proto.h
openair2/RRC/NR_UE/rrc_proto.h
+2
-12
No files found.
executables/nr-ue.c
View file @
08f0283c
...
...
@@ -981,18 +981,18 @@ void *UE_thread(void *arg)
void
init_NR_UE
(
int
nb_inst
,
char
*
uecap_file
,
char
*
reconfig_file
,
char
*
rbconfig_file
)
{
NR_UE_
MAC_INST_t
*
mac_inst
;
NR_UE_
RRC_INST_t
*
rrc_inst
;
for
(
int
inst
=
0
;
inst
<
nb_inst
;
inst
++
)
{
AssertFatal
((
rrc_inst
=
nr_l3_init_ue
(
uecap_file
))
!=
NULL
,
"can not initialize RRC module
\n
"
);
AssertFatal
((
mac_inst
=
nr_l2_init_ue
())
!=
NULL
,
"can not initialize L2 module
\n
"
);
AssertFatal
((
mac
_inst
->
if_module
=
nr_ue_if_module_init
(
inst
))
!=
NULL
,
"can not initialize IF module
\n
"
);
NR_UE_
RRC_INST_t
*
rrc_inst
=
nr_rrc_init_ue
(
uecap_file
,
nb_inst
)
;
NR_UE_
MAC_INST_t
*
mac_inst
=
nr_l2_init_ue
(
nb_inst
)
;
AssertFatal
(
mac_inst
,
"Couldn't allocate MAC module
\n
"
);
for
(
int
i
=
0
;
i
<
nb_inst
;
i
++
)
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
i
);
AssertFatal
((
mac
->
if_module
=
nr_ue_if_module_init
(
i
))
!=
NULL
,
"can not initialize IF module
\n
"
);
if
(
!
get_softmodem_params
()
->
sa
)
{
init_nsa_message
(
rrc_inst
,
reconfig_file
,
rbconfig_file
);
init_nsa_message
(
&
rrc_inst
[
i
]
,
reconfig_file
,
rbconfig_file
);
// TODO why do we need noS1 configuration?
// temporarily moved here to understand why not using the one provided by gNB
nr_rlc_activate_srb0
(
mac
_inst
->
crnti
,
NULL
,
send_srb0_rrc
);
nr_rlc_activate_srb0
(
mac
->
crnti
,
NULL
,
send_srb0_rrc
);
if
(
IS_SOFTMODEM_NOS1
)
{
// get default noS1 configuration
NR_RadioBearerConfig_t
*
rbconfig
=
NULL
;
...
...
@@ -1001,8 +1001,8 @@ void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconf
// set up PDCP, RLC, MAC
nr_pdcp_layer_init
(
false
);
nr_pdcp_add_drbs
(
ENB_FLAG_NO
,
i
nst
,
rbconfig
->
drb_ToAddModList
,
0
,
NULL
,
NULL
);
nr_rlc_add_drb
(
mac
_inst
->
crnti
,
rbconfig
->
drb_ToAddModList
->
list
.
array
[
0
]
->
drb_Identity
,
rlc_rbconfig
);
nr_pdcp_add_drbs
(
ENB_FLAG_NO
,
i
,
rbconfig
->
drb_ToAddModList
,
0
,
NULL
,
NULL
);
nr_rlc_add_drb
(
mac
->
crnti
,
rbconfig
->
drb_ToAddModList
->
list
.
array
[
0
]
->
drb_Identity
,
rlc_rbconfig
);
struct
NR_CellGroupConfig__rlc_BearerToAddModList
rlc_toadd_list
;
rlc_toadd_list
.
list
.
count
=
1
;
rlc_toadd_list
.
list
.
array
=
calloc
(
1
,
sizeof
(
NR_RLC_BearerConfig_t
));
...
...
This diff is collapsed.
Click to expand it.
executables/nr-uesoftmodem.c
View file @
08f0283c
...
...
@@ -454,7 +454,8 @@ configmodule_interface_t *uniqCfg = NULL;
// A global var to reduce the changes size
ldpc_interface_t
ldpc_interface
=
{
0
},
ldpc_interface_offload
=
{
0
};
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
int
set_exe_prio
=
1
;
if
(
checkIfFedoraDistribution
())
if
(
checkIfGenericKernelOnFedora
())
...
...
@@ -509,7 +510,7 @@ int main( int argc, char **argv ) {
memset
(
PHY_vars_UE_g
[
0
][
CC_id
],
0
,
sizeof
(
*
PHY_vars_UE_g
[
0
][
CC_id
]));
}
init_NR_UE
(
1
,
uecap_file
,
reconfig_file
,
rbconfig_file
);
init_NR_UE
(
NB_UE_INST
,
uecap_file
,
reconfig_file
,
rbconfig_file
);
int
mode_offset
=
get_softmodem_params
()
->
nsa
?
NUMBER_OF_UE_MAX
:
1
;
uint16_t
node_number
=
get_softmodem_params
()
->
node_number
;
...
...
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/dlsim.c
View file @
08f0283c
...
...
@@ -849,7 +849,7 @@ int main(int argc, char **argv)
nr_gold_pdsch
(
UE
,
i
,
UE
->
scramblingID_dlsch
[
i
]);
}
nr_l2_init_ue
();
nr_l2_init_ue
(
1
);
UE_mac
=
get_mac_inst
(
0
);
ue_init_config_request
(
UE_mac
,
mu
);
...
...
This diff is collapsed.
Click to expand it.
openair1/SIMULATION/NR_PHY/ulsim.c
View file @
08f0283c
...
...
@@ -690,8 +690,7 @@ int main(int argc, char *argv[])
}
//Configure UE
nr_l2_init_ue
();
nr_l2_init_ue
(
1
);
NR_UE_MAC_INST_t
*
UE_mac
=
get_mac_inst
(
0
);
ue_init_config_request
(
UE_mac
,
mu
);
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
08f0283c
...
...
@@ -68,7 +68,6 @@
// NR UE defs
// ==========
#define NB_NR_UE_MAC_INST 1
#define MAX_NUM_BWP_UE 5
#define NUM_SLOT_FRAME 10
...
...
@@ -452,6 +451,7 @@ typedef struct {
/*!\brief Top level UE MAC structure */
typedef
struct
{
module_id_t
ue_id
;
NR_UE_L2_STATE_t
state
;
int
servCellIndex
;
long
physCellId
;
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
08f0283c
...
...
@@ -197,10 +197,10 @@ void nr_rrc_mac_config_req_sib1(module_id_t module_id,
void
nr_rrc_mac_config_req_reset
(
module_id_t
module_id
,
NR_UE_MAC_reset_cause_t
cause
);
/**\brief initialization NR UE MAC instance(s)
, total number of MAC instance based on NB_NR_UE_MAC_INST
*/
NR_UE_MAC_INST_t
*
nr_l2_init_ue
();
/**\brief initialization NR UE MAC instance(s)*/
NR_UE_MAC_INST_t
*
nr_l2_init_ue
(
int
nb_inst
);
/**\brief fetch MAC instance by module_id
, within 0 - (NB_NR_UE_MAC_INST-1)
/**\brief fetch MAC instance by module_id
\param module_id index of MAC instance(s)*/
NR_UE_MAC_INST_t
*
get_mac_inst
(
module_id_t
module_id
);
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
08f0283c
...
...
@@ -112,26 +112,32 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
}
}
NR_UE_MAC_INST_t
*
nr_l2_init_ue
()
NR_UE_MAC_INST_t
*
nr_l2_init_ue
(
int
nb_inst
)
{
//init mac here
nr_ue_mac_inst
=
(
NR_UE_MAC_INST_t
*
)
calloc
(
NB_NR_UE_MAC_INST
,
sizeof
(
NR_UE_MAC_INST_t
));
nr_ue_mac_inst
=
(
NR_UE_MAC_INST_t
*
)
calloc
(
nb_inst
,
sizeof
(
NR_UE_MAC_INST_t
));
AssertFatal
(
nr_ue_mac_inst
,
"Couldn't allocate %d instances of MAC module
\n
"
,
nb_inst
);
for
(
int
j
=
0
;
j
<
NB_NR_UE_MAC_INST
;
j
++
)
{
for
(
int
j
=
0
;
j
<
nb_inst
;
j
++
)
{
nr_ue_init_mac
(
j
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
j
);
mac
->
ue_id
=
j
;
nr_ue_mac_default_configs
(
mac
);
if
(
get_softmodem_params
()
->
sa
)
ue_init_config_request
(
mac
,
get_softmodem_params
()
->
numerology
);
}
int
rc
=
rlc_module_init
(
0
);
AssertFatal
(
rc
==
0
,
"
%s: Could not initialize RLC layer
\n
"
,
__FUNCTION__
);
AssertFatal
(
rc
==
0
,
"
Could not initialize RLC layer
\n
"
);
return
(
nr_ue_mac_inst
);
}
NR_UE_MAC_INST_t
*
get_mac_inst
(
module_id_t
module_id
)
{
return
&
nr_ue_mac_inst
[(
int
)
module_id
];
NR_UE_MAC_INST_t
*
get_mac_inst
(
module_id_t
module_id
)
{
NR_UE_MAC_INST_t
*
mac
=
&
nr_ue_mac_inst
[(
int
)
module_id
];
AssertFatal
(
mac
,
"Couldn't get MAC inst %d
\n
"
,
module_id
);
return
mac
;
}
void
reset_mac_inst
(
NR_UE_MAC_INST_t
*
nr_mac
)
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
08f0283c
...
...
@@ -2409,7 +2409,6 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *p
int8_t
nr_ue_get_SR
(
module_id_t
module_idP
,
frame_t
frameP
,
slot_t
slot
)
{
// no UL-SCH resources available for this tti && UE has a valid PUCCH resources for SR configuration for this tti
DevCheck
(
module_idP
<
NB_NR_UE_MAC_INST
,
module_idP
,
NB_NR_UE_MAC_INST
,
0
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_idP
);
NR_UE_SCHEDULING_INFO
*
si
=
&
mac
->
scheduling_info
;
int
max_sr_transmissions
=
(
1
<<
(
2
+
si
->
sr_TransMax
));
...
...
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
08f0283c
...
...
@@ -308,9 +308,8 @@ rlc_op_status_t rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
nr_rlc_ue_t
*
ue
;
nr_rlc_entity_t
*
rb
;
LOG_D
(
RLC
,
"%s rnti %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d
\n
"
,
__FUNCTION__
,
rnti
,
srb_flagP
,
rb_idP
,
muiP
,
confirmP
,
sdu_sizeP
,
MBMS_flagP
);
LOG_D
(
RLC
,
"rnti %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d
\n
"
,
rnti
,
srb_flagP
,
rb_idP
,
muiP
,
confirmP
,
sdu_sizeP
,
MBMS_flagP
);
if
(
ctxt_pP
->
enb_flag
)
T
(
T_ENB_RLC_DL
,
T_INT
(
ctxt_pP
->
module_id
),
T_INT
(
ctxt_pP
->
rntiMaybeUEid
),
T_INT
(
rb_idP
),
T_INT
(
sdu_sizeP
));
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/main_ue.c
View file @
08f0283c
...
...
@@ -35,11 +35,6 @@
#include "common/utils/LOG/log.h"
#include "executables/softmodem-common.h"
NR_UE_RRC_INST_t
*
nr_l3_init_ue
(
char
*
uecap
)
{
return
openair_rrc_top_init_ue_nr
(
uecap
);
}
void
init_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
char
*
reconfig_file
,
char
*
rbconfig_file
)
{
if
(
get_softmodem_params
()
->
phy_test
==
1
||
get_softmodem_params
()
->
do_ra
==
1
)
{
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/rrc_UE.c
View file @
08f0283c
...
...
@@ -299,40 +299,37 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
}
}
NR_UE_RRC_INST_t
*
openair_rrc_top_init_ue_nr
(
char
*
uecap_file
)
NR_UE_RRC_INST_t
*
nr_rrc_init_ue
(
char
*
uecap_file
,
int
nb_inst
)
{
if
(
NB_NR_UE_INST
>
0
)
{
NR_UE_rrc_inst
=
(
NR_UE_RRC_INST_t
*
)
calloc
(
NB_NR_UE_INST
,
sizeof
(
NR_UE_RRC_INST_t
));
for
(
int
nr_ue
=
0
;
nr_ue
<
NB_NR_UE_INST
;
nr_ue
++
)
{
NR_UE_RRC_INST_t
*
rrc
=
&
NR_UE_rrc_inst
[
nr_ue
];
rrc
->
ue_id
=
nr_ue
;
// fill UE-NR-Capability @ UE-CapabilityRAT-Container here.
rrc
->
selected_plmn_identity
=
1
;
rrc
->
dl_bwp_id
=
0
;
rrc
->
ul_bwp_id
=
0
;
rrc
->
as_security_activated
=
false
;
for
(
int
i
=
0
;
i
<
NB_CNX_UE
;
i
++
)
{
rrcPerNB_t
*
ptr
=
&
rrc
->
perNB
[
i
];
ptr
->
SInfo
=
(
NR_UE_RRC_SI_INFO
){
0
};
for
(
int
j
=
0
;
j
<
NR_NUM_SRB
;
j
++
)
ptr
->
Srb
[
j
]
=
RB_NOT_PRESENT
;
for
(
int
j
=
0
;
j
<
MAX_DRBS_PER_UE
;
j
++
)
ptr
->
status_DRBs
[
j
]
=
RB_NOT_PRESENT
;
// SRB0 activated by default
ptr
->
Srb
[
0
]
=
RB_ESTABLISHED
;
}
}
NR_UE_rrc_inst
->
uecap_file
=
uecap_file
;
if
(
get_softmodem_params
()
->
sl_mode
)
{
configure_NR_SL_Preconfig
(
get_softmodem_params
()
->
sync_ref
);
NR_UE_rrc_inst
=
(
NR_UE_RRC_INST_t
*
)
calloc
(
nb_inst
,
sizeof
(
NR_UE_RRC_INST_t
));
AssertFatal
(
NR_UE_rrc_inst
,
"Couldn't allocate %d instances of RRC module
\n
"
,
nb_inst
);
for
(
int
nr_ue
=
0
;
nr_ue
<
nb_inst
;
nr_ue
++
)
{
NR_UE_RRC_INST_t
*
rrc
=
&
NR_UE_rrc_inst
[
nr_ue
];
rrc
->
ue_id
=
nr_ue
;
// fill UE-NR-Capability @ UE-CapabilityRAT-Container here.
rrc
->
selected_plmn_identity
=
1
;
rrc
->
dl_bwp_id
=
0
;
rrc
->
ul_bwp_id
=
0
;
rrc
->
as_security_activated
=
false
;
rrc
->
uecap_file
=
uecap_file
;
for
(
int
i
=
0
;
i
<
NB_CNX_UE
;
i
++
)
{
rrcPerNB_t
*
ptr
=
&
rrc
->
perNB
[
i
];
ptr
->
SInfo
=
(
NR_UE_RRC_SI_INFO
){
0
};
for
(
int
j
=
0
;
j
<
NR_NUM_SRB
;
j
++
)
ptr
->
Srb
[
j
]
=
RB_NOT_PRESENT
;
for
(
int
j
=
0
;
j
<
MAX_DRBS_PER_UE
;
j
++
)
ptr
->
status_DRBs
[
j
]
=
RB_NOT_PRESENT
;
// SRB0 activated by default
ptr
->
Srb
[
0
]
=
RB_ESTABLISHED
;
}
}
else
{
NR_UE_rrc_inst
=
NULL
;
if
(
get_softmodem_params
()
->
sl_mode
)
{
configure_NR_SL_Preconfig
(
get_softmodem_params
()
->
sync_ref
);
}
return
NR_UE_rrc_inst
;
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/rrc_defs.h
View file @
08f0283c
...
...
@@ -59,7 +59,6 @@
#include "as_message.h"
#include "common/utils/nr/nr_common.h"
#define NB_NR_UE_INST 1
#define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
#define MAX_MEAS_OBJ 7
#define MAX_MEAS_CONFIG 7
...
...
This diff is collapsed.
Click to expand it.
openair2/RRC/NR_UE/rrc_proto.h
View file @
08f0283c
...
...
@@ -52,18 +52,8 @@ extern queue_t nr_dl_tti_req_queue;
extern
queue_t
nr_tx_req_queue
;
extern
queue_t
nr_ul_dci_req_queue
;
extern
queue_t
nr_ul_tti_req_queue
;
//
// main_rrc.c
//
/**\brief Layer 3 initialization*/
NR_UE_RRC_INST_t
*
nr_l3_init_ue
(
char
*
);
//
// UE_rrc.c
//
/**\brief Initial the top level RRC structure instance*/
NR_UE_RRC_INST_t
*
openair_rrc_top_init_ue_nr
(
char
*
);
NR_UE_RRC_INST_t
*
nr_rrc_init_ue
(
char
*
uecap_file
,
int
nb_inst
);
void
init_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
char
*
reconfig_file
,
char
*
rbconfig_file
);
void
process_nsa_message
(
NR_UE_RRC_INST_t
*
rrc
,
nsa_message_t
nsa_message_type
,
void
*
message
,
int
msg_len
);
...
...
This diff is collapsed.
Click to expand it.
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