aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gprs_rlcmac.h5
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp23
-rw-r--r--src/pcu_vty.c13
3 files changed, 38 insertions, 3 deletions
diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index 3fc95e69..3c1f1a05 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -104,6 +104,11 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
struct 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,
+ struct GprsMs *ms,
+ struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single,
+ int use_trx);
#ifdef __cplusplus
}
#endif
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index a29e5db2..d664bbc9 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -996,3 +996,26 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
return 0;
}
+
+/* Slot Allocation: Algorithm dynamic
+ *
+ * This meta algorithm automatically selects on of the other algorithms based
+ * on the current system state.
+ *
+ * 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.
+ *
+ */
+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 rc;
+
+ rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx);
+ if (rc >= 0)
+ return rc;
+
+ rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx);
+ return rc;
+}
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 4c0730c2..ed708f8d 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -120,6 +120,8 @@ static int config_write_pcu(struct vty *vty)
vty_out(vty, " alloc-algorithm a%s", VTY_NEWLINE);
if (bts->alloc_algorithm == alloc_algorithm_b)
vty_out(vty, " alloc-algorithm b%s", VTY_NEWLINE);
+ if (bts->alloc_algorithm == alloc_algorithm_dynamic)
+ vty_out(vty, " alloc-algorithm dynamic%s", VTY_NEWLINE);
if (bts->force_two_phase)
vty_out(vty, " two-phase-access%s", VTY_NEWLINE);
vty_out(vty, " alpha %d%s", bts->alpha, VTY_NEWLINE);
@@ -447,10 +449,12 @@ DEFUN(cfg_pcu_no_queue_idle_ack_delay,
DEFUN(cfg_pcu_alloc,
cfg_pcu_alloc_cmd,
- "alloc-algorithm (a|b)",
+ "alloc-algorithm (a|b|dynamic)",
"Select slot allocation algorithm to use when assigning timeslots on "
- "PACCH\nSingle slot is assigned only\nMultiple slots are assigned for "
- "semi-duplex operation")
+ "PACCH\n"
+ "Single slot is assigned only\n"
+ "Multiple slots are assigned for semi-duplex operation\n"
+ "Dynamically select the algorithm based on the system state\n")
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@@ -461,6 +465,9 @@ DEFUN(cfg_pcu_alloc,
case 'b':
bts->alloc_algorithm = alloc_algorithm_b;
break;
+ default:
+ bts->alloc_algorithm = alloc_algorithm_dynamic;
+ break;
}
return CMD_SUCCESS;