aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-05-31 20:03:41 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-06-02 14:37:05 +0200
commitfe8f4a4c874344759ecc314396dd0ac8c556edc9 (patch)
tree966f50e48ab480e2ac2fbf23a87970a777a8e5e8 /src
parentbd461e62b55e96cd69ca0f5cd9f448e44a8efeab (diff)
Derive FN from RFN once and cache it in struct rach_ind_params
Diffstat (limited to 'src')
-rw-r--r--src/bts.cpp6
-rw-r--r--src/bts.h1
-rw-r--r--src/pcu_l1_if.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 8be87bed..5160fd5f 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -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);
diff --git a/src/bts.h b/src/bts.h
index 7a67f76c..9a18cf36 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -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;
};
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index cda7af7a..e675d86f 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -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,
};