Commit 92e90c2c authored by Laurent Thomas's avatar Laurent Thomas

Merge branch 'develop-SA-CBRA' of...

Merge branch 'develop-SA-CBRA' of https://gitlab.eurecom.fr/oai/openairinterface5g into develop-SA-CBRA
parents 9d72f65e 31cf9ab8
...@@ -655,6 +655,7 @@ typedef struct { ...@@ -655,6 +655,7 @@ typedef struct {
int prach_I0; int prach_I0;
} PHY_MEASUREMENTS_gNB; } PHY_MEASUREMENTS_gNB;
#define TOTAL_NUM_NR_PRACH_PREAMBLES 64
#define MAX_NUM_NR_RX_RACH_PDUS 4 #define MAX_NUM_NR_RX_RACH_PDUS 4
#define MAX_NUM_NR_RX_PRACH_PREAMBLES 4 #define MAX_NUM_NR_RX_PRACH_PREAMBLES 4
#define MAX_UL_PDUS_PER_SLOT 8 #define MAX_UL_PDUS_PER_SLOT 8
......
...@@ -524,7 +524,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -524,7 +524,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
uint8_t sdu_lcids[NB_RB_MAX] = {0}; uint8_t sdu_lcids[NB_RB_MAX] = {0};
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
int num_sdus, offset = 0; int num_sdus = 0;
int offset = 0;
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side // Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
if (!prach_resources->init_msg1) { if (!prach_resources->init_msg1) {
......
...@@ -416,6 +416,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -416,6 +416,13 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
for (int i = 0; i < num_preamble; i++) for (int i = 0; i < num_preamble; i++)
ra->preambles.preamble_list[i] = cfra.resources.choice.ssb->ssb_ResourceList.list.array[i]->ra_PreambleIndex; ra->preambles.preamble_list[i] = cfra.resources.choice.ssb->ssb_ResourceList.list.array[i]->ra_PreambleIndex;
} }
} 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.preamble_list[i] = i;
} }
LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup\n", rnti); LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup\n", rnti);
} else { // secondaryCellGroup has been updated } else { // secondaryCellGroup has been updated
......
...@@ -454,16 +454,12 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -454,16 +454,12 @@ void nr_initiate_ra_proc(module_id_t module_idP,
// if the preamble received correspond to one of the listed // if the preamble received correspond to one of the listed
// the UE sent a RACH either for starting RA procedure or RA procedure failed and UE retries // the UE sent a RACH either for starting RA procedure or RA procedure failed and UE retries
int pr_found=0; int pr_found=0;
if(ra->preambles.num_preambles > 0) {
for (int i = 0; i < ra->preambles.num_preambles; i++) { for (int i = 0; i < ra->preambles.num_preambles; i++) {
if (preamble_index == ra->preambles.preamble_list[i]) { if (preamble_index == ra->preambles.preamble_list[i]) {
pr_found=1; pr_found=1;
break; break;
} }
} }
} else {
pr_found=1;
}
if (!pr_found) { if (!pr_found) {
LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated\n", LOG_E(MAC, "[gNB %d][RAPROC] FAILURE: preamble %d does not correspond to any of the ones in rach_ConfigDedicated\n",
...@@ -487,7 +483,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -487,7 +483,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
preamble_index, preamble_index,
freq_index, freq_index,
symbol); symbol);
int loop = 0;
LOG_D(MAC, "Frame %d, Slot %d: Activating RA process \n", frameP, slotP); LOG_D(MAC, "Frame %d, Slot %d: Activating RA process \n", frameP, slotP);
ra->state = Msg2; ra->state = Msg2;
ra->timing_offset = timing_offset; ra->timing_offset = timing_offset;
...@@ -514,6 +510,10 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -514,6 +510,10 @@ void nr_initiate_ra_proc(module_id_t module_idP,
ra->Msg2_slot = msg2_slot; 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_I(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) { if (!ra->cfra) {
do { do {
ra->rnti = (taus() % 65518) + 1; ra->rnti = (taus() % 65518) + 1;
...@@ -525,6 +525,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -525,6 +525,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
abort(); abort();
} }
} }
*/
ra->RA_rnti = ra_rnti; ra->RA_rnti = ra_rnti;
ra->preamble_index = preamble_index; ra->preamble_index = preamble_index;
ra->beam_id = beam_index; ra->beam_id = beam_index;
......
...@@ -465,7 +465,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -465,7 +465,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
// random access pusch with TC-RNTI // random access pusch with TC-RNTI
if (ra->rnti != current_rnti) { if (ra->rnti != current_rnti) {
LOG_W(MAC, LOG_W(NR_MAC,
"expected TC-RNTI %04x to match current RNTI %04x\n", "expected TC-RNTI %04x to match current RNTI %04x\n",
ra->rnti, ra->rnti,
current_rnti); current_rnti);
......
...@@ -1368,9 +1368,9 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) { ...@@ -1368,9 +1368,9 @@ uint8_t do_RRCSetupRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
rrcSetupRequest->rrcSetupRequest.spare.size=1; rrcSetupRequest->rrcSetupRequest.spare.size=1;
rrcSetupRequest->rrcSetupRequest.spare.bits_unused = 7; rrcSetupRequest->rrcSetupRequest.spare.bits_unused = 7;
//if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_UL_CCCH_Message, (void *)&ul_ccch_msg); xer_fprint(stdout, &asn_DEF_NR_UL_CCCH_Message, (void *)&ul_ccch_msg);
//} }
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_CCCH_Message, enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_CCCH_Message,
NULL, NULL,
......
...@@ -78,14 +78,14 @@ typedef struct OAI_NR_UECapability_s { ...@@ -78,14 +78,14 @@ typedef struct OAI_NR_UECapability_s {
} OAI_NR_UECapability_t; } OAI_NR_UECapability_t;
typedef enum requested_SI_List_e { typedef enum requested_SI_List_e {
SIB2 = 0x1, SIB2 = 1,
SIB3 = 0x2, SIB3 = 2,
SIB4 = 0x4, SIB4 = 4,
SIB5 = 0x8, SIB5 = 8,
SIB6 = 0x16, SIB6 = 16,
SIB7 = 0x32, SIB7 = 32,
SIB8 = 0x64, SIB8 = 64,
SIB9 = 0x128 SIB9 = 128
} requested_SI_List_t; } requested_SI_List_t;
// 3GPP TS 38.300 Section 9.2.6 // 3GPP TS 38.300 Section 9.2.6
......
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