Add nr_mac_pc_reset_snr() to harmonize SNR reset on first reception
This commit is contained in:
@@ -4200,6 +4200,21 @@ void nr_mac_pc_snr(nr_power_control_t *pc, int snrx10, int rssi)
|
|||||||
pc->tpc_in_flight = PC_AVG_CNST * pc->tpc_in_flight; // + (1 - PC_AVG_CNST) * 0.0f
|
pc->tpc_in_flight = PC_AVG_CNST * pc->tpc_in_flight; // + (1 - PC_AVG_CNST) * 0.0f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enter new SNR and RSSI value for the latest UL transmission as new
|
||||||
|
* fixed averages. Reset "TPC in flight" to zero.
|
||||||
|
*
|
||||||
|
* @param pc the power control loop
|
||||||
|
* @param snrx10 the current SNR measurement multiplied by 10
|
||||||
|
* @param rssi the current RSSI measurement
|
||||||
|
*/
|
||||||
|
void nr_mac_pc_reset_snr(nr_power_control_t *pc, int snrx10, int rssi)
|
||||||
|
{
|
||||||
|
pc->avg_snr = 0.1f * snrx10;
|
||||||
|
pc->avg_rssi = rssi;
|
||||||
|
pc->tpc_in_flight = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set a new target SNR for this power control loop, which can be
|
* @brief Set a new target SNR for this power control loop, which can be
|
||||||
* updated on a continuous basis, and will be reflected immediately upon
|
* updated on a continuous basis, and will be reflected immediately upon
|
||||||
|
|||||||
@@ -911,10 +911,8 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, frame_t frame, slot_t slot, con
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Msg4 Ack: reset average with first measurement
|
// Msg4 Ack: reset average with first measurement
|
||||||
if (uci_01->ul_cqi != 0xff) {
|
if (uci_01->ul_cqi != 0xff)
|
||||||
UE->UE_sched_ctrl.pucch_pc.avg_rssi = uci_01->rssi;
|
nr_mac_pc_reset_snr(&UE->UE_sched_ctrl.pucch_pc, uci_01->ul_cqi * 5 - 640, uci_01->rssi);
|
||||||
UE->UE_sched_ctrl.pucch_pc.avg_snr = (uci_01->ul_cqi * 5 - 640) * 0.1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (harq_confidence == 1) {
|
if (harq_confidence == 1) {
|
||||||
UE->mac_stats.pucch0_DTX++;
|
UE->mac_stats.pucch0_DTX++;
|
||||||
|
|||||||
@@ -762,11 +762,9 @@ static void nr_rx_ra_sdu(const module_id_t mod_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ul_cqi != 0xff) {
|
if (ul_cqi != 0xff) {
|
||||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
|
|
||||||
// Msg3: reset average with first measurement. If this fails (e.g., ul_cqi == 0xff)
|
// Msg3: reset average with first measurement. If this fails (e.g., ul_cqi == 0xff)
|
||||||
// everything starts from predetermined value
|
// everything starts from predetermined value
|
||||||
sched_ctrl->pusch_pc.avg_snr = 0.1 * (ul_cqi * 5 - 640);
|
nr_mac_pc_reset_snr(&UE->UE_sched_ctrl.pusch_pc, ul_cqi * 5 - 640, rssi);
|
||||||
sched_ctrl->pusch_pc.avg_rssi = rssi;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sdu) { // NACK
|
if (!sdu) { // NACK
|
||||||
|
|||||||
@@ -500,6 +500,7 @@ void post_process_ulsch(gNB_MAC_INST *nr_mac, post_process_pusch_t *pusch, NR_UE
|
|||||||
|
|
||||||
float nr_mac_get_snr(const nr_power_control_t *pc);
|
float nr_mac_get_snr(const nr_power_control_t *pc);
|
||||||
void nr_mac_pc_snr(nr_power_control_t *pc, int snrx10, int rssi);
|
void nr_mac_pc_snr(nr_power_control_t *pc, int snrx10, int rssi);
|
||||||
|
void nr_mac_pc_reset_snr(nr_power_control_t *pc, int snrx10, int rssi);
|
||||||
void nr_mac_set_target_snrx10(nr_power_control_t *pc, int target_snrx10);
|
void nr_mac_set_target_snrx10(nr_power_control_t *pc, int target_snrx10);
|
||||||
void nr_mac_set_rssi_threshold(nr_power_control_t *pc, int rssi_threshold);
|
void nr_mac_set_rssi_threshold(nr_power_control_t *pc, int rssi_threshold);
|
||||||
void nr_mac_signal_dtx(nr_power_control_t *pc);
|
void nr_mac_signal_dtx(nr_power_control_t *pc);
|
||||||
|
|||||||
Reference in New Issue
Block a user