diff options
Diffstat (limited to 'src/pcu_vty.c')
-rw-r--r-- | src/pcu_vty.c | 121 |
1 files changed, 53 insertions, 68 deletions
diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 58fea99..edc777d 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -55,7 +55,9 @@ static int config_write_pcu(struct vty *vty) vty_out(vty, "pcu%s", VTY_NEWLINE); if (bts->egprs_enabled) - vty_out(vty, " egprs only%s", VTY_NEWLINE); + vty_out(vty, " egprs%s", VTY_NEWLINE); + else + vty_out(vty, " no egprs%s", VTY_NEWLINE); vty_out(vty, " flow-control-interval %d%s", bts->fc_interval, VTY_NEWLINE); @@ -85,7 +87,23 @@ static int config_write_pcu(struct vty *vty) VTY_NEWLINE); else vty_out(vty, " cs max %d %d%s", bts->max_cs_dl, - bts->max_cs_ul, VTY_NEWLINE); + bts->max_cs_ul, VTY_NEWLINE); + } + if (bts->force_mcs) { + if (bts->initial_mcs_ul == bts->initial_mcs_dl) + vty_out(vty, " mcs %d%s", bts->initial_mcs_dl, + VTY_NEWLINE); + else + vty_out(vty, " mcs %d %d%s", bts->initial_mcs_dl, + bts->initial_mcs_ul, VTY_NEWLINE); + } + if (bts->max_mcs_dl && bts->max_mcs_ul) { + if (bts->max_mcs_ul == bts->max_mcs_dl) + vty_out(vty, " mcs max %d%s", bts->max_mcs_dl, + VTY_NEWLINE); + else + vty_out(vty, " mcs max %d %d%s", bts->max_mcs_dl, + bts->max_mcs_ul, VTY_NEWLINE); } if (bts->cs_adj_enabled) vty_out(vty, " cs threshold %d %d%s", @@ -109,26 +127,6 @@ static int config_write_pcu(struct vty *vty) bts->cs_lqual_ranges[3].low, VTY_NEWLINE); - if (bts->initial_mcs_dl != 1 && bts->initial_mcs_ul != 1) { - if (bts->initial_mcs_ul == bts->initial_mcs_dl) - vty_out(vty, " mcs %d%s", bts->initial_mcs_dl, - VTY_NEWLINE); - else - vty_out(vty, " mcs %d %d%s", bts->initial_mcs_dl, - bts->initial_mcs_ul, VTY_NEWLINE); - } - if (bts->max_mcs_dl && bts->max_mcs_ul) { - if (bts->max_mcs_ul == bts->max_mcs_dl) - vty_out(vty, " mcs max %d%s", bts->max_mcs_dl, - VTY_NEWLINE); - else - vty_out(vty, " mcs max %d %d%s", bts->max_mcs_dl, - bts->max_mcs_ul, VTY_NEWLINE); - } - - vty_out(vty, " window-size %d %d%s", bts->ws_base, bts->ws_pdch, - VTY_NEWLINE); - if (bts->force_llc_lifetime == 0xffff) vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE); else if (bts->force_llc_lifetime) @@ -180,18 +178,13 @@ DEFUN(cfg_pcu, DEFUN(cfg_pcu_egprs, cfg_pcu_egprs_cmd, - "egprs only", - EGPRS_STR "Use EGPRS and disable plain GPRS\n") + "egprs", + EGPRS_STR) { struct gprs_rlcmac_bts *bts = bts_main_data(); bts->egprs_enabled = 1; - - vty_out(vty, "%%Note that EGPRS support is in an experimental state " - "and the PCU will currently fail to use a TBF if the MS is capable " - "to do EGPRS. You may want to disable this feature by entering " - "the \"no egprs\" command. " - "Do not use this in production!%s", VTY_NEWLINE); + vty_out(vty, "%%EGPRS is enabled %s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -379,12 +372,11 @@ DEFUN(cfg_pcu_no_cs, return CMD_SUCCESS; } -#define CS_MAX_STR "Set maximum values for adaptive CS selection (overrides BTS config)\n" DEFUN(cfg_pcu_cs_max, cfg_pcu_cs_max_cmd, "cs max <1-4> [<1-4>]", CS_STR - CS_MAX_STR + "Set maximum values for adaptive CS selection (overrides BTS config)\n" "Maximum CS value to be used\n" "Use a different maximum CS value for the uplink") { @@ -403,7 +395,8 @@ DEFUN(cfg_pcu_cs_max, DEFUN(cfg_pcu_no_cs_max, cfg_pcu_no_cs_max_cmd, "no cs max", - NO_STR CS_STR CS_MAX_STR) + NO_STR CS_STR + "Set maximum values for adaptive CS selection (overrides BTS config)\n") { struct gprs_rlcmac_bts *bts = bts_main_data(); @@ -413,23 +406,24 @@ DEFUN(cfg_pcu_no_cs_max, return CMD_SUCCESS; } -#define MCS_STR "Modulation and Coding Scheme configuration (EGPRS)\n" +#define MCS_STR "EGPRS Coding Scheme configuration\n" DEFUN(cfg_pcu_mcs, cfg_pcu_mcs_cmd, "mcs <1-9> [<1-9>]", MCS_STR - "Initial MCS value to be used (default 1)\n" + "Initial MCS value to be used (overrides BTS config)\n" "Use a different initial MCS value for the uplink") { struct gprs_rlcmac_bts *bts = bts_main_data(); - uint8_t cs = atoi(argv[0]); + uint8_t mcs = atoi(argv[0]); - bts->initial_mcs_dl = cs; + bts->force_mcs = 1; + bts->initial_mcs_dl = mcs; if (argc > 1) bts->initial_mcs_ul = atoi(argv[1]); else - bts->initial_mcs_ul = cs; + bts->initial_mcs_ul = mcs; return CMD_SUCCESS; } @@ -441,8 +435,7 @@ DEFUN(cfg_pcu_no_mcs, { struct gprs_rlcmac_bts *bts = bts_main_data(); - bts->initial_mcs_dl = 1; - bts->initial_mcs_ul = 1; + bts->force_mcs = 0; return CMD_SUCCESS; } @@ -451,7 +444,7 @@ DEFUN(cfg_pcu_mcs_max, cfg_pcu_mcs_max_cmd, "mcs max <1-9> [<1-9>]", MCS_STR - CS_MAX_STR + "Set maximum values for adaptive MCS selection (overrides BTS config)\n" "Maximum MCS value to be used\n" "Use a different maximum MCS value for the uplink") { @@ -470,7 +463,8 @@ DEFUN(cfg_pcu_mcs_max, DEFUN(cfg_pcu_no_mcs_max, cfg_pcu_no_mcs_max_cmd, "no mcs max", - NO_STR MCS_STR CS_MAX_STR) + NO_STR MCS_STR + "Set maximum values for adaptive MCS selection (overrides BTS config)\n") { struct gprs_rlcmac_bts *bts = bts_main_data(); @@ -480,26 +474,6 @@ DEFUN(cfg_pcu_no_mcs_max, return CMD_SUCCESS; } -DEFUN(cfg_pcu_window_size, - cfg_pcu_window_size_cmd, - "window-size <0-1024> [<0-256>]", - "Window size configuration (b + N_PDCH * f)\n" - "Base value (b)\n" - "Factor for number of PDCH (f)") -{ - struct gprs_rlcmac_bts *bts = bts_main_data(); - uint16_t b = atoi(argv[0]); - - bts->ws_base = b; - if (argc > 1) { - uint16_t f = atoi(argv[1]); - bts->ws_pdch = f; - } - - 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" @@ -880,7 +854,19 @@ DEFUN(show_tbf, SHOW_STR "information about TBFs\n" "All TBFs\n") { struct gprs_rlcmac_bts *bts = bts_main_data(); - return pcu_vty_show_tbf_all(vty, bts); + struct llist_head *tbf; + + vty_out(vty, "UL TBFs%s", VTY_NEWLINE); + llist_for_each(tbf, &bts->ul_tbfs) { + tbf_print_vty_info(vty, tbf); + } + + vty_out(vty, "%sDL TBFs%s", VTY_NEWLINE, VTY_NEWLINE); + llist_for_each(tbf, &bts->dl_tbfs) { + tbf_print_vty_info(vty, tbf); + } + + return CMD_SUCCESS; } DEFUN(show_ms_all, @@ -948,16 +934,15 @@ int pcu_vty_init(const struct log_info *cat) install_element(PCU_NODE, &cfg_pcu_no_cs_cmd); install_element(PCU_NODE, &cfg_pcu_cs_max_cmd); install_element(PCU_NODE, &cfg_pcu_no_cs_max_cmd); + install_element(PCU_NODE, &cfg_pcu_mcs_cmd); + install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); + install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd); + install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd); install_element(PCU_NODE, &cfg_pcu_cs_err_limits_cmd); install_element(PCU_NODE, &cfg_pcu_no_cs_err_limits_cmd); install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd); install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd); - install_element(PCU_NODE, &cfg_pcu_mcs_cmd); - install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); - install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd); - install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd); - install_element(PCU_NODE, &cfg_pcu_window_size_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); |