aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-16 14:24:55 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-16 15:43:01 +0800
commit57c4decd1d8861dfdc664be240d084ffd7e3bbe8 (patch)
tree7b8e589dfbc42833b78b76daa2532ff8fed58f20
parent0fbb3eca14053fe621cca197b266731b8b2ab7d0 (diff)
bsc_api: Pass the subscriber connection to the SMS...
-rw-r--r--openbsc/include/openbsc/gsm_04_11.h2
-rw-r--r--openbsc/src/gsm_04_08.c2
-rw-r--r--openbsc/src/gsm_04_11.c14
3 files changed, 9 insertions, 9 deletions
diff --git a/openbsc/include/openbsc/gsm_04_11.h b/openbsc/include/openbsc/gsm_04_11.h
index a941696ec..61eaffd60 100644
--- a/openbsc/include/openbsc/gsm_04_11.h
+++ b/openbsc/include/openbsc/gsm_04_11.h
@@ -25,7 +25,7 @@ struct sms_deliver {
struct msgb;
-int gsm0411_rcv_sms(struct msgb *msg, u_int8_t link_id);
+int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, struct msgb *msg, u_int8_t link_id);
struct gsm_sms *sms_alloc(void);
void sms_free(struct gsm_sms *sms);
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index f6a44e0a4..297a2c9f2 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -3117,7 +3117,7 @@ int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id)
rc = gsm0408_rcv_rr(msg);
break;
case GSM48_PDISC_SMS:
- rc = gsm0411_rcv_sms(msg, link_id);
+ rc = gsm0411_rcv_sms(&msg->lchan->conn, msg, link_id);
break;
case GSM48_PDISC_MM_GPRS:
case GSM48_PDISC_SM_GPRS:
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 33fadd7e0..ee0aba59d 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -912,25 +912,25 @@ static int gsm411_tx_cp_error(struct gsm_trans *trans, u_int8_t cause)
}
/* Entry point for incoming GSM48_PDISC_SMS from abis_rsl.c */
-int gsm0411_rcv_sms(struct msgb *msg, u_int8_t link_id)
+int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, u_int8_t link_id)
{
struct gsm48_hdr *gh = msgb_l3(msg);
u_int8_t msg_type = gh->msg_type;
u_int8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
- struct gsm_lchan *lchan = msg->lchan;
struct gsm_trans *trans;
int rc = 0;
- if (!lchan->conn.subscr)
+ if (!conn->subscr)
return -EIO;
/* FIXME: send some error message */
DEBUGP(DSMS, "trans_id=%x ", transaction_id);
- trans = trans_find_by_id(lchan->conn.subscr, GSM48_PDISC_SMS,
+ trans = trans_find_by_id(conn->subscr, GSM48_PDISC_SMS,
transaction_id);
if (!trans) {
DEBUGPC(DSMS, "(new) ");
- trans = trans_alloc(lchan->conn.subscr, GSM48_PDISC_SMS,
+ trans = trans_alloc(conn->subscr, GSM48_PDISC_SMS,
transaction_id, new_callref++);
if (!trans) {
DEBUGPC(DSMS, "No memory for trans\n");
@@ -942,7 +942,7 @@ int gsm0411_rcv_sms(struct msgb *msg, u_int8_t link_id)
trans->sms.is_mt = 0;
trans->sms.link_id = link_id;
- trans->conn = &lchan->conn;
+ trans->conn = conn;
use_subscr_con(trans->conn);
}
@@ -962,7 +962,7 @@ int gsm0411_rcv_sms(struct msgb *msg, u_int8_t link_id)
if (i == transaction_id)
continue;
- ptrans = trans_find_by_id(lchan->conn.subscr,
+ ptrans = trans_find_by_id(conn->subscr,
GSM48_PDISC_SMS, i);
if (!ptrans)
continue;