Adding flow chart diagram of ongoing TBFs and their events

It is quite essential. It shows how TBFs are related and helps to estimate
states and timers (timeouts) of the MS.

In order to use it, it must be defined by a switch at gprs_rlcmac.h.
diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index 1900d89..c67a68b 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -31,6 +31,9 @@
 }
 #endif
 
+/* generate a diagram for debugging timing issues */
+//#define DEBUG_DIAGRAM
+
 /* This special feature will delay assignment of downlink TBF by one second,
  * in case there is already a TBF.
  * This is usefull to debug downlink establishment during packet idle mode.
@@ -225,6 +228,11 @@
 	uint32_t bw_octets; /* number of octets transmitted since bw_tv */
 
 	uint8_t cs; /* current coding scheme */
+
+#ifdef DEBUG_DIAGRAM
+	int diag; /* number where TBF is presented in diagram */
+	int diag_new; /* used to format output of new TBF */
+#endif
 };
 
 extern struct llist_head gprs_rlcmac_ul_tbfs; /* list of uplink TBFs */
@@ -262,6 +270,12 @@
 
 extern struct gprs_rlcmac_cs gprs_rlcmac_cs[];
 
+#ifdef DEBUG_DIAGRAM
+void debug_diagram(int diag, const char *format, ...);
+#else
+#define debug_diagram(a, b, args...) ;
+#endif
+
 int sba_alloc(uint8_t *_trx, uint8_t *_ts, uint32_t *_fn, uint8_t ta);
 
 struct gprs_rlcmac_sba *sba_find(uint8_t trx, uint8_t ts, uint32_t fn);