summaryrefslogtreecommitdiffstats
path: root/openbsc/src/trau_mux.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-07-28 18:37:07 +0200
committerHarald Welte <laforge@gnumonks.org>2009-07-28 18:37:07 +0200
commite211da49b98162cbf9653da7b80e30634f2b1637 (patch)
treeeb8d9954ccc3aac8436442e2c6bbb4a1564110e2 /openbsc/src/trau_mux.c
parente51b2eaa0b9b5bfaaa3adb3c0f7ae0e567d5be10 (diff)
parentf4e79f24fcdabdfd81be5d3842b4bf4c05465db4 (diff)
Merge branch 'master' into proxy
Diffstat (limited to 'openbsc/src/trau_mux.c')
-rw-r--r--openbsc/src/trau_mux.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/openbsc/src/trau_mux.c b/openbsc/src/trau_mux.c
index 04febbd63..9ff7001d3 100644
--- a/openbsc/src/trau_mux.c
+++ b/openbsc/src/trau_mux.c
@@ -55,10 +55,6 @@ int trau_mux_map(const struct gsm_e1_subslot *src,
{
struct map_entry *me;
- if (!tall_map_ctx)
- tall_map_ctx = talloc_named_const(tall_bsc_ctx, 1,
- "trau_map_entry");
-
me = talloc(tall_map_ctx, struct map_entry);
if (!me)
return -ENOMEM;
@@ -201,10 +197,6 @@ int trau_recv_lchan(struct gsm_lchan *lchan, u_int32_t callref)
struct gsm_e1_subslot *src_ss;
struct upqueue_entry *ue;
- if (!tall_upq_ctx)
- tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 1,
- "trau_upq_entry");
-
ue = talloc(tall_upq_ctx, struct upqueue_entry);
if (!ue)
return -ENOMEM;
@@ -243,3 +235,12 @@ int trau_send_lchan(struct gsm_lchan *lchan, struct decoded_trau_frame *tf)
return subchan_mux_enqueue(mx, dst_e1_ss->e1_ts_ss, trau_bits_out,
TRAU_FRAME_BITS);
}
+
+static __attribute__((constructor)) void on_dso_load_trau_mux(void)
+{
+ tall_map_ctx = talloc_named_const(tall_bsc_ctx, 1,
+ "trau_map_entry");
+
+ tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 1,
+ "trau_upq_entry");
+}