mscsplit: directly access gsm_network backpointer from gsm_subscriber_connection
The previous commit added a network backpointer to gsm_subscriber_connection.
Use it wherever it makes sense, to skip the step through the bts structure.
In some places, remove local variables that become unused.
Change-Id: I34537025986713291e14c8212a81539b497befd4
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index 02751f4..cc12e9f 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -146,7 +146,7 @@
conn->secondary_lchan = NULL;
/* inform them about the failure */
- api = conn->bts->network->bsc_api;
+ api = conn->network->bsc_api;
api->assign_fail(conn, GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, NULL);
}
@@ -157,7 +157,7 @@
struct gsm_lchan *lchan, int full_rate)
{
struct bsc_api *api;
- api = conn->bts->network->bsc_api;
+ api = conn->network->bsc_api;
struct amr_multirate_conf *mr;
struct gsm48_multi_rate_conf *mr_conf;
@@ -387,7 +387,7 @@
int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate)
{
struct bsc_api *api;
- api = conn->bts->network->bsc_api;
+ api = conn->network->bsc_api;
if (!chan_compat_with_mode(conn->lchan, chan_mode, full_rate)) {
if (handle_new_assignment(conn, chan_mode, full_rate) != 0)
@@ -424,7 +424,7 @@
struct msgb *msg)
{
struct gsm48_hdr *gh;
- struct bsc_api *api = conn->bts->network->bsc_api;
+ struct bsc_api *api = conn->network->bsc_api;
if (conn->secondary_lchan != msg->lchan) {
LOGP(DMSC, LOGL_ERROR, "Assignment Compl should occur on second lchan.\n");
@@ -461,7 +461,7 @@
static void handle_ass_fail(struct gsm_subscriber_connection *conn,
struct msgb *msg)
{
- struct bsc_api *api = conn->bts->network->bsc_api;
+ struct bsc_api *api = conn->network->bsc_api;
uint8_t *rr_failure;
struct gsm48_hdr *gh;
@@ -751,7 +751,7 @@
if (!conn)
return;
- api = conn->bts->network->bsc_api;
+ api = conn->network->bsc_api;
if (!api || !api->sapi_n_reject)
return;