aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bs11_config.c
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2010-01-07 01:27:50 +0100
committerDaniel Willmann <daniel@totalueberwachung.de>2010-01-07 14:03:22 +0100
commit6a9fa7308db906c8a92ac610ad3f05e14f2c2af5 (patch)
treeb419067ca1909376a5e5f3ea2eaf91337cbea467 /openbsc/src/bs11_config.c
parentf904fa80ee8aea959ebb339de042e34c2140b9ed (diff)
[bs11_config] Add pll-setvalue and pll-workvalue commands
These commands let you change the PLL set and work values. Many thanks to Dieter Spaar for figuring out how to do this! Now you can just reset your PLL work value if it drifts away due to your E1 card. Use it like this: bs11_config pll-workvalue 1000
Diffstat (limited to 'openbsc/src/bs11_config.c')
-rw-r--r--openbsc/src/bs11_config.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/openbsc/src/bs11_config.c b/openbsc/src/bs11_config.c
index 3d719bb5d..6a76b962d 100644
--- a/openbsc/src/bs11_config.c
+++ b/openbsc/src/bs11_config.c
@@ -51,7 +51,7 @@ enum bs11cfg_state {
STATE_QUERY,
};
static enum bs11cfg_state bs11cfg_state = STATE_NONE;
-static char *command;
+static char *command, *value;
struct timer_list status_timer;
static const u_int8_t obj_li_attr[] = {
@@ -540,6 +540,21 @@ static int handle_state_resp(enum abis_bs11_phase state)
sleep(1);
abis_nm_bs11_factory_logon(g_bts, 0);
command = NULL;
+ } else if (!strcmp(command, "pll-setvalue")) {
+ abis_nm_bs11_set_pll(g_bts, atoi(value));
+ sleep(1);
+ abis_nm_bs11_factory_logon(g_bts, 0);
+ command = NULL;
+ } else if (!strcmp(command, "pll-workvalue")) {
+ /* To set the work value we need to login as FIELD */
+ abis_nm_bs11_factory_logon(g_bts, 0);
+ sleep(1);
+ abis_nm_bs11_infield_logon(g_bts, 1);
+ sleep(1);
+ abis_nm_bs11_set_pll(g_bts, atoi(value));
+ sleep(1);
+ abis_nm_bs11_infield_logon(g_bts, 0);
+ command = NULL;
} else if (!strcmp(command, "oml-tei")) {
abis_nm_bs11_conn_oml_tei(g_bts, 0, 1, 0xff, TEI_OML);
command = NULL;
@@ -720,6 +735,8 @@ static void print_help(void)
printf("\tdelete-trx1\t\tDelete objects for TRX1\n");
printf("\tpll-e1-locked\t\tSet the PLL to be locked to E1 clock\n");
printf("\tpll-standalone\t\tSet the PLL to be in standalone mode\n");
+ printf("\tpll-setvalue <value>\tSet the PLL set value\n");
+ printf("\tpll-workvalue <value>\tSet the PLL work value\n");
printf("\toml-tei\t\t\tSet OML E1 TS and TEI\n");
printf("\tbport0-star\t\tSet BPORT0 line config to star\n");
printf("\tbport0-multiport\tSet BPORT0 line config to multiport\n");
@@ -791,6 +808,9 @@ static void handle_options(int argc, char **argv)
}
if (optind < argc)
command = argv[optind];
+ if (optind+1 < argc)
+ value = argv[optind+1];
+
}
static int num_sigint;