diff options
author | Max <msuraev@sysmocom.de> | 2017-01-02 21:42:56 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-01-08 11:09:58 +0000 |
commit | ec11a85929afffd46b0c3daf8979c90e992fb727 (patch) | |
tree | 0bc61daec862f2020f9edc96d028a1df44d81ca9 /src/common | |
parent | c038cb790309c4970980d6811456c3ed6bc4d896 (diff) |
Alarm on various errors
Send OML Failure Report for unsupported BTS attributes and other errors.
Change-Id: Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e
Related: OS#1615
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/bts.c | 10 | ||||
-rw-r--r-- | src/common/l1sap.c | 5 | ||||
-rw-r--r-- | src/common/oml.c | 62 | ||||
-rw-r--r-- | src/common/rsl.c | 16 |
4 files changed, 85 insertions, 8 deletions
diff --git a/src/common/bts.c b/src/common/bts.c index d2491370..efefb862 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -256,6 +256,7 @@ int trx_link_estab(struct gsm_bts_trx *trx) { struct e1inp_sign_link *link = trx->rsl_link; uint8_t radio_state = link ? NM_OPSTATE_ENABLED : NM_OPSTATE_DISABLED; + int rc; LOGP(DSUM, LOGL_INFO, "RSL link (TRX %02x) state changed to %s, sending Status'.\n", trx->nr, link ? "up" : "down"); @@ -263,10 +264,13 @@ int trx_link_estab(struct gsm_bts_trx *trx) oml_mo_state_chg(&trx->mo, radio_state, NM_AVSTATE_OK); if (link) - rsl_tx_rf_res(trx); + rc = rsl_tx_rf_res(trx); else - bts_model_trx_deact_rf(trx); - + rc = bts_model_trx_deact_rf(trx); + if (rc < 0) + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_RSL_FAIL, link ? + "Failed to establish RSL link (%d)\n" : + "Failed to deactivate RF (%d)\n", rc); return 0; } diff --git a/src/common/l1sap.c b/src/common/l1sap.c index e6e53db6..968237f3 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -44,6 +44,7 @@ #include <osmo-bts/measurement.h> #include <osmo-bts/bts.h> #include <osmo-bts/rsl.h> +#include <osmo-bts/oml.h> #include <osmo-bts/bts_model.h> #include <osmo-bts/handover.h> #include <osmo-bts/power_control.h> @@ -1024,6 +1025,10 @@ int l1sap_up(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) default: LOGP(DL1P, LOGL_NOTICE, "unknown prim %d op %d\n", l1sap->oph.primitive, l1sap->oph.operation); + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, + "unknown prim %d op %d\n", + l1sap->oph.primitive, + l1sap->oph.operation); break; } diff --git a/src/common/oml.c b/src/common/oml.c index 870ef3c7..8ccfcc66 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -345,19 +345,28 @@ static int oml_rx_set_bts_attr(struct gsm_bts *bts, struct msgb *msg) DEBUGPC(DOML, "Rx SET BTS ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, + "New value for Attribute not supported\n"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* Test for globally unsupported stuff here */ if (TLVP_PRESENT(&tp, NM_ATT_BCCH_ARFCN)) { uint16_t arfcn = ntohs(tlvp_val16_unal(&tp, NM_ATT_BCCH_ARFCN)); if (arfcn > 1024) { + oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_WARN_SW_WARN, + "Given ARFCN %d is not supported.\n", + arfcn); LOGP(DOML, LOGL_NOTICE, "Given ARFCN %d is not supported.\n", arfcn); return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); } } /* 9.4.52 Starting Time */ if (TLVP_PRESENT(&tp, NM_ATT_START_TIME)) { + oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, + "NM_ATT_START_TIME Attribute not " + "supported\n"); return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP); } @@ -494,8 +503,12 @@ static int oml_rx_set_radio_attr(struct gsm_bts_trx *trx, struct msgb *msg) DEBUGPC(DOML, "Rx SET RADIO CARRIER ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UNSUP_ATTR, + "New value for Set Radio Attribute not" + " supported\n"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* merge existing BTS attributes with new attributes */ tp_merged = osmo_tlvp_copy(trx->mo.nm_attr, trx->bts); @@ -656,8 +669,12 @@ static int oml_rx_set_chan_attr(struct gsm_bts_trx_ts *ts, struct msgb *msg) DEBUGPC(DOML, "Rx SET CHAN ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + oml_tx_failure_event_rep(&ts->mo, OSMO_EVT_MAJ_UNSUP_ATTR, + "New value for Set Channel Attribute " + "not supported\n"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* 9.4.21 HSN... */ /* 9.4.27 MAIO */ @@ -791,11 +808,29 @@ static int down_fom(struct gsm_bts *bts, struct msgb *msg) if (msgb_l2len(msg) < sizeof(*foh)) { LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too short\n"); + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, + "Formatted O&M message too short\n"); + } return -EIO; } if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, + "Formatted O&M with BTS %d out" + " of range (0:0xFF).\n", + foh->obj_inst.bts_nr); + } return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); } @@ -829,6 +864,20 @@ static int down_fom(struct gsm_bts *bts, struct msgb *msg) default: LOGP(DOML, LOGL_INFO, "unknown Formatted O&M msg_type 0x%02x\n", foh->msg_type); + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, + "unknown Formatted O&M " + "msg_type 0x%02x\n", + foh->msg_type); + } else + oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG, + "unknown Formatted O&M " + "msg_type 0x%02x\n", + foh->msg_type); ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL); } @@ -997,8 +1046,13 @@ static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg) DEBUGPC(DOML, "Rx IPA SET ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, + "New value for IPAC Set Attribute not " + "supported\n"); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* Resolve MO by obj_class/obj_inst */ mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); diff --git a/src/common/rsl.c b/src/common/rsl.c index 9e9cbb62..be1861cb 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -401,7 +401,11 @@ static int rsl_rx_paging_cmd(struct gsm_bts_trx *trx, struct msgb *msg) rc = paging_add_identity(btsb->paging_state, paging_group, identity_lv, chan_needed); if (rc < 0) { - /* FIXME: notfiy the BSC somehow ?*/ + /* FIXME: notfiy the BSC on other errors? */ + if (rc == -ENOSPC && trx) + oml_tx_failure_event_rep(&trx->mo, + OSMO_EVT_MIN_PAG_TAB_FULL, + "BTS paging table is full\n"); } pcu_tx_pag_req(identity_lv, chan_needed); @@ -1649,6 +1653,11 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) LOGP(DRSL, LOGL_ERROR, "%s IPAC Failed to create RTP/RTCP sockets\n", gsm_lchan_name(lchan)); + oml_tx_failure_event_rep(&lchan->ts->trx->mo, + OSMO_EVT_CRIT_RTP_TOUT, + "%s IPAC Failed to create " + "RTP/RTCP sockets\n", + gsm_lchan_name(lchan)); return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL, inc_ip_port, dch->c.msg_type); } @@ -1688,6 +1697,11 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) LOGP(DRSL, LOGL_ERROR, "%s IPAC Failed to bind RTP/RTCP sockets\n", gsm_lchan_name(lchan)); + oml_tx_failure_event_rep(&lchan->ts->trx->mo, + OSMO_EVT_CRIT_RTP_TOUT, + "%s IPAC Failed to bind " + "RTP/RTCP sockets\n", + gsm_lchan_name(lchan)); osmo_rtp_socket_free(lchan->abis_ip.rtp_socket); lchan->abis_ip.rtp_socket = NULL; msgb_queue_flush(&lchan->dl_tch_queue); |