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 -----
  • December
  • November
  • 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

  • 1 participants
  • 97203 discussions
Change in osmo-e1d[master]: usb: Print failed USB isochronous packets
by laforge 10 Jan '22

10 Jan '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26819 ) Change subject: usb: Print failed USB isochronous packets ...................................................................... usb: Print failed USB isochronous packets Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda --- M src/usb.c 1 file changed, 28 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/19/26819/1 diff --git a/src/usb.c b/src/usb.c index d5107bc..2ccb3ac 100644 --- a/src/usb.c +++ b/src/usb.c @@ -173,6 +173,18 @@ // USB flow // --------------------------------------------------------------------------- +/* strings for enum libusb_transfer_status */ +static const struct value_string libusb_status_str[] = { + { LIBUSB_TRANSFER_COMPLETED, "COMPLETED" }, + { LIBUSB_TRANSFER_ERROR, "ERROR" }, + { LIBUSB_TRANSFER_TIMED_OUT, "TIMED_OUT" }, + { LIBUSB_TRANSFER_CANCELLED, "CANCELLED" }, + { LIBUSB_TRANSFER_STALL, "STALL" }, + { LIBUSB_TRANSFER_NO_DEVICE, "NO_DEVICE" }, + { LIBUSB_TRANSFER_OVERFLOW, "OVERFLOW" }, + { 0, NULL } +}; + static void LIBUSB_CALL _e1uf_xfr(struct libusb_transfer *xfr) { @@ -184,18 +196,29 @@ /* FIXME: Check transfer status ? Error handling ? */ + if (flow->ep & 0x80) { for (j=0; j<flow->ppx; j++) { + struct libusb_iso_packet_descriptor *iso_pd = &xfr->iso_packet_desc[j]; + if (iso_pd->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(flow->line, DE1D, LOGL_ERROR, "IN EP %02x ISO packet %d failed with status %s\n", + flow->ep, j, get_value_string(libusb_status_str, iso_pd->status)); + } flow->cb(flow, libusb_get_iso_packet_buffer_simple(xfr, j), - (xfr->iso_packet_desc[j].status == LIBUSB_TRANSFER_COMPLETED) ? - xfr->iso_packet_desc[j].actual_length : -1 + (iso_pd->status == LIBUSB_TRANSFER_COMPLETED) ? iso_pd->actual_length : -1 ); - len += (xfr->iso_packet_desc[j].length = flow->size); + len += (iso_pd->length = flow->size); } } else { - for (j=0; j<flow->ppx; j++) - len += (xfr->iso_packet_desc[j].length = flow->cb(flow, &xfr->buffer[len], flow->size)); + for (j=0; j<flow->ppx; j++) { + struct libusb_iso_packet_descriptor *iso_pd = &xfr->iso_packet_desc[j]; + if (iso_pd->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(flow->line, DE1D, LOGL_ERROR, "OUT EP %02x ISO packet %d failed with status %s\n", + flow->ep, j, get_value_string(libusb_status_str, iso_pd->status)); + } + len += (iso_pd->length = flow->cb(flow, &xfr->buffer[len], flow->size)); + } } libusb_fill_iso_transfer(xfr, id->devh, flow->ep, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ib6fcf46be40d47817632ccae4e742d6cf7340cda Gerrit-Change-Number: 26819 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 7
0 0
Change in osmo-e1d[master]: cosmetic: Adhere osmocom coding style in for-loops
by laforge 10 Jan '22

