bsc_api: Pass the subscriber connection to the SMS...
This commit is contained in:
parent
0fbb3eca14
commit
57c4decd1d
|
@ -25,7 +25,7 @@ struct sms_deliver {
|
||||||
|
|
||||||
struct msgb;
|
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);
|
struct gsm_sms *sms_alloc(void);
|
||||||
void sms_free(struct gsm_sms *sms);
|
void sms_free(struct gsm_sms *sms);
|
||||||
|
|
|
@ -3117,7 +3117,7 @@ int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id)
|
||||||
rc = gsm0408_rcv_rr(msg);
|
rc = gsm0408_rcv_rr(msg);
|
||||||
break;
|
break;
|
||||||
case GSM48_PDISC_SMS:
|
case GSM48_PDISC_SMS:
|
||||||
rc = gsm0411_rcv_sms(msg, link_id);
|
rc = gsm0411_rcv_sms(&msg->lchan->conn, msg, link_id);
|
||||||
break;
|
break;
|
||||||
case GSM48_PDISC_MM_GPRS:
|
case GSM48_PDISC_MM_GPRS:
|
||||||
case GSM48_PDISC_SM_GPRS:
|
case GSM48_PDISC_SM_GPRS:
|
||||||
|
|
|
@ -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 */
|
/* 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);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
u_int8_t msg_type = gh->msg_type;
|
u_int8_t msg_type = gh->msg_type;
|
||||||
u_int8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
|
u_int8_t transaction_id = ((gh->proto_discr >> 4) ^ 0x8); /* flip */
|
||||||
struct gsm_lchan *lchan = msg->lchan;
|
|
||||||
struct gsm_trans *trans;
|
struct gsm_trans *trans;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (!lchan->conn.subscr)
|
if (!conn->subscr)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
/* FIXME: send some error message */
|
/* FIXME: send some error message */
|
||||||
|
|
||||||
DEBUGP(DSMS, "trans_id=%x ", transaction_id);
|
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);
|
transaction_id);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
DEBUGPC(DSMS, "(new) ");
|
DEBUGPC(DSMS, "(new) ");
|
||||||
trans = trans_alloc(lchan->conn.subscr, GSM48_PDISC_SMS,
|
trans = trans_alloc(conn->subscr, GSM48_PDISC_SMS,
|
||||||
transaction_id, new_callref++);
|
transaction_id, new_callref++);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
DEBUGPC(DSMS, "No memory for trans\n");
|
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.is_mt = 0;
|
||||||
trans->sms.link_id = link_id;
|
trans->sms.link_id = link_id;
|
||||||
|
|
||||||
trans->conn = &lchan->conn;
|
trans->conn = conn;
|
||||||
use_subscr_con(trans->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)
|
if (i == transaction_id)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ptrans = trans_find_by_id(lchan->conn.subscr,
|
ptrans = trans_find_by_id(conn->subscr,
|
||||||
GSM48_PDISC_SMS, i);
|
GSM48_PDISC_SMS, i);
|
||||||
if (!ptrans)
|
if (!ptrans)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue