Get rid of singleton gprs_bssgp_pcu_current_bctx()
Access it from existing pointers instead.
Change-Id: I77455da5221090ebea142ecd49d5dba0065bfc5c
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) {