* add trau_mux implementation to relay from one incoming TRAU
  channel to another one (simple voice call switching)
* add a way more generic E1 input layer, abstracting out the misdn
  low-level interface. This also adds infrastructure for multiple TRX
  in one BTS, as well as multiple BTS on one E1 link
* add a E1 subchannel multiplexer for sending multiple 16kbit sub-channels
  one one 64kBps E1 channel
* add TRAU IDLE frame generation
* terminate bsc_hack in case there is a E1 / mISDN init error
* introduce 'e1_config.c' file with static configuration of our
  E1 setup (which TRX/BTS is configured for which TEI/SAPI/E1). This should
  later become a config file rather than a compiled C file.

WARNING: all this compiles but is not tested yet.  Expect fix-up committs over
the next hours or so

diff --git a/src/trau_frame.c b/src/trau_frame.c
index 9d7e517..4b02c7b 100644
--- a/src/trau_frame.c
+++ b/src/trau_frame.c
@@ -26,6 +26,7 @@
 #include <errno.h>
 
 #include <openbsc/trau_frame.h>
+#include <openbsc/subchan_demux.h>
 
 static u_int32_t get_bits(const u_int8_t *bitbuf, int offset, int num)
 {
@@ -192,6 +193,9 @@
 	memcpy(trau_bits + 305, fr->d_bits + d_idx, 5);
 	/* C16 .. C21 */
 	memcpy(trau_bits+310, fr->c_bits+15, 6);
+
+	/* FIXME: handle timing adjustment */
+
 	/* T1 .. T4 */
 	memcpy(trau_bits+316, fr->t_bits+0, 4);
 }
@@ -230,3 +234,21 @@
 
 	return 0;
 }
+
+static struct decoded_trau_frame fr_idle_frame = {
+	.c_bits = { 0, 1, 1, 1, 0 },	/* IDLE DOWNLINK 3.5.5 */
+	.t_bits = { 1, 1, 1, 1 },
+};
+static u_int8_t encoded_idle_frame[TRAU_FRAME_BITS];
+static int dbits_initted;
+
+u_int8_t *trau_idle_frame(void)
+{
+	/* only initialize during the first call */
+	if (!dbits_initted) {
+		/* set all D-bits to 1 */
+		memset(&fr_idle_frame.d_bits, 0x01, 260);
+		encode_fr(encoded_idle_frame, &fr_idle_frame);
+	}
+	return encoded_idle_frame;
+}