From 59eee42b05cf12076576ee4f65f8052d492e6fc3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 14 Feb 2011 16:17:49 +0100 Subject: OM2000/RBS2000: Make IS+CON configuration persistent in config file This uses the new bts_model->config_write_bts() callbacks --- openbsc/include/openbsc/abis_om2000.h | 3 +++ openbsc/src/abis_om2000_vty.c | 27 +++++++++++++++++++++++---- openbsc/src/bts_ericsson_rbs2000.c | 18 ++++++++++++------ 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index f15a50d5e..ee59454b0 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -56,4 +56,7 @@ int abis_om2k_tx_is_conf_req(struct gsm_bts *bts, struct om2k_is_conn_grp *cg, int abis_om2k_vty_init(void); +struct vty; +void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts); + #endif /* OPENBCS_ABIS_OM2K_H */ diff --git a/openbsc/src/abis_om2000_vty.c b/openbsc/src/abis_om2000_vty.c index 4c42f6dd3..aeb562040 100644 --- a/openbsc/src/abis_om2000_vty.c +++ b/openbsc/src/abis_om2000_vty.c @@ -339,14 +339,13 @@ struct is_conn_group { uint8_t ci; }; -DEFUN(om2k_is_conn_list, om2k_is_conn_list_cmd, +DEFUN(cfg_bts_is_conn_list, cfg_bts_is_conn_list_cmd, "is-connection-list (add|del) <0-2047> <0-2047> <0-255>", "Interface Switch Connnection List\n" "Add to IS list\n" "Delete from IS list\n" "ICP1\n" "ICP2\n" "Contiguity Index\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; + struct gsm_bts *bts = vty->index; uint16_t icp1 = atoi(argv[1]); uint16_t icp2 = atoi(argv[2]); uint8_t ci = atoi(argv[3]); @@ -411,6 +410,25 @@ DEFUN(om2k_is_conf_req, om2k_is_conf_req_cmd, return CMD_SUCCESS; } +void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + struct is_conn_group *igrp; + struct con_conn_group *cgrp; + + llist_for_each_entry(igrp, &bts->rbs2000.is.conn_groups, list) + vty_out(vty, " is-connection-list add %u %u %u%s", + igrp->icp1, igrp->icp2, igrp->ci, VTY_NEWLINE); + + llist_for_each_entry(cgrp, &bts->rbs2000.con.conn_groups, list) { + vty_out(vty, " con-connection-list add %u %u ", + cgrp->cg, cgrp->ccp); + if (cgrp->tei == 0xff) + vty_out(vty, "deconcentrated%s", VTY_NEWLINE); + else + vty_out(vty, "tei %u%s", cgrp->tei, VTY_NEWLINE); + } +} + int abis_om2k_vty_init(void) { install_element(ENABLE_NODE, &om2k_class_inst_cmd); @@ -429,9 +447,10 @@ int abis_om2k_vty_init(void) install_element(OM2K_NODE, &om2k_op_info_cmd); install_element(OM2K_NODE, &om2k_test_cmd); install_element(OM2K_NODE, &om2k_is_conf_req_cmd); - install_element(OM2K_NODE, &om2k_is_conn_list_cmd); install_element(OM2K_NODE, &om2k_con_list_dec_cmd); install_element(OM2K_NODE, &om2k_con_list_tei_cmd); + install_element(BTS_NODE, &cfg_bts_is_conn_list_cmd); + return 0; } diff --git a/openbsc/src/bts_ericsson_rbs2000.c b/openbsc/src/bts_ericsson_rbs2000.c index fa25f3aa1..ab2959107 100644 --- a/openbsc/src/bts_ericsson_rbs2000.c +++ b/openbsc/src/bts_ericsson_rbs2000.c @@ -31,12 +31,6 @@ #include "input/lapd.h" -static struct gsm_bts_model model_rbs2k = { - .type = GSM_BTS_TYPE_RBS2000, - .name = "rbs2000", - .oml_rcvmsg = &abis_om2k_rcvmsg, -}; - static void bootstrap_om_bts(struct gsm_bts *bts) { LOGP(DNM, LOGL_NOTICE, "bootstrapping OML for BTS %u\n", bts->nr); @@ -143,6 +137,18 @@ static int inp_sig_cb(unsigned int subsys, unsigned int signal, return 0; } +static void config_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + abis_om2k_config_write_bts(vty, bts); +} + +static struct gsm_bts_model model_rbs2k = { + .type = GSM_BTS_TYPE_RBS2000, + .name = "rbs2000", + .oml_rcvmsg = &abis_om2k_rcvmsg, + .config_write_bts = &config_write_bts, +}; + int bts_model_rbs2k_init(void) { model_rbs2k.features.data = &model_rbs2k._features_data[0]; -- cgit v1.2.3