Enables user to Enable/Disable FANR feature from VTY interface
This is second patch among series of patches for FANR feature --- src/bts.h | 1 + src/pcu_main.cpp | 4 ++++ src/pcu_vty.c | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+)
diff --git a/src/bts.h b/src/bts.h index ccb8025..7e3ea80 100644 --- a/src/bts.h +++ b/src/bts.h @@ -192,6 +192,7 @@ struct gprs_rlcmac_bts { uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; + uint8_t fanr_enabled; uint8_t initial_mcs_dl; uint8_t initial_mcs_ul; uint8_t max_mcs_dl; diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 9f38742..32d234d 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -183,6 +183,10 @@ int main(int argc, char *argv[]) bts->initial_mcs_ul = 1; bts->max_mcs_ul = 9; bts->max_mcs_dl = 9; + + bts->egprs_enabled = true; + bts->fanr_enabled = false; + /* CS-1 to CS-4 */ bts->cs_lqual_ranges[0].low = -256; bts->cs_lqual_ranges[0].high = 6; diff --git a/src/pcu_vty.c b/src/pcu_vty.c index edc777d..90c828b 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -59,6 +59,11 @@ static int config_write_pcu(struct vty *vty) else vty_out(vty, " no egprs%s", VTY_NEWLINE);
+ if (bts->fanr_enabled) + vty_out(vty, " egprs fanr %s", VTY_NEWLINE); + else + vty_out(vty, " no egprs fanr%s", VTY_NEWLINE); + vty_out(vty, " flow-control-interval %d%s", bts->fc_interval, VTY_NEWLINE); if (bts->fc_bvc_bucket_size) @@ -201,6 +206,34 @@ DEFUN(cfg_pcu_no_egprs, return CMD_SUCCESS; }
+#define EGPRS_FANR_STR "EGPRS FANR configuration\n" + +DEFUN(cfg_pcu_egprs_fanr, + cfg_pcu_egprs_fanr_cmd, + "egprs_fanr", + EGPRS_FANR_STR) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->fanr_enabled = 1; + vty_out(vty, "%%EGPRS FANR is enabled %s", VTY_NEWLINE); + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_egprs_fanr, + cfg_pcu_no_egprs_fanr_cmd, + "no egprs fanr", + NO_STR EGPRS_FANR_STR) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->fanr_enabled = 0; + vty_out(vty, "%%EGPRS FANR is disabled %s", VTY_NEWLINE); + + return CMD_SUCCESS; +} + DEFUN(cfg_pcu_fc_interval, cfg_pcu_fc_interval_cmd, "flow-control-interval <1-10>", @@ -929,6 +962,8 @@ int pcu_vty_init(const struct log_info *cat) vty_install_default(PCU_NODE); install_element(PCU_NODE, &cfg_pcu_egprs_cmd); install_element(PCU_NODE, &cfg_pcu_no_egprs_cmd); + install_element(PCU_NODE, &cfg_pcu_egprs_fanr_cmd); + install_element(PCU_NODE, &cfg_pcu_no_egprs_fanr_cmd); 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);
Hi Aravind,
On Wed, Mar 09, 2016 at 06:07:14PM +0530, Aravind Sirsikar wrote:
uint8_t egprs_enabled;
- uint8_t fanr_enabled;
you are adding only one field: fanr_enabled.
- bts->egprs_enabled = true;
- bts->fanr_enabled = false;
here you are enabling egprs in main.c, which is unrelated to the FANR change. Please make sure you don't introduce chanes unrelated to the currently worked on feature.
- if (bts->fanr_enabled)
vty_out(vty, " egprs fanr %s", VTY_NEWLINE);- else
vty_out(vty, " no egprs fanr%s", VTY_NEWLINE);
+DEFUN(cfg_pcu_egprs_fanr,
cfg_pcu_egprs_fanr_cmd,"egprs_fanr",EGPRS_FANR_STR)
+DEFUN(cfg_pcu_no_egprs_fanr,
cfg_pcu_no_egprs_fanr_cmd,"no egprs fanr",NO_STR EGPRS_FANR_STR)
So you add a command "egprs_fanr", but you write to the config file as "egprs fanr". Once you save the config file, it will fail to parse and thus the PCU system ends up being unusable. Please be careful with such changes and try to manually re-read a configuration file before sending patches for submission next time :) Thanks!
Regards, Harald
osmocom-net-gprs@lists.osmocom.org