diff options
-rw-r--r-- | include/osmo-bts/oml.h | 2 | ||||
-rw-r--r-- | src/common/bts.c | 11 | ||||
-rw-r--r-- | src/common/l1sap.c | 6 | ||||
-rw-r--r-- | src/common/main.c | 5 | ||||
-rw-r--r-- | src/common/oml.c | 15 | ||||
-rw-r--r-- | src/common/rsl.c | 21 |
6 files changed, 26 insertions, 34 deletions
diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index a87d438e..5136058c 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -45,8 +45,6 @@ int oml_set_lchan_t200(struct gsm_lchan *lchan); extern const unsigned int oml_default_t200_ms[7]; /* Transmit failure event report */ -void oml_fail_rep(uint16_t cause_value, const char *fmt, ...); - int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, uint16_t cause_value, const char *fmt, ...); diff --git a/src/common/bts.c b/src/common/bts.c index abbaeb46..8c2b2fea 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -309,10 +309,13 @@ int trx_link_estab(struct gsm_bts_trx *trx) rc = rsl_tx_rf_res(trx); else rc = bts_model_trx_deact_rf(trx); - if (rc < 0) - oml_fail_rep(OSMO_EVT_MAJ_RSL_FAIL, - link ? "Failed to establish RSL link (%d)" : - "Failed to deactivate RF (%d)", rc); + if (rc < 0) { + oml_tx_failure_event_rep(&trx->bb_transc.mo, OSMO_EVT_MAJ_RSL_FAIL, + link ? + "Failed to establish RSL link (%d)" : + "Failed to deactivate RF (%d)", rc); + } + return 0; } diff --git a/src/common/l1sap.c b/src/common/l1sap.c index a1b04642..f8f3fefb 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1364,8 +1364,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_fail_rep(OSMO_EVT_MAJ_UKWN_MSG, "unknown prim %d op %d", - l1sap->oph.primitive, l1sap->oph.operation); + oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG, + "unknown prim %d op %d", + l1sap->oph.primitive, + l1sap->oph.operation); break; } diff --git a/src/common/main.c b/src/common/main.c index 9575f57c..0d84c183 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -183,8 +183,9 @@ static void signal_handler(int signal) case SIGINT: case SIGTERM: if (!quit) { - oml_fail_rep(OSMO_EVT_CRIT_PROC_STOP, - "BTS: SIGINT received -> shutdown"); + oml_tx_failure_event_rep(&bts->mo, + OSMO_EVT_CRIT_PROC_STOP, + "BTS: SIGINT received -> shutdown"); bts_shutdown(bts, "SIGINT"); } quit++; diff --git a/src/common/oml.c b/src/common/oml.c index ac388d1b..7ff5967f 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -87,21 +87,6 @@ int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, uint16_t cause_value, return oml_mo_send_msg(mo, nmsg, NM_MT_FAILURE_EVENT_REP); } -void oml_fail_rep(uint16_t cause_value, const char *fmt, ...) -{ - va_list ap; - char *rep; - - va_start(ap, fmt); - rep = talloc_asprintf(tall_bts_ctx, fmt, ap); - va_end(ap); - - osmo_signal_dispatch(SS_FAIL, cause_value, rep); - /* signal dispatch is synchronous so all the signal handlers are - finished already: we're free to free */ - talloc_free(rep); -} - /* Push OM header in front of msgb and send it */ int oml_send_msg(struct msgb *msg, int is_manuf) { diff --git a/src/common/rsl.c b/src/common/rsl.c index 9334ed9d..f93ca50d 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -466,9 +466,10 @@ static int rsl_rx_paging_cmd(struct gsm_bts_trx *trx, struct msgb *msg) rc = paging_add_identity(bts->paging_state, paging_group, identity_lv, chan_needed); if (rc < 0) { /* FIXME: notfiy the BSC on other errors? */ - if (rc == -ENOSPC) - oml_fail_rep(OSMO_EVT_MIN_PAG_TAB_FULL, - "BTS paging table is full"); + if (rc == -ENOSPC) { + oml_tx_failure_event_rep(&trx->bts->mo, OSMO_EVT_MIN_PAG_TAB_FULL, + "BTS paging table is full"); + } } pcu_tx_pag_req(identity_lv, chan_needed); @@ -1938,9 +1939,10 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) LOGP(DRTP, LOGL_ERROR, "%s IPAC Failed to create RTP/RTCP sockets\n", gsm_lchan_name(lchan)); - oml_fail_rep(OSMO_EVT_CRIT_RTP_TOUT, - "%s IPAC Failed to create RTP/RTCP sockets", - 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", + gsm_lchan_name(lchan)); return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL, inc_ip_port, dch->c.msg_type); } @@ -1979,9 +1981,10 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) LOGP(DRTP, LOGL_ERROR, "%s IPAC Failed to bind RTP/RTCP sockets\n", gsm_lchan_name(lchan)); - oml_fail_rep(OSMO_EVT_CRIT_RTP_TOUT, - "%s IPAC Failed to bind RTP/RTCP sockets", - 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", + 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); |