diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-01-21 18:02:40 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-01-21 18:02:57 +0100 |
commit | db5e339da4a34568d0ae65657616bf0fb4c91951 (patch) | |
tree | 6e137404caa3a3d09d18588705fecad14a54929e | |
parent | 2e6b60df455ad35c296460e0ad38e2dbe8ae511e (diff) |
Get rid of singleton gprs_bssgp_pcu_current_bctx()
Access it from existing pointers instead.
Change-Id: I77455da5221090ebea142ecd49d5dba0065bfc5c
-rw-r--r-- | src/gprs_bssgp_pcu.c | 7 | ||||
-rw-r--r-- | src/gprs_bssgp_pcu.h | 1 | ||||
-rw-r--r-- | src/pcu_l1_if.cpp | 2 | ||||
-rw-r--r-- | src/tbf_dl.cpp | 2 | ||||
-rw-r--r-- | src/tbf_ul.cpp | 2 |
5 files changed, 4 insertions, 10 deletions
diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c index 956fb666..c5cc39df 100644 --- a/src/gprs_bssgp_pcu.c +++ b/src/gprs_bssgp_pcu.c @@ -515,7 +515,7 @@ static void handle_nm_status(struct osmo_bssgp_prim *bp) 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 @@ void gprs_bssgp_destroy(struct gprs_rlcmac_bts *bts) 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 df225411..4b0e0aa0 100644 --- a/src/gprs_bssgp_pcu.h +++ b/src/gprs_bssgp_pcu.h @@ -78,7 +78,6 @@ struct gprs_bssgp_pcu { }; 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 8ae74d52..d7590e1f 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -782,7 +782,7 @@ static int pcu_rx_pag_req(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_pag_req 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 87c897f5..de433492 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -641,7 +641,7 @@ void gprs_rlcmac_dl_tbf::schedule_next_frame() 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 0c59a50f..a5fc376a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -560,7 +560,7 @@ int gprs_rlcmac_ul_tbf::snd_ul_ud() 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) { |