OML: consider RSL link state
OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. That's implemented via BTS model-specific functions (currently Sysmo- and Nano- BTS only) Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486
This commit is contained in:
parent
081cebaa6d
commit
3d049d27f5
|
@ -654,6 +654,9 @@ extern struct e1inp_line_ops bts_isdn_e1inp_line_ops;
|
|||
extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1];
|
||||
extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1];
|
||||
|
||||
char *get_oml_status(const struct gsm_bts *bts);
|
||||
char *get_model_oml_status(const struct gsm_bts *bts);
|
||||
|
||||
/* control interface handling */
|
||||
int bsc_base_ctrl_cmds_install(void);
|
||||
|
||||
|
|
|
@ -546,6 +546,7 @@ struct gsm_bts_model {
|
|||
bool started;
|
||||
int (*start)(struct gsm_network *net);
|
||||
int (*oml_rcvmsg)(struct msgb *msg);
|
||||
char * (*oml_status)(const struct gsm_bts *bts);
|
||||
|
||||
void (*e1line_bind_ops)(struct e1inp_line *line);
|
||||
|
||||
|
|
|
@ -683,6 +683,34 @@ static int abis_nm_rx_lmt_event(struct msgb *mb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline bool all_trx_rsl_connected(const struct gsm_bts *bts)
|
||||
{
|
||||
const struct gsm_bts_trx *trx;
|
||||
|
||||
llist_for_each_entry(trx, &bts->trx_list, list) {
|
||||
if (!trx->rsl_link)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char *get_oml_status(const struct gsm_bts *bts)
|
||||
{
|
||||
if (bts->oml_link)
|
||||
return all_trx_rsl_connected(bts) ? "connected" : "degraded";
|
||||
|
||||
return "disconnected";
|
||||
}
|
||||
|
||||
char *get_model_oml_status(const struct gsm_bts *bts)
|
||||
{
|
||||
if (bts->model->oml_status)
|
||||
return bts->model->oml_status(bts);
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
void abis_nm_queue_send_next(struct gsm_bts *bts)
|
||||
{
|
||||
int wait = 0;
|
||||
|
|
|
@ -231,9 +231,10 @@ CTRL_CMD_DEFINE_RO(bts_chan_load, "channel-load");
|
|||
|
||||
static int get_bts_oml_conn(struct ctrl_cmd *cmd, void *data)
|
||||
{
|
||||
struct gsm_bts *bts = cmd->node;
|
||||
const struct gsm_bts *bts = cmd->node;
|
||||
|
||||
cmd->reply = get_model_oml_status(bts);
|
||||
|
||||
cmd->reply = bts->oml_link ? "connected" : "disconnected";
|
||||
return CTRL_CMD_REPLY;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <osmocom/bsc/common_bsc.h>
|
||||
#include <osmocom/bsc/pcu_if.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* global pointer to the gsm network data structure */
|
||||
extern struct gsm_network *bsc_gsmnet;
|
||||
|
|
|
@ -308,9 +308,8 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
|||
paging_pending_requests_nr(bts),
|
||||
bts->paging.available_slots, VTY_NEWLINE);
|
||||
if (is_ipaccess_bts(bts)) {
|
||||
vty_out(vty, " OML Link state: ");
|
||||
vty_out(vty, " OML Link state: %s", get_model_oml_status(bts));
|
||||
if (bts->oml_link) {
|
||||
vty_out(vty, "connected");
|
||||
if (bts->uptime) {
|
||||
rc = clock_gettime(CLOCK_MONOTONIC, &tp);
|
||||
if (rc == 0) { /* monotonic clock helps to ensure that conversion below is valid */
|
||||
|
@ -320,8 +319,7 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
|
|||
sec % 60, VTY_NEWLINE);
|
||||
}
|
||||
}
|
||||
} else
|
||||
vty_out(vty, "disconnected.%s", VTY_NEWLINE);
|
||||
}
|
||||
} else {
|
||||
vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
|
||||
e1isl_dump_vty(vty, bts->oml_link);
|
||||
|
|
|
@ -52,6 +52,7 @@ struct gsm_bts_model bts_model_nanobts = {
|
|||
.name = "nanobts",
|
||||
.start = bts_model_nanobts_start,
|
||||
.oml_rcvmsg = &abis_nm_rcvmsg,
|
||||
.oml_status = &get_oml_status,
|
||||
.e1line_bind_ops = bts_model_nanobts_e1line_bind_ops,
|
||||
.nm_att_tlvdef = {
|
||||
.def = {
|
||||
|
|
Loading…
Reference in New Issue