lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2024

  • 1 participants
  • 1559 discussions
[M] Change in osmo-e1d[master]: Add option to automatically reset RIFO on underrun/overflow
by jolly 14 Jan '24

14 Jan '24
Attention is currently required from: laforge, manawyrm, pespin, tnt. jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email ) Change subject: Add option to automatically reset RIFO on underrun/overflow ...................................................................... Patch Set 4: (4 comments) Commit Message: https://gerrit.osmocom.org/c/osmo-e1d/+/34554/comment/f7be57bf_25d48c4e PS1, Line 7: Automatically reset RIFO on underrun/overflow > Maybe I need to split this commit. It is the work I have done. Check it out and do some comments. Due to rework, not required anymore. Patchset: PS3: > RX Buffer fill: 0-----50%D-----D-----150%D […] The process is reworked. File src/octoi/e1oip.c: https://gerrit.osmocom.org/c/osmo-e1d/+/34554/comment/605e2b5d_951a5069 PS3, Line 274: iline_ctr_add(iline, LINE_CTR_E1oIP_E1T_OVERFLOW, 1); > I'm a bit worried that we do this after the first packet with out of range frame nr. […] Done File src/octoi/octoi_srv_vty.c: https://gerrit.osmocom.org/c/osmo-e1d/+/34554/comment/3209f46c_97439da3 PS3, Line 419: void set_frames_per_fifo_str(void) > why do we have those runtime generated strings? can't we generate them at compile time? We're passin […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748 Gerrit-Change-Number: 34554 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Attention: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: tnt <tnt(a)246tNt.com> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Sun, 14 Jan 2024 15:19:41 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmo-abis[master]: Add support for sending and receiving Sa bits, as well as some line s...
by Jenkins Builder 14 Jan '24

