Commit 3d804db4 authored by francescomani's avatar francescomani

minor code refactoring

parent 64568b2a
......@@ -921,12 +921,12 @@ void update_ul_ue_R_Qm(int mcs, const NR_pusch_semi_static_t *ps, uint16_t *R, u
}
}
void nr_ue_max_mcs_min_rb(int mu, int ph, NR_pusch_semi_static_t *ps, long* deltaMCS, uint16_t minRb, uint32_t tbs, uint16_t *Rb, uint8_t *mcs)
void nr_ue_max_mcs_min_rb(int mu, int ph_limit, NR_pusch_semi_static_t *ps, long* deltaMCS, uint16_t minRb, uint32_t tbs, uint16_t *Rb, uint8_t *mcs)
{
AssertFatal(*Rb >= minRb, "illegal Rb %d < minRb %d\n", *Rb, minRb);
AssertFatal(*mcs >= 0 && *mcs <= 28, "illegal MCS %d\n", *mcs);
int tbs_bits = tbs << 3;
const int tbs_bits = tbs << 3;
uint16_t R;
uint8_t Qm;
update_ul_ue_R_Qm(*mcs, ps, &R, &Qm);
......@@ -939,7 +939,7 @@ void nr_ue_max_mcs_min_rb(int mu, int ph, NR_pusch_semi_static_t *ps, long* delt
ps->N_PRB_DMRS*ps->num_dmrs_symb,
deltaMCS);
while (ph < tx_power && *Rb >= minRb) {
while (ph_limit < tx_power && *Rb >= minRb) {
(*Rb)--;
tx_power = compute_bw_factor(mu, *Rb) +
compute_delta_tf(tbs_bits,
......@@ -950,7 +950,7 @@ void nr_ue_max_mcs_min_rb(int mu, int ph, NR_pusch_semi_static_t *ps, long* delt
deltaMCS);
}
while (ph < tx_power && *mcs > 6) {
while (ph_limit < tx_power && *mcs > 6) {
(*mcs)--;
update_ul_ue_R_Qm(*mcs, ps, &R, &Qm);
tx_power = compute_bw_factor(mu, *Rb) +
......@@ -962,8 +962,9 @@ void nr_ue_max_mcs_min_rb(int mu, int ph, NR_pusch_semi_static_t *ps, long* delt
deltaMCS);
}
if (ph < tx_power)
LOG_W(NR_MAC, "PH %d < tx_power %d (RBs %d, MCS %d)\n", ph, tx_power, *Rb, *mcs);
if (ph_limit < tx_power)
LOG_W(NR_MAC, "Normalized power %d based on current resources (RBs %d, MCS %d) exceed reported PHR %d (normalized value)\n",
tx_power, *Rb, *mcs, ph_limit);
}
static bool allocate_ul_retransmission(gNB_MAC_INST *nrmac,
......
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