diff options
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/libmsc/transaction.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/transaction.c b/openbsc/src/libmsc/transaction.c index efe0d8251..0c1d08db1 100644 --- a/openbsc/src/libmsc/transaction.c +++ b/openbsc/src/libmsc/transaction.c @@ -77,6 +77,32 @@ struct gsm_trans *trans_find_by_msgref(struct gsm_subscriber_connection *conn, return NULL; } +struct gsm_trans *trans_find_by_lchan(struct gsm_lchan *lchan) +{ + struct gsm_trans *temp; + struct gsm_trans *trans = NULL; + struct gsm_network *net = lchan->ts->trx->bts->network; + + llist_for_each_entry(temp, &net->trans_list, entry) { + if (!temp->conn) + continue; + if (temp->conn->lchan != lchan && temp->conn->ho_lchan != lchan) + continue; + if (!trans) { + trans = temp; + if (trans->tch_recv) + break; + else + continue; + } + if (temp->tch_recv) { + trans = temp; + break; + } + } + return trans; +} + struct gsm_trans *trans_alloc(struct gsm_network *net, struct gsm_subscriber *subscr, uint8_t protocol, uint8_t trans_id, |