Commit 7011b04b authored by rmagueta's avatar rmagueta

Code clean up and minor correction in RA for SA

parent d2e9ca59
...@@ -541,6 +541,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -541,6 +541,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
sdu_lcids[0] = lcid; sdu_lcids[0] = lcid;
// initialisation by RRC // initialisation by RRC
// TODO: To be removed after RA procedures fully implemented
if(get_softmodem_params()->do_ra) { if(get_softmodem_params()->do_ra) {
nr_rrc_ue_generate_RRCSetupRequest(mod_id,gNB_id); nr_rrc_ue_generate_RRCSetupRequest(mod_id,gNB_id);
} }
......
...@@ -96,7 +96,7 @@ void mac_top_init_gNB(void) ...@@ -96,7 +96,7 @@ void mac_top_init_gNB(void)
// These should be out of here later // These should be out of here later
pdcp_layer_init(); pdcp_layer_init();
if(IS_SOFTMODEM_NOS1 && !get_softmodem_params()->do_ra) if(IS_SOFTMODEM_NOS1 && !(get_softmodem_params()->do_ra || get_softmodem_params()->sa) )
nr_DRB_preconfiguration(0x1234); nr_DRB_preconfiguration(0x1234);
rrc_init_nr_global_param(); rrc_init_nr_global_param();
......
...@@ -255,7 +255,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -255,7 +255,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
1024); 1024);
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = (enc_rval.encoded+7)>>3; X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).rrc_buffer_size = (enc_rval.encoded+7)>>3;
itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding itti_send_msg_to_task(TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(0), msg); //Check right id instead of hardcoding
} else if (get_softmodem_params()->do_ra) { } else if (get_softmodem_params()->do_ra || get_softmodem_params()->sa) {
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id);
} }
......
...@@ -172,7 +172,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco ...@@ -172,7 +172,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->cellGroupId = scg_id; secondaryCellGroup->cellGroupId = scg_id;
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);
if (get_softmodem_params()->do_ra) if (get_softmodem_params()->do_ra || get_softmodem_params()->sa)
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional); nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
else else
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am); nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
......
...@@ -75,10 +75,10 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP, ...@@ -75,10 +75,10 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
//NR_UE_rrc_inst[Mod_idP].Info[gNB_id].T300_active = 1; //NR_UE_rrc_inst[Mod_idP].Info[gNB_id].T300_active = 1;
//NR_UE_rrc_inst[Mod_idP].Info[gNB_id].T300_cnt = 0; //NR_UE_rrc_inst[Mod_idP].Info[gNB_id].T300_cnt = 0;
LOG_D(RRC, "nr_mac_rrc_data_req_ue: Payload size = %i\n", NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size); LOG_D(NR_RRC, "nr_mac_rrc_data_req_ue: Payload size = %i\n", NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size);
memcpy(buffer_pP, (uint8_t*)NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.Payload, NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size); memcpy(buffer_pP, (uint8_t*)NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.Payload, NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size);
for(int i = 0; i<NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size; i++) { for(int i = 0; i<NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size; i++) {
LOG_D(RRC,"(%i): %i\n", i, buffer_pP[i]); LOG_D(NR_RRC,"(%i): %i\n", i, buffer_pP[i]);
} }
return NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size; return NR_UE_rrc_inst[Mod_idP].Srb0[gNB_id].Tx_buffer.payload_size;
......
...@@ -1102,6 +1102,7 @@ int8_t nr_rrc_ue_generate_ra_msg(module_id_t module_id, uint8_t gNB_index) { ...@@ -1102,6 +1102,7 @@ int8_t nr_rrc_ue_generate_ra_msg(module_id_t module_id, uint8_t gNB_index) {
switch(NR_UE_rrc_inst[module_id].ra_trigger){ switch(NR_UE_rrc_inst[module_id].ra_trigger){
case INITIAL_ACCESS_FROM_RRC_IDLE: case INITIAL_ACCESS_FROM_RRC_IDLE:
// After SIB1 is received, prepare RRCConnectionRequest
nr_rrc_ue_generate_RRCSetupRequest(module_id,gNB_index); nr_rrc_ue_generate_RRCSetupRequest(module_id,gNB_index);
break; break;
case RRC_CONNECTION_REESTABLISHMENT: case RRC_CONNECTION_REESTABLISHMENT:
...@@ -1192,10 +1193,7 @@ int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message( ...@@ -1192,10 +1193,7 @@ int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(
} }
LOG_I(NR_RRC, "SIB1 decoded\n"); LOG_I(NR_RRC, "SIB1 decoded\n");
// TODO: prepare RRCConnectionRequest // FIXME: improve condition for the RA trigger
// After SIB1 is received, prepare RRCConnectionRequest
// FIXME: fix condition for the RA trigger
// Check for on-demand not broadcasted SI // Check for on-demand not broadcasted SI
check_requested_SI_List(module_id, NR_UE_rrc_inst[module_id].requested_SI_List, *sib1); check_requested_SI_List(module_id, NR_UE_rrc_inst[module_id].requested_SI_List, *sib1);
if( nr_rrc_get_state(module_id) == RRC_STATE_IDLE_NR ) { if( nr_rrc_get_state(module_id) == RRC_STATE_IDLE_NR ) {
......
...@@ -75,17 +75,12 @@ gNBs = ...@@ -75,17 +75,12 @@ gNBs =
initialDLBWPk0_2 = 0; initialDLBWPk0_2 = 0;
initialDLBWPmappingType_2 = 0; initialDLBWPmappingType_2 = 0;
#this is SS=1,L=12 #this is SS=1,L=12
initialDLBWPstartSymbolAndLength_2 = 95; initialDLBWPstartSymbolAndLength_2 = 54;
initialDLBWPk0_3 = 0; initialDLBWPk0_3 = 0;
initialDLBWPmappingType_3 = 0; initialDLBWPmappingType_3 = 0;
#this is SS=2,L=7 #this is SS=1,L=5
initialDLBWPstartSymbolAndLength_3 = 86; initialDLBWPstartSymbolAndLength_3 = 57;
initialDLBWPk0_4 = 0;
initialDLBWPmappingType_4 = 0;
#this is SS=2,L=5
initialDLBWPstartSymbolAndLength_4 = 58;
#uplinkConfigCommon #uplinkConfigCommon
#frequencyInfoUL #frequencyInfoUL
......
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