aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-24 17:06:42 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-03 16:19:07 +0100
commitac9951e54a97890fd588ebb6b18a15b0013c70e8 (patch)
treec8cf4cf164a28dc58de168f8c9797a382900d833 /openbsc/src/libmsc
parent75cdeaf1e33a4f43c4fcfa280a2db39fad9a8120 (diff)
gsm_04_08.c: Don't set msg->lchan nor msg->dst
the BSC-side of the API behind gsm0808_submit_dtap() is doing this resolving again anyway. So let's avoid doing it twice, and avoid having more dependency of the MSC down into the lchan details.
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 33c96d73a..ccf30eb6e 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -121,27 +121,25 @@ static int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection
* work that the caller no longer has to do */
if (trans) {
gh->proto_discr = trans->protocol | (trans->transaction_id << 4);
- msg->lchan = trans->conn->lchan;
}
- if (msg->lchan) {
+ if (conn && conn->lchan) {
struct e1inp_sign_link *sign_link =
- msg->lchan->ts->trx->rsl_link;
+ conn->lchan->ts->trx->rsl_link;
- msg->dst = sign_link;
if ((gh->proto_discr & GSM48_PDISC_MASK) == GSM48_PDISC_CC)
DEBUGP(DCC, "(bts %d trx %d ts %d ti %02x) "
"Sending '%s' to MS.\n",
sign_link->trx->bts->nr,
- sign_link->trx->nr, msg->lchan->ts->nr,
+ sign_link->trx->nr, conn->lchan->ts->nr,
gh->proto_discr & 0xf0,
gsm48_cc_msg_name(gh->msg_type));
else
DEBUGP(DCC, "(bts %d trx %d ts %d pd %02x) "
"Sending 0x%02x to MS.\n",
sign_link->trx->bts->nr,
- sign_link->trx->nr, msg->lchan->ts->nr,
+ sign_link->trx->nr, conn->lchan->ts->nr,
gh->proto_discr, gh->msg_type);
}
@@ -443,8 +441,6 @@ int gsm0408_loc_upd_rej(struct gsm_subscriber_connection *conn, uint8_t cause)
LOGP(DMM, LOGL_ERROR, "Failed to create msg for LOCATION UPDATING REJECT.\n");
return -1;
}
-
- msg->lchan = conn->lchan;
LOGP(DMM, LOGL_INFO, "Subscriber %s: LOCATION UPDATING REJECT "
"LAC=%u BTS=%u\n", subscr_name(conn->subscr),
@@ -461,8 +457,6 @@ static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn)
struct gsm48_hdr *gh;
struct gsm48_loc_area_id *lai;
uint8_t *mid;
-
- msg->lchan = conn->lchan;
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
gh->proto_discr = GSM48_PDISC_MM;
@@ -496,8 +490,6 @@ static int mm_tx_identity_req(struct gsm_subscriber_connection *conn, uint8_t id
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ID REQ");
struct gsm48_hdr *gh;
- msg->lchan = conn->lchan;
-
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
gh->proto_discr = GSM48_PDISC_MM;
gh->msg_type = GSM48_MT_MM_ID_REQ;
@@ -719,8 +711,6 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn)
int tzunits;
int dst = 0;
- msg->lchan = conn->lchan;
-
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
gh->proto_discr = GSM48_PDISC_MM;
gh->msg_type = GSM48_MT_MM_INFO;
@@ -860,7 +850,6 @@ int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand,
DEBUGP(DMM, "-> AUTH REQ (rand = %s)\n", osmo_hexdump(rand, 16));
- msg->lchan = conn->lchan;
gh->proto_discr = GSM48_PDISC_MM;
gh->msg_type = GSM48_MT_MM_AUTH_REQ;
@@ -1261,11 +1250,9 @@ int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 APP INF");
struct gsm48_hdr *gh;
- msg->lchan = conn->lchan;
-
DEBUGP(DRR, "TX APPLICATION INFO id=0x%02x, len=%u\n",
apdu_id, apdu_len);
-
+
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 2 + apdu_len);
gh->proto_discr = GSM48_PDISC_RR;
gh->msg_type = GSM48_MT_RR_APP_INFO;
@@ -1320,8 +1307,6 @@ static int gsm48_tx_simple(struct gsm_subscriber_connection *conn,
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE");
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
- msg->lchan = conn->lchan;
-
gh->proto_discr = pdisc;
gh->msg_type = msg_type;