move radio link failure detection on pbch at MAC
This commit is contained in:
@@ -376,8 +376,9 @@ typedef struct {
|
||||
uint32_t ssb_index;
|
||||
/// SSB RSRP in dBm
|
||||
short ssb_rsrp_dBm;
|
||||
int consecutive_bch_failures;
|
||||
|
||||
} NR_PHY_meas_t;
|
||||
} NR_SSB_meas_t;
|
||||
|
||||
/*!\brief Top level UE MAC structure */
|
||||
typedef struct {
|
||||
@@ -465,7 +466,7 @@ typedef struct {
|
||||
uint16_t nr_band;
|
||||
uint8_t ssb_subcarrier_offset;
|
||||
|
||||
NR_PHY_meas_t phy_measurements;
|
||||
NR_SSB_meas_t ssb_measurements;
|
||||
|
||||
dci_pdu_rel15_t def_dci_pdu_rel15[8];
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
|
||||
nr_ue_mac_inst->sib1_decoded = false;
|
||||
nr_ue_mac_inst->phy_config_request_sent = false;
|
||||
nr_ue_mac_inst->state = UE_NOT_SYNC;
|
||||
memset(&nr_ue_mac_inst->ssb_measurements, 0, sizeof(nr_ue_mac_inst->ssb_measurements));
|
||||
|
||||
for (int j=0;j<NB_NR_UE_MAC_INST;j++) {
|
||||
nr_ue_init_mac(j);
|
||||
|
||||
@@ -124,7 +124,7 @@ int16_t get_prach_tx_power(module_id_t mod_id) {
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
int16_t pathloss = compute_nr_SSB_PL(mac, mac->phy_measurements.ssb_rsrp_dBm);
|
||||
int16_t pathloss = compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm);
|
||||
int16_t ra_preamble_rx_power = (int16_t)(ra->prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER - pathloss + 30);
|
||||
return min(nr_get_Pcmax(mod_id), ra_preamble_rx_power);
|
||||
|
||||
@@ -674,7 +674,7 @@ void nr_get_prach_resources(module_id_t mod_id,
|
||||
} else {
|
||||
/* TODO: This controls the tx_power of UE and the ramping procedure of RA of UE. Later we
|
||||
can abstract this, perhaps in the proxy. But for the time being lets leave it as below. */
|
||||
int16_t dl_pathloss = !get_softmodem_params()->emulate_l1 ? compute_nr_SSB_PL(mac, mac->phy_measurements.ssb_rsrp_dBm) : 0;
|
||||
int16_t dl_pathloss = !get_softmodem_params()->emulate_l1 ? compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm) : 0;
|
||||
ssb_rach_config(ra, prach_resources, nr_rach_ConfigCommon);
|
||||
ra_preambles_config(prach_resources, mac, dl_pathloss);
|
||||
LOG_D(MAC, "[RAPROC] - Selected RA preamble index %d for contention-based random access procedure... \n", ra->ra_PreambleIndex);
|
||||
|
||||
@@ -238,6 +238,8 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
|
||||
|
||||
AssertFatal(mac->mib != NULL, "nr_ue_decode_mib() mac->mib == NULL\n");
|
||||
|
||||
mac->ssb_measurements.consecutive_bch_failures = 0; // resetting decoding failures
|
||||
|
||||
uint16_t frame = (mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused);
|
||||
uint16_t frame_number_4lsb = 0;
|
||||
|
||||
@@ -1564,7 +1566,7 @@ int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
|
||||
return (PUCCH_POWER_DEFAULT);
|
||||
}
|
||||
|
||||
int16_t pathloss = compute_nr_SSB_PL(mac, mac->phy_measurements.ssb_rsrp_dBm);
|
||||
int16_t pathloss = compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm);
|
||||
int M_pucch_component = (10 * log10((double)(pow(2,scs) * nb_of_prbs)));
|
||||
|
||||
int16_t pucch_power = P_O_PUCCH + M_pucch_component + pathloss + delta_F_PUCCH + DELTA_TF + G_b_f_c;
|
||||
@@ -2179,7 +2181,7 @@ uint8_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
}
|
||||
AssertFatal(*SSB_resource.list.array[ssb_rsrp[0][0]] == mac->mib_ssb, "Couldn't find corresponding SSB in csi_SSB_ResourceList\n");
|
||||
ssb_rsrp[1][0] = mac->phy_measurements.ssb_rsrp_dBm;
|
||||
ssb_rsrp[1][0] = mac->ssb_measurements.ssb_rsrp_dBm;
|
||||
|
||||
uint8_t ssbi;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user