aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-08-17 22:44:07 +0200
committerHarald Welte <laforge@gnumonks.org>2011-08-19 22:38:35 +0200
commited5cacb240b846c106f0fc6a3ab8e8721f4c70a5 (patch)
treeba6bffbf0c95ecc0c50b5335bed77f3a2b29120f /openbsc/src/libbsc/bsc_vty.c
parent7abecfcfc9ef94c1367cd88ac858b79d20f75db0 (diff)
src: port openBSC over libosmo-abis0.9.15
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r--openbsc/src/libbsc/bsc_vty.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 8a5c7fdf2..a98779dac 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -30,7 +30,7 @@
#include <osmocom/core/linuxlist.h>
#include <openbsc/gsm_data.h>
-#include <openbsc/e1_input.h>
+#include <osmocom/abis/e1_input.h>
#include <openbsc/abis_nm.h>
#include <openbsc/abis_om2000.h>
#include <osmocom/core/utils.h>
@@ -506,10 +506,13 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
case GSM_BTS_TYPE_NANOBTS:
vty_out(vty, " ip.access unit_id %u %u%s",
bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
- vty_out(vty, " oml ip.access stream_id %u%s", bts->oml_tei, VTY_NEWLINE);
+ vty_out(vty, " oml ip.access stream_id %u line %u%s",
+ bts->oml_tei, bts->oml_e1_link.e1_nr, VTY_NEWLINE);
break;
case GSM_BTS_TYPE_HSL_FEMTO:
vty_out(vty, " hsl serial-number %lu%s", bts->hsl.serno, VTY_NEWLINE);
+ vty_out(vty, " oml hsl line %u%s",
+ bts->oml_e1_link.e1_nr, VTY_NEWLINE);
break;
default:
config_write_e1_link(vty, &bts->oml_e1_link, " oml ");
@@ -1507,12 +1510,12 @@ DEFUN(cfg_bts_serno,
DEFUN(cfg_bts_stream_id,
cfg_bts_stream_id_cmd,
- "oml ip.access stream_id <0-255>",
+ "oml ip.access stream_id <0-255> line E1_LINE",
OML_STR IPA_STR
"Set the ip.access Stream ID of the OML link of this BTS\n")
{
struct gsm_bts *bts = vty->index;
- int stream_id = atoi(argv[0]);
+ int stream_id = atoi(argv[0]), linenr = atoi(argv[1]);
if (!is_ipaccess_bts(bts)) {
vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE);
@@ -1520,6 +1523,27 @@ DEFUN(cfg_bts_stream_id,
}
bts->oml_tei = stream_id;
+ /* This is used by e1inp_bind_ops callback for each BTS model. */
+ bts->oml_e1_link.e1_nr = linenr;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_hsl_oml,
+ cfg_bts_hsl_oml_cmd,
+ "oml hsl line E1_LINE",
+ OML_STR "HSL femto Specific Options"
+ "Set OML link of this HSL femto BTS\n")
+{
+ struct gsm_bts *bts = vty->index;
+ int linenr = atoi(argv[0]);
+
+ if (!(bts->type == GSM_BTS_TYPE_HSL_FEMTO)) {
+ vty_out(vty, "%% BTS is not of HSL type%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ bts->oml_e1_link.e1_nr = linenr;
return CMD_SUCCESS;
}
@@ -2624,6 +2648,7 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
install_element(BTS_NODE, &cfg_bts_serno_cmd);
install_element(BTS_NODE, &cfg_bts_stream_id_cmd);
+ install_element(BTS_NODE, &cfg_bts_hsl_oml_cmd);
install_element(BTS_NODE, &cfg_bts_oml_e1_cmd);
install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd);
install_element(BTS_NODE, &cfg_bts_challoc_cmd);