Change in osmo-pcu[master]: Get rid of singleton gprs_bssgp_pcu_current_bctx()

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
Thu Jan 21 17:03:20 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/22360 )


Change subject: Get rid of singleton gprs_bssgp_pcu_current_bctx()
......................................................................

Get rid of singleton gprs_bssgp_pcu_current_bctx()

Access it from existing pointers instead.

Change-Id: I77455da5221090ebea142ecd49d5dba0065bfc5c
---
M src/gprs_bssgp_pcu.c
M src/gprs_bssgp_pcu.h
M src/pcu_l1_if.cpp
M src/tbf_dl.cpp
M src/tbf_ul.cpp
5 files changed, 4 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/22360/1

diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c
index 956fb66..c5cc39d 100644
--- a/src/gprs_bssgp_pcu.c
+++ b/src/gprs_bssgp_pcu.c
@@ -515,7 +515,7 @@
 	if (!TLVP_PRESENT(bp->tp, BSSGP_IE_BVCI))
 		return;
 
-	if (gprs_bssgp_pcu_current_bctx()->bvci != bp->bvci) {
+	if (the_pcu->bssgp.bctx->bvci != bp->bvci) {
 		LOGP(DPCU, LOGL_NOTICE,
 			"Received BSSGP STATUS message for an unknown BVCI (%d), "
 			"ignored\n",
@@ -1181,11 +1181,6 @@
 	bts->nse = NULL;
 }
 
-struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void)
-{
-	return the_pcu->bssgp.bctx;
-}
-
 void gprs_bssgp_update_frames_sent()
 {
 	the_pcu->bssgp.queue_frames_sent += 1;
diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h
index df22541..4b0e0aa 100644
--- a/src/gprs_bssgp_pcu.h
+++ b/src/gprs_bssgp_pcu.h
@@ -78,7 +78,6 @@
 };
 
 int gprs_gp_send_cb(void *ctx, struct msgb *msg);
-struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void);
 int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
 void gprs_bssgp_update_queue_delay(const struct timespec *tv_recv,
 		const struct timespec *tv_now);
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 8ae74d5..d7590e1 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -782,7 +782,7 @@
 
 static int pcu_rx_susp_req(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_susp_req *susp_req)
 {
-	struct bssgp_bvc_ctx *bctx = gprs_bssgp_pcu_current_bctx();
+	struct bssgp_bvc_ctx *bctx = bts->pcu->bssgp.bctx;
 	GprsMs *ms;
 	struct gprs_rlcmac_dl_tbf *dl_tbf;
 	struct gprs_rlcmac_ul_tbf *ul_tbf;
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 87c897f..de43349 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -641,7 +641,7 @@
 		return;
 
 	/* dequeue next LLC frame, if any */
-	msg = llc_dequeue(gprs_bssgp_pcu_current_bctx());
+	msg = llc_dequeue(bts->pcu->bssgp.bctx);
 	if (!msg)
 		return;
 
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 0c59a50..a5fc376 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -560,7 +560,7 @@
 	uint8_t qos_profile[3];
 	struct msgb *llc_pdu;
 	unsigned msg_len = NS_HDR_LEN + BSSGP_HDR_LEN + llc_frame_length(&m_llc);
-	struct bssgp_bvc_ctx *bctx = gprs_bssgp_pcu_current_bctx();
+	struct bssgp_bvc_ctx *bctx = bts->pcu->bssgp.bctx;
 
 	LOGP(DBSSGP, LOGL_INFO, "LLC [PCU -> SGSN] %s len=%d\n", tbf_name(this), llc_frame_length(&m_llc));
 	if (!bctx) {

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I77455da5221090ebea142ecd49d5dba0065bfc5c
Gerrit-Change-Number: 22360
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210121/9291de54/attachment.htm>


More information about the gerrit-log mailing list