Commit 70475fec authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/NR_UE_RRC_handle_otherSI' into integration_2023_w28

parents b55bff37 b4734211
......@@ -936,7 +936,7 @@ void *UE_thread(void *arg) {
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
notifiedFIFO_elt_t *newElt = newNotifiedFIFO_elt(sizeof(nr_rxtx_thread_data_t), curMsg.proc.nr_slot_tx, &txFifo, processSlotTX);
......
......@@ -442,6 +442,9 @@ typedef struct {
uint16_t start_rb;
uint16_t number_symbols;
uint16_t start_symbol;
// TODO this is a workaround to make it work
// implementation is also a bunch of workarounds
uint16_t rb_offset;
uint16_t dlDmrsSymbPos;
uint8_t dmrsConfigType;
uint8_t prb_bundling_size_ind;
......
......@@ -1597,13 +1597,13 @@ void NFAPI_NR_DMRS_TYPE2_average_prb(NR_DL_FRAME_PARMS *frame_parms,
}
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
bool is_SI,
unsigned short p,
unsigned char symbol,
unsigned char nscid,
unsigned short scrambling_id,
unsigned short BWPStart,
uint8_t config_type,
uint16_t rb_offset,
unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pdsch,
uint32_t pdsch_est_size,
......@@ -1629,10 +1629,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
#endif
// generate pilot for gNB port number 1000+p
uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12;
if (is_SI) {
rb_offset -= BWPStart;
}
int8_t delta = get_delta(p, config_type);
// checking if re-initialization of scrambling IDs is needed
......
......@@ -80,13 +80,13 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
bool is_SI,
unsigned short p,
unsigned char symbol,
unsigned char nscid,
unsigned short scrambling_id,
unsigned short BWPStart,
uint8_t config_type,
uint16_t rb_offset,
unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pdsch,
uint32_t pdsch_est_size,
......
......@@ -516,10 +516,9 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
uint16_t pdsch_nb_rb = dlsch0->dlsch_config.number_rbs;
uint16_t s0 = dlsch0->dlsch_config.start_symbol;
uint16_t s1 = dlsch0->dlsch_config.number_symbols;
bool is_SI = dlsch0->rnti_type == _SI_RNTI_;
LOG_D(PHY,"[UE %d] nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x, Nl %d\n",
ue->Mod_id,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0->dlsch_config.dlDmrsSymbPos, dlsch0->Nl);
LOG_D(PHY,"[UE %d] nr_slot_rx %d, harq_pid %d (%d), BWP start %d, rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x, Nl %d\n",
ue->Mod_id,nr_slot_rx,harq_pid,dlsch0_harq->status,BWPStart,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0->dlsch_config.dlDmrsSymbPos, dlsch0->Nl);
const uint32_t pdsch_est_size = ((ue->frame_parms.symbols_per_slot * ue->frame_parms.ofdm_symbol_size + 15) / 16) * 16;
__attribute__((aligned(32))) int32_t pdsch_dl_ch_estimates[ue->frame_parms.nb_antennas_rx * dlsch0->Nl][pdsch_est_size];
......@@ -541,13 +540,13 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m);
nr_pdsch_channel_estimation(ue,
proc,
is_SI,
get_dmrs_port(aatx,dlsch0->dlsch_config.dmrs_ports),
m,
dlsch0->dlsch_config.nscid,
dlsch0->dlsch_config.dlDmrsScramblingId,
BWPStart,
dlsch0->dlsch_config.dmrsConfigType,
dlsch0->dlsch_config.rb_offset,
ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12,
pdsch_nb_rb,
pdsch_est_size,
......
......@@ -467,6 +467,7 @@ typedef struct rrc_subframe_process_s {
typedef struct nrrrc_slot_process_s {
int frame;
int slot;
int gnb_id;
} NRRrcSlotProcess;
// eNB: RLC -> RRC messages
......
......@@ -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,
int cc_idP,
NR_MIB_t *mib,
bool sched_sib1)
int sched_sib)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
AssertFatal(mib, "MIB should not be NULL\n");
......@@ -709,16 +709,21 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
mac->mib = mib; // update by every reception
mac->phy_config.Mod_id = module_id;
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,
int cc_idP,
struct NR_SI_SchedulingInfo *si_SchedulingInfo,
NR_ServingCellConfigCommonSIB_t *scc)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
AssertFatal(scc, "SIB1 SCC should not be NULL\n");
mac->scc_SIB = scc;
mac->si_SchedulingInfo = si_SchedulingInfo;
mac->nr_band = *scc->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
config_common_ue_sa(mac, module_id, cc_idP);
configure_current_BWP(mac, scc, NULL);
......
......@@ -382,6 +382,43 @@ typedef struct NR_UL_TIME_ALIGNMENT {
int slot;
} NR_UL_TIME_ALIGNMENT_t;
// The PRACH Config period is a series of selected slots in one or multiple frames
typedef struct prach_conf_period {
prach_occasion_slot_t prach_occasion_slot_map[MAX_NB_FRAME_IN_PRACH_CONF_PERIOD][MAX_NB_SLOT_IN_FRAME];
uint16_t nb_of_prach_occasion; // Total number of PRACH occasions in the PRACH Config period
uint8_t nb_of_frame; // Size of the PRACH Config period in number of 10ms frames
uint8_t nb_of_slot; // Nb of slots in each frame
} prach_conf_period_t;
// The association period is a series of PRACH Config periods
typedef struct prach_association_period {
prach_conf_period_t *prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PERIOD];
uint8_t nb_of_prach_conf_period; // Nb of PRACH configuration periods within the association period
uint8_t nb_of_frame; // Total number of frames included in the association period
} prach_association_period_t;
// The association pattern is a series of Association periods
typedef struct prach_association_pattern {
prach_association_period_t prach_association_period_list[MAX_NB_ASSOCIATION_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
prach_conf_period_t prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
uint8_t nb_of_assoc_period; // Nb of association periods within the association pattern
uint8_t nb_of_prach_conf_period_in_max_period; // Nb of PRACH configuration periods within the maximum association pattern period (according to the size of the configured PRACH
uint8_t nb_of_frame; // Total number of frames included in the association pattern period (after mapping the SSBs and determining the real association pattern length)
} prach_association_pattern_t;
// SSB details
typedef struct ssb_info {
bool transmitted; // True if the SSB index is transmitted according to the SSB positions map configuration
prach_occasion_info_t *mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN]; // List of mapped RACH Occasions to this SSB index
uint32_t nb_mapped_ro; // Total number of mapped ROs to this SSB index
} ssb_info_t;
// List of all the possible SSBs and their details
typedef struct ssb_list_info {
ssb_info_t tx_ssb[MAX_NB_SSB];
uint8_t nb_tx_ssb;
} ssb_list_info_t;
/*!\brief Top level UE MAC structure */
typedef struct {
NR_UE_L2_STATE_t state;
......@@ -394,6 +431,7 @@ typedef struct {
//// MAC config
int first_sync_frame;
bool get_sib1;
bool get_otherSI;
NR_DRX_Config_t *drx_Config;
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
NR_BSR_Config_t *bsr_Config;
......@@ -401,6 +439,9 @@ typedef struct {
NR_PHR_Config_t *phr_Config;
NR_RNTI_Value_t *cs_RNTI;
NR_MIB_t *mib;
struct NR_SI_SchedulingInfo *si_SchedulingInfo;
int si_window_start;
ssb_list_info_t ssb_list;
NR_UE_DL_BWP_t current_DL_BWP;
NR_UE_UL_BWP_t current_UL_BWP;
......@@ -484,43 +525,5 @@ typedef struct {
} NR_UE_MAC_INST_t;
// The PRACH Config period is a series of selected slots in one or multiple frames
typedef struct prach_conf_period {
prach_occasion_slot_t prach_occasion_slot_map[MAX_NB_FRAME_IN_PRACH_CONF_PERIOD][MAX_NB_SLOT_IN_FRAME];
uint16_t nb_of_prach_occasion; // Total number of PRACH occasions in the PRACH Config period
uint8_t nb_of_frame; // Size of the PRACH Config period in number of 10ms frames
uint8_t nb_of_slot; // Nb of slots in each frame
} prach_conf_period_t;
// The association period is a series of PRACH Config periods
typedef struct prach_association_period {
prach_conf_period_t *prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PERIOD];
uint8_t nb_of_prach_conf_period; // Nb of PRACH configuration periods within the association period
uint8_t nb_of_frame; // Total number of frames included in the association period
} prach_association_period_t;
// The association pattern is a series of Association periods
typedef struct prach_association_pattern {
prach_association_period_t prach_association_period_list[MAX_NB_ASSOCIATION_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
prach_conf_period_t prach_conf_period_list[MAX_NB_PRACH_CONF_PERIOD_IN_ASSOCIATION_PATTERN_PERIOD];
uint8_t nb_of_assoc_period; // Nb of association periods within the association pattern
uint8_t nb_of_prach_conf_period_in_max_period; // Nb of PRACH configuration periods within the maximum association pattern period (according to the size of the configured PRACH
uint8_t nb_of_frame; // Total number of frames included in the association pattern period (after mapping the SSBs and determining the real association pattern length)
} prach_association_pattern_t;
// SSB details
typedef struct ssb_info {
bool transmitted; // True if the SSB index is transmitted according to the SSB positions map configuration
prach_occasion_info_t *mapped_ro[MAX_NB_RO_PER_SSB_IN_ASSOCIATION_PATTERN]; // List of mapped RACH Occasions to this SSB index
uint32_t nb_mapped_ro; // Total number of mapped ROs to this SSB index
} ssb_info_t;
// List of all the possible SSBs and their details
typedef struct ssb_list_info {
ssb_info_t tx_ssb[MAX_NB_SSB];
uint8_t nb_tx_ssb;
} ssb_list_info_t;
/*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */
......@@ -106,10 +106,11 @@ void nr_rrc_mac_config_req_mcg(module_id_t module_id,
void nr_rrc_mac_config_req_mib(module_id_t module_id,
int cc_idP,
NR_MIB_t *mibP,
bool sched_sib1);
int sched_sib1);
void nr_rrc_mac_config_req_sib1(module_id_t module_id,
int cc_idP,
struct NR_SI_SchedulingInfo *si_SchedulingInfo,
NR_ServingCellConfigCommonSIB_t *scc);
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
......
......@@ -365,10 +365,78 @@ bool is_ss_monitor_occasion(const int frame, const int slot, const int slots_per
return monitor;
}
bool monitior_dci_for_other_SI(NR_UE_MAC_INST_t *mac,
const NR_SearchSpace_t *ss,
const int slots_per_frame,
const int frame,
const int slot)
{
const struct NR_SI_SchedulingInfo *si_SchedulingInfo = mac->si_SchedulingInfo;
// 5.2.2.3.2 in 331
if (!si_SchedulingInfo)
return false;
const int si_window_slots = 5 << si_SchedulingInfo->si_WindowLength;
const int abs_slot = frame * slots_per_frame + slot;
for (int n = 0; n < si_SchedulingInfo->schedulingInfoList.list.count; n++) {
struct NR_SchedulingInfo *sched_Info = si_SchedulingInfo->schedulingInfoList.list.array[n];
if(mac->si_window_start == -1) {
int x = n * si_window_slots;
int T = 8 << sched_Info->si_Periodicity; // radio frame periodicity
if ((frame % T) == (x / slots_per_frame) &&
(x % slots_per_frame == 0))
mac->si_window_start = abs_slot; // in terms of absolute slot number
}
if (mac->si_window_start == -1) {
// out of window
return false;
}
else if (abs_slot > mac->si_window_start + si_window_slots) {
// window expired
mac->si_window_start = -1;
return false;
}
else {
const int duration = ss->duration ? *ss->duration : 1;
int period, offset;
get_monitoring_period_offset(ss, &period, &offset);
for (int i = 0; i < duration; i++) {
if (((frame * slots_per_frame + slot - offset - i) % period) == 0) {
int N = mac->ssb_list.nb_tx_ssb;
int K = 0; // k_th transmitted SSB
for (int i = 0; i < mac->mib_ssb; i++) {
if(mac->ssb_list.tx_ssb[i].transmitted)
K++;
}
// numbering current frame and slot in terms of monitoring occasions in window
int current_monitor_occasion = ((abs_slot - mac->si_window_start) % period) +
(duration * (abs_slot - mac->si_window_start) / period);
if (current_monitor_occasion % N == K)
return true;
else
return false;
}
}
}
}
return false;
}
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, const frame_t frame, const int slot)
{
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];
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 (monitior_dci_for_other_SI(mac, ss, slots_per_frame, frame, slot)) {
LOG_D(NR_MAC, "Monitoring DCI for other SIs in frame %d slot %d\n", frame, slot);
config_dci_pdu(mac, dl_config, NR_RNTI_SI, slot, ss);
}
}
if (mac->state == UE_PERFORMING_RA &&
mac->ra.ra_state >= WAIT_RAR) {
// if RA is ongoing use RA search space
......
......@@ -165,8 +165,10 @@ void nr_ue_init_mac(module_id_t module_idP)
nr_ue_mac_default_configs(mac);
mac->first_sync_frame = -1;
mac->get_sib1 = false;
mac->get_otherSI = false;
mac->phy_config_request_sent = false;
mac->state = UE_NOT_SYNC;
mac->si_window_start = -1;
}
void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
......@@ -354,13 +356,17 @@ int8_t nr_ue_decode_BCCH_DL_SCH(module_id_t module_id,
unsigned int gNB_index,
uint8_t ack_nack,
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) {
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);
}
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;
}
......@@ -655,7 +661,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
dlsch_config_pdu_1_0->pduBitmap = 0;
NR_PDSCH_Config_t *pdsch_config = current_DL_BWP ? current_DL_BWP->pdsch_Config : NULL;
NR_PDSCH_Config_t *pdsch_config = (current_DL_BWP || !mac->get_sib1) ? current_DL_BWP->pdsch_Config : NULL;
if (dci_ind->ss_type == NR_SearchSpace__searchSpaceType_PR_common) {
dlsch_config_pdu_1_0->BWPSize = mac->type0_PDCCH_CSS_config.num_rbs ? mac->type0_PDCCH_CSS_config.num_rbs : current_DL_BWP->initial_BWPSize;
dlsch_config_pdu_1_0->BWPStart = dci_ind->cset_start;
......@@ -672,7 +678,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
dlsch_config_pdu_1_0->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon;
if(mac->frequency_range == FR2)
dlsch_config_pdu_1_0->SubcarrierSpacing = mac->mib->subCarrierSpacingCommon + 2;
if (pdsch_config) pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL; // For PDSCH with mapping type A, the UE shall assume dmrs-AdditionalPosition='pos2'
} else {
dlsch_config_pdu_1_0->SubcarrierSpacing = current_DL_BWP->scs;
if (ra->RA_window_cnt >= 0 && rnti == ra->ra_rnti){
......@@ -688,19 +693,23 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
LOG_W(MAC, "[%d.%d] Invalid frequency_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
return -1;
}
dlsch_config_pdu_1_0->rb_offset = dlsch_config_pdu_1_0->start_rb + dlsch_config_pdu_1_0->BWPStart;
if (mac->get_sib1)
dlsch_config_pdu_1_0->rb_offset -= dlsch_config_pdu_1_0->BWPStart;
/* TIME_DOM_RESOURCE_ASSIGNMENT */
int dmrs_typeA_pos = (mac->scc != NULL) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position;
// TODO need to differentiate SI_RNTI between SIB1 and other SIB
NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP, dci_ind->ss_type, dci->time_domain_assignment.val,
dmrs_typeA_pos, mux_pattern, get_rnti_type(mac, rnti), coreset_type, rnti == SI_RNTI);
dmrs_typeA_pos, mux_pattern, get_rnti_type(mac, rnti), coreset_type, mac->get_sib1);
dlsch_config_pdu_1_0->number_symbols = tda_info.nrOfSymbols;
dlsch_config_pdu_1_0->start_symbol = tda_info.startSymbolIndex;
struct NR_DMRS_DownlinkConfig *dl_dmrs_config = NULL;
if (pdsch_config)
dl_dmrs_config = (tda_info.mapping_type == typeA) ? pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup : pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
dl_dmrs_config = (tda_info.mapping_type == typeA) ?
pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup :
pdsch_config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
dlsch_config_pdu_1_0->nscid = 0;
if(dl_dmrs_config && dl_dmrs_config->scramblingID0)
......@@ -908,6 +917,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
LOG_W(MAC, "[%d.%d] Invalid frequency_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
return -1;
}
dlsch_config_pdu_1_1->rb_offset = dlsch_config_pdu_1_1->start_rb + dlsch_config_pdu_1_1->BWPStart;
/* TIME_DOM_RESOURCE_ASSIGNMENT */
int dmrs_typeA_pos = (mac->scc != NULL) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position;
NR_tda_info_t tda_info = get_dl_tda_info(current_DL_BWP, dci_ind->ss_type, dci->time_domain_assignment.val,
......
This diff is collapsed.
......@@ -1053,7 +1053,8 @@ int handle_bcch_bch(module_id_t module_id, int cc_id,
}
// 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);
}
......
This diff is collapsed.
......@@ -134,23 +134,34 @@ typedef enum RA_trigger_e {
} RA_trigger_t;
typedef struct UE_RRC_SI_INFO_NR_s {
uint32_t SIStatus;
uint32_t SIcnt;
NR_SystemInformation_t *si;
NR_SIB1_t *sib1;
int sib1_timer;
NR_SIB2_t *sib2;
int sib2_timer;
NR_SIB3_t *sib3;
int sib3_timer;
NR_SIB4_t *sib4;
int sib4_timer;
NR_SIB5_t *sib5;
int sib5_timer;
NR_SIB6_t *sib6;
int sib6_timer;
NR_SIB7_t *sib7;
int sib7_timer;
NR_SIB8_t *sib8;
int sib8_timer;
NR_SIB9_t *sib9;
int sib9_timer;
NR_SIB10_r16_t *sib10;
int sib10_timer;
NR_SIB11_r16_t *sib11;
int sib11_timer;
NR_SIB12_r16_t *sib12;
int sib12_timer;
NR_SIB13_r16_t *sib13;
int sib13_timer;
NR_SIB14_r16_t *sib14;
int sib14_timer;
} __attribute__ ((__packed__)) NR_UE_RRC_SI_INFO;
typedef struct NR_UE_Timers_Constants_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 Srb2[NB_CNX_UE];
uint8_t MBMS_flag;
OAI_NR_UECapability_t *UECap;
uint8_t *UECapability;
uint16_t UECapability_size;
......@@ -223,7 +233,6 @@ typedef struct NR_UE_RRC_INST_s {
plmn_t plmnID;
BIT_STRING_t requested_SI_List;
NR_UE_RRC_SI_INFO SInfo[NB_SIG_CNX_UE];
NR_MIB_t *mib;
......
......@@ -159,7 +159,9 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len);
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 reset_rlf_timers_and_constants(NR_UE_Timers_Constants_t *tac);
......
......@@ -21,6 +21,124 @@
#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)
{
// 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