Change in osmo-pcu[master]: bts_rcv_rach(): Gather pointers to data objects early and use them later

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Oct 19 11:41:52 UTC 2021


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

Change subject: bts_rcv_rach(): Gather pointers to data objects early and use them later
......................................................................

bts_rcv_rach(): Gather pointers to data objects early and use them later

Change-Id: I476814d0f7be4b53f66211bb472700fee4f2caa9
---
M src/bts.cpp
1 file changed, 11 insertions(+), 12 deletions(-)

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



diff --git a/src/bts.cpp b/src/bts.cpp
index cad6c90..8d98fe4 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -867,7 +867,8 @@
 	struct chan_req_params chan_req = { 0 };
 	struct gprs_rlcmac_ul_tbf *tbf = NULL;
 	struct gprs_rlcmac_sba *sba;
-	uint8_t trx_no = 0, ts_no = 0; /* initialize to avoid uninitialized false warnings on some gcc versions (11.1.0) */
+	struct gprs_rlcmac_pdch *pdch = NULL;
+	struct gprs_rlcmac_trx *trx = NULL;
 	uint32_t sb_fn = 0;
 	uint8_t usf = 7;
 	uint8_t tsc = 0;
@@ -917,12 +918,11 @@
 			goto send_imm_ass_rej;
 		}
 
-		trx_no = sba->pdch->trx_no();
-		ts_no = sba->pdch->ts_no;
+		pdch = sba->pdch;
 		sb_fn = sba->fn;
-		tsc = bts->trx[trx_no].pdch[ts_no].tsc;
+		tsc = pdch->tsc;
 		LOGP(DRLCMAC, LOGL_DEBUG, "Allocated a single block at "
-		     "SBFn=%u TRX=%u TS=%u\n", sb_fn, trx_no, ts_no);
+		     "SBFn=%u TRX=%u TS=%u\n", sb_fn, pdch->trx->trx_no, pdch->ts_no);
 	} else {
 		GprsMs *ms = bts_alloc_ms(bts, 0, chan_req.egprs_mslot_class);
 		tbf = tbf_alloc_ul_ccch(bts, ms);
@@ -932,11 +932,11 @@
 			goto send_imm_ass_rej;
 		}
 		tbf->set_ta(ta);
-		trx_no = tbf->trx->trx_no;
-		ts_no = tbf->first_ts;
-		usf = tbf->m_usf[ts_no];
+		pdch = &tbf->trx->pdch[tbf->first_ts];
+		usf = tbf->m_usf[pdch->ts_no];
 		tsc = tbf->tsc();
 	}
+	trx = pdch->trx;
 
 send_imm_ass_rej:
 	/* Allocate a bit-vector for RR Immediate Assignment [Reject] */
@@ -952,10 +952,9 @@
 	} else {
 		LOGP(DRLCMAC, LOGL_DEBUG, "Tx Immediate Assignment on AGCH: "
 		     "TRX=%u (ARFCN %u) TS=%u TA=%u TSC=%u TFI=%d USF=%d\n",
-		     trx_no, bts->trx[trx_no].arfcn & ~ARFCN_FLAG_MASK,
-		     ts_no, ta, tsc, tbf ? tbf->tfi() : -1, usf);
-		plen = Encoding::write_immediate_assignment(
-			&bts->trx[trx_no].pdch[ts_no], tbf, bv,
+		     trx->trx_no, trx->arfcn & ~ARFCN_FLAG_MASK,
+		     pdch->ts_no, ta, tsc, tbf ? tbf->tfi() : -1, usf);
+		plen = Encoding::write_immediate_assignment(pdch, tbf, bv,
 			false, rip->ra, Fn, ta, usf, false, sb_fn,
 			bts_get_ms_pwr_alpha(bts), bts->pcu->vty.gamma, -1,
 			rip->burst_type);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I476814d0f7be4b53f66211bb472700fee4f2caa9
Gerrit-Change-Number: 25812
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211019/6fb8433c/attachment.htm>


More information about the gerrit-log mailing list