remove obsolete gsm_subscriber_connection.bts member

This member was merely a cache for conn->lchan->ts->trx->bts,
so let's avoid having to keep copies of the same data (which needs
to be kept up to date).

Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0
This commit is contained in:
Harald Welte 2017-12-18 18:48:21 +01:00
parent 720de68cb0
commit b794887cab
4 changed files with 5 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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