Commit 9da0cd5b authored by luis_pereira87's avatar luis_pereira87

Merge branch 'develop-SA-CBRA' into develop-SA-CBRA-CUDU

# Conflicts:
#	openair2/RRC/NR_UE/rrc_UE.c
parents fd9f2b8f 8646dd0b
......@@ -435,7 +435,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
}
} else {
ra->cfra = false;
ra->rnti = rnti;
ra->rnti = 0;
ra->preambles.num_preambles = MAX_NUM_NR_PRACH_PREAMBLES;
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++)
......
......@@ -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);
// TODO: Configure RRC with the new RNTI of the following commented lines
/*
int loop = 0;
if (!ra->cfra) {
do {
......@@ -590,7 +588,6 @@ void nr_initiate_ra_proc(module_id_t module_idP,
abort();
}
}
*/
ra->RA_rnti = ra_rnti;
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
{
if (harq->round == 0)
{
ra->state = RA_IDLE;
UE_info->active[UE_id] = true;
nr_clear_ra_proc(module_id, CC_id, frame, ra);
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);
}
else
......@@ -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){
NR_RA_t *ra = &RC.nrmac[module_idP]->common_channels[CC_id].ra[0];
void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra){
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->timing_offset = 0;
......
......@@ -511,10 +511,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if(no_sig) {
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
ra->state = RA_IDLE;
ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0;
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
} else {
// random access pusch with TC-RNTI
......@@ -566,10 +563,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
continue;
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
ra->state = RA_IDLE;
ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0;
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
}
}
}
......
......@@ -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,
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);
......
......@@ -1138,7 +1138,9 @@ void nr_DRB_preconfiguration(uint16_t crnti)
rbconfig->securityConfig->keyToUse = calloc(1,sizeof(*rbconfig->securityConfig->keyToUse));
*rbconfig->securityConfig->keyToUse = NR_SecurityConfig__keyToUse_master;
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
}
/*Adding SRB RLC configuration to the corresponding list*/
NR_RLC_BearerConfig_t *RLC_SRB_BearerConfig = calloc(1,sizeof(*RLC_SRB_BearerConfig));
......
......@@ -1633,6 +1633,9 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
rrc_gNB_generate_RRCSetup(ctxt_pP,
rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti),
CC_id);
// FIXME: Check the best place to perform this DRB configuration
nr_DRB_preconfiguration(ctxt_pP->rnti);
}
break;
......
......@@ -56,7 +56,29 @@ nr_mac_rrc_data_ind_ue(
break;
case NR_BCCH_DL_SCH:
AssertFatal( nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(module_id, gNB_index, (uint8_t*)pduP, pdu_len, 0, 0) == 0, "UE decode BCCH-DL-SCH error!\n");
if (pdu_len>0) {
LOG_T(NR_RRC, "[UE %d] Received SDU for NR-BCCH-DL-SCH on SRB %u from gNB %d\n", module_id, channel & RAB_OFFSET,
gNB_index);
MessageDef *message_p;
int msg_sdu_size = BCCH_SDU_SIZE;
if (pdu_len > msg_sdu_size) {
LOG_E(NR_RRC, "SDU larger than NR-BCCH-DL-SCH SDU buffer size (%d, %d)", sdu_size, msg_sdu_size);
sdu_size = msg_sdu_size;
} else {
sdu_size = pdu_len;
}
message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_BCCH_DATA_IND);
memset(NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu, 0, BCCH_SDU_SIZE);
memcpy(NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu, pduP, sdu_size);
NR_RRC_MAC_BCCH_DATA_IND (message_p).frame = frame; //frameP
NR_RRC_MAC_BCCH_DATA_IND (message_p).sub_frame = sub_frame; //sub_frameP
NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size;
NR_RRC_MAC_BCCH_DATA_IND (message_p).gnb_index = gNB_index;
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
}
break;
case CCCH:
......@@ -83,6 +105,8 @@ nr_mac_rrc_data_ind_ue(
NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti; //rntiP
itti_send_msg_to_task (TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE( module_id ), message_p);
}
break;
default:
break;
}
......
......@@ -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,
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);
// }
}
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);
......@@ -2392,7 +2392,6 @@ void *rrc_nrue_task( void *args_p ) {
case NR_RRC_MAC_BCCH_DATA_IND:
LOG_D(NR_RRC, "[UE %d] Received %s: frameP %d, gNB %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p),
NR_RRC_MAC_BCCH_DATA_IND (msg_p).frame, NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NOT_A_RNTI, NR_RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0,NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index);
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message (ctxt.module_id,
NR_RRC_MAC_BCCH_DATA_IND (msg_p).gnb_index,
......@@ -2400,6 +2399,7 @@ void *rrc_nrue_task( void *args_p ) {
NR_RRC_MAC_BCCH_DATA_IND (msg_p).sdu_size,
NR_RRC_MAC_BCCH_DATA_IND (msg_p).rsrq,
NR_RRC_MAC_BCCH_DATA_IND (msg_p).rsrp);
break;
case NR_RRC_MAC_CCCH_DATA_IND:
LOG_I(NR_RRC, "[UE %d] RNTI %x Received %s: frameP %d, gNB %d\n",
......
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