[PATCH 6/8] tbf: Warn about copy and paste between different tbf alloc routines

Holger Freyther hfreyther at sysmocom.de
Wed Oct 16 14:23:46 UTC 2013


From: Holger Hans Peter Freyther <holger at moiji-mobile.com>

These need to be re-factored to use a common allocation routine.
---
 src/gprs_rlcmac_data.cpp | 2 ++
 src/tbf.cpp              | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/gprs_rlcmac_data.cpp b/src/gprs_rlcmac_data.cpp
index 294753d..17e1fb9 100644
--- a/src/gprs_rlcmac_data.cpp
+++ b/src/gprs_rlcmac_data.cpp
@@ -238,6 +238,7 @@ static struct gprs_rlcmac_tbf *alloc_ul_tbf(int8_t use_trx, uint8_t ms_class,
 	struct gprs_rlcmac_tbf *tbf;
 	uint8_t tfi;
 
+#warning "Copy and paste with tbf_new_dl_assignment"
 	/* create new TBF, use sme TRX as DL TBF */
 	tfi = tfi_find_free(bts, GPRS_RLCMAC_UL_TBF, &trx, use_trx);
 	if (tfi < 0) {
@@ -1174,6 +1175,7 @@ int gprs_rlcmac_rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
 			"(AGCH)\n");
 	} else {
 		// Create new TBF
+		#warning "Copy and pate with other routines.."
 		tfi = tfi_find_free(bts, GPRS_RLCMAC_UL_TBF, &trx, -1);
 		if (tfi < 0) {
 			LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH ressource\n");
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 8dad6bc..21b58ac 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -141,6 +141,7 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
 	}
 
 	// Create new TBF (any TRX)
+#warning "Copy and paste with alloc_ul_tbf"
 	tfi = tfi_find_free(bts, GPRS_RLCMAC_DL_TBF, &trx, use_trx);
 	if (tfi < 0) {
 		LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
-- 
1.8.4.rc3





More information about the osmocom-net-gprs mailing list