14 Jan '24
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/35563?usp=email ) Change subject: Add support for sending and receiving Sa bits, as well as some line signals ...................................................................... Patch Set 1: (16 comments) File src/input/e1d.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/7b982e26_e313cb4a PS1, Line 81: struct e1inp_line *e1i_line; code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/e28bf67a_4d3119ee PS1, Line 81: struct e1inp_line *e1i_line; please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/1ac5acb5_44812c23 PS1, Line 83: /* iterate over global list of e1 lines */ code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/f862f0ce_22934153 PS1, Line 84: llist_for_each_entry(e1i_line, &e1inp_line_list, list) { code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/1b88b87b_ca1b8a42 PS1, Line 84: llist_for_each_entry(e1i_line, &e1inp_line_list, list) { please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/a78ab10b_a566a23e PS1, Line 85: if (e1i_line->port_nr == port_nr) code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/3b721756_ef6c9939 PS1, Line 85: if (e1i_line->port_nr == port_nr) please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/0ec7ecb0_2feb1a06 PS1, Line 86: return e1i_line; code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/4710df86_4e0b3bae PS1, Line 86: return e1i_line; please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/77be6ac8_cbb9ec1f PS1, Line 87: } code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/b25f9f9f_9e3abb27 PS1, Line 87: } please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/f3d77ce6_8e329110 PS1, Line 88: return NULL; code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/38a4cfa3_21f021c3 PS1, Line 88: return NULL; please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/b132a521_bb3d0d2f PS1, Line 97: memset(&isd, 0, sizeof(isd)); code indent should use tabs where possible Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/47b5f222_598163f5 PS1, Line 97: memset(&isd, 0, sizeof(isd)); please, no spaces at the start of a line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13558): https://gerrit.osmocom.org/c/libosmo-abis/+/35563/comment/a54b8dc4_89ae6d0e PS1, Line 106: switch (event) { switch and case should be at the same indent -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/35563?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ie7643693c2daac99f5747591decd60e982b8052a Gerrit-Change-Number: 35563 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sun, 14 Jan 2024 15:17:33 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmo-abis[master]: Add support for sending and receiving Sa bits, as well as some line s...
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/35563?usp=email ) Change subject: Add support for sending and receiving Sa bits, as well as some line signals ...................................................................... Add support for sending and receiving Sa bits, as well as some line signals The Sa bits are required for osmo-v5. V5.2 interface must alter and detect Sa7 bit on time slot 0. 'Fastlink' multiplexers do not allow to disable link check with Sa7, so that it must be supported by osmo-v5. Requires: osmo-e1d Change-Id I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f Change-Id: Ie7643693c2daac99f5747591decd60e982b8052a --- M src/input/e1d.c 1 file changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/63/35563/1 diff --git a/src/input/e1d.c b/src/input/e1d.c index d55c395..9389ee9 100644 --- a/src/input/e1d.c +++ b/src/input/e1d.c @@ -30,6 +30,7 @@ #include <osmocom/core/bits.h> #include <osmocom/core/logging.h> #include <osmocom/core/fsm.h> +#include <osmocom/core/signal.h> #include <osmocom/vty/vty.h> @@ -75,6 +76,66 @@ { 0, NULL } }; +struct e1inp_line *e1inp_port_find(uint8_t port_nr) +{ + struct e1inp_line *e1i_line; + + /* iterate over global list of e1 lines */ + llist_for_each_entry(e1i_line, &e1inp_line_list, list) { + if (e1i_line->port_nr == port_nr) + return e1i_line; + } + return NULL; +} + +static void e1d_client_event_cb(enum osmo_e1dp_msg_type event, uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len) +{ + struct e1inp_line *e1_line; + struct input_signal_data isd; + int signal; + + memset(&isd, 0, sizeof(isd)); + + /* we use higher 4 bits for interface, lower 4 bits for line, + * resulting in max. 16 interfaces with 16 lines each */ + e1_line = e1inp_port_find((intf << 4) | line); + if (!e1_line) + return; + isd.line = e1_line; + + switch (event) { + case E1DP_EVT_LOS_ON: + signal = S_L_INP_LINE_LOS; + break; + case E1DP_EVT_LOS_OFF: + signal = S_L_INP_LINE_NOLOS; + break; + case E1DP_EVT_AIS_ON: + signal = S_L_INP_LINE_AIS; + break; + case E1DP_EVT_AIS_OFF: + signal = S_L_INP_LINE_NOAIS; + break; + case E1DP_EVT_RAI_ON: + signal = S_L_INP_LINE_RAI; + break; + case E1DP_EVT_RAI_OFF: + signal = S_L_INP_LINE_NORAI; + break; + case E1DP_EVT_SABITS: + signal = S_L_INP_LINE_SA_BITS; + if (len < 1) + return; + isd.sa_bits = *data; + break; + default: + /* Ignore all other events. */ + return; + } + + osmo_signal_dispatch(SS_L_INPUT, signal, &isd); +} + static int fsm_e1_client_timer_cb(struct osmo_fsm_inst *fi) { osmo_fsm_inst_dispatch(g_e1d_fsm_inst, EV_CONNECT, NULL); @@ -92,6 +153,7 @@ osmo_fsm_inst_state_chg(g_e1d_fsm_inst, ST_DISCONNECTED, 1, 0); return; } + osmo_e1dp_client_event_register(g_e1d, e1d_client_event_cb); } LOGPFSML(fi, LOGL_NOTICE, "Successfully (re)connected to osmo-e1d daemon!\n"); @@ -766,9 +828,20 @@ return 0; } +static int set_sa_bits(struct e1inp_line *line, uint8_t sa_bits) +{ + /* we use higher 4 bits for interface, lower 4 bits for line, + * resulting in max. 16 interfaces with 16 lines each */ + uint8_t e1d_intf = (line->port_nr >> 4) & 0xF; + uint8_t e1d_line = line->port_nr & 0xF; + + return osmo_e1dp_client_set_sa_bits(g_e1d, e1d_intf, e1d_line, sa_bits); +} + struct e1inp_driver e1d_driver = { .name = "e1d", .want_write = e1d_want_write, + .set_sa_bits = set_sa_bits, .line_update = e1d_line_update, .line_create = e1d_line_create, }; -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/35563?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ie7643693c2daac99f5747591decd60e982b8052a Gerrit-Change-Number: 35563 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-e1d[master]: Indicate change in received Sa bits
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email ) Change subject: Indicate change in received Sa bits ...................................................................... Indicate change in received Sa bits Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b --- M src/e1d.h M src/intf_line.c M src/mux_demux.c 3 files changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/61/35561/1 diff --git a/src/e1d.h b/src/e1d.h index ec264c7..74010ba 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -148,6 +148,8 @@ uint8_t prev_errmask; /*! timer to re-set the rx_crc4_err and rx_alarm above */ struct osmo_timer_list timer; + /*! last received frame with Sa bits */ + uint8_t rx_frame; } ts0; /* watchdog timer to catch situations where no more USB data is received */ diff --git a/src/intf_line.c b/src/intf_line.c index 4433e96..b3dafff 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -272,6 +272,7 @@ line->intf = intf; line->drv_data = drv_data; line->mode = E1_LINE_MODE_CHANNELIZED; + line->ts0.rx_frame = 0xff; for (int i = 0; i < 32; i++) _ts_init(&line->ts[i], line, i); diff --git a/src/mux_demux.c b/src/mux_demux.c index abe01a3..71374ef 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -378,8 +378,8 @@ 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 (frame[0] & 0x20) { if (!(line->ts0.cur_errmask & E1L_TS0_RX_ALARM)) { line->ts0.cur_errmask |= E1L_TS0_RX_ALARM; @@ -394,6 +394,17 @@ line->intf->id, line->id, 0, NULL, 0); } } + /* SA bits changed */ + if (line->ts0.rx_frame != (frame[0] | 0xe0)) { + uint8_t sa_bits = ((frame[0] & 0x01) << 7) | /* Sa8 -> Bit 7 */ + ((frame[0] & 0x02) << 5) | /* Sa7 -> Bit 6 */ + ((frame[0] & 0x04) >> 2) | /* Sa6 -> Bit 0 */ + ((frame[0] & 0x08) << 2) | /* Sa5 -> Bit 5 */ + (frame[0] & 0x10); /* Sa4 -> Bit 4 */ + line->ts0.rx_frame = frame[0] | 0xe0; + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_SABITS, + line->intf->id, line->id, 0, &sa_bits, 1); + } } /* E bits are present in frame 13 + 15 */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35561?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b Gerrit-Change-Number: 35561 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-e1d[master]: Add command and client function to change transmitted Sa bits
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35562?usp=email ) Change subject: Add command and client function to change transmitted Sa bits ...................................................................... Add command and client function to change transmitted Sa bits Change-Id: I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f --- M include/osmocom/e1d/proto_clnt.h M src/ctl.c M src/e1d.h M src/intf_line.c M src/mux_demux.c M src/proto_clnt.c 6 files changed, 90 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/62/35562/1 diff --git a/include/osmocom/e1d/proto_clnt.h b/include/osmocom/e1d/proto_clnt.h index 26bd44e..b5be2ce 100644 --- a/include/osmocom/e1d/proto_clnt.h +++ b/include/osmocom/e1d/proto_clnt.h @@ -43,6 +43,7 @@ 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); diff --git a/src/ctl.c b/src/ctl.c index 8ed4a69..331f2ad 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -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 */ }, }; diff --git a/src/e1d.h b/src/e1d.h index 74010ba..4da463b 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -148,6 +148,8 @@ 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; diff --git a/src/intf_line.c b/src/intf_line.c index b3dafff..8eac84d 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -272,6 +272,7 @@ 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++) diff --git a/src/mux_demux.c b/src/mux_demux.c index 71374ef..dd8ca45 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -149,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->ts[0]; + 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->ts[tsn]; + ts = &line->ts[tsn]; uint8_t buf_ts[fts]; int l; diff --git a/src/proto_clnt.c b/src/proto_clnt.c index d922e4a..aba6ae3 100644 --- a/src/proto_clnt.c +++ b/src/proto_clnt.c @@ -393,6 +393,37 @@ return 0; } +/*! Set Sa-bits of a specific E1 line in osmo-e1d. + * \param[in] clnt Client previously returned from osmo_e1dp_client_create(). + * \param[in] intf E1 interface number to configure. + * \param[in] line E1 line number (within interface) to configure. + * \param[in] 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) != sizeof(struct osmo_e1dp_line_info)) + return -EPIPE; + + msgb_free(msgb); + + return 0; +} + static int _client_ts_open(struct osmo_e1dp_client *clnt, uint8_t intf, uint8_t line, uint8_t ts, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35562?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f Gerrit-Change-Number: 35562 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-e1d[master]: Add new protocol command and events for Sa bits and line states
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35557?usp=email ) Change subject: Add new protocol command and events for Sa bits and line states ...................................................................... Add new protocol command and events for Sa bits and line states Change-Id: I4c20ec19fa3d9cce82c8199b38d173aa272fb07d --- M include/osmocom/e1d/proto.h M src/proto.c 2 files changed, 43 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/57/35557/1 diff --git a/include/osmocom/e1d/proto.h b/include/osmocom/e1d/proto.h index 005da61..46e655f 100644 --- a/include/osmocom/e1d/proto.h +++ b/include/osmocom/e1d/proto.h @@ -56,6 +56,32 @@ * + 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 Sa bits from interface. + * out: uint8_t; */ + E1DP_EVT_SABITS = 0x7f, + /*! Message is an event */ E1DP_EVT_TYPE = 0x40, /*! Message is a response */ diff --git a/src/proto.c b/src/proto.c index 479175a..f178493 100644 --- a/src/proto.c +++ b/src/proto.c @@ -41,6 +41,14 @@ { E1DP_CMD_LINE_QUERY, "CMD_LINE_QUERY" }, { E1DP_CMD_TS_QUERY, "CMD_TS_QUERY" }, { E1DP_CMD_TS_OPEN, "CMD_TS_OPEN" }, + { E1DP_CMD_SABITS, "E1DP_CMD_SABITS" }, + { E1DP_EVT_LOS_ON, "E1DP_EVT_LOS_ON" }, + { E1DP_EVT_LOS_OFF, "E1DP_EVT_LOS_OFF" }, + { E1DP_EVT_AIS_ON, "E1DP_EVT_AIS_ON" }, + { E1DP_EVT_AIS_OFF, "E1DP_EVT_AIS_OFF" }, + { E1DP_EVT_RAI_ON, "E1DP_EVT_RAI_ON" }, + { E1DP_EVT_RAI_OFF, "E1DP_EVT_RAI_OFF" }, + { E1DP_EVT_SABITS, "E1DP_EVT_SABITS" }, { E1DP_EVT_TYPE, "EVT_TYPE" }, { E1DP_RESP_TYPE, "RESP_TYPE" }, { E1DP_ERR_TYPE, "ERR_TYPE" }, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35557?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I4c20ec19fa3d9cce82c8199b38d173aa272fb07d Gerrit-Change-Number: 35557 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-e1d[master]: Add functions to events from server to client
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35558?usp=email ) Change subject: Add functions to events from server to client ...................................................................... Add functions to events from server to client The client may register a callback function to receive events. Because there is no relation between the connected client and the interface, all events are broadcasted to all clients that are connected to the server. Change-Id: I5ee3268f8349b611c3cf3fa0572dc5eab280ab2e --- M include/osmocom/e1d/proto_clnt.h M include/osmocom/e1d/proto_srv.h M src/e1d.h M src/osmo-e1d.c M src/osmo-e1gen.c M src/proto_clnt.c M src/proto_srv.c 7 files changed, 73 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/58/35558/1 diff --git a/include/osmocom/e1d/proto_clnt.h b/include/osmocom/e1d/proto_clnt.h index 53ccf89..26bd44e 100644 --- a/include/osmocom/e1d/proto_clnt.h +++ b/include/osmocom/e1d/proto_clnt.h @@ -49,3 +49,5 @@ 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)); diff --git a/include/osmocom/e1d/proto_srv.h b/include/osmocom/e1d/proto_srv.h index e794725..f95ae13 100644 --- a/include/osmocom/e1d/proto_srv.h +++ b/include/osmocom/e1d/proto_srv.h @@ -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); diff --git a/src/e1d.h b/src/e1d.h index 45ecb82..ec264c7 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -196,6 +196,7 @@ struct e1_daemon { void *ctx; struct llist_head interfaces; + void *srv; }; extern const struct octoi_ops e1d_octoi_ops; diff --git a/src/osmo-e1d.c b/src/osmo-e1d.c index dc264d9..329f584 100644 --- a/src/osmo-e1d.c +++ b/src/osmo-e1d.c @@ -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) { diff --git a/src/osmo-e1gen.c b/src/osmo-e1gen.c index 008f083..81ef21a 100644 --- a/src/osmo-e1gen.c +++ b/src/osmo-e1gen.c @@ -436,3 +436,5 @@ return 0; } + +void osmo_e1dp_server_event(void) {} diff --git a/src/proto_clnt.c b/src/proto_clnt.c index 93853e9..d922e4a 100644 --- a/src/proto_clnt.c +++ b/src/proto_clnt.c @@ -69,13 +69,20 @@ struct osmo_e1dp_client { void *ctx; /*!< talloc context */ struct osmo_fd ctl_fd; /*!< osmo-fd wrapped unix domain (CTL) socket to @osmo-e1d@ */ + void (*event_cb)(enum osmo_e1dp_msg_type event, uint8_t intf, uint8_t line, uint8_t ts, uint8_t *data, int len); + /*!< 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_l1(msgb) + sizeof(*hdr), msgb_l1len(msgb) - sizeof(*hdr)); return 0; } @@ -455,3 +462,12 @@ { return _client_ts_open(clnt, intf, line, ts, mode, read_bufsize, E1DP_TS_OPEN_F_FORCE); } + +/*! Register event handler for incoming event messages. + * \param[in] 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; +} diff --git a/src/proto_srv.c b/src/proto_srv.c index 2b85ac6..ab2fd30 100644 --- a/src/proto_srv.c +++ b/src/proto_srv.c @@ -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); +} -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35558?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I5ee3268f8349b611c3cf3fa0572dc5eab280ab2e Gerrit-Change-Number: 35558 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-e1d[master]: Indicate remote alarm bit as remote alarm inidication
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35560?usp=email ) Change subject: Indicate remote alarm bit as remote alarm inidication ...................................................................... Indicate remote alarm bit as remote alarm inidication The flag that stores the current alarm is not cleared periodically. Instead it is cleared when the alarm ceases. Change-Id: Id6cd193c71330c350c27e02b3a692d2c7e0b3fbe --- M src/intf_line.c M src/mux_demux.c 2 files changed, 27 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/60/35560/1 diff --git a/src/intf_line.c b/src/intf_line.c index f41214e..4433e96 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -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); } diff --git a/src/mux_demux.c b/src/mux_demux.c index cd5c286..abe01a3 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -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" @@ -380,8 +381,18 @@ /* A bit is present in each odd frame */ if (frame_nr % 2) { if (frame[0] & 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); + } } } @@ -395,7 +406,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 */ } } -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35560?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id6cd193c71330c350c27e02b3a692d2c7e0b3fbe Gerrit-Change-Number: 35560 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-e1d[master]: Add option to automatically reset RIFO on underrun/overflow
by jolly 14 Jan '24

