aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-12-17 17:13:28 +0100
committerHarald Welte <laforge@gnumonks.org>2009-12-17 17:13:28 +0100
commitcc9beb53663c9660c7e7a225256a9e71d3c9165e (patch)
tree2358b6eb600cf460ed243d25fa8e7c424a351ec1 /openbsc
parent8d77b9540a907fb36afbb324df549c9261e1ca02 (diff)
introduce trans_lchan_change() to update transaction about lchan change
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/transaction.h5
-rw-r--r--openbsc/src/transaction.c19
2 files changed, 24 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/transaction.h b/openbsc/include/openbsc/transaction.h
index 961a64923..6314f987f 100644
--- a/openbsc/include/openbsc/transaction.h
+++ b/openbsc/include/openbsc/transaction.h
@@ -65,4 +65,9 @@ void trans_free(struct gsm_trans *trans);
int trans_assign_trans_id(struct gsm_subscriber *subscr,
u_int8_t protocol, u_int8_t ti_flag);
+
+/* update all transactions to use a different LCHAN, e.g.
+ * after handover has succeeded */
+int trans_lchan_change(struct gsm_lchan *lchan_old,
+ struct gsm_lchan *lchan_new);
#endif
diff --git a/openbsc/src/transaction.c b/openbsc/src/transaction.c
index 04eaa3c99..9f1bbf36d 100644
--- a/openbsc/src/transaction.c
+++ b/openbsc/src/transaction.c
@@ -140,3 +140,22 @@ int trans_assign_trans_id(struct gsm_subscriber *subscr,
return -1;
}
+
+/* update all transactions to use a different LCHAN, e.g.
+ * after handover has succeeded */
+int trans_lchan_change(struct gsm_lchan *lchan_old,
+ struct gsm_lchan *lchan_new)
+{
+ struct gsm_network *net = lchan_old->ts->trx->bts->network;
+ struct gsm_trans *trans;
+ int num = 0;
+
+ llist_for_each_entry(trans, &net->trans_list, entry) {
+ if (trans->lchan == lchan_old) {
+ trans->lchan = lchan_new;
+ num++;
+ }
+ }
+
+ return num;
+}