aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-04-07 12:49:52 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2014-04-06 08:58:01 +0200
commitfde3cc24a91c40151c4b7dabcadbc7eff88b847e (patch)
tree14df86591ffc18a3133609d55eac0201a8bc22a4
parent9cc4475510663fc418ff989a4fe53440d092c0a7 (diff)
TRX: Add VTY options to enable and disable SETTSC and SETBSIC
-rw-r--r--src/osmo-bts-trx/main.c2
-rw-r--r--src/osmo-bts-trx/trx_if.c14
-rw-r--r--src/osmo-bts-trx/trx_if.h3
-rw-r--r--src/osmo-bts-trx/trx_vty.c52
4 files changed, 69 insertions, 2 deletions
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index a5971fe6..e9b2bd97 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -333,6 +333,8 @@ int main(int argc, char **argv)
config_file);
exit(1);
}
+ if (!settsc_enabled && !setbsic_enabled)
+ settsc_enabled = setbsic_enabled = 1;
write_pid_file("osmo-bts");
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index bca9cdca..e6b70134 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -46,6 +46,8 @@
int tranceiver_available = 0;
const char *tranceiver_ip = "127.0.0.1";
+int settsc_enabled = 0;
+int setbsic_enabled = 0;
/*
* socket
@@ -230,12 +232,20 @@ int trx_if_cmd_poweron(struct trx_l1h *l1h)
int trx_if_cmd_settsc(struct trx_l1h *l1h, uint8_t tsc)
{
- return trx_ctrl_cmd(l1h, 0, "SETTSC", "%d", tsc);
+ if (!settsc_enabled)
+ return 0;
+ /* if TSC is enabled only, the positive response is mandatory */
+ return trx_ctrl_cmd(l1h, (setbsic_enabled) ? 0 : 1, "SETTSC", "%d",
+ tsc);
}
int trx_if_cmd_setbsic(struct trx_l1h *l1h, uint8_t bsic)
{
- return trx_ctrl_cmd(l1h, 0, "SETBSIC", "%d", bsic);
+ if (!setbsic_enabled)
+ return 0;
+ /* if BSIC is enabled only, the positive response is mandatory */
+ return trx_ctrl_cmd(l1h, (settsc_enabled) ? 0 : 1, "SETBSIC", "%d",
+ bsic);
}
int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db)
diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h
index 8ec071fe..21812248 100644
--- a/src/osmo-bts-trx/trx_if.h
+++ b/src/osmo-bts-trx/trx_if.h
@@ -3,6 +3,9 @@
extern int tranceiver_available;
extern const char *tranceiver_ip;
+extern int settsc_enabled;
+extern int setbsic_enabled;
+
struct trx_ctrl_msg {
struct llist_head list;
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index fa08df4d..207930a8 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -164,6 +164,50 @@ DEFUN(cfg_bts_no_timing_advance_loop, cfg_bts_no_timing_advance_loop_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_settsc, cfg_bts_settsc_cmd,
+ "settsc",
+ "Use SETTSC to configure transceiver\n")
+{
+ settsc_enabled = 1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_setbsic, cfg_bts_setbsic_cmd,
+ "setbsic",
+ "Use SETBSIC to configure transceiver\n")
+{
+ setbsic_enabled = 1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_settsc, cfg_bts_no_settsc_cmd,
+ "no settsc",
+ NO_STR "Disable SETTSC to configure transceiver\n")
+{
+ settsc_enabled = 0;
+ if (!setbsic_enabled) {
+ vty_out(vty, "%% Auto enabling SETBSIC.%s", VTY_NEWLINE);
+ setbsic_enabled = 1;
+ }
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_setbsic, cfg_bts_no_setbsic_cmd,
+ "no setbsic",
+ NO_STR "Disable SETBSIC to configure transceiver\n")
+{
+ setbsic_enabled = 0;
+ if (!settsc_enabled) {
+ vty_out(vty, "%% Auto enabling SETTSC.%s", VTY_NEWLINE);
+ settsc_enabled = 1;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_trx_rxgain, cfg_trx_rxgain_cmd,
"rxgain <0-50>",
"Set the receiver gain in dB\n"
@@ -282,6 +326,10 @@ void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " no ms-power-loop%s", VTY_NEWLINE);
vty_out(vty, " %stiming-advance-loop%s", (trx_ta_loop) ? "":"no ",
VTY_NEWLINE);
+ if (settsc_enabled)
+ vty_out(vty, " settsc%s", VTY_NEWLINE);
+ if (setbsic_enabled)
+ vty_out(vty, " setbsic%s", VTY_NEWLINE);
}
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
@@ -318,6 +366,10 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element(BTS_NODE, &cfg_bts_no_ms_power_loop_cmd);
install_element(BTS_NODE, &cfg_bts_timing_advance_loop_cmd);
install_element(BTS_NODE, &cfg_bts_no_timing_advance_loop_cmd);
+ install_element(BTS_NODE, &cfg_bts_settsc_cmd);
+ install_element(BTS_NODE, &cfg_bts_setbsic_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_settsc_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_setbsic_cmd);
install_element(TRX_NODE, &cfg_trx_rxgain_cmd);
install_element(TRX_NODE, &cfg_trx_power_cmd);