14 Jan '24
Attention is currently required from: laforge, manawyrm, pespin, tnt. Hello Jenkins Builder, laforge, manawyrm, pespin, tnt, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review+1 by manawyrm, Code-Review+1 by pespin, Verified+1 by Jenkins Builder Change subject: Add option to automatically reset RIFO on underrun/overflow ...................................................................... Add option to automatically reset RIFO on underrun/overflow Whenever the RIFO buffer fill drifts away from its target, it can be automatically reset and filled to the initial prefill_frame_count value. The average fill is measured over several seconds. A given deviation in percent of the prefill_frame_count is used to trigger that reset. If the deviation is not set (0), this feature is deactivated. There are two reasons for this to happen: The GPS clock is missing, so the receiving interface is not in sync with the transmitting interface. The delay changes significantly, due to congestion on the path between both peers. (poor internet connection) Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748 --- M include/osmocom/octoi/octoi.h M src/octoi/e1oip.c M src/octoi/e1oip.h M src/octoi/frame_rifo.c M src/octoi/frame_rifo.h M src/octoi/octoi_clnt_fsm.c M src/octoi/octoi_clnt_vty.c M src/octoi/octoi_srv_fsm.c M src/octoi/octoi_srv_vty.c M src/octoi/octoi_vty.h M tests/rifo/rifo_test.c 11 files changed, 74 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/54/34554/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/34554?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id7ccbfbdb288990c01f185dec79a1022a68b4748 Gerrit-Change-Number: 34554 Gerrit-PatchSet: 4 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Attention: manawyrm <osmocom.account(a)tbspace.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: tnt <tnt(a)246tNt.com> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmo-e1d[master]: Indicate framing alignment error as alarm inidication signal
by jolly 14 Jan '24

14 Jan '24
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/35559?usp=email ) Change subject: Indicate framing alignment error as alarm inidication signal ...................................................................... Indicate framing alignment error as alarm inidication signal Change-Id: Iaad3adb6afb9e1d8a002fa4a04ba4ab8e51671a3 --- M src/usb.c 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/59/35559/1 diff --git a/src/usb.c b/src/usb.c index fcffc12..950d0ae 100644 --- a/src/usb.c +++ b/src/usb.c @@ -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_AIS_ON, + line->intf->id, line->id, 0, NULL, 0); + } else { + osmo_e1dp_server_event(line->intf->e1d->srv, E1DP_EVT_AIS_OFF, + line->intf->id, line->id, 0, NULL, 0); + } } if ((errcnt->flags & ICE1USB_ERR_F_LOS) != (last->flags & ICE1USB_ERR_F_LOS)) { -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/35559?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Iaad3adb6afb9e1d8a002fa4a04ba4ab8e51671a3 Gerrit-Change-Number: 35559 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • ...
  • 156
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.