Commit cdb6beab authored by luis_pereira87's avatar luis_pereira87

Improve RNTI selection to use all the specified values (0x0001-0xfff2)

parent c8aceea4
...@@ -626,11 +626,12 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -626,11 +626,12 @@ void nr_initiate_ra_proc(module_id_t module_idP,
int loop = 0; int loop = 0;
if (ra->rnti == 0) { // This condition allows for the usage of a preconfigured rnti for the CFRA if (ra->rnti == 0) { // This condition allows for the usage of a preconfigured rnti for the CFRA
do { do {
ra->rnti = (taus() % 65518) + 1; // 3GPP TS 38.321 Section 7.1 Table 7.1-1: RNTI values
ra->rnti = (taus() % 0xfff2) + 1;
loop++; loop++;
} while (loop != 100 } while (loop != 100
&& !((find_nr_UE(&nr_mac->UE_info, ra->rnti) == NULL) && (find_nr_RA_id(module_idP, CC_id, ra->rnti) == -1) && !((find_nr_UE(&nr_mac->UE_info, ra->rnti) == NULL) && (find_nr_RA_id(module_idP, CC_id, ra->rnti) == -1)
&& ra->rnti >= 1 && ra->rnti <= 65519)); && ra->rnti >= 1 && ra->rnti <= 0xfff2));
if (loop == 100) { if (loop == 100) {
LOG_E(NR_MAC, "%s:%d:%s: [RAPROC] initialisation random access aborted\n", __FILE__, __LINE__, __FUNCTION__); LOG_E(NR_MAC, "%s:%d:%s: [RAPROC] initialisation random access aborted\n", __FILE__, __LINE__, __FUNCTION__);
abort(); abort();
......
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