10 Jan '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26820 ) Change subject: cosmetic: Adhere osmocom coding style in for-loops ...................................................................... cosmetic: Adhere osmocom coding style in for-loops We either have to bring osmo-e1d in line with other osmocom projects, or we'd have to disable the linter in jenkins. Change-Id: I74ab20b22118d471dcdb60d1b9681ab62eb13d51 --- M src/ctl.c M src/intf_line.c M src/mux_demux.c M src/usb.c 4 files changed, 17 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/20/26820/1 diff --git a/src/ctl.c b/src/ctl.c index 4a922b9..7040001 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -278,7 +278,7 @@ if (n == 1) { _e1d_fill_ts_info(ti, &line->ts[hdr->ts]); } else { - for (int i=0; i<32; i++) + for (int i = 0; i < 32; i++) _e1d_fill_ts_info(ti++, &line->ts[i]); } diff --git a/src/intf_line.c b/src/intf_line.c index 5659129..1f833fb 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -192,7 +192,7 @@ line->drv_data = drv_data; line->mode = E1_LINE_MODE_CHANNELIZED; - for (int i=0; i<32; i++) + for (int i = 0; i < 32; i++) _ts_init(&line->ts[i], line, i); _ts_init(&line->superchan, line, E1DP_TS_SUPERCHAN); @@ -228,7 +228,7 @@ osmo_timer_del(&line->watchdog.timer); /* close all [peer] file descriptors */ - for (int i=0; i<32; i++) + for (int i = 0; i < 32; i++) e1_ts_stop(&line->ts[i]); /* remove from per-interface list of lines */ diff --git a/src/mux_demux.c b/src/mux_demux.c index 2971c87..6a7b326 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -151,8 +151,7 @@ OSMO_ASSERT(line->mode == E1_LINE_MODE_CHANNELIZED); /* Scan timeslots */ - for (int tsn=1; tsn<32; tsn++) - { + for (int tsn = 1; tsn < 32; tsn++) { struct e1_ts *ts = &line->ts[tsn]; uint8_t buf_ts[fts]; int l; @@ -164,7 +163,7 @@ if (l <= 0) continue; - for (int i=0; i<l; i++) + for (int i = 0; i < l; i++) buf[tsn+(i*32)] = buf_ts[i]; } } @@ -327,15 +326,14 @@ { OSMO_ASSERT(line->mode == E1_LINE_MODE_CHANNELIZED); - for (int tsn=1; tsn<32; tsn++) - { + for (int tsn = 1; tsn < 32; tsn++) { struct e1_ts *ts = &line->ts[tsn]; uint8_t buf_ts[ftr]; if (ts->mode == E1_TS_MODE_OFF) continue; - for (int i=0; i<ftr; i++) + for (int i = 0; i < ftr; i++) buf_ts[i] = buf[tsn+(i*32)]; _e1_ts_write(ts, buf_ts, ftr); diff --git a/src/usb.c b/src/usb.c index c67f5b9..d36ed42 100644 --- a/src/usb.c +++ b/src/usb.c @@ -185,7 +185,7 @@ /* FIXME: Check transfer status ? Error handling ? */ if (flow->ep & 0x80) { - for (j=0; j<flow->ppx; j++) { + for (j = 0; j < flow->ppx; j++) { flow->cb(flow, libusb_get_iso_packet_buffer_simple(xfr, j), (xfr->iso_packet_desc[j].status == LIBUSB_TRANSFER_COMPLETED) ? @@ -194,7 +194,7 @@ len += (xfr->iso_packet_desc[j].length = flow->size); } } else { - for (j=0; j<flow->ppx; j++) + for (j = 0; j < flow->ppx; j++) len += (xfr->iso_packet_desc[j].length = flow->cb(flow, &xfr->buffer[len], flow->size)); } @@ -226,7 +226,7 @@ flow->ppx = ppx; flow->entries = talloc_zero_size(ctx, count * sizeof(struct e1_usb_flow_entry)); - for (int i=0; i<count; i++) + for (int i = 0; i < count; i++) flow->entries[i].buf = talloc_zero_size(ctx, size * ppx); return flow; @@ -239,7 +239,7 @@ return; /* FIXME: stop pending transfers */ - for (int i=0; i<flow->count; i++) + for (int i = 0; i < flow->count; i++) talloc_free(flow->entries[i].buf); talloc_free(flow->entries); @@ -253,8 +253,7 @@ struct libusb_transfer *xfr; int i, j, rv, len; - for (i=0; i<flow->count; i++) - { + for (i = 0; i < flow->count; i++) { xfr = libusb_alloc_transfer(flow->ppx); if (!xfr) return -ENOMEM; @@ -262,10 +261,10 @@ len = 0; if (flow->ep & 0x80) { - for (j=0; j<flow->ppx; j++) + for (j = 0; j < flow->ppx; j++) len += (xfr->iso_packet_desc[j].length = flow->size); } else { - for (j=0; j<flow->ppx; j++) + for (j = 0; j < flow->ppx; j++) len += (xfr->iso_packet_desc[j].length = flow->cb(flow, &flow->entries[i].buf[len], flow->size)); } @@ -529,7 +528,7 @@ return ret; } - for (i=0; i<cd->bNumInterfaces; i++) { + for (i =0; i < cd->bNumInterfaces; i++) { /* Expect 2 altsettings with proper class/subclass/eps */ if (cd->interface[i].num_altsetting != 2) continue; @@ -559,7 +558,7 @@ line_data->r_acc = 0; line_data->r_sw = 8192; - for (j=0; j<id->bNumEndpoints; j++) { + for (j = 0; j < id->bNumEndpoints; j++) { if (id->endpoint[j].bmAttributes == 0x11) { line_data->ep_fb = id->endpoint[j].bEndpointAddress; } else if (id->endpoint[j].bmAttributes == 0x05) { @@ -623,7 +622,7 @@ return -EIO; } - for (i=0; i<n_dev; i++) { + for (i = 0; i < n_dev; i++) { struct libusb_device_descriptor desc; ret = libusb_get_device_descriptor(dev_list[i], &desc); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I74ab20b22118d471dcdb60d1b9681ab62eb13d51 Gerrit-Change-Number: 26820 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
3 5
0 0
Change in libosmocore[master]: bits.c: Fix -Wsign-compare warnings
by laforge 10 Jan '22

10 Jan '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/26813 ) Change subject: bits.c: Fix -Wsign-compare warnings ...................................................................... bits.c: Fix -Wsign-compare warnings Change-Id: I6a2e3e9c8743b229633204562712fda1433a78ec --- M src/bits.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/26813/1 diff --git a/src/bits.c b/src/bits.c index 4b413a3..c1c3f90 100644 --- a/src/bits.c +++ b/src/bits.c @@ -188,7 +188,7 @@ const ubit_t *in, unsigned int in_ofs, unsigned int num_bits, int lsb_mode) { - int i, op, bn; + unsigned int i, op, bn; for (i=0; i<num_bits; i++) { op = out_ofs + i; bn = lsb_mode ? (op&7) : (7-(op&7)); @@ -213,7 +213,7 @@ const pbit_t *in, unsigned int in_ofs, unsigned int num_bits, int lsb_mode) { - int i, ip, bn; + unsigned int i, ip, bn; for (i=0; i<num_bits; i++) { ip = in_ofs + i; bn = lsb_mode ? (ip&7) : (7-(ip&7)); @@ -304,7 +304,7 @@ */ void osmo_revbytebits_buf(uint8_t *buf, int len) { - unsigned int i; + int i; for (i = 0; i < len; i++) buf[i] = flip_table[buf[i]]; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26813 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I6a2e3e9c8743b229633204562712fda1433a78ec Gerrit-Change-Number: 26813 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
3 3
0 0
Change in libosmocore[master]: bitvec: Fix -Wsign-compare warnings
by laforge 10 Jan '22

10 Jan '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/26810 ) Change subject: bitvec: Fix -Wsign-compare warnings ...................................................................... bitvec: Fix -Wsign-compare warnings Change-Id: I34f65cda83bcd7050bd0cc0fb9e5cb5d33a09086 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/26810/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 6a37861..70b0e27 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -73,7 +73,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); -unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, unsigned int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 6a54344..350f738 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -197,7 +197,8 @@ * \return 0 on success; negative in case of error */ int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count) { - int i, rc; + unsigned int i; + int rc; for (i = 0; i < count; i++) { rc = bitvec_set_bit(bv, bits[i]); @@ -260,7 +261,7 @@ * \return integer value retrieved from bit vector */ int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits) { - int i; + unsigned int i; unsigned int ui = 0; for (i = 0; i < num_bits; i++) { @@ -603,7 +604,7 @@ * \returns Number of consecutive bits of \p b in \p bv and cur_bit will * \go to cur_bit + number of consecutive bit */ -unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, unsigned int max_bits) { unsigned i = 0; unsigned j = 8; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26810 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I34f65cda83bcd7050bd0cc0fb9e5cb5d33a09086 Gerrit-Change-Number: 26810 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
3 3
0 0
Change in libosmocore[master]: utils: Fix -Wsign-compare warnings
by laforge 10 Jan '22

10 Jan '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/26811 ) Change subject: utils: Fix -Wsign-compare warnings ...................................................................... utils: Fix -Wsign-compare warnings Change-Id: I8b1118ca519b0a419a42eab8b7d4ba9e26a0bab5 --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/26811/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 1fdb0eb..327aa3d 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -40,7 +40,7 @@ /*! A mapping between human-readable string and numeric value */ struct value_string { - int value; /*!< numeric value */ + uint32_t value; /*!< numeric value */ const char *str; /*!< human-readable string */ }; @@ -57,7 +57,7 @@ int osmo_bcd2str(char *dst, size_t dst_size, const uint8_t *bcd, int start_nibble, int end_nibble, bool allow_hex); int osmo_str2bcd(uint8_t *dst, size_t dst_size, const char *digits, int start_nibble, int end_nibble, bool allow_hex); -int osmo_hexparse(const char *str, uint8_t *b, int max_len); +int osmo_hexparse(const char *str, uint8_t *b, unsigned int max_len); char *osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, unsigned int len); char *osmo_ubit_dump(const uint8_t *bits, unsigned int len); @@ -323,7 +323,7 @@ _needed = FUNC_BUF(_str, _len, ## FUNC_BUF_ARGS); \ if (_needed < 0) \ goto OSMO_NAME_C_on_error; \ - if (_needed < _len) \ + if ((unsigned int) _needed < _len) \ return _str; \ _len = _needed + 1; \ if (_str) \ diff --git a/src/utils.c b/src/utils.c index bec4b75..357ed53 100644 --- a/src/utils.c +++ b/src/utils.c @@ -202,7 +202,7 @@ if (end_nibble & 1) end_nibble++; } - if ((end_nibble / 2) > dst_size) + if ((unsigned int) (end_nibble / 2) > dst_size) return -ENOMEM; for (nibble_i = start_nibble; nibble_i < end_nibble; nibble_i++) { @@ -237,7 +237,7 @@ * \param[in] max_len maximum space in output buffer * \returns number of parsed octets, or -1 on error */ -int osmo_hexparse(const char *str, uint8_t *b, int max_len) +int osmo_hexparse(const char *str, uint8_t *b, unsigned int max_len) { char c; @@ -312,7 +312,7 @@ for (i = 0; i < len; i++) { const char *delimp = delim; int len_remain = out_buf_size - (cur - out_buf) - 1; - if (len_remain < (2 + delim_len) + if (len_remain < (int) (2 + delim_len) && !(!delim_after_last && i == (len - 1) && len_remain >= 2)) break; @@ -340,7 +340,7 @@ */ char *osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, unsigned int len) { - int i; + unsigned int i; if (len > buf_len-1) len = buf_len-1; @@ -1222,7 +1222,7 @@ int64_t precision_factor; int64_t integer_max; int64_t decimal_max; - int i; + unsigned int i; OSMO_ASSERT(val); *val = 0; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26811 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I8b1118ca519b0a419a42eab8b7d4ba9e26a0bab5 Gerrit-Change-Number: 26811 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Pablo Neira Ayuso <pablo(a)gnumonks.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
3 3
0 0
Change in libosmocore[master]: log_taget_find() should use enum log_target_type, not int
by laforge 10 Jan '22

10 Jan '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/26812 ) Change subject: log_taget_find() should use enum log_target_type, not int ...................................................................... log_taget_find() should use enum log_target_type, not int This has shown up in -Wsign-compare Change-Id: I2f5ba81aa0328db7db29f49f26de4cea3f522789 --- M include/osmocom/core/logging.h M src/logging.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/26812/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 7907734..4a34c7d 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -431,7 +431,7 @@ void log_add_target(struct log_target *target); void log_del_target(struct log_target *target); -struct log_target *log_target_find(int type, const char *fname); +struct log_target *log_target_find(enum log_target_type type, const char *fname); void log_enable_multithread(void); diff --git a/src/logging.c b/src/logging.c index 7f6dbb5..9d2a065 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1259,7 +1259,7 @@ * \returns Log target (if found), NULL otherwise * Must be called with mutex osmo_log_tgt_mutex held, see log_tgt_mutex_lock. */ -struct log_target *log_target_find(int type, const char *fname) +struct log_target *log_target_find(enum log_target_type type, const char *fname) { struct log_target *tgt; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26812 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I2f5ba81aa0328db7db29f49f26de4cea3f522789 Gerrit-Change-Number: 26812 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
3 3
0 0
Change in osmo-e1d[master]: mux_demux: In RAW mode, fill with dummy until first TX
by tnt 09 Jan '22

09 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26817 ) Change subject: mux_demux: In RAW mode, fill with dummy until first TX ...................................................................... mux_demux: In RAW mode, fill with dummy until first TX Until the remote side sends the first byte, we send fill data since it can take it some time after the mode change and the file descriptor is open for data to show up. Previously due to a bug, the warning about short read was not printed, but now that it's fixed, you get a bunch of fairly "useless" warning at the beginning of the timeslot. This fixes that since reported data by _e1_tx_raw is "faked" until the pipe is active. (Fill data is actually added upstream) Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Iaa6268e9b4a7bce5ea3027a29c48c147499373be --- M src/e1d.h M src/mux_demux.c 2 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/17/26817/1 diff --git a/src/e1d.h b/src/e1d.h index 618776d..a0c8ceb 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -79,6 +79,7 @@ uint8_t *rx_buf; /* actual buffer storage */ unsigned int rx_buf_size; /* size of 'buf' in bytes */ unsigned int rx_buf_used; /* number of bytes used so far */ + bool tx_started; /* tx started */ } raw; /* Remote end */ diff --git a/src/mux_demux.c b/src/mux_demux.c index 6d854dd..3919580 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -45,6 +45,24 @@ // --------------------------------------------------------------------------- static int +_e1_tx_raw(struct e1_ts *ts, uint8_t *buf, int len) +{ + int l; + + l = read(ts->fd, buf, len); + /* FIXME: handle underflow */ + + /* If we're not started yet, we 'fake' data until the other side + * send something */ + if (l < 0 && errno == EAGAIN && !ts->raw.tx_started) + return len; + + ts->raw.tx_started = true; + + return l; +} + +static int _e1_tx_hdlcfs(struct e1_ts *ts, uint8_t *buf, int len) { int rv, oo, cl; @@ -105,8 +123,7 @@ switch (ts->mode) { case E1_TS_MODE_RAW: - l = read(ts->fd, buf, len); - /* FIXME: handle underflow */ + l = _e1_tx_raw(ts, buf, len); break; case E1_TS_MODE_HDLCFCS: l = _e1_tx_hdlcfs(ts, buf, len); -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Iaa6268e9b4a7bce5ea3027a29c48c147499373be Gerrit-Change-Number: 26817 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1d[master]: contrib/e1-prbs-test: Delay the TX pipe fill data until first RX
by tnt 09 Jan '22

09 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26818 ) Change subject: contrib/e1-prbs-test: Delay the TX pipe fill data until first RX ...................................................................... contrib/e1-prbs-test: Delay the TX pipe fill data until first RX There is non negligible time between the moment init_timeslot is called and the moment when we get the first RX (which is when we start sending out data at the same rate we RX it). And those 1024 byte were borderline not enough to not underflow. By delaying the 1024 byte pre-fill until we get the first RX, we ensure the time that pre-fill covers is more consistant and less dependend on whatever the app/scheduling does during the init phase. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Ic1c93fd138073a75830dc16bb41c4541e68eef90 --- M contrib/e1-prbs-test/internal.h M contrib/e1-prbs-test/main.c 2 files changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/18/26818/1 diff --git a/contrib/e1-prbs-test/internal.h b/contrib/e1-prbs-test/internal.h index a2c4ef5..64ee146 100644 --- a/contrib/e1-prbs-test/internal.h +++ b/contrib/e1-prbs-test/internal.h @@ -30,6 +30,7 @@ struct osmo_prbs prbs; /* PRBS definition */ struct prbs_precomp prbs_pc; /* pre-computed PRBS bytes */ unsigned int prbs_pc_idx; /* next to-be-transmitted byte offset in prbs_pc */ + bool active; /* started tx ? */ }; struct timeslot_state_rx { diff --git a/contrib/e1-prbs-test/main.c b/contrib/e1-prbs-test/main.c index d0809bf..b64cb15 100644 --- a/contrib/e1-prbs-test/main.c +++ b/contrib/e1-prbs-test/main.c @@ -66,6 +66,12 @@ len = rc; process_rx(&ts->rx, ofd->priv_nr, buf, len); + /* if this is the first cb, we preload the transmit queue a bit */ + if (!ts->tx.active) { + process_tx(ts, 1024); + ts->tx.active = true; + } + /* generate as many bytes as were read */ process_tx(ts, len); @@ -79,10 +85,6 @@ ts_init_prbs_tx(ts, g_prbs_offs_tx); ts_init_prbs_rx(ts, g_prbs_offs_rx); - - /* start to put something into the transmit queue, before we get read-triggered - * later on */ - process_tx(ts, 1024); } static int open_slots_e1d(struct test_state *tst, int intf_nr, int line_nr) -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ic1c93fd138073a75830dc16bb41c4541e68eef90 Gerrit-Change-Number: 26818 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1d[master]: usb: Add warning for error during interrupt transfers
by tnt 09 Jan '22

09 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26809 ) Change subject: usb: Add warning for error during interrupt transfers ...................................................................... usb: Add warning for error during interrupt transfers Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Id4d2c95a2d934700f817e971aa4ce29e4bd85675 --- M src/usb.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/09/26809/1 diff --git a/src/usb.c b/src/usb.c index 32a249a..c67f5b9 100644 --- a/src/usb.c +++ b/src/usb.c @@ -352,6 +352,11 @@ struct e1_line *line = (struct e1_line *) xfer->user_data; const struct ice1usb_irq *irq = (const struct ice1usb_irq *) xfer->buffer; + if (xfer->status != LIBUSB_TRANSFER_COMPLETED) { + LOGPLI(line, DE1D, LOGL_ERROR, "Error in Interrupt transfer\n"); + goto out; + } + if (!xfer->actual_length) { LOGPLI(line, DE1D, LOGL_ERROR, "Zero-Length Interrupt transfer\n"); goto out; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Id4d2c95a2d934700f817e971aa4ce29e4bd85675 Gerrit-Change-Number: 26809 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 2
0 0
Change in osmo-e1d[master]: mux_demux: Shuffle functions around for consistency
by tnt 09 Jan '22

09 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26816 ) Change subject: mux_demux: Shuffle functions around for consistency ...................................................................... mux_demux: Shuffle functions around for consistency No functional changes, just making things a bit more organized for the next patch adding an _e1_tx_raw. The order after the patch is : _e1_tx_hdlcfs _e1_ts_read _e1_line_mux_out_channelized _e1_line_mux_out_superchan e1_line_mux_out _e1_rx_raw _e1_rx_hdlcfs _e1_ts_write _e1_line_demux_in_channelized _e1_line_demux_in_superchan _e1_line_demux_in_ts0 e1_line_demux_in Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I2ced3a5ba3cf3cc1f212d8f3e46cfefa15e4af0c --- M src/mux_demux.c 1 file changed, 52 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/16/26816/1 diff --git a/src/mux_demux.c b/src/mux_demux.c index efd7ac8..6d854dd 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -45,37 +45,6 @@ // --------------------------------------------------------------------------- static int -_e1_rx_hdlcfs(struct e1_ts *ts, const uint8_t *buf, int len) -{ - int rv, cl, oi; - - oi = 0; - - while (oi < len) { - rv = osmo_isdnhdlc_decode(&ts->hdlc.rx, - &buf[oi], len-oi, &cl, - ts->hdlc.rx_buf, sizeof(ts->hdlc.rx_buf) - ); - - if (rv > 0) { - int bytes_to_write = rv; - LOGPTS(ts, DXFR, LOGL_DEBUG, "RX Message: %d [ %s]\n", - rv, osmo_hexdump(ts->hdlc.rx_buf, rv)); - rv = write(ts->fd, ts->hdlc.rx_buf, bytes_to_write); - if (rv <= 0) - return rv; - } else if (rv < 0 && ts->id == 4) { - LOGPTS(ts, DXFR, LOGL_ERROR, "ERR RX: %d %d %d [ %s]\n", - rv,oi,cl, osmo_hexdump(buf, len)); - } - - oi += cl; - } - - return len; -} - -static int _e1_tx_hdlcfs(struct e1_ts *ts, uint8_t *buf, int len) { int rv, oo, cl; @@ -275,6 +244,37 @@ return appended; } +static int +_e1_rx_hdlcfs(struct e1_ts *ts, const uint8_t *buf, int len) +{ + int rv, cl, oi; + + oi = 0; + + while (oi < len) { + rv = osmo_isdnhdlc_decode(&ts->hdlc.rx, + &buf[oi], len-oi, &cl, + ts->hdlc.rx_buf, sizeof(ts->hdlc.rx_buf) + ); + + if (rv > 0) { + int bytes_to_write = rv; + LOGPTS(ts, DXFR, LOGL_DEBUG, "RX Message: %d [ %s]\n", + rv, osmo_hexdump(ts->hdlc.rx_buf, rv)); + rv = write(ts->fd, ts->hdlc.rx_buf, bytes_to_write); + if (rv <= 0) + return rv; + } else if (rv < 0 && ts->id == 4) { + LOGPTS(ts, DXFR, LOGL_ERROR, "ERR RX: %d %d %d [ %s]\n", + rv,oi,cl, osmo_hexdump(buf, len)); + } + + oi += cl; + } + + return len; +} + /* write data to a timeslot (hardware -> application direction) */ static int _e1_ts_write(struct e1_ts *ts, const uint8_t *buf, size_t len) @@ -306,27 +306,6 @@ } static int -_e1_line_demux_in_superchan(struct e1_line *line, const uint8_t *buf, int ftr) -{ - struct e1_ts *ts = &line->superchan; - uint8_t sc_buf[ftr*31]; - - OSMO_ASSERT(line->mode == E1_LINE_MODE_SUPERCHANNEL); - - if (ts->mode == E1_TS_MODE_OFF) - return 0; - - /* first gather input data from multiple frames*/ - for (int i = 0; i < ftr; i++) - memcpy(sc_buf + (i*31), buf + (i*32) + 1, 31); - - /* then dispatch to appropriate action */ - _e1_ts_write(ts, sc_buf, ftr*31); - - return 0; -} - -static int _e1_line_demux_in_channelized(struct e1_line *line, const uint8_t *buf, int ftr) { OSMO_ASSERT(line->mode == E1_LINE_MODE_CHANNELIZED); @@ -348,6 +327,27 @@ return 0; } +static int +_e1_line_demux_in_superchan(struct e1_line *line, const uint8_t *buf, int ftr) +{ + struct e1_ts *ts = &line->superchan; + uint8_t sc_buf[ftr*31]; + + OSMO_ASSERT(line->mode == E1_LINE_MODE_SUPERCHANNEL); + + if (ts->mode == E1_TS_MODE_OFF) + return 0; + + /* first gather input data from multiple frames*/ + for (int i = 0; i < ftr; i++) + memcpy(sc_buf + (i*31), buf + (i*32) + 1, 31); + + /* then dispatch to appropriate action */ + _e1_ts_write(ts, sc_buf, ftr*31); + + return 0; +} + static void _e1_line_demux_in_ts0(struct e1_line *line, const uint8_t *buf, int ftr, uint8_t frame_base) { -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26816 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I2ced3a5ba3cf3cc1f212d8f3e46cfefa15e4af0c Gerrit-Change-Number: 26816 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 3
0 0
  • ← Newer
  • 1
  • ...
  • 9702
  • 9703
  • 9704
  • 9705
  • 9706
  • 9707
  • 9708
  • ...
  • 9721
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.