aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcu_vty.c
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2013-06-18 21:55:22 +0400
committerIvan Kluchnikov <kluchnikovi@gmail.com>2013-06-18 21:55:22 +0400
commit07cd260d9d9a6da0b3856c87852ee8039640d745 (patch)
tree3fb6057cb9fbe229fc040f10abb4725c46e8bf6c /src/pcu_vty.c
parenta004e6a8233695abd417a97d6f81a802b605038a (diff)
Implemented estimated C/I algorithm for link adaptation.link_adaptation
Description of algorithm: 1. Start with initial coding scheme. 2. Transmit RLC blocks until the end of the reporting window (Packet Downlink Ack/Nack message is received) 3. Estimate the average C/I for the previous reporting window and change CS, if it is necessary. 4. If there is more data to transmit return to step 2. Added configuration options to enable/disable link adaptation and setting maximum C/I level for CS1, CS2, CS3, CS4.
Diffstat (limited to 'src/pcu_vty.c')
-rw-r--r--src/pcu_vty.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 3ab6865c..454b31c9 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -88,6 +88,10 @@ static int config_write_pcu(struct vty *vty)
else
vty_out(vty, " cs %d %d%s", bts->initial_cs_dl,
bts->initial_cs_ul, VTY_NEWLINE);
+ if (bts->cs_link_adaptation)
+ vty_out(vty, " cs ci level %f %f %f %f%s", bts->cs1_ci_level,
+ bts->cs2_ci_level, bts->cs3_ci_level, bts->cs4_ci_level,
+ VTY_NEWLINE);
if (bts->force_llc_lifetime == 0xffff)
vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
else if (bts->force_llc_lifetime)
@@ -159,6 +163,45 @@ DEFUN(cfg_pcu_no_cs,
return CMD_SUCCESS;
}
+DEFUN(cfg_pcu_cs_link_adaptation,
+ cfg_pcu_cs_link_adaptation_cmd,
+ "cs link adaptation",
+ NO_STR "Turn on CS link adaptation\n")
+{
+ struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts;
+
+ bts->cs_link_adaptation = 1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_no_cs_link_adaptation,
+ cfg_pcu_no_cs_link_adaptation_cmd,
+ "no cs link adaptation",
+ NO_STR "Turn off CS link adaptation\n")
+{
+ struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts;
+
+ bts->cs_link_adaptation = 0;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_cs_ci_level,
+ cfg_pcu_cs_ci_level_cmd,
+ "cs ci level <0-30> <0-30> <0-30> <0-30>",
+ NO_STR "Set maximum C/I level for CS1 CS2 CS3 CS4\n")
+{
+ struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts;
+
+ bts->cs1_ci_level = atoi(argv[0]);
+ bts->cs2_ci_level = atoi(argv[1]);
+ bts->cs3_ci_level = atoi(argv[2]);
+ bts->cs4_ci_level = atoi(argv[3]);
+
+ return CMD_SUCCESS;
+}
+
#define QUEUE_STR "Packet queue options\n"
#define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \
"(overrides the value given by SGSN)\n"
@@ -300,6 +343,9 @@ int pcu_vty_init(const struct log_info *cat)
install_element(PCU_NODE, &cfg_pcu_no_two_phase_cmd);
install_element(PCU_NODE, &cfg_pcu_cs_cmd);
install_element(PCU_NODE, &cfg_pcu_no_cs_cmd);
+ install_element(PCU_NODE, &cfg_pcu_cs_link_adaptation_cmd);
+ install_element(PCU_NODE, &cfg_pcu_no_cs_link_adaptation_cmd);
+ install_element(PCU_NODE, &cfg_pcu_cs_ci_level_cmd);
install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd);
install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd);
install_element(PCU_NODE, &cfg_pcu_no_queue_lifetime_cmd);