tbf: Put the TFI->TBF mapping into the PDCH objects

Currently the TBFs are registered in a TFI indexed array within the TRX
objects. TBFs can be searched globally by TFI and TRX number. This
conflicts with the use of the same TFI for different TBF on different
PDCH. This use case requires the specification of the PDCH as
additional search dimension.

This commit moves the TFI index TBF arrays into the PDCH objects. The
related methods are updated accordingly.

Ticket: #1793
Sponsored-by: On-Waves ehf
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 70483e3..e3a441a 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -201,11 +201,6 @@
 {
 	int ts;
 
-	if (tbf->direction == GPRS_RLCMAC_UL_TBF)
-		tbf->trx->ul_tbf[tbf->tfi()] = NULL;
-	else
-		tbf->trx->dl_tbf[tbf->tfi()] = NULL;
-
 	for (ts = 0; ts < 8; ts++) {
 		if (!tbf->pdch[ts])
 			continue;
@@ -800,16 +795,8 @@
 
 void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_trx *trx)
 {
-	for (uint8_t tfi = 0; tfi < 32; tfi++) {
-		struct gprs_rlcmac_tbf *tbf;
-
-		tbf = trx->ul_tbf[tfi];
-		if (tbf)
-			tbf_free(tbf);
-		tbf = trx->dl_tbf[tfi];
-		if (tbf)
-			tbf_free(tbf);
-	}
+	for (uint8_t ts = 0; ts < 8; ts++)
+		free_all(&trx->pdch[ts]);
 }
 
 void gprs_rlcmac_tbf::free_all(struct gprs_rlcmac_pdch *pdch)