aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libtrau/trau_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libtrau/trau_mux.c')
-rw-r--r--openbsc/src/libtrau/trau_mux.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/libtrau/trau_mux.c b/openbsc/src/libtrau/trau_mux.c
index c9d77cf78..7b9bac0eb 100644
--- a/openbsc/src/libtrau/trau_mux.c
+++ b/openbsc/src/libtrau/trau_mux.c
@@ -31,6 +31,7 @@
#include <osmocom/core/talloc.h>
#include <openbsc/trau_upqueue.h>
#include <osmocom/core/crcgen.h>
+#include <openbsc/transaction.h>
/* this corresponds to the bit-lengths of the individual codec
* parameters as indicated in Table 1.1 of TS 06.10 */
@@ -518,3 +519,20 @@ int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame)
return subchan_mux_enqueue(mx, dst_e1_ss->e1_ts_ss, trau_bits_out,
TRAU_FRAME_BITS);
}
+
+/* switch trau muxer to new lchan */
+int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan)
+{
+ struct gsm_network *net = old_lchan->ts->trx->bts->network;
+ struct gsm_trans *trans;
+
+ /* look up transaction with TCH frame receive enabled */
+ llist_for_each_entry(trans, &net->trans_list, entry) {
+ if (trans->conn && trans->conn->lchan == old_lchan && trans->tch_recv) {
+ /* switch */
+ trau_recv_lchan(new_lchan, trans->callref);
+ }
+ }
+
+ return 0;
+}