Get rid of singleton gprs_bssgp_pcu_current_bctx()

Access it from existing pointers instead.

Change-Id: I77455da5221090ebea142ecd49d5dba0065bfc5c
This commit is contained in:
Pau Espin 2021-01-21 18:02:40 +01:00
parent 2e6b60df45
commit db5e339da4
5 changed files with 4 additions and 10 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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) {