From 7214a9148eeea567e6934965ee805e65c23ce59f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 9 Nov 2016 14:43:33 +0100 Subject: UNTESTED WIP: remove global bssgp_nsi variable As we can now have several NS instances inside the program, let's remove the global bsspg_nsi to which BSSGP bound itself. Rather, all functions are now parametrized based on the NS Instance that's either * explicitly passed to the function (in case no msgb and no bctx), or * stated in the BVC context / bctx (if any), or * explicitly given as argument to the function (if no msgb and no bctx) Change-Id: Ibc7df60caf4adef690001536bd7a1293d866a1c2 --- include/osmocom/gprs/gprs_bssgp.h | 10 ++++++---- include/osmocom/gprs/gprs_bssgp_bss.h | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index b70487ce..f349e8a1 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -16,10 +16,10 @@ struct msgb *bssgp_msgb_copy(const struct msgb *msg, const char *name); const char *bssgp_cause_str(enum gprs_bssgp_cause cause); const char *bssgp_pdu_str(enum bssgp_pdu_type pdu); /* Transmit a simple response such as BLOCK/UNBLOCK/RESET ACK/NACK */ -int bssgp_tx_simple_bvci(uint8_t pdu_type, uint16_t nsei, +int bssgp_tx_simple_bvci(struct gprs_ns_inst *nsi, uint8_t pdu_type, uint16_t nsei, uint16_t bvci, uint16_t ns_bvci); /* Chapter 10.4.14: Status */ -int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg); +int bssgp_tx_status(struct gprs_ns_inst *nsi, uint8_t cause, uint16_t *bvci, struct msgb *orig_msg); enum bssgp_prim { PRIM_BSSGP_DL_UD, @@ -45,6 +45,7 @@ struct osmo_bssgp_prim { uint16_t nsei; uint16_t bvci; uint32_t tlli; + struct gprs_ns_inst *nsi; struct tlv_parsed *tp; struct gprs_ra_id *ra_id; @@ -86,6 +87,7 @@ struct bssgp_bvc_ctx { struct gprs_ra_id ra_id; /*!< parsed RA ID of the remote BTS */ uint16_t cell_id; /*!< Cell ID of the remote BTS */ + struct gprs_ns_inst *nsi; /* NSEI and BVCI of underlying Gb link. Together they * uniquely identify a link to a BTS (5.4.4) */ uint16_t bvci; @@ -185,8 +187,8 @@ struct bssgp_paging_info { }; /* Send a single GMM-PAGING.req to a given NSEI/NS-BVCI */ -int bssgp_tx_paging(uint16_t nsei, uint16_t ns_bvci, - struct bssgp_paging_info *pinfo); +int bssgp_tx_paging(struct gprs_ns_inst *nsi, uint16_t nsei, + uint16_t ns_bvci, struct bssgp_paging_info *pinfo); void bssgp_fc_init(struct bssgp_flow_control *fc, uint32_t bucket_size_max, uint32_t bucket_leak_rate, diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index d79b2100..1b6f7a69 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -27,10 +27,10 @@ uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); -int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, - const struct gprs_ra_id *ra_id); +int bssgp_tx_suspend(struct gprs_ns_inst *nsi, uint16_t nsei, + uint32_t tlli, const struct gprs_ra_id *ra_id); -int bssgp_tx_resume(uint16_t nsei, uint32_t tlli, +int bssgp_tx_resume(struct gprs_ns_inst *nsi, uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id, uint8_t suspend_ref); int bssgp_tx_ra_capa_upd(struct bssgp_bvc_ctx *bctx, uint32_t tlli, uint8_t tag); -- cgit v1.2.3