Projects
osmocom:nightly
osmo-e1d
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 577
View file
osmo-e1d.spec
Changed
@@ -14,14 +14,14 @@ # published by the Open Source Initiative. Name: osmo-e1d -Requires: osmocom-nightly = 202401182026 -Version: 0.6.0.4.6b0f.202401182026 +Requires: osmocom-nightly = 202401192026 +Version: 0.6.0.12.174a.202401192026 Release: 0 Summary: Osmocom E1 Daemon License: GPL-2.0-or-later Group: Productivity/Telephony/Utilities URL: https://osmocom.org/projects/osmo-e1d/wiki/Wiki -Source: osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz +Source: osmo-e1d_0.6.0.12.174a.202401192026.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2 @@ -46,7 +46,7 @@ timeslots on the top side. %package -n libosmo-e1d1 -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Summary: Osmocom E1 daemon protocol library License: LGPL-3.0-or-later Group: System/Libraries @@ -55,7 +55,7 @@ Osmocom E1 Daemon Protocol Library. %package -n libosmo-octoi2 -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Summary: Library for the Osmocom Community TDMoIP network License: LGPL-3.0-or-later Group: System/Libraries @@ -64,7 +64,7 @@ Library for the Osmocom Community TDMoIP network. %package devel -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Summary: Header files for the Osmocom E1 daemon protocol library License: LGPL-3.0-or-later Group: Development/Libraries/C and C++
View file
osmo-e1d_0.6.0.12.174a.202401192026.dsc
Added
@@ -0,0 +1,23 @@ +Format: 3.0 (native) +Source: osmo-e1d +Binary: osmo-e1d, libosmo-e1d1, libosmo-e1d-dev, libosmo-octoi2, libosmo-octoi-dev +Architecture: any +Version: 0.6.0.12.174a.202401192026 +Maintainer: Osmocom team <openbsc@lists.osmocom.org> +Homepage: https://projects.osmocom.org/projects/osmo-e1d +Standards-Version: 3.9.8 +Vcs-Browser: https://gitea.osmocom.org/retronetworking/osmo-e1d +Vcs-Git: https://gitea.osmocom.org/retronetworking/osmo-e1d +Build-Depends: debhelper (>= 10), dh-autoreconf, autotools-dev, autoconf, automake, libtool, pkg-config, python3-minimal, libosmocore-dev (>= 1.9.0), libusb-1.0-0-dev, osmo-gsm-manuals-dev (>= 1.4.0) +Package-List: + libosmo-e1d-dev deb libdevel extra arch=any + libosmo-e1d1 deb libs extra arch=any + libosmo-octoi-dev deb libdevel extra arch=any + libosmo-octoi2 deb libs extra arch=any + osmo-e1d deb net extra arch=any +Checksums-Sha1: + ec949fb3a568cd0ad099276ff6acee9808633a98 107168 osmo-e1d_0.6.0.12.174a.202401192026.tar.xz +Checksums-Sha256: + 407e3032293641a16efef91fcdb49b6711f67e2ae79021db65f3273c661b473f 107168 osmo-e1d_0.6.0.12.174a.202401192026.tar.xz +Files: + d2ae881971c93088c80e8d94b51d593a 107168 osmo-e1d_0.6.0.12.174a.202401192026.tar.xz
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/.tarball-version -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -0.6.0.4-6b0f.202401182026 +0.6.0.12-174a.202401192026
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/contrib/osmo-e1d.spec.in -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/contrib/osmo-e1d.spec.in
Changed
@@ -14,7 +14,7 @@ # published by the Open Source Initiative. Name: osmo-e1d -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Version: @VERSION@ Release: 0 Summary: Osmocom E1 Daemon @@ -45,7 +45,7 @@ timeslots on the top side. %package -n libosmo-e1d1 -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Summary: Osmocom E1 daemon protocol library License: LGPL-3.0-or-later Group: System/Libraries @@ -54,7 +54,7 @@ Osmocom E1 Daemon Protocol Library. %package -n libosmo-octoi2 -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Summary: Library for the Osmocom Community TDMoIP network License: LGPL-3.0-or-later Group: System/Libraries @@ -63,7 +63,7 @@ Library for the Osmocom Community TDMoIP network. %package devel -Requires: osmocom-nightly = 202401182026 +Requires: osmocom-nightly = 202401192026 Summary: Header files for the Osmocom E1 daemon protocol library License: LGPL-3.0-or-later Group: Development/Libraries/C and C++
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/debian/changelog -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-e1d (0.6.0.4.6b0f.202401182026) unstable; urgency=medium +osmo-e1d (0.6.0.12.174a.202401192026) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Thu, 18 Jan 2024 20:26:32 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Fri, 19 Jan 2024 20:26:40 +0000 osmo-e1d (0.6.0) unstable; urgency=medium
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/debian/control -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/debian/control
Changed
@@ -21,14 +21,14 @@ Package: osmo-e1d Architecture: any Multi-Arch: foreign -Depends: osmocom-nightly (= 202401182026), ${misc:Depends}, ${shlibs:Depends} +Depends: osmocom-nightly (= 202401192026), ${misc:Depends}, ${shlibs:Depends} Description: osmo-e1d: Osmocom's E1 interface daemon Package: libosmo-e1d1 Section: libs Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 202401182026), ${misc:Depends}, ${shlibs:Depends} +Depends: osmocom-nightly (= 202401192026), ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Client library for talking to the Osmocom E1 interface daemon osmo-e1d. @@ -36,7 +36,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 202401182026), ${misc:Depends}, ${shlibs:Depends}, +Depends: osmocom-nightly (= 202401192026), ${misc:Depends}, ${shlibs:Depends}, libosmo-e1d1 (= ${binary:Version}), libosmocore-dev, Description: Development headers for the osmo-e1d library. @@ -45,7 +45,7 @@ Section: libs Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 202401182026), ${misc:Depends}, ${shlibs:Depends} +Depends: osmocom-nightly (= 202401192026), ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Library for the Osmocom Community TDMoIP network. @@ -53,7 +53,7 @@ Section: libdevel Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 202401182026), ${misc:Depends}, ${shlibs:Depends}, +Depends: osmocom-nightly (= 202401192026), ${misc:Depends}, ${shlibs:Depends}, libosmo-octoi2 (= ${binary:Version}), libosmocore-dev, Description: Development headers for the Osmocom Community TDMoIP library.
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/include/osmocom/e1d/proto.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/include/osmocom/e1d/proto.h
Changed
@@ -56,6 +56,38 @@ * + message with the file descriptor */ E1DP_CMD_TS_OPEN = 0x04, + /*! Send Sa bits to line. + * filter: intf (required), line (required), ts n/a; in: uint8_t; */ + E1DP_CMD_SABITS = 0x05, + + /*! Received signal loss from interface. */ + E1DP_EVT_LOS_ON = 0x40, + + /*! Ceased signal loss from interface. */ + E1DP_EVT_LOS_OFF = 0x41, + + /*! Received alarm indication signal from interface. */ + E1DP_EVT_AIS_ON = 0x42, + + /*! Ceased alarm indication signal from interface. */ + E1DP_EVT_AIS_OFF = 0x43, + + /*! Received remote alarm indication from interface. */ + E1DP_EVT_RAI_ON = 0x44, + + /*! Ceased remote alarm indication from interface. */ + E1DP_EVT_RAI_OFF = 0x45, + + /*! Received frame loss from interface. */ + E1DP_EVT_LOF_ON = 0x46, + + /*! Ceased frame loss from interface. */ + E1DP_EVT_LOF_OFF = 0x47, + + /*! Received Sa bits from interface. + * out: uint8_t; */ + E1DP_EVT_SABITS = 0x7f, + /*! Message is an event */ E1DP_EVT_TYPE = 0x40, /*! Message is a response */
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/include/osmocom/e1d/proto_clnt.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/include/osmocom/e1d/proto_clnt.h
Changed
@@ -43,9 +43,12 @@ uint8_t intf, uint8_t line, uint8_t ts); int osmo_e1dp_client_line_config(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, enum osmo_e1dp_line_mode mode); +int osmo_e1dp_client_set_sa_bits(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t sa_bits); int osmo_e1dp_client_ts_open(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t ts, enum osmo_e1dp_ts_mode mode, uint16_t read_bufsize); int osmo_e1dp_client_ts_open_force(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t ts, enum osmo_e1dp_ts_mode mode, uint16_t read_bufsize); +void osmo_e1dp_client_event_register(struct osmo_e1dp_client *clnt, + void (*cb)(enum osmo_e1dp_msg_type event, uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len));
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/include/osmocom/e1d/proto_srv.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/include/osmocom/e1d/proto_srv.h
Changed
@@ -46,3 +46,5 @@ struct osmo_e1dp_server *osmo_e1dp_server_create(void *ctx, const char *path, struct osmo_e1dp_server_handler *handlers, void *handler_data); void osmo_e1dp_server_destroy(struct osmo_e1dp_server *srv); +void osmo_e1dp_server_event(struct osmo_e1dp_server *srv, enum osmo_e1dp_msg_type event, + uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/include/osmocom/octoi/octoi.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/include/osmocom/octoi/octoi.h
Changed
@@ -24,6 +24,7 @@ uint8_t batching_factor; /* E1 frames per UDP packet (Tx) */ bool force_send_all_ts; /* force transmission of all timeslots */ uint32_t prefill_frame_count; /* FIFO prefill/preseed count (Rx) */ + uint8_t buffer_reset_percent; /* When to reset Rx RIFO in percent */ union { struct { char *usb_serial; /* USB serial string (ASCII) of icE1usb */
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/ctl.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/ctl.c
Changed
@@ -430,6 +430,37 @@ return 0; } +static int +_e1d_ctl_sabits(void *data, struct msgb *msgb, struct msgb *rmsgb, int *rfd) +{ + struct e1_daemon *e1d = (struct e1_daemon *)data; + struct osmo_e1dp_msg_hdr *hdr = msgb_l1(msgb); + uint8_t sa_bits = *(uint8_t *)msgb_l2(msgb); + struct e1_intf *intf = NULL; + struct e1_line *line = NULL; + + /* Process query and find timeslot */ + intf = e1d_find_intf(e1d, hdr->intf); + if (!intf) { + LOGP(DE1D, LOGL_NOTICE, "Client request for non-existant Interface %u\n", hdr->intf); + return 0; + } + + line = e1_intf_find_line(intf, hdr->line); + if (!line) { + LOGPIF(intf, DE1D, LOGL_NOTICE, "Client request for non-existant line %u\n", hdr->line); + return 0; + } + + line->ts0.tx_frame = ((sa_bits & 0x80) >> 7) | /* Bit 7 -> Sa8 */ + ((sa_bits & 0x40) >> 5) | /* Bit 6 -> Sa7 */ + ((sa_bits & 0x01) << 2) | /* Bit 0 -> Sa6 */ + ((sa_bits & 0x20) >> 2) | /* Bit 5 -> Sa5 */ + (sa_bits & 0x10); /* Bit 4 -> Sa4 */ + + return 0; +} + struct osmo_e1dp_server_handler e1d_ctl_handlers = { { @@ -462,5 +493,11 @@ .payload_len = sizeof(struct osmo_e1dp_ts_config), .fn = _e1d_ctl_ts_open, }, + { + .type = E1DP_CMD_SABITS, + .flags = E1DP_SF_INTF_REQ | E1DP_SF_LINE_REQ, + .payload_len = sizeof(uint8_t), + .fn = _e1d_ctl_sabits, + }, { /* guard */ }, };
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/e1d.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/e1d.h
Changed
@@ -148,6 +148,10 @@ uint8_t prev_errmask; /*! timer to re-set the rx_crc4_err and rx_alarm above */ struct osmo_timer_list timer; + /*! current transmitting frame with Sa bits */ + uint8_t tx_frame; + /*! last received frame with Sa bits */ + uint8_t rx_frame; } ts0; /* watchdog timer to catch situations where no more USB data is received */ @@ -193,9 +197,12 @@ struct llist_head lines; }; +struct osmo_e1dp_server; + struct e1_daemon { void *ctx; struct llist_head interfaces; + struct osmo_e1dp_server *srv; }; extern const struct octoi_ops e1d_octoi_ops;
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/intf_line.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/intf_line.c
Changed
@@ -239,7 +239,7 @@ } line->ts0.prev_errmask = line->ts0.cur_errmask; - line->ts0.cur_errmask = 0; + line->ts0.cur_errmask &= ~E1L_TS0_RX_CRC4_ERR; osmo_timer_schedule(&line->ts0.timer, 1, 0); } @@ -272,6 +272,8 @@ line->intf = intf; line->drv_data = drv_data; line->mode = E1_LINE_MODE_CHANNELIZED; + line->ts0.tx_frame = 0xff; + line->ts0.rx_frame = 0xff; for (int i = 0; i < 32; i++) _ts_init(&line->tsi, line, i);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/mux_demux.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/mux_demux.c
Changed
@@ -36,6 +36,7 @@ #include <osmocom/core/stats.h> #include <osmocom/core/rate_ctr.h> #include <osmocom/e1d/proto.h> +#include <osmocom/e1d/proto_srv.h> #include "e1d.h" #include "log.h" @@ -148,11 +149,18 @@ static void _e1_line_mux_out_channelized(struct e1_line *line, uint8_t *buf, int fts) { + struct e1_ts *ts; + OSMO_ASSERT(line->mode == E1_LINE_MODE_CHANNELIZED); - /* Scan timeslots */ + /* Fill timeslot 0 */ + ts = &line->ts0; + for (int i = 0; i < fts; i++) + buf(i*32) = line->ts0.tx_frame; + + /* Scan timeslots 1..31 */ for (int tsn = 1; tsn < 32; tsn++) { - struct e1_ts *ts = &line->tstsn; + ts = &line->tstsn; uint8_t buf_tsfts; int l; @@ -377,11 +385,32 @@ const uint8_t *frame = buf + i*32; uint8_t frame_nr = (frame_base + i) & 0xf; - /* A bit is present in each odd frame */ if (frame_nr % 2) { + /* A bit is present in each odd frame */ if (frame0 & 0x20) { - line->ts0.cur_errmask |= E1L_TS0_RX_ALARM; - line_ctr_add(line, LINE_CTR_RX_REMOTE_A, 1); + if (!(line->ts0.cur_errmask & E1L_TS0_RX_ALARM)) { + line->ts0.cur_errmask |= E1L_TS0_RX_ALARM; + line_ctr_add(line, LINE_CTR_RX_REMOTE_A, 1); + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_RAI_ON, + line->intf->id, line->id, 0, NULL, 0); + } + } else { + if ((line->ts0.cur_errmask & E1L_TS0_RX_ALARM)) { + line->ts0.cur_errmask &= ~E1L_TS0_RX_ALARM; + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_RAI_OFF, + line->intf->id, line->id, 0, NULL, 0); + } + } + /* SA bits changed */ + if (line->ts0.rx_frame != (frame0 | 0xe0)) { + uint8_t sa_bits = ((frame0 & 0x01) << 7) | /* Sa8 -> Bit 7 */ + ((frame0 & 0x02) << 5) | /* Sa7 -> Bit 6 */ + ((frame0 & 0x04) >> 2) | /* Sa6 -> Bit 0 */ + ((frame0 & 0x08) << 2) | /* Sa5 -> Bit 5 */ + (frame0 & 0x10); /* Sa4 -> Bit 4 */ + line->ts0.rx_frame = frame0 | 0xe0; + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_SABITS, + line->intf->id, line->id, 0, &sa_bits, 1); } } @@ -395,7 +424,7 @@ line_ctr_add(line, LINE_CTR_RX_REMOTE_E, 1); } } - /* cur_errmask is being cleared once per second via line->ts0.timer */ + /* CRC error in cur_errmask is being cleared once per second via line->ts0.timer */ } }
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/e1oip.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/e1oip.c
Changed
@@ -250,7 +250,7 @@ "RxIP: %u extraneous bytes (len=%u, num_ts=%u, n_frames=%u)\n", msgb_length(msg) % num_ts, msgb_length(msg), num_ts, n_frames); } - LOGPEER(peer, LOGL_INFO, "RxIP: frame=%05u ts_mask=0x%08x num_ts=%02u, n_frames=%u\n", + LOGPEER(peer, LOGL_DEBUG, "RxIP: frame=%05u ts_mask=0x%08x num_ts=%02u, n_frames=%u\n", frame_nr, ts_mask, num_ts, n_frames); } else { if (msgb_l3len(msg) < 1) { @@ -271,7 +271,26 @@ rc = frame_rifo_in(&iline->e1t.rifo, frame_buf, fn32+i); if (rc < 0) iline_ctr_add(iline, LINE_CTR_E1oIP_E1T_OVERFLOW, 1); + /* Continue the for loop, if buffer reset is not configured. */ + if (!iline->cfg.buffer_reset_percent) + continue; + /* Calculate average RIFO delay. */ + int32_t d = fn32 + i - iline->e1t.rifo.next_out_fn; + iline->e1t.delay += d; + if (++iline->e1t.delay_cnt == FRAMES_BUFFER_RESET_AVG) { + int offset; + d = iline->e1t.delay / iline->e1t.delay_cnt; + iline->e1t.delay = iline->e1t.delay_cnt = 0; + offset = abs((int32_t)iline->cfg.prefill_frame_count - d) * 100 / iline->cfg.prefill_frame_count; + LOGPEER(peer, LOGL_INFO, "RxIP: Buffer fill %u frames, %u%% off target.\n", d, offset); + if (offset > iline->cfg.buffer_reset_percent) { + LOGPEER(peer, LOGL_ERROR, "RxIP: frame number out of range. Reset buffer.\n"); + frame_rifo_init(&iline->e1t.rifo, fn32 + i); + iline->e1t.primed_rx_tdm = false; + } + } } + /* update local state */ memcpy(iline->e1t.last_frame, frame_buf, BYTES_PER_FRAME); if (update_next) @@ -318,10 +337,11 @@ } void e1oip_line_configure(struct e1oip_line *iline, uint8_t batching_factor, - uint32_t prefill_frame_count, bool force_send_all_ts) + uint32_t prefill_frame_count, uint8_t buffer_reset_percent, bool force_send_all_ts) { iline->cfg.batching_factor = batching_factor; iline->cfg.prefill_frame_count = prefill_frame_count; + iline->cfg.buffer_reset_percent = buffer_reset_percent; iline->cfg.force_send_all_ts = force_send_all_ts; } @@ -331,10 +351,12 @@ memset(&iline->e1o.last_frame, 0xff, sizeof(iline->e1o.last_frame)); iline->e1o.next_seq = 0; - frame_rifo_init(&iline->e1t.rifo); + frame_rifo_init(&iline->e1t.rifo, 0); memset(&iline->e1t.last_frame, 0xff, sizeof(iline->e1t.last_frame)); iline->e1t.next_fn32 = 0; iline->e1t.primed_rx_tdm = false; + iline->e1t.delay = 0; + iline->e1t.delay_cnt = 0; } void e1oip_line_destroy(struct e1oip_line *iline)
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/e1oip.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/e1oip.h
Changed
@@ -15,6 +15,8 @@ #define FRAMES_PER_SEC_THRESHOLD 7500 +#define FRAMES_BUFFER_RESET_AVG 40000 + #define DEFAULT_BATCHING_FACTOR 32 #define DEFAULT_PREFILL_FRAME_COUNT 200 /* 25ms */ @@ -54,6 +56,7 @@ struct { uint8_t batching_factor; uint32_t prefill_frame_count; + uint8_t buffer_reset_percent; bool force_send_all_ts; } cfg; @@ -70,6 +73,7 @@ uint8_t last_frameBYTES_PER_FRAME; /* last frame on the E1 side */ uint32_t next_fn32; /* next expected frame number */ bool primed_rx_tdm; /* Was RX RIFO primed */ + int32_t delay, delay_cnt; /* Delay counter to calculate average delay */ } e1t; }; @@ -84,7 +88,7 @@ void e1oip_line_set_name(struct e1oip_line *line, const char *name); void e1oip_line_reset(struct e1oip_line *iline); void e1oip_line_configure(struct e1oip_line *iline, uint8_t batching_factor, - uint32_t prefill_frame_count, bool force_send_all_ts); + uint32_t prefill_frame_count, uint8_t buffer_reset_percent, bool force_send_all_ts); void e1oip_line_destroy(struct e1oip_line *iline); int e1oip_rcvmsg_tdm_data(struct e1oip_line *iline, struct msgb *msg);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/frame_rifo.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/frame_rifo.c
Changed
@@ -86,12 +86,12 @@ /*! Initialize a frame RIFO. * \param rifo Caller-allocated memory for RIFO data structure */ -void frame_rifo_init(struct frame_rifo *rifo) +void frame_rifo_init(struct frame_rifo *rifo, uint32_t fn) { memset(rifo->buf, 0xff, sizeof(rifo->buf)); rifo->next_out = rifo->buf; - rifo->next_out_fn = 0; - rifo->last_in_fn = -1; + rifo->next_out_fn = fn; + rifo->last_in_fn = fn - 1; memset(rifo->bitvec, 0, sizeof(rifo->bitvec)); }
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/frame_rifo.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/frame_rifo.h
Changed
@@ -27,7 +27,7 @@ return rifo->last_in_fn - rifo->next_out_fn + 1; } -void frame_rifo_init(struct frame_rifo *rifo); +void frame_rifo_init(struct frame_rifo *rifo, uint32_t fn); /* number of frames currently available in FIFO */ static inline unsigned int frame_rifo_frames(struct frame_rifo *rifo)
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/octoi_clnt_fsm.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/octoi_clnt_fsm.c
Changed
@@ -123,7 +123,7 @@ struct clnt_state *st = fi->priv; e1oip_line_configure(st->peer->iline, st->acc->batching_factor, - st->acc->prefill_frame_count, st->acc->force_send_all_ts); + st->acc->prefill_frame_count, st->acc->buffer_reset_percent, st->acc->force_send_all_ts); /* reset RIFO/FIFO etc. */ e1oip_line_reset(st->peer->iline); iline_ctr_add(st->peer->iline, LINE_CTR_E1oIP_CONNECT_ACCEPT, 1);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/octoi_clnt_vty.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/octoi_clnt_vty.c
Changed
@@ -283,6 +283,7 @@ install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_force_all_ts_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_no_force_all_ts_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_prefill_frame_count_cmd); + install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_buffer_reset_cmd); #ifdef HAVE_DAHDI_TRUNKDEV install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_trunkdev_name_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_trunkdev_line_cmd);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/octoi_srv_fsm.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/octoi_srv_fsm.c
Changed
@@ -176,7 +176,7 @@ struct srv_state *st = fi->priv; e1oip_line_configure(st->peer->iline, st->acc->batching_factor, - st->acc->prefill_frame_count, st->acc->force_send_all_ts); + st->acc->prefill_frame_count, st->acc->buffer_reset_percent, st->acc->force_send_all_ts); /* reset RIFO/FIFO etc. */ e1oip_line_reset(st->peer->iline); iline_ctr_add(st->peer->iline, LINE_CTR_E1oIP_CONNECT_ACCEPT, 1);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/octoi_srv_vty.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/octoi_srv_vty.c
Changed
@@ -412,7 +412,7 @@ } gDEFUN(cfg_account_prefill_frame_count, cfg_account_prefill_frame_count_cmd, - "prefill-frame-count <0-8000>", + "prefill-frame-count <0-900>", "Number of E1 frames to pre-fill/pre-seed in Rx RIFO\n" "Number of E1 frames to pre-fill/pre-seed in Rx RIFO\n") { @@ -422,6 +422,17 @@ return CMD_SUCCESS; } +gDEFUN(cfg_account_buffer_reset, cfg_account_buffer_reset_cmd, + "buffer-reset <0-100>", + "Reset Rx RIFO when fill in Rx RIFO drifts too much off normal\n" + "Give fill in percentage, use 0 to disable this feature\n") +{ + struct octoi_account *acc = vty->index; + + acc->buffer_reset_percent = atoi(argv0); + return CMD_SUCCESS; +} + void octoi_vty_show_one_account(struct vty *vty, const char *pfx, struct octoi_account *acc) { vty_out(vty, "%sAccount '%s': Mode=%s, Batching=%u, Prefill=%u%s", pfx, @@ -563,6 +574,7 @@ install_element(OCTOI_ACCOUNT_NODE, &cfg_account_force_all_ts_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_no_force_all_ts_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_prefill_frame_count_cmd); + install_element(OCTOI_ACCOUNT_NODE, &cfg_account_buffer_reset_cmd); #ifdef HAVE_DAHDI_TRUNKDEV install_element(OCTOI_ACCOUNT_NODE, &cfg_account_trunkdev_name_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_trunkdev_line_cmd);
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/octoi/octoi_vty.h -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/octoi/octoi_vty.h
Changed
@@ -11,6 +11,7 @@ extern struct cmd_element cfg_account_force_all_ts_cmd; extern struct cmd_element cfg_account_no_force_all_ts_cmd; extern struct cmd_element cfg_account_prefill_frame_count_cmd; +extern struct cmd_element cfg_account_buffer_reset_cmd; extern struct cmd_element cfg_account_trunkdev_name_cmd; extern struct cmd_element cfg_account_trunkdev_line_cmd;
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/osmo-e1d.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/osmo-e1d.c
Changed
@@ -44,8 +44,8 @@ #include <osmocom/vty/misc.h> #include <osmocom/vty/cpu_sched_vty.h> -#include <osmocom/e1d/proto_srv.h> #include <osmocom/e1d/proto.h> +#include <osmocom/e1d/proto_srv.h> #include "e1d.h" #include <osmocom/octoi/octoi.h> @@ -221,6 +221,7 @@ /* server init */ srv = osmo_e1dp_server_create(g_e1d_ctx, E1DP_DEFAULT_SOCKET, e1d_ctl_handlers, e1d); OSMO_ASSERT(srv); + e1d->srv = srv; /* main loop */ while (!g_shutdown) {
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/osmo-e1gen.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/osmo-e1gen.c
Changed
@@ -436,3 +436,5 @@ return 0; } + +void osmo_e1dp_server_event(void) {}
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/proto.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/proto.c
Changed
@@ -41,7 +41,16 @@ { E1DP_CMD_LINE_QUERY, "CMD_LINE_QUERY" }, { E1DP_CMD_TS_QUERY, "CMD_TS_QUERY" }, { E1DP_CMD_TS_OPEN, "CMD_TS_OPEN" }, - { E1DP_EVT_TYPE, "EVT_TYPE" }, + { E1DP_CMD_SABITS, "CMD_SABITS" }, + { E1DP_EVT_LOS_ON, "EVT_LOS_ON" }, + { E1DP_EVT_LOS_OFF, "EVT_LOS_OFF" }, + { E1DP_EVT_AIS_ON, "EVT_AIS_ON" }, + { E1DP_EVT_AIS_OFF, "EVT_AIS_OFF" }, + { E1DP_EVT_RAI_ON, "EVT_RAI_ON" }, + { E1DP_EVT_RAI_OFF, "EVT_RAI_OFF" }, + { E1DP_EVT_LOF_ON, "EVT_LOF_ON" }, + { E1DP_EVT_LOF_OFF, "EVT_LOF_OFF" }, + { E1DP_EVT_SABITS, "EVT_SABITS" }, { E1DP_RESP_TYPE, "RESP_TYPE" }, { E1DP_ERR_TYPE, "ERR_TYPE" }, { 0, NULL }
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/proto_clnt.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/proto_clnt.c
Changed
@@ -64,18 +64,26 @@ #include "log.h" +typedef void (*osmo_e1dp_event_cb_t)(enum osmo_e1dp_msg_type, uint8_t, uint8_t, uint8_t, uint8_t *, int); /*! Internal representation of client program connected to the CTL socket */ struct osmo_e1dp_client { void *ctx; /*!< talloc context */ struct osmo_fd ctl_fd; /*!< osmo-fd wrapped unix domain (CTL) socket to @osmo-e1d@ */ + osmo_e1dp_event_cb_t event_cb; + /*!< callback function for incoming events */ }; static int _e1dp_client_event(struct osmo_e1dp_client *clnt, struct msgb *msgb) { - /* FIXME */ + struct osmo_e1dp_msg_hdr *hdr = msgb_l1(msgb); + + if (!clnt->event_cb) + return -EINVAL; + + clnt->event_cb(hdr->type, hdr->intf, hdr->line, hdr->ts, msgb_l2(msgb), msgb_l2len(msgb)); return 0; } @@ -182,10 +190,13 @@ } rc = osmo_e1dp_send(&clnt->ctl_fd, msgb, -1); - if (rc < 0) + if (rc < 0) { + msgb_free(msgb); return rc; + } msgb_free(msgb); + msgb = NULL; /* Response */ int flags = fcntl(clnt->ctl_fd.fd, F_GETFL, 0); @@ -378,8 +389,43 @@ if (rc) return rc; - if (msgb_l2len(msgb) != sizeof(struct osmo_e1dp_line_info)) + if (msgb_l2len(msgb) != sizeof(struct osmo_e1dp_line_info)) { + msgb_free(msgb); return -EPIPE; + } + + msgb_free(msgb); + + return 0; +} + +/*! Set Sa-bits of a specific E1 line in osmo-e1d. + * \paramin clnt Client previously returned from osmo_e1dp_client_create(). + * \paramin intf E1 interface number to configure. + * \paramin line E1 line number (within interface) to configure. + * \paramin sa_bits Sa bits to set on line. + * \returns zero in case of success; negative in case of error. */ +int +osmo_e1dp_client_set_sa_bits(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t sa_bits) +{ + struct msgb *msgb; + struct osmo_e1dp_msg_hdr hdr; + int rc; + + memset(&hdr, 0x00, sizeof(struct osmo_e1dp_msg_hdr)); + hdr.type = E1DP_CMD_SABITS; + hdr.intf = intf; + hdr.line = line; + hdr.ts = E1DP_INVALID; + + rc = _e1dp_client_query_base(clnt, &hdr, &sa_bits, 1, &msgb, NULL); + if (rc) + return rc; + + if (msgb_l2len(msgb) != 0) { + msgb_free(msgb); + return -EPIPE; + } msgb_free(msgb); @@ -413,8 +459,10 @@ if (rc) return rc; - if ((tsfd < 0) || (msgb_l2len(msgb) != sizeof(struct osmo_e1dp_ts_info))) + if ((tsfd < 0) || (msgb_l2len(msgb) != sizeof(struct osmo_e1dp_ts_info))) { + msgb_free(msgb); return -EPIPE; + } msgb_free(msgb); @@ -455,3 +503,12 @@ { return _client_ts_open(clnt, intf, line, ts, mode, read_bufsize, E1DP_TS_OPEN_F_FORCE); } + +/*! Register event handler for incoming event messages. + * \paramin clnt Client previously returned from osmo_e1dp_client_create(). */ +void +osmo_e1dp_client_event_register(struct osmo_e1dp_client *clnt, + void (*cb)(enum osmo_e1dp_msg_type event, uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len)) +{ + clnt->event_cb = cb; +}
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/proto_srv.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/proto_srv.c
Changed
@@ -260,3 +260,35 @@ osmo_fd_close(&srv->ctl_fd); talloc_free(srv); } + +void +osmo_e1dp_server_event(struct osmo_e1dp_server *srv, enum osmo_e1dp_msg_type event, + uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len) +{ + struct osmo_e1dp_msg_hdr *hdr; + struct msgb *msgb; + struct osmo_e1dp_server_conn *conn; + + /* Call handler */ + msgb = msgb_alloc(E1DP_MAX_LEN, "e1d proto tx (event) message"); + + msgb->l1h = msgb_put(msgb, sizeof(struct osmo_e1dp_msg_hdr)); + hdr = msgb_l1(msgb); + if (data && len) { + msgb->l2h = msgb_put(msgb, len); + memcpy(msgb->l2h, data, len); + } + hdr->magic = E1DP_MAGIC; + hdr->type = event; + hdr->len = msgb_length(msgb); + hdr->intf = intf; + hdr->line = line; + hdr->ts = ts; + + /* Send event */ + llist_for_each_entry(conn, &srv->conns, list) + osmo_e1dp_send(&conn->fd, msgb, -1); + + /* Done */ + msgb_free(msgb); +}
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/src/usb.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/src/usb.c
Changed
@@ -33,6 +33,8 @@ #include <osmocom/core/utils.h> #include <osmocom/core/bit32gen.h> #include <osmocom/usb/libusb.h> +#include <osmocom/e1d/proto.h> +#include <osmocom/e1d/proto_srv.h> #include <libusb.h> @@ -396,6 +398,13 @@ if ((errcnt->flags & ICE1USB_ERR_F_ALIGN_ERR) != (last->flags & ICE1USB_ERR_F_ALIGN_ERR)) { LOGPLI(line, DE1D, LOGL_ERROR, "ALIGNMENT %s\n", errcnt->flags & ICE1USB_ERR_F_ALIGN_ERR ? "LOST" : "REGAINED"); + if ((errcnt->flags & ICE1USB_ERR_F_ALIGN_ERR)) { + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_LOF_ON, + line->intf->id, line->id, 0, NULL, 0); + } else { + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_LOF_OFF, + line->intf->id, line->id, 0, NULL, 0); + } } if ((errcnt->flags & ICE1USB_ERR_F_LOS) != (last->flags & ICE1USB_ERR_F_LOS)) {
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz/tests/rifo/rifo_test.c -> osmo-e1d_0.6.0.12.174a.202401192026.tar.xz/tests/rifo/rifo_test.c
Changed
@@ -23,7 +23,7 @@ static void rifo_init(struct frame_rifo *rifo) { - frame_rifo_init(rifo); + frame_rifo_init(rifo, 0); rifo->next_out_fn = init_next_out_fn; rifo->last_in_fn = init_next_out_fn - 1; } @@ -48,7 +48,7 @@ static void missing_frames(uint8_t modulo) { struct frame_rifo rifo; - frame_rifo_init(&rifo); + frame_rifo_init(&rifo, 0); rifo.next_out_fn = init_next_out_fn; rifo.last_in_fn = init_next_out_fn - 1;
View file
osmo-e1d_0.6.0.4.6b0f.202401182026.dsc
Deleted
@@ -1,23 +0,0 @@ -Format: 3.0 (native) -Source: osmo-e1d -Binary: osmo-e1d, libosmo-e1d1, libosmo-e1d-dev, libosmo-octoi2, libosmo-octoi-dev -Architecture: any -Version: 0.6.0.4.6b0f.202401182026 -Maintainer: Osmocom team <openbsc@lists.osmocom.org> -Homepage: https://projects.osmocom.org/projects/osmo-e1d -Standards-Version: 3.9.8 -Vcs-Browser: https://gitea.osmocom.org/retronetworking/osmo-e1d -Vcs-Git: https://gitea.osmocom.org/retronetworking/osmo-e1d -Build-Depends: debhelper (>= 10), dh-autoreconf, autotools-dev, autoconf, automake, libtool, pkg-config, python3-minimal, libosmocore-dev (>= 1.9.0), libusb-1.0-0-dev, osmo-gsm-manuals-dev (>= 1.4.0) -Package-List: - libosmo-e1d-dev deb libdevel extra arch=any - libosmo-e1d1 deb libs extra arch=any - libosmo-octoi-dev deb libdevel extra arch=any - libosmo-octoi2 deb libs extra arch=any - osmo-e1d deb net extra arch=any -Checksums-Sha1: - 1c34f14333e99fd8f00177fe06d17d2000c61cdb 105808 osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz -Checksums-Sha256: - 21000b28fb06809610c7d9684bc76ecf9405f1a4f5fa309a85cf8318d543df31 105808 osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz -Files: - 71eedeb984dbf2bb9c9593d040e78f81 105808 osmo-e1d_0.6.0.4.6b0f.202401182026.tar.xz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.