aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libabis/e1_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libabis/e1_input.c')
-rw-r--r--openbsc/src/libabis/e1_input.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/openbsc/src/libabis/e1_input.c b/openbsc/src/libabis/e1_input.c
index 97dcd3364..a6661b785 100644
--- a/openbsc/src/libabis/e1_input.c
+++ b/openbsc/src/libabis/e1_input.c
@@ -39,17 +39,19 @@
#endif
#include <osmocom/core/select.h>
+#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/rate_ctr.h>
+
#include <openbsc/debug.h>
#include <openbsc/gsm_data.h>
#include <openbsc/e1_input.h>
#include <openbsc/abis_nm.h>
#include <openbsc/abis_rsl.h>
-#include <osmocom/core/linuxlist.h>
#include <openbsc/subchan_demux.h>
#include <openbsc/trau_frame.h>
#include <openbsc/trau_mux.h>
-#include <osmocom/core/talloc.h>
#include <openbsc/signal.h>
#include <openbsc/misdn.h>
@@ -65,6 +67,31 @@ LLIST_HEAD(e1inp_line_list);
static void *tall_sigl_ctx;
+static const struct rate_ctr_desc e1inp_ctr_d[] = {
+ [E1I_CTR_HDLC_ABORT] = {
+ "hdlc.abort", "HDLC abort"
+ },
+ [E1I_CTR_HDLC_BADFCS] = {
+ "hdlc.bad_fcs", "HLDC Bad FCS"
+ },
+ [E1I_CTR_HDLC_OVERR] = {
+ "hdlc.overrun", "HDLC Overrun"
+ },
+ [E1I_CTR_ALARM] = {
+ "alarm", "Alarm"
+ },
+ [E1I_CTR_REMOVED] = {
+ "removed", "Line removed"
+ },
+};
+
+static const struct rate_ctr_group_desc e1inp_ctr_g_d = {
+ .group_name_prefix = "e1inp",
+ .group_description = "E1 Input subsystem",
+ .num_ctr = ARRAY_SIZE(e1inp_ctr_d),
+ .ctr_desc = e1inp_ctr_d,
+};
+
/*
* pcap writing of the misdn load
* pcap format is from http://wiki.wireshark.org/Development/LibpcapFileFormat
@@ -360,8 +387,10 @@ struct e1inp_line *e1inp_line_create(uint8_t e1_nr, const char *driver_name)
return NULL;
line->driver = driver;
-
line->num = e1_nr;
+
+ line->rate_ctr = rate_ctr_group_alloc(line, &e1inp_ctr_g_d, line->num);
+
for (i = 0; i < NUM_E1_TS; i++) {
line->ts[i].num = i+1;
line->ts[i].line = line;
@@ -570,6 +599,7 @@ int e1inp_event(struct e1inp_ts *ts, int evt, uint8_t tei, uint8_t sapi)
if (!link)
return -EINVAL;
+ isd.line = ts->line;
isd.link_type = link->type;
isd.trx = link->trx;
isd.tei = tei;