alloc_algo: Move printing outside of update_ms_reserved_slots()
Change-Id: I0d8838829c519bb6da8a68d62947b98bab35a39f
diff --git a/src/alloc_algo.cpp b/src/alloc_algo.cpp
index 9d4db4c..bc44cbf 100644
--- a/src/alloc_algo.cpp
+++ b/src/alloc_algo.cpp
@@ -773,22 +773,14 @@
* \param[in] tbf_ Pointer to TBF struct
* \param[in] res_ul_slots Newly reserved UL slots
* \param[in] res_dl_slots Newly reserved DL slots
- * \param[in] ul_slots available UL slots (for logging only)
- * \param[in] dl_slots available DL slots (for logging only)
*/
-static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots,
- uint8_t ul_slots, uint8_t dl_slots)
+static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots)
{
- char slot_info[9] = { 0 };
-
if (res_ul_slots == ms_reserved_ul_slots(ms) && res_dl_slots == ms_reserved_dl_slots(ms))
return;
/* The reserved slots have changed, update the MS */
ms_set_reserved_slots(ms, trx, res_ul_slots, res_dl_slots);
-
- ts_format(slot_info, dl_slots, ul_slots);
- LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info);
}
/*! Assign given UL timeslots to UL TBF
@@ -857,6 +849,7 @@
int rc;
int tfi;
gprs_rlcmac_trx *trx;
+ char slot_info[9] = { 0 };
struct gprs_rlcmac_pdch *first_common_ts = ms_first_common_ts(req->ms);
LOGPAL(req, "B", LOGL_DEBUG, "Alloc start\n");
@@ -927,12 +920,15 @@
LOGPAL(req, "B", LOGL_INFO, "using %d slots\n", slotcount);
}
+ ts_format(slot_info, dl_slots, ul_slots);
+ LOGP(DRLCMAC, LOGL_DEBUG, "- Available DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info);
+
/* The allocation will be successful, so the system state and tbf/ms
* may be modified from now on. */
/* Step 4: Update MS and TBF and really allocate the resources */
- update_ms_reserved_slots(trx, req->ms, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots);
+ update_ms_reserved_slots(trx, req->ms, reserved_ul_slots, reserved_dl_slots);
ms_set_first_common_ts(req->ms, first_common_ts);
req->tbf->trx = trx;
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 657db59..2b844db 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -4159,7 +4159,7 @@
Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1
Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi
[DL] algo B <multi> (suggested TRX: 0): using 4 slots
-- Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7)
+- Available DL/UL slots: (TS=0)"..DDCD.."(TS=7)
- Assigning DL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:GPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 3
@@ -4205,7 +4205,7 @@
Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1
Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi
[DL] algo B <multi> (suggested TRX: 0): using 4 slots
-- Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7)
+- Available DL/UL slots: (TS=0)"..DDCD.."(TS=7)
- Assigning DL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 3
@@ -7551,7 +7551,7 @@
Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1
Selected DL slots: (TS=0)"..ddDd.."(TS=7), single
[DL] algo B <single> (suggested TRX: 0): using single slot at TS 4
-- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7)
+- Available DL/UL slots: (TS=0)"...DC..."(TS=7)
- Assigning DL TS 4
PDCH(bts=0,trx=0,ts=4) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS) Setting Control TS PDCH(bts=0,trx=0,ts=4)
@@ -7567,6 +7567,7 @@
Found first unallocated TRX=0 TFI=0
Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi
[DL] algo B <multi> (suggested TRX: -1): using 4 slots
+- Available DL/UL slots: (TS=0)"..DDCD.."(TS=7)
- Assigning DL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 3
@@ -9976,7 +9977,7 @@
- Skipping TS 6, because num TBFs 0 >= 0
Selected DL slots: (TS=0)".ddd.D.."(TS=7), single
[DL] algo B <single> (suggested TRX: -1): using single slot at TS 5
-- Reserved DL/UL slots: (TS=0)"..D..CU."(TS=7)
+- Available DL/UL slots: (TS=0)"..D..CU."(TS=7)
- Assigning DL TS 5
PDCH(bts=0,trx=1,ts=5) Attaching TBF(DL:TFI-0-1-0:STATE-NEW:GPRS:IMSI-001001000000001:TLLI-0xa3c2f953), 1 TBFs, USFs = 00, TFIs = 00000001.
TBF(DL:TFI-0-1-0:STATE-NEW:GPRS:IMSI-001001000000001:TLLI-0xa3c2f953) Setting Control TS PDCH(bts=0,trx=1,ts=5)
@@ -10014,7 +10015,7 @@
- Skipping TS 3, because num TBFs 0 >= 0
Selected UL slots: (TS=0)"..U.uu.."(TS=7), single
[UL] algo B <single> (suggested TRX: 0): using single slot at TS 2
-- Reserved DL/UL slots: (TS=0)"..C.DDD."(TS=7)
+- Available DL/UL slots: (TS=0)"..C.DDD."(TS=7)
- Assigning UL TS 2
PDCH(bts=0,trx=0,ts=2) Attaching TBF(UL:TFI-0-0-0:STATE-NEW:GPRS:TLLI-0xecc1f953), 1 TBFs, USFs = 01, TFIs = 00000001.
TBF(UL:TFI-0-0-0:STATE-NEW:GPRS:TLLI-0xecc1f953) Setting Control TS PDCH(bts=0,trx=0,ts=2)
@@ -10047,6 +10048,7 @@
Found first unallocated TRX=0 TFI=0
Selected DL slots: (TS=0)".DDDddd."(TS=7), multi
[DL] algo B <multi> (suggested TRX: 0): using 3 slots
+- Available DL/UL slots: (TS=0)"..C.DDD."(TS=7)
- Assigning DL TS 1
PDCH(bts=0,trx=0,ts=1) Attaching TBF(DL:TFI-0-0-0:STATE-NEW:GPRS:IMSI-001001000000001:TLLI-0xecc1f953), 1 TBFs, USFs = 00, TFIs = 00000001.
- Assigning DL TS 2