diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4b8..bdf7cfba7 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -96,9 +96,6 @@ struct gsm_subscriber_connection { struct gsm_lchan *lchan; /* the future/allocated but not yet used lchan during HANDOVER */ struct gsm_lchan *ho_lchan; - /* a short-hand pointer to the BTS currently serving the subscriber, - * points to gsm_subscriber_connection.lchan->ts->trx->bts */ - struct gsm_bts *bts; /* timer for assignment handling */ struct osmo_timer_list T10; @@ -116,13 +113,14 @@ struct gsm_subscriber_connection { struct llist_head ho_penalty_timers; }; -static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { - return conn->bts; -} - #include "gsm_data_shared.h" +static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { + OSMO_ASSERT(conn->lchan); + return conn->lchan->ts->trx->bts; +} + enum { BTS_CTR_CHREQ_TOTAL, BTS_CTR_CHREQ_NO_CHANNEL, diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 27bf739d1..21836f326 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -274,7 +274,6 @@ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lcha conn->network = net; conn->lchan = lchan; - conn->bts = lchan->ts->trx->bts; lchan->conn = conn; INIT_LLIST_HEAD(&conn->ho_dtap_cache); INIT_LLIST_HEAD(&conn->ho_penalty_timers); @@ -873,7 +872,6 @@ int gsm0808_clear(struct gsm_subscriber_connection *conn) conn->lchan = NULL; conn->secondary_lchan = NULL; conn->ho_lchan = NULL; - conn->bts = NULL; osmo_timer_del(&conn->T10); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de73e..6eada5b96 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -288,7 +288,6 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan) new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; - new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 1fb51aadc..420ef73d6 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -134,7 +134,6 @@ static void test_scan(void) bts->network = net; sccp_con->msc = msc; - conn->bts = bts; conn->sccp_con = sccp_con; conn->lchan = &bts->c0->ts[1].lchan[0];