Commit f93413e1 authored by rmagueta's avatar rmagueta

Define trigger_RA_List

parent 9c71e941
...@@ -404,6 +404,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ ...@@ -404,6 +404,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){
// fill UE-NR-Capability @ UE-CapabilityRAT-Container here. // fill UE-NR-Capability @ UE-CapabilityRAT-Container here.
NR_UE_rrc_inst[nr_ue].selected_plmn_identity = 1; NR_UE_rrc_inst[nr_ue].selected_plmn_identity = 1;
// TODO: Put the appropriate list of SIBs
NR_UE_rrc_inst[nr_ue].requested_SI_List.buf = CALLOC(1,4); NR_UE_rrc_inst[nr_ue].requested_SI_List.buf = CALLOC(1,4);
NR_UE_rrc_inst[nr_ue].requested_SI_List.buf[0] = SIB2 | SIB3 | SIB5; // SIB2 - SIB9 NR_UE_rrc_inst[nr_ue].requested_SI_List.buf[0] = SIB2 | SIB3 | SIB5; // SIB2 - SIB9
NR_UE_rrc_inst[nr_ue].requested_SI_List.buf[1] = 0; // SIB10 - SIB17 NR_UE_rrc_inst[nr_ue].requested_SI_List.buf[1] = 0; // SIB10 - SIB17
...@@ -412,6 +413,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ ...@@ -412,6 +413,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){
NR_UE_rrc_inst[nr_ue].requested_SI_List.size= 4; NR_UE_rrc_inst[nr_ue].requested_SI_List.size= 4;
NR_UE_rrc_inst[nr_ue].requested_SI_List.bits_unused= 0; NR_UE_rrc_inst[nr_ue].requested_SI_List.bits_unused= 0;
NR_UE_rrc_inst[nr_ue].do_ra = RA_NOT_RUNNING;
// init RRC lists // init RRC lists
RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].RLC_Bearer_Config_list, NR_maxLC_ID); RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].RLC_Bearer_Config_list, NR_maxLC_ID);
RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].SchedulingRequest_list, NR_maxNrofSR_ConfigPerCellGroup); RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].SchedulingRequest_list, NR_maxNrofSR_ConfigPerCellGroup);
...@@ -1486,67 +1489,61 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -1486,67 +1489,61 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
return rval; return rval;
} }
int8_t check_requested_SI_List(BIT_STRING_t requested_SI_List, NR_SIB1_t sib1) { int8_t check_requested_SI_List(module_id_t module_id, BIT_STRING_t requested_SI_List, NR_SIB1_t sib1) {
printf("\n\n");
if(sib1.si_SchedulingInfo) { if(sib1.si_SchedulingInfo) {
if(sib1.si_SchedulingInfo->schedulingInfoList.list.array) {
bool SIB_to_request[32] = {}; bool SIB_to_request[32] = {};
LOG_I(RRC, "SIBs broadcasting: "); LOG_I(RRC, "SIBs broadcasting: ");
for(int i = 0; i < sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.count; i++) { for(int i = 0; i < sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.count; i++) {
printf("SIB%li ", sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.array[i]->type + 2); printf("SIB%li ", sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.array[i]->type + 2);
} }
printf("\n"); printf("\n");
LOG_I(RRC, "SIBs needed by UE: "); LOG_I(RRC, "SIBs needed by UE: ");
for(int j = 0; j < 8*requested_SI_List.size; j++) { for(int j = 0; j < 8*requested_SI_List.size; j++) {
if( ((requested_SI_List.buf[j/8]>>(j%8))&1) == 1) { if( ((requested_SI_List.buf[j/8]>>(j%8))&1) == 1) {
printf("SIB%i ", j + 2); printf("SIB%i ", j + 2);
SIB_to_request[j] = true; SIB_to_request[j] = true;
for(int i = 0; i < sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.count; i++) { for(int i = 0; i < sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.count; i++) {
if(sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.array[i]->type == j) { if(sib1.si_SchedulingInfo->schedulingInfoList.list.array[0]->sib_MappingInfo.list.array[i]->type == j) {
SIB_to_request[j] = false; SIB_to_request[j] = false;
break; break;
}
} }
} }
} }
printf("\n"); }
printf("\n");
LOG_I(RRC, "SIBs to request by UE: "); LOG_I(RRC, "SIBs to request by UE: ");
bool do_ra = false; bool do_ra = false;
for(int j = 0; j < 8*requested_SI_List.size; j++) { for(int j = 0; j < 8*requested_SI_List.size; j++) {
if(SIB_to_request[j]) { if(SIB_to_request[j]) {
printf("SIB%i ", j + 2); printf("SIB%i ", j + 2);
do_ra = true; do_ra = true;
}
} }
printf("\n"); }
printf("\n");
if(do_ra) { if(do_ra) {
if(sib1.si_SchedulingInfo->si_RequestConfig) { NR_UE_rrc_inst[module_id].do_ra = REQUEST_FOR_OTHER_SI;
LOG_I(RRC, "Starting contention-free RA procedure\n"); get_softmodem_params()->do_ra = 1;
} else {
LOG_I(RRC, "Starting contention-based RA procedure\n");
get_softmodem_params()->do_ra = 1;
}
if(sib1.si_SchedulingInfo->si_RequestConfig) {
LOG_I(RRC, "Trigger contention-free RA procedure (do_ra = %i)\n", NR_UE_rrc_inst[module_id].do_ra);
} else {
LOG_I(RRC, "Trigger contention-based RA procedure (do_ra = %i)\n", NR_UE_rrc_inst[module_id].do_ra);
} }
} }
} }
printf("\n\n");
return 0; return 0;
} }
...@@ -1578,7 +1575,7 @@ int8_t nr_rrc_ue_decode_NR_SIB1_Message(module_id_t module_id, uint8_t gNB_index ...@@ -1578,7 +1575,7 @@ int8_t nr_rrc_ue_decode_NR_SIB1_Message(module_id_t module_id, uint8_t gNB_index
if( g_log->log_component[RRC].level >= OAILOG_DEBUG ) if( g_log->log_component[RRC].level >= OAILOG_DEBUG )
xer_fprint(stdout, &asn_DEF_NR_SIB1, (const void*)sib1); xer_fprint(stdout, &asn_DEF_NR_SIB1, (const void*)sib1);
check_requested_SI_List(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);
} }
else else
LOG_E(PHY, "sib1 is starting by 8 times 0\n"); LOG_E(PHY, "sib1 is starting by 8 times 0\n");
......
...@@ -84,9 +84,23 @@ typedef enum requested_SI_List_e { ...@@ -84,9 +84,23 @@ typedef enum requested_SI_List_e {
SIB4 = 0x4, SIB4 = 0x4,
SIB5 = 0x8, SIB5 = 0x8,
SIB6 = 0x16, SIB6 = 0x16,
SIB7 = 0x32 SIB7 = 0x32,
SIB8 = 0x64,
SIB9 = 0x128
} requested_SI_List_t; } requested_SI_List_t;
typedef enum trigger_RA_List_e {
RA_NOT_RUNNING,
INITIAL_ACCESS_FROM_RRC_IDLE,
RRC_CONNECTION_REESTABLISHMENT,
DURING_HANDOVER,
NON_SYNCHRONISED,
TRANSITION_FROM_RRC_INACTIVE,
TO_ESTABLISH_TA,
REQUEST_FOR_OTHER_SI,
BEAM_FAILURE_RECOVERY,
} trigger_RA_List_t;
typedef struct NR_UE_RRC_INST_s { typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config; NR_MeasConfig_t *meas_config;
...@@ -113,6 +127,7 @@ typedef struct NR_UE_RRC_INST_s { ...@@ -113,6 +127,7 @@ typedef struct NR_UE_RRC_INST_s {
uint8_t *UECapability; uint8_t *UECapability;
uint8_t UECapability_size; uint8_t UECapability_size;
trigger_RA_List_t do_ra;
BIT_STRING_t requested_SI_List; BIT_STRING_t requested_SI_List;
NR_SystemInformation_t *si[NB_CNX_UE]; NR_SystemInformation_t *si[NB_CNX_UE];
......
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