Commit 4d070036 authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

Thread safe get_ue_nas_info

Call get_ue_nas_info before any thread starts to prevent
concurrent initialization of uicc array.
parent f6ea1648
......@@ -453,6 +453,7 @@ int main(int argc, char **argv)
init_pdcp(0);
else
init_pdcp(mode_offset + ue_id_g);
nas_init_nrue(NB_UE_INST);
init_NR_UE(NB_UE_INST, get_nrUE_params()->uecap_file, get_nrUE_params()->reconfig_file, get_nrUE_params()->rbconfig_file);
......
......@@ -1210,11 +1210,6 @@ static int get_user_nssai_idx(const nr_nas_msg_snssai_t allowed_nssai[8], const
void *nas_nrue_task(void *args_p)
{
for (int UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
// This sets UE uicc from command line. Needs to be called 2 seconds into nr-ue runtime, otherwise the unused command line
// arguments will be reported as unused and the modem asserts.
(void)get_ue_nas_info(UE_id);
}
while (1) {
nas_nrue(NULL);
}
......@@ -1453,3 +1448,9 @@ void *nas_nrue(void *args_p)
}
return NULL;
}
void nas_init_nrue(int num_ues) {
for (int i = 0; i < num_ues; i++) {
(void)get_ue_nas_info(i);
}
}
......@@ -160,5 +160,6 @@ nr_ue_nas_t *get_ue_nas_info(module_id_t module_id);
void generateRegistrationRequest(as_nas_info_t *initialNasMsg, nr_ue_nas_t *nas);
void *nas_nrue_task(void *args_p);
void *nas_nrue(void *args_p);
void nas_init_nrue(int num_ues);
#endif /* __NR_NAS_MSG_SIM_H__*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment