From 934355a2681b673a4f1ab943a968284a0563bc66 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 8 Jun 2011 15:52:07 +0200 Subject: bsc: Hand the msc_connection to the UDT handling, pass it to paging Pass the osmo_msc_data to the paging sub system, change the code to pass the osmo_msc_data instead of network + bsc_msc_conn. --- openbsc/include/openbsc/osmo_bsc.h | 2 +- openbsc/src/osmo-bsc/osmo_bsc_bssap.c | 21 ++++++++++----------- openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/openbsc/include/openbsc/osmo_bsc.h b/openbsc/include/openbsc/osmo_bsc.h index bf582b20a..0bc39dc1e 100644 --- a/openbsc/include/openbsc/osmo_bsc.h +++ b/openbsc/include/openbsc/osmo_bsc.h @@ -40,7 +40,7 @@ struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struc int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_handle_udt(struct gsm_network *net, struct bsc_msc_connection *conn, struct msgb *msg, unsigned int length); +int bsc_handle_udt(struct osmo_msc_data *msc, struct msgb *msg, unsigned int length); int bsc_handle_dt1(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len); int bsc_ctrl_cmds_install(); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c index 25a99d737..b2c3aa194 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c @@ -98,7 +98,7 @@ enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech) return GSM48_CMODE_SPEECH_AMR; } -static int bssmap_handle_reset_ack(struct gsm_network *net, +static int bssmap_handle_reset_ack(struct osmo_msc_data *msc, struct msgb *msg, unsigned int length) { LOGP(DMSC, LOGL_NOTICE, "Reset ACK from MSC\n"); @@ -106,7 +106,7 @@ static int bssmap_handle_reset_ack(struct gsm_network *net, } /* GSM 08.08 ยง 3.2.1.19 */ -static int bssmap_handle_paging(struct gsm_network *net, +static int bssmap_handle_paging(struct osmo_msc_data *msc, struct msgb *msg, unsigned int payload_length) { struct gsm_subscriber *subscr; @@ -169,7 +169,7 @@ static int bssmap_handle_paging(struct gsm_network *net, LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n"); } - subscr = subscr_get_or_create(net, mi_string); + subscr = subscr_get_or_create(msc->network, mi_string); if (!subscr) { LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); return -1; @@ -179,7 +179,7 @@ static int bssmap_handle_paging(struct gsm_network *net, subscr->tmsi = tmsi; LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); - paging_request(net, subscr, chan_needed, NULL, NULL); + paging_request(msc->network, subscr, chan_needed, NULL, msc); return 0; } @@ -404,7 +404,7 @@ reject: return -1; } -static int bssmap_rcvmsg_udt(struct gsm_network *net, +static int bssmap_rcvmsg_udt(struct osmo_msc_data *msc, struct msgb *msg, unsigned int length) { int ret = 0; @@ -419,11 +419,11 @@ static int bssmap_rcvmsg_udt(struct gsm_network *net, switch (msg->l4h[0]) { case BSS_MAP_MSG_RESET_ACKNOWLEDGE: - ret = bssmap_handle_reset_ack(net, msg, length); + ret = bssmap_handle_reset_ack(msc, msg, length); break; case BSS_MAP_MSG_PAGING: - if (bsc_grace_allow_new_connection(net)) - ret = bssmap_handle_paging(net, msg, length); + if (bsc_grace_allow_new_connection(msc->network)) + ret = bssmap_handle_paging(msc, msg, length); break; } @@ -508,8 +508,7 @@ static int dtap_rcvmsg(struct osmo_bsc_sccp_con *conn, return gsm0808_submit_dtap(conn->conn, gsm48, header->link_id, 1); } -int bsc_handle_udt(struct gsm_network *network, - struct bsc_msc_connection *conn, +int bsc_handle_udt(struct osmo_msc_data *msc, struct msgb *msgb, unsigned int length) { struct bssmap_header *bs; @@ -529,7 +528,7 @@ int bsc_handle_udt(struct gsm_network *network, switch (bs->type) { case BSSAP_MSG_BSS_MANAGEMENT: msgb->l4h = &msgb->l3h[sizeof(*bs)]; - bssmap_rcvmsg_udt(network, msgb, length - sizeof(*bs)); + bssmap_rcvmsg_udt(msc, msgb, length - sizeof(*bs)); break; default: LOGP(DMSC, LOGL_NOTICE, "Unimplemented msg type: %s\n", diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 6d1127ac3..d25275271 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -161,7 +161,7 @@ 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 osmo_msc_data *msc = (struct osmo_msc_data *) msgb->cb[0]; - return bsc_handle_udt(msc->network, msc->msc_con, msgb, length); + return bsc_handle_udt(msc, msgb, length); } int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg) -- cgit v1.2.3