Commit 8646dd0b authored by rmagueta's avatar rmagueta

DRB configuration for a new crnti

parent bdc97f7a
...@@ -435,7 +435,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -435,7 +435,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
} }
} else { } else {
ra->cfra = false; ra->cfra = false;
ra->rnti = rnti; ra->rnti = 0;
ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES; ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
ra->preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t)); ra->preambles.preamble_list = (uint8_t *) malloc(MAX_NUM_NR_PRACH_PREAMBLES*sizeof(uint8_t));
for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++) for (int i = 0; i < MAX_NUM_NR_PRACH_PREAMBLES; i++)
......
...@@ -575,8 +575,6 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -575,8 +575,6 @@ void nr_initiate_ra_proc(module_id_t module_idP,
LOG_D(MAC, "%s() Msg2[%04d%d] SFN/SF:%04d%d\n", __FUNCTION__, ra->Msg2_frame, ra->Msg2_slot, frameP, slotP); LOG_D(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; int loop = 0;
if (!ra->cfra) { if (!ra->cfra) {
do { do {
...@@ -590,7 +588,6 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -590,7 +588,6 @@ 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;
...@@ -1364,9 +1361,9 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram ...@@ -1364,9 +1361,9 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
{ {
if (harq->round == 0) if (harq->round == 0)
{ {
ra->state = RA_IDLE; nr_clear_ra_proc(module_id, CC_id, frame, ra);
UE_info->active[UE_id] = true;
free(ra->preambles.preamble_list); free(ra->preambles.preamble_list);
UE_info->active[UE_id] = true;
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. RA procedure succeeded!\n", UE_id, ra->rnti); LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. RA procedure succeeded!\n", UE_id, ra->rnti);
} }
else else
...@@ -1377,9 +1374,7 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram ...@@ -1377,9 +1374,7 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
} }
void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP){ void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra){
NR_RA_t *ra = &RC.nrmac[module_idP]->common_channels[CC_id].ra[0];
LOG_D(MAC,"[gNB %d][RAPROC] CC_id %d Frame %d Clear Random access information rnti %x\n", module_idP, CC_id, frameP, ra->rnti); LOG_D(MAC,"[gNB %d][RAPROC] CC_id %d Frame %d Clear Random access information rnti %x\n", module_idP, CC_id, frameP, ra->rnti);
ra->state = RA_IDLE; ra->state = RA_IDLE;
ra->timing_offset = 0; ra->timing_offset = 0;
......
...@@ -492,10 +492,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -492,10 +492,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if(no_sig) { if(no_sig) {
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state); LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
ra->state = RA_IDLE; nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0;
} else { } else {
// random access pusch with TC-RNTI // random access pusch with TC-RNTI
...@@ -547,10 +544,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -547,10 +544,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
continue; continue;
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state); LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
ra->state = RA_IDLE; nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0;
} }
} }
} }
......
...@@ -114,7 +114,7 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP); ...@@ -114,7 +114,7 @@ void nr_schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP,
uint16_t preamble_index, uint8_t freq_index, uint8_t symbol, int16_t timing_offset); uint16_t preamble_index, uint8_t freq_index, uint8_t symbol, int16_t timing_offset);
void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP); void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra);
int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only); int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only);
......
...@@ -796,7 +796,9 @@ void nr_DRB_preconfiguration(uint16_t crnti) ...@@ -796,7 +796,9 @@ void nr_DRB_preconfiguration(uint16_t crnti)
rbconfig->securityConfig->keyToUse = calloc(1,sizeof(*rbconfig->securityConfig->keyToUse)); rbconfig->securityConfig->keyToUse = calloc(1,sizeof(*rbconfig->securityConfig->keyToUse));
*rbconfig->securityConfig->keyToUse = NR_SecurityConfig__keyToUse_master; *rbconfig->securityConfig->keyToUse = NR_SecurityConfig__keyToUse_master;
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig); xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
}
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig)); NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
nr_rlc_bearer_init(RLC_BearerConfig); nr_rlc_bearer_init(RLC_BearerConfig);
......
...@@ -1496,6 +1496,9 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, ...@@ -1496,6 +1496,9 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
rrc_gNB_generate_RRCSetup(ctxt_pP, rrc_gNB_generate_RRCSetup(ctxt_pP,
rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti), rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti),
CC_id); CC_id);
// FIXME: Check the best place to perform this DRB configuration
nr_DRB_preconfiguration(ctxt_pP->rnti);
} }
break; break;
......
...@@ -1366,9 +1366,9 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -1366,9 +1366,9 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
(uint8_t *)Srb_info->Rx_buffer.Payload, (uint8_t *)Srb_info->Rx_buffer.Payload,
100,0,0); 100,0,0);
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout,&asn_DEF_NR_DL_CCCH_Message,(void *)dl_ccch_msg); xer_fprint(stdout,&asn_DEF_NR_DL_CCCH_Message,(void *)dl_ccch_msg);
// } }
if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) { if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) {
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed); LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed);
......
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