Commit 6d0ae249 authored by francescomani's avatar francescomani

handling SIB other than SIB1 at UE RRC

parent 392ef79b
...@@ -938,7 +938,7 @@ void *UE_thread(void *arg) { ...@@ -938,7 +938,7 @@ void *UE_thread(void *arg) {
timing_advance = UE->timing_advance; timing_advance = UE->timing_advance;
} }
nr_ue_rrc_timer_trigger(UE->Mod_id, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx); nr_ue_rrc_timer_trigger(UE->Mod_id, curMsg.proc.frame_tx, curMsg.proc.nr_slot_tx, curMsg.proc.gNB_id);
// Start TX slot processing here. It runs in parallel with RX slot processing // Start TX slot processing here. It runs in parallel with RX slot processing
notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_tx, &txFifo, processSlotTX); notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_tx, &txFifo, processSlotTX);
......
...@@ -467,6 +467,7 @@ typedef struct rrc_subframe_process_s { ...@@ -467,6 +467,7 @@ typedef struct rrc_subframe_process_s {
typedef struct nrrrc_slot_process_s { typedef struct nrrrc_slot_process_s {
int frame; int frame;
int slot; int slot;
int gnb_id;
} NRRrcSlotProcess; } NRRrcSlotProcess;
// eNB: RLC -> RRC messages // eNB: RLC -> RRC messages
......
...@@ -701,7 +701,7 @@ void ue_init_config_request(NR_UE_MAC_INST_t *mac, int scs) ...@@ -701,7 +701,7 @@ void ue_init_config_request(NR_UE_MAC_INST_t *mac, int scs)
void nr_rrc_mac_config_req_mib(module_id_t module_id, void nr_rrc_mac_config_req_mib(module_id_t module_id,
int cc_idP, int cc_idP,
NR_MIB_t *mib, NR_MIB_t *mib,
bool sched_sib1) int sched_sib)
{ {
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
AssertFatal(mib, "MIB should not be NULL\n"); AssertFatal(mib, "MIB should not be NULL\n");
...@@ -709,7 +709,10 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id, ...@@ -709,7 +709,10 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
mac->mib = mib; // update by every reception mac->mib = mib; // update by every reception
mac->phy_config.Mod_id = module_id; mac->phy_config.Mod_id = module_id;
mac->phy_config.CC_id = cc_idP; mac->phy_config.CC_id = cc_idP;
mac->get_sib1 = sched_sib1; if (sched_sib == 1)
mac->get_sib1 = true;
else if (sched_sib == 2)
mac->get_otherSI = true;
} }
void nr_rrc_mac_config_req_sib1(module_id_t module_id, void nr_rrc_mac_config_req_sib1(module_id_t module_id,
......
...@@ -394,6 +394,7 @@ typedef struct { ...@@ -394,6 +394,7 @@ typedef struct {
//// MAC config //// MAC config
int first_sync_frame; int first_sync_frame;
bool get_sib1; bool get_sib1;
bool get_otherSI;
NR_DRX_Config_t *drx_Config; NR_DRX_Config_t *drx_Config;
NR_SchedulingRequestConfig_t *schedulingRequestConfig; NR_SchedulingRequestConfig_t *schedulingRequestConfig;
NR_BSR_Config_t *bsr_Config; NR_BSR_Config_t *bsr_Config;
......
...@@ -106,7 +106,7 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id, ...@@ -106,7 +106,7 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id,
void nr_rrc_mac_config_req_mib(module_id_t module_id, void nr_rrc_mac_config_req_mib(module_id_t module_id,
int cc_idP, int cc_idP,
NR_MIB_t *mibP, NR_MIB_t *mibP,
bool sched_sib1); int sched_sib1);
void nr_rrc_mac_config_req_sib1(module_id_t module_id, void nr_rrc_mac_config_req_sib1(module_id_t module_id,
int cc_idP, int cc_idP,
......
...@@ -369,6 +369,15 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -369,6 +369,15 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
{ {
const NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP; const NR_UE_DL_BWP_t *current_DL_BWP = &mac->current_DL_BWP;
const int slots_per_frame = nr_slots_per_frame[current_DL_BWP->scs]; const int slots_per_frame = nr_slots_per_frame[current_DL_BWP->scs];
if (mac->get_otherSI) {
// If searchSpaceOtherSystemInformation is set to zero,
// PDCCH monitoring occasions for SI message reception in SI-window
// are same as PDCCH monitoring occasions for SIB1
const NR_SearchSpace_t *ss = mac->otherSI_SS ? mac->otherSI_SS : mac->search_space_zero;
// TODO configure SI-window
if (is_ss_monitor_occasion(frame, slot, slots_per_frame, ss))
config_dci_pdu(mac, dl_config, NR_RNTI_SI, slot, ss);
}
if (mac->state == UE_PERFORMING_RA && if (mac->state == UE_PERFORMING_RA &&
mac->ra.ra_state >= WAIT_RAR) { mac->ra.ra_state >= WAIT_RAR) {
// if RA is ongoing use RA search space // if RA is ongoing use RA search space
......
...@@ -165,6 +165,7 @@ void nr_ue_init_mac(module_id_t module_idP) ...@@ -165,6 +165,7 @@ void nr_ue_init_mac(module_id_t module_idP)
nr_ue_mac_default_configs(mac); nr_ue_mac_default_configs(mac);
mac->first_sync_frame = -1; mac->first_sync_frame = -1;
mac->get_sib1 = false; mac->get_sib1 = false;
mac->get_otherSI = false;
mac->phy_config_request_sent = false; mac->phy_config_request_sent = false;
mac->state = UE_NOT_SYNC; mac->state = UE_NOT_SYNC;
} }
...@@ -354,13 +355,17 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id, ...@@ -354,13 +355,17 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
unsigned int gNB_index, unsigned int gNB_index,
uint8_t ack_nack, uint8_t ack_nack,
uint8_t *pduP, uint8_t *pduP,
uint32_t pdu_len) { uint32_t pdu_len)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
if(ack_nack) { if(ack_nack) {
LOG_D(NR_MAC, "Decoding NR-BCCH-DL-SCH-Message (SIB1 or SI)\n"); LOG_D(NR_MAC, "Decoding NR-BCCH-DL-SCH-Message (SIB1 or SI)\n");
nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len); nr_mac_rrc_data_ind_ue(module_id, cc_id, gNB_index, 0, 0, 0, NR_BCCH_DL_SCH, (uint8_t *) pduP, pdu_len);
} }
else else
LOG_E(NR_MAC, "Got NACK on NR-BCCH-DL-SCH-Message (SIB1 or SI)\n"); LOG_E(NR_MAC, "Got NACK on NR-BCCH-DL-SCH-Message (%s)\n", mac->get_sib1 ? "SIB1" : "other SI");
mac->get_sib1 = false;
mac->get_otherSI = false;
return 0; return 0;
} }
......
...@@ -1053,7 +1053,8 @@ int handle_bcch_bch(module_id_t module_id, int cc_id, ...@@ -1053,7 +1053,8 @@ int handle_bcch_bch(module_id_t module_id, int cc_id,
} }
// L2 Abstraction Layer // L2 Abstraction Layer
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, uint32_t pdu_len){ int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, uint32_t pdu_len)
{
return nr_ue_decode_BCCH_DL_SCH(module_id, cc_id, gNB_index, ack_nack, pduP, pdu_len); return nr_ue_decode_BCCH_DL_SCH(module_id, cc_id, gNB_index, ack_nack, pduP, pdu_len);
} }
......
This diff is collapsed.
...@@ -134,23 +134,34 @@ typedef enum RA_trigger_e { ...@@ -134,23 +134,34 @@ typedef enum RA_trigger_e {
} RA_trigger_t; } RA_trigger_t;
typedef struct UE_RRC_SI_INFO_NR_s { typedef struct UE_RRC_SI_INFO_NR_s {
uint32_t SIStatus;
uint32_t SIcnt;
NR_SystemInformation_t *si;
NR_SIB1_t *sib1; NR_SIB1_t *sib1;
int sib1_timer;
NR_SIB2_t *sib2; NR_SIB2_t *sib2;
int sib2_timer;
NR_SIB3_t *sib3; NR_SIB3_t *sib3;
int sib3_timer;
NR_SIB4_t *sib4; NR_SIB4_t *sib4;
int sib4_timer;
NR_SIB5_t *sib5; NR_SIB5_t *sib5;
int sib5_timer;
NR_SIB6_t *sib6; NR_SIB6_t *sib6;
int sib6_timer;
NR_SIB7_t *sib7; NR_SIB7_t *sib7;
int sib7_timer;
NR_SIB8_t *sib8; NR_SIB8_t *sib8;
int sib8_timer;
NR_SIB9_t *sib9; NR_SIB9_t *sib9;
int sib9_timer;
NR_SIB10_r16_t *sib10; NR_SIB10_r16_t *sib10;
int sib10_timer;
NR_SIB11_r16_t *sib11; NR_SIB11_r16_t *sib11;
int sib11_timer;
NR_SIB12_r16_t *sib12; NR_SIB12_r16_t *sib12;
int sib12_timer;
NR_SIB13_r16_t *sib13; NR_SIB13_r16_t *sib13;
int sib13_timer;
NR_SIB14_r16_t *sib14; NR_SIB14_r16_t *sib14;
int sib14_timer;
} __attribute__ ((__packed__)) NR_UE_RRC_SI_INFO; } __attribute__ ((__packed__)) NR_UE_RRC_SI_INFO;
typedef struct NR_UE_Timers_Constants_s { typedef struct NR_UE_Timers_Constants_s {
...@@ -212,7 +223,6 @@ typedef struct NR_UE_RRC_INST_s { ...@@ -212,7 +223,6 @@ typedef struct NR_UE_RRC_INST_s {
NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE];
NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE];
uint8_t MBMS_flag;
OAI_NR_UECapability_t *UECap; OAI_NR_UECapability_t *UECap;
uint8_t *UECapability; uint8_t *UECapability;
uint16_t UECapability_size; uint16_t UECapability_size;
...@@ -223,7 +233,6 @@ typedef struct NR_UE_RRC_INST_s { ...@@ -223,7 +233,6 @@ typedef struct NR_UE_RRC_INST_s {
plmn_t plmnID; plmn_t plmnID;
BIT_STRING_t requested_SI_List;
NR_UE_RRC_SI_INFO SInfo[NB_SIG_CNX_UE]; NR_UE_RRC_SI_INFO SInfo[NB_SIG_CNX_UE];
NR_MIB_t *mib; NR_MIB_t *mib;
......
...@@ -159,7 +159,9 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len); ...@@ -159,7 +159,9 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len);
int get_from_lte_ue_fd(); int get_from_lte_ue_fd();
void nr_ue_rrc_timer_trigger(int module_id, int frame, int slot); void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo);
void nr_ue_rrc_timer_trigger(int module_id, int frame, int slot, int gnb_id);
void configure_spcell(NR_UE_RRC_INST_t *rrc, NR_SpCellConfig_t *spcell_config); void configure_spcell(NR_UE_RRC_INST_t *rrc, NR_SpCellConfig_t *spcell_config);
void reset_rlf_timers_and_constants(NR_UE_Timers_Constants_t *tac); void reset_rlf_timers_and_constants(NR_UE_Timers_Constants_t *tac);
......
...@@ -21,6 +21,124 @@ ...@@ -21,6 +21,124 @@
#include "openair2/RRC/NR_UE/rrc_proto.h" #include "openair2/RRC/NR_UE/rrc_proto.h"
void nr_rrc_SI_timers(NR_UE_RRC_SI_INFO *SInfo)
{
// delete any stored version of a SIB after 3 hours
// from the moment it was successfully confirmed as valid
if (SInfo->sib1) {
SInfo->sib1_timer += 10;
if (SInfo->sib1_timer > 10800000) {
SInfo->sib1_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB1, SInfo->sib1, 1);
SInfo->sib1 = NULL;
}
}
if (SInfo->sib2) {
SInfo->sib2_timer += 10;
if (SInfo->sib2_timer > 10800000) {
SInfo->sib2_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB2, SInfo->sib2, 1);
SInfo->sib2 = NULL;
}
}
if (SInfo->sib3) {
SInfo->sib3_timer += 10;
if (SInfo->sib3_timer > 10800000) {
SInfo->sib3_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB3, SInfo->sib3, 1);
SInfo->sib3 = NULL;
}
}
if (SInfo->sib4) {
SInfo->sib4_timer += 10;
if (SInfo->sib4_timer > 10800000) {
SInfo->sib4_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB4, SInfo->sib4, 1);
SInfo->sib4 = NULL;
}
}
if (SInfo->sib5) {
SInfo->sib5_timer += 10;
if (SInfo->sib5_timer > 10800000) {
SInfo->sib5_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB5, SInfo->sib5, 1);
SInfo->sib5 = NULL;
}
}
if (SInfo->sib6) {
SInfo->sib6_timer += 10;
if (SInfo->sib6_timer > 10800000) {
SInfo->sib6_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB6, SInfo->sib6, 1);
SInfo->sib6 = NULL;
}
}
if (SInfo->sib7) {
SInfo->sib7_timer += 10;
if (SInfo->sib7_timer > 10800000) {
SInfo->sib7_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB7, SInfo->sib7, 1);
SInfo->sib7 = NULL;
}
}
if (SInfo->sib8) {
SInfo->sib8_timer += 10;
if (SInfo->sib8_timer > 10800000) {
SInfo->sib8_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB8, SInfo->sib8, 1);
SInfo->sib8 = NULL;
}
}
if (SInfo->sib9) {
SInfo->sib9_timer += 10;
if (SInfo->sib9_timer > 10800000) {
SInfo->sib9_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB9, SInfo->sib9, 1);
SInfo->sib9 = NULL;
}
}
if (SInfo->sib10) {
SInfo->sib10_timer += 10;
if (SInfo->sib10_timer > 10800000) {
SInfo->sib10_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB10_r16, SInfo->sib10, 1);
SInfo->sib10 = NULL;
}
}
if (SInfo->sib11) {
SInfo->sib11_timer += 10;
if (SInfo->sib11_timer > 10800000) {
SInfo->sib11_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB11_r16, SInfo->sib11, 1);
SInfo->sib11 = NULL;
}
}
if (SInfo->sib12) {
SInfo->sib12_timer += 10;
if (SInfo->sib12_timer > 10800000) {
SInfo->sib12_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB12_r16, SInfo->sib12, 1);
SInfo->sib12 = NULL;
}
}
if (SInfo->sib13) {
SInfo->sib13_timer += 10;
if (SInfo->sib13_timer > 10800000) {
SInfo->sib13_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB13_r16, SInfo->sib13, 1);
SInfo->sib13 = NULL;
}
}
if (SInfo->sib14) {
SInfo->sib14_timer += 10;
if (SInfo->sib14_timer > 10800000) {
SInfo->sib14_timer = 0;
SEQUENCE_free(&asn_DEF_NR_SIB14_r16, SInfo->sib14, 1);
SInfo->sib14 = NULL;
}
}
}
void nr_rrc_handle_timers(NR_UE_Timers_Constants_t *timers) void nr_rrc_handle_timers(NR_UE_Timers_Constants_t *timers)
{ {
// T304 // T304
......
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