From 9ae282372c9b3e10050244b8a1c9179122556175 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Wed, 1 Jul 2015 12:27:30 +0200 Subject: alloc: Set minimum slot capacity to 1 Currently the capacity of a PDCH slot is calculated as 32 - N_reserved for each direction. This can result in a capacity of 0 and even negative values. This commit forces the capacity of an usable slot to be at least zero under the assumption, that an overly reserved PDCH is still better than none. Sponsored-by: On-Waves ehf --- src/gprs_rlcmac_ts_alloc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0085f819..bfc8c31e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -546,11 +546,13 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); + c = OSMO_MAX(c, 1); capacity += c; } /* Only consider common slots for UL */ if (tx_window & rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); + c = OSMO_MAX(c, 1); capacity += c; } } -- cgit v1.2.3