Derive FN from RFN once and cache it in struct rach_ind_params

Change-Id: Iaefb9650dfc5083360a4a24b9c17fdbf3115e51f
This commit is contained in:
Pau Espin 2023-05-31 20:03:41 +02:00
parent bd461e62b5
commit fe8f4a4c87
4 changed files with 6 additions and 4 deletions

View File

@ -531,7 +531,7 @@ void bts_send_gsmtap_rach(struct gprs_rlcmac_bts *bts,
}
bts_send_gsmtap_meas(bts, categ, true, rip->trx_nr, rip->ts_nr, channel,
bts_rfn_to_fn(bts, rip->rfn), ra_buf,
rip->fn, ra_buf,
rip->is_11bit ? 2 : 1, &meas);
}
@ -943,15 +943,13 @@ int bts_rcv_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip)
if (rip->is_11bit)
bts_do_rate_ctr_inc(bts, CTR_RACH_REQUESTS_11BIT);
/* Determine full frame number */
uint32_t Fn = bts_rfn_to_fn(bts, rip->rfn);
uint8_t ta = qta2ta(rip->qta);
bts_send_gsmtap_rach(bts, PCU_GSMTAP_C_UL_RACH, GSMTAP_CHANNEL_RACH, rip);
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests Uplink resource on CCCH/RACH: "
"ra=0x%02x (%d bit) Fn=%u qta=%d\n", rip->ra,
rip->is_11bit ? 11 : 8, Fn, rip->qta);
rip->is_11bit ? 11 : 8, rip->fn, rip->qta);
/* Parse [EGPRS Packet] Channel Request from RACH.ind */
rc = parse_rach_ind(rip, &chan_req);

View File

@ -197,6 +197,7 @@ struct rach_ind_params {
uint8_t trx_nr;
uint8_t ts_nr;
uint16_t rfn;
uint32_t fn;
int16_t qta;
};

View File

@ -631,6 +631,7 @@ extern "C" int pcu_rx_rach_ind_ptcch(struct gprs_rlcmac_bts *bts, uint8_t trx_nr
.trx_nr = trx_nr,
.ts_nr = ts_nr,
.rfn = fn2rfn(fn),
.fn = fn,
.qta = qta,
};
@ -670,6 +671,7 @@ static int pcu_rx_rach_ind(struct gprs_rlcmac_bts *bts, const struct gsm_pcu_if_
.trx_nr = rach_ind->trx_nr,
.ts_nr = rach_ind->ts_nr,
.rfn = rfn,
.fn = bts_rfn_to_fn(bts, rfn),
.qta = rach_ind->qta,
};

View File

@ -81,6 +81,7 @@ static int bts_handle_rach(struct gprs_rlcmac_bts *bts, uint16_t ra, uint32_t Fn
.trx_nr = 0,
.ts_nr = 0,
.rfn = fn2rfn(Fn),
.fn = Fn,
.qta = qta,
};