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

January 2022

  • 3 participants
  • 781 discussions
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
Change in osmo-e1d[master]: Fix a bunch of warning raised by the new build warning options
by tnt 09 Jan '22

09 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26808 ) Change subject: Fix a bunch of warning raised by the new build warning options ...................................................................... Fix a bunch of warning raised by the new build warning options A lot of them are related to signedness or type range limitation. A lot are not actual issues and work find in practice, but a few lead to actual bad behavior. This makes all the conversion explicit to mark intent. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I992b9bc51659e85966651b1146091501b8f149f5 --- M src/ctl.c M src/e1gen/osmo_e1f.c M src/mux_demux.c M src/proto_srv.c M src/usb.c M src/vty.c 6 files changed, 12 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/08/26808/1 diff --git a/src/ctl.c b/src/ctl.c index b633b9b..4a922b9 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -264,10 +264,7 @@ if (!line) return 0; - n = (hdr->ts == E1DP_INVALID) ? 32 : ( - ((hdr->ts >= 0) && (hdr->ts < 31)) ? 1 : 0 - ); - + n = (hdr->ts == E1DP_INVALID) ? 32 : ((hdr->ts < 31) ? 1 : 0); if (!n) return 0; diff --git a/src/e1gen/osmo_e1f.c b/src/e1gen/osmo_e1f.c index fa64e17..9d4f808 100644 --- a/src/e1gen/osmo_e1f.c +++ b/src/e1gen/osmo_e1f.c @@ -55,7 +55,7 @@ int osmo_e1f_instance_init(struct osmo_e1f_instance *e1i, const char *name, e1_notify_cb cb, bool crc4_enabled, void *priv) { - int i; + unsigned int i; e1i->crc4_enabled = crc4_enabled; e1i->notify_cb = cb; @@ -101,7 +101,7 @@ * \param[in] e1t E1 instance which we are to stop */ void osmo_e1f_instance_reset(struct osmo_e1f_instance *e1i) { - int i; + unsigned int i; align_fsm_reset(e1i); @@ -290,7 +290,7 @@ * \returns 0 on success, negative on error */ int osmo_e1f_pull_tx_frame(struct osmo_e1f_instance *e1i, uint8_t *out_frame) { - int i; + unsigned int i; if (e1i->tx.ais) { memset(out_frame, 0xff, 32); @@ -684,7 +684,7 @@ */ int osmo_e1f_rx_frame(struct osmo_e1f_instance *e1i, const uint8_t *in_frame) { - int i; + unsigned int i; e1_rx_update_crc4(e1i, in_frame); diff --git a/src/mux_demux.c b/src/mux_demux.c index a588829..efd7ac8 100644 --- a/src/mux_demux.c +++ b/src/mux_demux.c @@ -87,7 +87,7 @@ if (!ts->hdlc.tx_len) { rv = recv(ts->fd, ts->hdlc.tx_buf, sizeof(ts->hdlc.tx_buf), MSG_TRUNC); if (rv > 0) { - if (rv > sizeof(ts->hdlc.tx_buf)) { + if (rv > (int)sizeof(ts->hdlc.tx_buf)) { LOGPTS(ts, DXFR, LOGL_ERROR, "Truncated message: Client tried to " "send %d bytes but our buffer is limited to %lu\n", rv, sizeof(ts->hdlc.tx_buf)); @@ -151,7 +151,7 @@ LOGPTS(ts, DE1D, LOGL_ERROR, "dead socket during read: %s\n", strerror(errno)); e1_ts_stop(ts); - } else if (l < len) { + } else if (l < (int)len) { LOGPTS(ts, DE1D, LOGL_NOTICE, "TS read underflow: We had %zu bytes to read, " "but socket returned only %d\n", len, l); } @@ -297,7 +297,7 @@ LOGPTS(ts, DE1D, LOGL_ERROR, "dead socket during write: %s\n", strerror(errno)); e1_ts_stop(ts); - } else if (rv < len) { + } else if (rv < (int)len) { LOGPTS(ts, DE1D, LOGL_NOTICE, "TS write overflow: We had %zu bytes to send, " "but write returned only %d\n", len, rv); } diff --git a/src/proto_srv.c b/src/proto_srv.c index c376423..d6d3d17 100644 --- a/src/proto_srv.c +++ b/src/proto_srv.c @@ -94,7 +94,7 @@ /* Check payload length */ if ((h->payload_len >= 0) && - (h->payload_len != (msgb_length(msgb) - sizeof(struct osmo_e1dp_msg_hdr)))) + (h->payload_len != (int)(msgb_length(msgb) - sizeof(struct osmo_e1dp_msg_hdr)))) { LOGP(DE1D, LOGL_ERROR, "Invalid payload for message type: %d / (%d/%d/%d).\n", hdr->type, hdr->intf, hdr->line, hdr->ts); diff --git a/src/usb.c b/src/usb.c index d5107bc..32a249a 100644 --- a/src/usb.c +++ b/src/usb.c @@ -189,7 +189,7 @@ 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 + (int)xfr->iso_packet_desc[j].actual_length : -1 ); len += (xfr->iso_packet_desc[j].length = flow->size); } @@ -359,7 +359,7 @@ switch (irq->type) { case ICE1USB_IRQ_T_ERRCNT: - if (xfer->actual_length < sizeof(*irq)) { + if (xfer->actual_length < (int)sizeof(*irq)) { LOGPLI(line, DE1D, LOGL_ERROR, "Short ERRCNT interrupt: %u<%zu\n", xfer->actual_length, sizeof(*irq)); break; diff --git a/src/vty.c b/src/vty.c index 563950d..2f2425c 100644 --- a/src/vty.c +++ b/src/vty.c @@ -107,7 +107,7 @@ static void vty_dump_line(struct vty *vty, const struct e1_line *line) { - int tn; + unsigned int tn; vty_out(vty, "Interface #%u, Line #%u, Mode %s%s%s:%s", line->intf->id, line->id, get_value_string(e1_line_mode_names, line->mode), -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I992b9bc51659e85966651b1146091501b8f149f5 Gerrit-Change-Number: 26808 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]: build: Increase warnings
by tnt 09 Jan '22

09 Jan '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26807 ) Change subject: build: Increase warnings ...................................................................... build: Increase warnings Go with -Wextra but removing some of the obnoxious options it brings with it. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Iaafd35ba39e272d5900b31b14d2651e0ecb8a84a --- M src/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/07/26807/1 diff --git a/src/Makefile.am b/src/Makefile.am index 74ade7d..f4af9f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,7 @@ LIBVERSION=1:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS=-Wall -Wno-unused-result $(LIBOSMOCORE_CFLAGS) \ +AM_CFLAGS=-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-result $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) $(LIBOSMOUSB_CFLAGS) $(LIBUSB_CFLAGS) lib_LTLIBRARIES = libosmo-e1d.la -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26807 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Iaafd35ba39e272d5900b31b14d2651e0ecb8a84a Gerrit-Change-Number: 26807 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
2 3
0 0
  • ← Newer
  • 1
  • ...
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • ...
  • 79
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.