dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13268


Change subject: oml: use oml_tx_failure_event_rep() instead of oml_fail_rep()
......................................................................

oml: use oml_tx_failure_event_rep() instead of oml_fail_rep()

The function oml_tx_failure_event_rep() replaces oml_fail_rep(), so lets
use only oml_tx_failure_event_rep() and remove oml_fail_rep()

Change-Id: I83c4fa9ebd519299fd54b37b5d95d6d7c1da24f6
Related: OS#3843
---
M include/osmo-bts/oml.h
M src/common/bts.c
M src/common/l1sap.c
M src/common/main.c
M src/common/oml.c
M src/common/rsl.c
6 files changed, 29 insertions(+), 37 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/68/13268/1

diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h
index a87d438..5136058 100644
--- a/include/osmo-bts/oml.h
+++ b/include/osmo-bts/oml.h
@@ -45,8 +45,6 @@
 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 abbaeb4..37d1cf9 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -309,10 +309,13 @@
                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->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 dba08df..692c781 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1364,8 +1364,10 @@
        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 3a53813..be73b2b 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -183,8 +183,9 @@
        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++;
@@ -192,9 +193,9 @@
        case SIGABRT:
        case SIGUSR1:
        case SIGUSR2:
-               oml_fail_rep(OSMO_EVT_CRIT_PROC_STOP,
-                            "BTS: signal %d (%s) received", signal,
-                            strsignal(signal));
+               oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_CRIT_PROC_STOP,
+                                        "BTS: signal %d (%s) received", signal,
+                                        strsignal(signal));
                talloc_report_full(tall_bts_ctx, stderr);
                break;
        default:
diff --git a/src/common/oml.c b/src/common/oml.c
index ac388d1..7ff5967 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -87,21 +87,6 @@
        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 fce3495..516f6fb 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -465,9 +465,10 @@
        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->mo, 
OSMO_EVT_MIN_PAG_TAB_FULL,
+                                                "BTS paging table is full");
+               }
        }

        pcu_tx_pag_req(identity_lv, chan_needed);
@@ -1937,9 +1938,10 @@
                        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);
                }
@@ -1978,9 +1980,10 @@
                        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);

--
To view, visit https://gerrit.osmocom.org/13268
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83c4fa9ebd519299fd54b37b5d95d6d7c1da24f6
Gerrit-Change-Number: 13268
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>

Reply via email to