pdch: Manage TFIs per direction

Currently a single bit set is used to maintain a set of used TFI
without distinguishing between uplink and downlink. Since the
namespaces of UL and DL TFI are separate, this implementation is
not correct.

This commit changes gprs_rlcmac_pdch to use a separate bit set for
each direction. It also replace the corresponding conditional fprintf
statement in check_tfi_usage (AllocTest.cpp) by an equivalent
OSMO_ASSERT.

Sponsored-by: On-Waves ehf
diff --git a/src/bts.cpp b/src/bts.cpp
index b96971d..bd1e025 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1144,12 +1144,12 @@
 		ul_tbf = static_cast<gprs_rlcmac_ul_tbf *>(tbf);
 		m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no];
 	}
-	m_assigned_tfi |= 1UL << tbf->tfi();
+	m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi();
 
 	LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, "
 		"USFs = %02x, TFIs = %08x.\n",
 		ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction],
-		m_assigned_usf, m_assigned_tfi);
+		m_assigned_usf, m_assigned_tfi[tbf->direction]);
 }
 
 void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf)
@@ -1163,12 +1163,12 @@
 		ul_tbf = static_cast<gprs_rlcmac_ul_tbf *>(tbf);
 		m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]);
 	}
-	m_assigned_tfi &= ~(1UL << tbf->tfi());
+	m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi());
 
 	LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, "
 		"USFs = %02x, TFIs = %08x.\n",
 		ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction],
-		m_assigned_usf, m_assigned_tfi);
+		m_assigned_usf, m_assigned_tfi[tbf->direction]);
 }
 
 void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir)