diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-06-04 13:20:04 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-05-02 19:24:28 +0200 |
commit | 621cadf6750be28cfbdac0ca8e407a0070a31ea2 (patch) | |
tree | 12df0941336151772708046c9e94749acadb4287 /openbsc/src/osmo-bsc | |
parent | 2677218846ebd1c99ddc8de69e07b1a6495d66b4 (diff) |
bsc: Stop using net->bsc->msc and get the right msc from somewhere else
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_msc.c | 1 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 604f00b86..b44c8ad09 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -267,6 +267,7 @@ static int ipaccess_a_fd_cb(struct osmo_fd *bfd) ipaccess_rcvmsg_base(msg, bfd); /* initialize the networking. This includes sending a GSM08.08 message */ + msg->cb[0] = (unsigned long) data; if (hh->proto == IPAC_PROTO_IPACCESS) { if (msg->l2h[0] == IPAC_MSGT_ID_ACK) initialize_if_needed(data->msc_con); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index fbccfbfe5..c52104914 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -152,8 +152,8 @@ static int msc_sccp_accept(struct sccp_connection *connection, void *data) static int msc_sccp_read(struct msgb *msgb, unsigned int length, void *data) { - struct gsm_network *net = (struct gsm_network *) data; - return bsc_handle_udt(net, net->bsc_data->msc.msc_con, msgb, length); + struct osmo_msc_data *msc = (struct osmo_msc_data *) msgb->cb[0]; + return bsc_handle_udt(msc->network, msc->msc_con, msgb, length); } int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg) @@ -182,11 +182,13 @@ int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg) int bsc_create_new_connection(struct gsm_subscriber_connection *conn) { struct gsm_network *net; + struct bsc_msc_connection *msc; struct osmo_bsc_sccp_con *bsc_con; struct sccp_connection *sccp; net = conn->bts->network; - if (!net->bsc_data->msc.msc_con->is_authenticated) { + msc = net->bsc_data->msc.msc_con; + if (!msc->is_authenticated) { LOGP(DMSC, LOGL_ERROR, "Not connected to a MSC. Not forwarding data.\n"); return -1; } @@ -223,7 +225,7 @@ int bsc_create_new_connection(struct gsm_subscriber_connection *conn) INIT_LLIST_HEAD(&bsc_con->sccp_queue); bsc_con->sccp = sccp; - bsc_con->msc_con = net->bsc_data->msc.msc_con; + bsc_con->msc_con = msc; bsc_con->conn = conn; llist_add(&bsc_con->entry, &active_connections); conn->sccp_con = bsc_con; |