pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/33121 )

 (

2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: Derive FN from RFN once and cache it in struct rach_ind_params
......................................................................

Derive FN from RFN once and cache it in struct rach_ind_params

Change-Id: Iaefb9650dfc5083360a4a24b9c17fdbf3115e51f
---
M src/bts.cpp
M src/bts.h
M src/pcu_l1_if.cpp
M tests/tbf/TbfTest.cpp
4 files changed, 15 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/bts.cpp b/src/bts.cpp
index 8be87be..5160fd5 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -531,7 +531,7 @@
        }

        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 @@
        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 7a67f76..9a18cf3 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -197,6 +197,7 @@
        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 cda7af7..e675d86 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -631,6 +631,7 @@
                .trx_nr = trx_nr,
                .ts_nr = ts_nr,
                .rfn = fn2rfn(fn),
+               .fn = fn,
                .qta = qta,
        };

@@ -670,6 +671,7 @@
                .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,
        };

diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index ae8b56f..bb36f9e 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -81,6 +81,7 @@
                .trx_nr = 0,
                .ts_nr = 0,
                .rfn = fn2rfn(Fn),
+               .fn = Fn,
                .qta = qta,
        };


--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/33121
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Iaefb9650dfc5083360a4a24b9c17fdbf3115e51f
Gerrit-Change-Number: 33121
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to