aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-24 14:19:14 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-24 14:37:36 +0100
commit37ac4202547d41aa23f2bca5bb4ecfc67c806da0 (patch)
tree9ba06e9feb2e0e010de656db5c05e2cfdc438ea0 /openbsc
parent6a458eac2c1db16454fe0b4e7b3f68aa961d4004 (diff)
rf: Remember the last command requested on the RF CMD interface
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/osmo_bsc_rf.h2
-rw-r--r--openbsc/src/bsc/osmo_bsc_rf.c5
-rw-r--r--openbsc/src/bsc_vty.c8
3 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/osmo_bsc_rf.h b/openbsc/include/openbsc/osmo_bsc_rf.h
index b4e17f01..63115fe9 100644
--- a/openbsc/include/openbsc/osmo_bsc_rf.h
+++ b/openbsc/include/openbsc/osmo_bsc_rf.h
@@ -12,6 +12,8 @@ struct osmo_bsc_rf {
struct bsc_fd listen;
struct gsm_network *gsm_network;
+ const char *last_state_command;
+
/* some handling for the automatic grace switch */
struct timer_list grace_timeout;
};
diff --git a/openbsc/src/bsc/osmo_bsc_rf.c b/openbsc/src/bsc/osmo_bsc_rf.c
index e70af56f..6d2a1743 100644
--- a/openbsc/src/bsc/osmo_bsc_rf.c
+++ b/openbsc/src/bsc/osmo_bsc_rf.c
@@ -166,18 +166,22 @@ static int rf_read_cmd(struct bsc_fd *fd)
handle_query(conn);
break;
case RF_CMD_D_OFF:
+ conn->rf->last_state_command = "RF Direct Off";
bsc_del_timer(&conn->rf->grace_timeout);
switch_rf_off(conn->rf);
break;
case RF_CMD_ON:
+ conn->rf->last_state_command = "RF Direct On";
bsc_del_timer(&conn->rf->grace_timeout);
lock_each_trx(conn->rf->gsm_network, 0);
send_signal(conn->rf, S_RF_ON);
break;
case RF_CMD_OFF:
+ conn->rf->last_state_command = "RF Scheduled Off";
enter_grace(conn);
break;
default:
+ conn->rf->last_state_command = "Unknown command";
LOGP(DINP, LOGL_ERROR, "Unknown command %d\n", buf[0]);
break;
}
@@ -305,6 +309,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net
rf->gsm_network = net;
rf->policy = S_RF_ON;
+ rf->last_state_command = "";
return rf;
}
diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c
index e5e424ce..ed45afd4 100644
--- a/openbsc/src/bsc_vty.c
+++ b/openbsc/src/bsc_vty.c
@@ -47,6 +47,8 @@
#include <openbsc/paging.h>
#include <openbsc/ipaccess.h>
#include <openbsc/abis_rsl.h>
+#include <openbsc/osmo_msc_data.h>
+#include <openbsc/osmo_bsc_rf.h>
#include "../bscconfig.h"
@@ -185,6 +187,12 @@ static void net_dump_vty(struct vty *vty, struct gsm_network *net)
network_chan_load(&pl, net);
vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE);
dump_pchan_load_vty(vty, " ", &pl);
+
+ /* show rf */
+ if (net->msc_data)
+ vty_out(vty, " Last RF Command: %s%s",
+ net->msc_data->rf_ctl->last_state_command,
+ VTY_NEWLINE);
}
DEFUN(show_net, show_net_cmd, "show network",