tbf: Remove the trx_no field from the tbf, go through the trx object
diff --git a/src/bts.cpp b/src/bts.cpp
index c4d565f..d4c5e27 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -159,7 +159,7 @@
 					if (first_ts < 0)
 						first_ts = ts;
 					/* break, if we already marked a slot */
-					if ((slot_mask[tbf->trx_no] & (1 << ts)))
+					if ((slot_mask[tbf->trx->trx_no] & (1 << ts)))
 						break;
 				}
 			}
@@ -169,14 +169,14 @@
 					"TRX=%d TS=%d, so we mark\n",
 					(tbf->direction == GPRS_RLCMAC_UL_TBF)
 						? "UL" : "DL",
-					tbf->tfi, tbf->trx_no, first_ts);
-				slot_mask[tbf->trx_no] |= (1 << first_ts);
+					tbf->tfi, tbf->trx->trx_no, first_ts);
+				slot_mask[tbf->trx->trx_no] |= (1 << first_ts);
 			} else
 				LOGP(DRLCMAC, LOGL_DEBUG, "- %s TFI=%d uses "
 					"already marked TRX=%d TS=%d\n",
 					(tbf->direction == GPRS_RLCMAC_UL_TBF)
 						? "UL" : "DL",
-					tbf->tfi, tbf->trx_no, ts);
+					tbf->tfi, tbf->trx->trx_no, ts);
 		}
 	}
 
@@ -240,14 +240,14 @@
 	llist_for_each_entry(tbf, &m_bts.ul_tbfs, list) {
 		if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
 		 && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
-		 && tbf->poll_fn == fn && tbf->trx_no == trx
+		 && tbf->poll_fn == fn && tbf->trx->trx_no == trx
 		 && tbf->control_ts == ts)
 			return tbf;
 	}
 	llist_for_each_entry(tbf, &m_bts.dl_tbfs, list) {
 		if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
 		 && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
-		 && tbf->poll_fn == fn && tbf->trx_no == trx
+		 && tbf->poll_fn == fn && tbf->trx->trx_no == trx
 		 && tbf->control_ts == ts)
 			return tbf;
 	}
@@ -1005,7 +1005,7 @@
 	if (ack_nack->Exist_Channel_Request_Description) {
 		LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack "
 			"message, so we provide one:\n");
-		tbf_alloc_ul(bts_data(), tbf->trx_no, tbf->ms_class, tbf->tlli, tbf->ta, tbf);
+		tbf_alloc_ul(bts_data(), tbf->trx->trx_no, tbf->ms_class, tbf->tlli, tbf->ta, tbf);
 		/* schedule uplink assignment */
 		tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS;
 	}
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 76ddac4..504f6b7 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -40,7 +40,7 @@
 	poll_fn = poll_fn % 2715648;
 	llist_for_each_entry(tbf, &bts->ul_tbfs, list) {
 		/* this trx, this ts */
-		if (tbf->trx_no != trx || tbf->control_ts != ts)
+		if (tbf->trx->trx_no != trx || tbf->control_ts != ts)
 			continue;
 		/* polling for next uplink block */
 		if (tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
@@ -56,7 +56,7 @@
 	}
 	llist_for_each_entry(tbf, &bts->dl_tbfs, list) {
 		/* this trx, this ts */
-		if (tbf->trx_no != trx || tbf->control_ts != ts)
+		if (tbf->trx->trx_no != trx || tbf->control_ts != ts)
 			continue;
 		/* polling for next uplink block */
 		if (tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 6909aba..c92192c 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -280,7 +280,7 @@
 				"because it has different TSC than lower TS "
 				"of TRX. In order to allow multislot, all "
 				"slots must be configured with the same "
-				"TSC!\n", ts, tbf->trx_no);
+				"TSC!\n", ts, tbf->trx->trx_no);
 			/* increase window for Type 1 */
 			if (Type == 1 && rx_window)
 				i++;
@@ -434,7 +434,7 @@
 					"than lower TS of TRX. In order to "
 					"allow multislot, all slots must be "
 					"configured with the same TSC!\n",
-					ts, tbf->trx_no);
+					ts, tbf->trx->trx_no);
 				/* increase window for Type 1 */
 				if (Type == 1)
 					i++;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 7b6bbfb..43b13ef 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -156,7 +156,7 @@
 	tbf = bts->bts->tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF);
 	if (tbf && tbf->dir.ul.contention_resolution_done
 	 && !tbf->dir.ul.final_ack_sent) {
-		use_trx = tbf->trx_no;
+		use_trx = tbf->trx->trx_no;
 		ta = tbf->ta;
 		ss = 0;
 		old_tbf = tbf;
@@ -581,7 +581,6 @@
 #endif
 	tbf->direction = dir;
 	tbf->tfi = tfi;
-	tbf->trx_no = trx;
 	tbf->trx = &bts->trx[trx];
 	tbf->ms_class = ms_class;
 	tbf->ws = 64;
@@ -1184,7 +1183,7 @@
 			LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
 				"sheduled in this TS %d, waiting for "
 				"TS %d\n", ts, control_ts);
-		else if (bts->sba()->find(trx_no, ts, (fn + 13) % 2715648))
+		else if (bts->sba()->find(trx->trx_no, ts, (fn + 13) % 2715648))
 			LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
 				"sheduled, because single block alllocation "
 				"already exists\n");
@@ -1250,7 +1249,7 @@
 				"assignment...\n", tfi);
 				return NULL;
 		}
-		if (bts->sba()->find(trx_no, control_ts, (fn + 13) % 2715648)) {
+		if (bts->sba()->find(trx->trx_no, control_ts, (fn + 13) % 2715648)) {
 			LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
 				"scheduled for single block allocation...\n");
 			return NULL;
@@ -1331,7 +1330,7 @@
 			"assignment...\n", tfi);
 			return NULL;
 	}
-	if (bts->sba()->find(trx_no, control_ts, (fn + 13) % 2715648)) {
+	if (bts->sba()->find(trx->trx_no, control_ts, (fn + 13) % 2715648)) {
 		LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already scheduled for "
 			"single block allocation...\n");
 			return NULL;
@@ -1403,7 +1402,7 @@
 				"final uplink ack...\n", tfi);
 			return NULL;
 		}
-		if (bts->sba()->find(trx_no, control_ts, (fn + 13) % 2715648)) {
+		if (bts->sba()->find(trx->trx_no, control_ts, (fn + 13) % 2715648)) {
 			LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
 				"scheduled for single block allocation...\n");
 			return NULL;
diff --git a/src/tbf.h b/src/tbf.h
index 196454a..e6981bc 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -121,7 +121,6 @@
 	uint32_t tlli;
 	uint8_t tlli_valid;
 	struct gprs_rlcmac_trx *trx;
-	uint8_t trx_no;
 	uint8_t tsc;
 	uint8_t first_ts; /* first TS used by TBF */
 	uint8_t first_common_ts; /* first TS that the phone can send and