aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c5
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c9
-rw-r--r--openbsc/src/libmsc/transaction.c8
3 files changed, 11 insertions, 11 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 82be4d1b7..8916fe638 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1924,7 +1924,8 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
}
/* Get free transaction_id */
- trans_id = trans_assign_trans_id(trans->subscr, GSM48_PDISC_CC, 0);
+ trans_id = trans_assign_trans_id(trans->net, trans->subscr,
+ GSM48_PDISC_CC, 0);
if (trans_id < 0) {
/* no free transaction ID */
rc = mncc_release_ind(trans->net, trans, trans->callref,
@@ -3240,7 +3241,7 @@ static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *m
}
/* Find transaction */
- trans = trans_find_by_id(conn->subscr, GSM48_PDISC_CC, transaction_id);
+ trans = trans_find_by_id(conn, GSM48_PDISC_CC, transaction_id);
DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) "
"Received '%s' from MS in state %d (%s)\n",
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index b2100d8b5..1c46b96b0 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -749,8 +749,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
/* FIXME: send some error message */
DEBUGP(DLSMS, "receiving data (trans_id=%x)\n", transaction_id);
- trans = trans_find_by_id(conn->subscr, GSM48_PDISC_SMS,
- transaction_id);
+ trans = trans_find_by_id(conn, GSM48_PDISC_SMS, transaction_id);
/*
* A transaction we created but don't know about?
@@ -795,8 +794,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
if (i == transaction_id)
continue;
- ptrans = trans_find_by_id(conn->subscr,
- GSM48_PDISC_SMS, i);
+ ptrans = trans_find_by_id(conn, GSM48_PDISC_SMS, i);
if (!ptrans)
continue;
@@ -827,7 +825,8 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
int rc;
transaction_id =
- trans_assign_trans_id(conn->subscr, GSM48_PDISC_SMS, 0);
+ trans_assign_trans_id(conn->bts->network, conn->subscr,
+ GSM48_PDISC_SMS, 0);
if (transaction_id == -1) {
LOGP(DLSMS, LOGL_ERROR, "No available transaction ids\n");
send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0);
diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c
index 3bed67244..4d3aeacf1 100644
--- a/openbsc/src/libmsc/transaction.c
+++ b/openbsc/src/libmsc/transaction.c
@@ -33,11 +33,12 @@ void *tall_trans_ctx;
void _gsm48_cc_trans_free(struct gsm_trans *trans);
-struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
+struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
uint8_t proto, uint8_t trans_id)
{
struct gsm_trans *trans;
- struct gsm_network *net = subscr->net;
+ struct gsm_network *net = conn->bts->network;
+ struct gsm_subscriber *subscr = conn->subscr;
llist_for_each_entry(trans, &net->trans_list, entry) {
if (trans->subscr == subscr &&
@@ -121,10 +122,9 @@ void trans_free(struct gsm_trans *trans)
/* allocate an unused transaction ID for the given subscriber
* in the given protocol using the ti_flag specified */
-int trans_assign_trans_id(struct gsm_subscriber *subscr,
+int trans_assign_trans_id(struct gsm_network *net, struct gsm_subscriber *subscr,
uint8_t protocol, uint8_t ti_flag)
{
- struct gsm_network *net = subscr->net;
struct gsm_trans *trans;
unsigned int used_tid_bitmask = 0;
int i, j, h;