diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-02-19 15:14:23 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-02-19 15:14:23 +0000 |
commit | 26aa6a1166f2593e93f926285a5a5476a9724195 (patch) | |
tree | c43cb225e029dbedb4c044247af329425a278dc1 | |
parent | ad2a12a4c30ea0af9373c5f3479429fddb36af05 (diff) |
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
-rw-r--r-- | include/openbsc/trau_mux.h | 2 | ||||
-rw-r--r-- | src/trau_mux.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/openbsc/trau_mux.h b/include/openbsc/trau_mux.h index 43836dbc5..f3d519fb1 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 3823c11b6..94d11cfc6 100644 --- a/src/trau_mux.c +++ b/src/trau_mux.c @@ -46,6 +46,10 @@ int trau_mux_map(const struct gsm_e1_subslot *src, 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 @@ int trau_mux_map(const struct gsm_e1_subslot *src, 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) { |