aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_rlcmac_ts_alloc.cpp
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-09-28 15:56:05 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-02-27 22:27:51 +0100
commit399804b941414e2eaa9763e21abde73166cc469b (patch)
tree7afe62f7b5692364e4788a3b8672826b1ce36c90 /src/gprs_rlcmac_ts_alloc.cpp
parentf7607d63290583f978e6c6677694047d823b8f05 (diff)
Simplify TS alloc: adjust allocator signatures
* drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282
Diffstat (limited to 'src/gprs_rlcmac_ts_alloc.cpp')
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp46
1 files changed, 30 insertions, 16 deletions
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index b5edf051..cd82ca73 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -351,14 +351,19 @@ static int tfi_find_free(BTS *bts, const GprsMs *ms,
return tfi;
}
-/* Slot Allocation: Algorithm A
+/*! Slot Allocation: Algorithm A
*
* Assign single slot for uplink and downlink
+ *
+ * \param[in,out] bts Pointer to BTS struct
+ * \param[in,out] ms_ Pointer to MS object
+ * \param[in,out] tbf_ Pointer to TBF struct
+ * \param[in] single flag indicating if we should force single-slot allocation
+ * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation
+ * \returns negative error code or 0 on success
*/
-int alloc_algorithm_a(struct gprs_rlcmac_bts *bts,
- GprsMs *ms_,
- struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single,
- int use_trx)
+int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single,
+ int8_t use_trx)
{
struct gprs_rlcmac_pdch *pdch;
int ts = -1;
@@ -725,15 +730,20 @@ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *
return 0;
}
-/* Slot Allocation: Algorithm B
+/*! Slot Allocation: Algorithm B
*
* Assign as many downlink slots as possible.
* Assign one uplink slot. (With free USF)
*
+ * \param[in,out] bts Pointer to BTS struct
+ * \param[in,out] ms_ Pointer to MS object
+ * \param[in,out] tbf_ Pointer to TBF struct
+ * \param[in] single flag indicating if we should force single-slot allocation
+ * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation
+ * \returns negative error code or 0 on success
*/
-int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
- GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_,
- uint32_t cust, uint8_t single, int use_trx)
+int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single,
+ int8_t use_trx)
{
uint8_t dl_slots;
uint8_t ul_slots;
@@ -954,7 +964,7 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
return 0;
}
-/* Slot Allocation: Algorithm dynamic
+/*! Slot Allocation: Algorithm dynamic
*
* This meta algorithm automatically selects on of the other algorithms based
* on the current system state.
@@ -962,10 +972,15 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
* The goal is to support as many MS and TBF as possible. On low usage, the
* goal is to provide the highest possible bandwidth per MS.
*
+ * \param[in,out] bts Pointer to BTS struct
+ * \param[in,out] ms_ Pointer to MS object
+ * \param[in,out] tbf_ Pointer to TBF struct
+ * \param[in] single flag indicating if we should force single-slot allocation
+ * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation
+ * \returns negative error code or 0 on success
*/
-int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts,
- GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_,
- uint32_t cust, uint8_t single, int use_trx)
+int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single,
+ int8_t use_trx)
{
int rc;
@@ -977,7 +992,7 @@ int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts,
}
if (!bts->multislot_disabled) {
- rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx);
+ rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx);
if (rc >= 0)
return rc;
@@ -986,8 +1001,7 @@ int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts,
bts->multislot_disabled = 1;
}
- rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx);
- return rc;
+ return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx);
}
int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class)