Commit Graph

9 Commits

Author SHA1 Message Date
Sylvain Munaut 3729f8f90e 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@246tNt.com>
Change-Id: Iaa6268e9b4a7bce5ea3027a29c48c147499373be
2022-01-09 15:09:11 +01:00
Sylvain Munaut e945a897f7 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@246tNt.com>
Change-Id: I2ced3a5ba3cf3cc1f212d8f3e46cfefa15e4af0c
2022-01-09 15:09:11 +01:00
Sylvain Munaut 73d7184088 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@246tNt.com>
Change-Id: I992b9bc51659e85966651b1146091501b8f149f5
2022-01-09 11:43:01 +01:00
Harald Welte fb1293ccea Use the error counters for remote alarm + remote CRC error
Some time ago we added various error counters, but for two of them
we missed to actually ever increment them at all.

Change-Id: Ieb83a2e2e83e334c543bee83726f04f83b19227a
2022-01-02 13:02:37 +01:00
Harald Welte 8ddb22f8c6 e1d: Add watchdog timer to detect dead lines / USB devices
We just found a bug in icE1usb (likely firmware) which was hard to find
as there was zero notification from osmo-e1d that it actually never
received any data from the icE1usb hardware/firmware anymore.

Change-Id: Id22e4110b9067f50b1818eb12295b2d4eb9cdc12
2021-12-31 17:20:32 +01:00
Harald Welte 383782396f e1d: reliably detect EOF (HDLC-FCS mode)
This patch makes e1d reliably detect EOF on client sockets while in
HDLC-FCS mode.

Change-Id: I0260360643f723f7c721ae67c47dce8df7778694
2021-12-31 16:46:06 +01:00
Harald Welte d8e37c8b56 e1d: reliably detect EOF in _e1_ts_{read,write} (RAW mode)
This allows us to reliably detect client disconnection at least in
the case of RAW mode channels.  Even with this patch applied, e1d
still fails to reliably detect client disconnect on HDLC-FCS channels.

Change-Id: Ifb8b91d39b394f9c10c859f3adac85ea47b7653f
2021-12-31 16:45:54 +01:00
Harald Welte 31ac0bea55 Evaluate received E and A bits in TS0
Related: OS#4917
Change-Id: I7e1c919518b3418e973b7ae5bedd5a6dd1c2adec
2021-01-05 23:46:02 +01:00
Harald Welte 929a5a7588 e1_line.c: Split multiplex + demultiplex into separate mux_demux.c
The remaining intf_line.c really only manages the data structures.

This is useful for building other programs than osmo-e1d, such as
an upcoming E1 test utility called osmo-e1gen which will also use
the USB interface and icE1usb hardware, but not any of the mux/demux/ctl
code.

Change-Id: I1ceaea85a15e2fae1d2e041173be9d758c6d0b78
2020-12-20 11:45:44 +01:00