rlcmac: Reduce the depedency on the global gprs_rlcmac_bts variable

For mocking/unit-testing/emulation (and a dual trx-systems) having
global state is quite bad. Cut back on the usage of the global
struct gprs_rlcmac_bts. It also makes the complexity of certain
routines more clear.
diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index c5af602..ac437f5 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -84,7 +84,8 @@
 	uint8_t n3103;
 	uint8_t n3105;
 	struct gprs_rlcmac_trx trx[8];
-	int (*alloc_algorithm)(struct gprs_rlcmac_tbf *old_tbf,
+	int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts,
+		struct gprs_rlcmac_tbf *old_tbf,
 		struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single);
 	uint32_t alloc_algorithm_curst; /* options to customize algorithm */
 	uint8_t force_two_phase;
@@ -308,14 +309,16 @@
 
 struct gprs_rlcmac_sba *sba_find(uint8_t trx, uint8_t ts, uint32_t fn);
 
-int tfi_alloc(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx,
-	int8_t use_trx);
+int tfi_alloc(struct gprs_rlcmac_bts *bts, enum gprs_rlcmac_tbf_direction dir,
+	uint8_t *_trx, int8_t use_trx);
 
-struct gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_tbf *old_tbf,
+struct gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts,
+	struct gprs_rlcmac_tbf *old_tbf,
 	enum gprs_rlcmac_tbf_direction dir, uint8_t tfi, uint8_t trx,
 	uint8_t ms_class, uint8_t single_slot);
 
-struct gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, uint8_t trx,
+struct gprs_rlcmac_tbf *tbf_by_tfi(struct gprs_rlcmac_bts *bts,
+	uint8_t tfi, uint8_t trx,
         enum gprs_rlcmac_tbf_direction dir);
 
 struct gprs_rlcmac_tbf *tbf_by_tlli(uint32_t tlli,
@@ -431,10 +434,12 @@
 
 extern "C" {
 #endif
-int alloc_algorithm_a(struct gprs_rlcmac_tbf *old_tbf,
+int alloc_algorithm_a(struct gprs_rlcmac_bts *bts,
+	struct gprs_rlcmac_tbf *old_tbf,
 	struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single);
 
-int alloc_algorithm_b(struct gprs_rlcmac_tbf *old_tbf,
+int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
+	struct gprs_rlcmac_tbf *old_tbf,
 	struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single);
 #ifdef __cplusplus
 }