trau mux updates
* add function to map two lchans to each other
* make sure to evic old trau mux mappings before creating a new one
diff --git a/include/openbsc/trau_mux.h b/include/openbsc/trau_mux.h
index 43836db..f3d519f 100644
--- a/include/openbsc/trau_mux.h
+++ b/include/openbsc/trau_mux.h
@@ -32,6 +32,8 @@
/* map a TRAU mux map entry */
int trau_mux_map(const struct gsm_e1_subslot *src,
const struct gsm_e1_subslot *dst);
+int trau_mux_map_lchan(const struct gsm_lchan *src,
+ const struct gsm_lchan *dst);
/* unmap a TRAU mux map entry */
int trau_mux_unmap(const struct gsm_e1_subslot *ss);
diff --git a/src/trau_mux.c b/src/trau_mux.c
index 3823c11..94d11cf 100644
--- a/src/trau_mux.c
+++ b/src/trau_mux.c
@@ -46,6 +46,10 @@
if (!me)
return -ENOMEM;
+ /* make sure to get rid of any stale old mappings */
+ trau_mux_unmap(src);
+ trau_mux_unmap(dst);
+
memcpy(&me->src, src, sizeof(me->src));
memcpy(&me->dst, dst, sizeof(me->dst));
llist_add(&me->list, &ss_map);
@@ -53,6 +57,18 @@
return 0;
}
+int trau_mux_map_lchan(const struct gsm_lchan *src,
+ const struct gsm_lchan *dst)
+{
+ struct gsm_e1_subslot *src_ss, *dst_ss;
+
+ src_ss = &src->ts->e1_link;
+ dst_ss = &dst->ts->e1_link;
+
+ return trau_mux_map(src_ss, dst_ss);
+}
+
+
/* unmap one particular subslot from another subslot */
int trau_mux_unmap(const struct gsm_e1_subslot *ss)
{