working state up to location update and classmark inquiry

diff --git a/src/bsc_hack.c b/src/bsc_hack.c
index b0d7265..384f25d 100644
--- a/src/bsc_hack.c
+++ b/src/bsc_hack.c
@@ -31,6 +31,7 @@
 #include <openbsc/select.h>
 #include <openbsc/abis_rsl.h>
 #include <openbsc/abis_nm.h>
+#include <openbsc/debug.h>
 
 /* global pointer to the gsm network data structure */
 static struct gsm_network *gsmnet;
@@ -252,6 +253,15 @@
 	/* begin DB transmission */
 	abis_nm_db_transmission(bts, 1);
 
+	/* end DB transmission */
+	abis_nm_db_transmission(bts, 0);
+
+	/* Reset BTS Site manager resource */
+	abis_nm_reset_resource(bts);
+
+	/* begin DB transmission */
+	abis_nm_db_transmission(bts, 1);
+
 	abis_nm_raw_msg(bts, sizeof(msg_1), msg_1); /* set BTS SiteMgr attr*/
 	abis_nm_raw_msg(bts, sizeof(msg_2), msg_2); /* set BTS attr */
 	abis_nm_raw_msg(bts, sizeof(msg_3), msg_3); /* set BTS handover attr */
@@ -533,7 +543,7 @@
 	set_system_infos(bts);
 
 	/* FIXME: defer this until the channels are used */
-	activate_traffic_channels(&bts->trx[0]);
+	//activate_traffic_channels(&bts->trx[0]);
 }
 
 static void mi_cb(int event, struct gsm_bts *bts)
@@ -570,13 +580,18 @@
 	return 0;
 }
 
-void debugp(int subsys, char *file, int line, const char *format, ...)
+static unsigned int debug_mask = 0xffffffff & ~DMI;
+
+void debugp(unsigned int subsys, char *file, int line, const char *format, ...)
 {
 	char *timestr;
 	va_list ap;
 	time_t tm;
 	FILE *outfd = stderr;
 
+	if (!(debug_mask & subsys))
+		return;
+
 	va_start(ap, format);
 	
 	tm = time(NULL);