aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30ctl: When setting Sa bits, other bits must remain set to '1'tnt/workSylvain Munaut1-5/+8
Some of the other bits will be used 'as-is'. For instance the bit 0 (MSB) will be copied from this if operating in nocrc4 mode. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Id482c6a114e7bf051d157e81038f015e9d26fa99
2024-04-30iCE1usb: Transmit AIS events to clientsSylvain Munaut1-0/+12
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I4a35a2ab2537cbc9ecec381ab5078c1b08067925
2024-04-30iCE1usb: Transmit LOS events to clientsSylvain Munaut1-1/+7
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I8822d24c25f8ba0bb70e9f717ca04dbf0e656e71
2024-04-30Update ice1usb_proto.hSylvain Munaut1-0/+7
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I8e041b3d94723eba9d3d30b9f03815d46dacf995
2024-04-30iCE1usb: Add support to configure CRC4 mode for TX/RXSylvain Munaut3-1/+72
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I9b627a9617af4ae9ed98214d672c7d0391f801eb
2024-01-19Prevent memory leaks / double free of msgb in proto_clnt.cAndreas Eversberg1-3/+15
Change-Id: Ic0c4c06ba7c1a405ec3c73100fe9e8476f4f5512
2024-01-19Add command and client function to change transmitted Sa bitsAndreas Eversberg5-2/+77
Change-Id: I2608af7bbb8092fddd68d4f3bb36b10a1100ce0f
2024-01-19Indicate change in received Sa bitsAndreas Eversberg3-1/+15
Change-Id: I4ea2a11e221629a90ed227a0df33576c8607881b
2024-01-19Indicate remote alarm bit as remote alarm inidicationAndreas Eversberg2-4/+15
The flag that stores the current alarm is not cleared periodically. Instead it is cleared when the alarm ceases. Change-Id: Id6cd193c71330c350c27e02b3a692d2c7e0b3fbe
2024-01-19Indicate framing alignment error as loss of framing signalAndreas Eversberg1-0/+9
Change-Id: Iaad3adb6afb9e1d8a002fa4a04ba4ab8e51671a3
2024-01-19Add functions for events from server to clientAndreas Eversberg5-2/+57
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
2024-01-19Add new protocol command and events for Sa bits and line statesAndreas Eversberg1-1/+10
Change-Id: I4c20ec19fa3d9cce82c8199b38d173aa272fb07d
2024-01-19Add option to automatically reset RIFO on underrun/overflowAndreas Eversberg9-11/+51
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
2023-12-17usb: Deal with truncated ISO IN transfersHarald Welte3-0/+29
It seems that in some circumstances, an ISO IN transfer can be truncated by the bus / host. In such situation we'd currently pass a non-modulo-32 length to the mux_demux (deframer) code, and it ASSERTs on that. Let's try to handle this more gracefully by substituting random garbage and letting higher layers deal with massive bit errors. Related: OS#5490 Change-Id: Ic453325b93b0e12727625a1495a948d96df4b542
2023-12-17usb: Pass not just the actual transfer length but also the buffer sizeHarald Welte1-7/+9
Change-Id: I5088a5213d2945fdfaf3b242a63e35d0ed511914
2023-12-03[cosmetic] e1oip.h: Update TODO comment (we have RTT, frame loss stats)Harald Welte1-2/+1
Change-Id: I837676cb3905c0113307ebc400974c3d8cf3a3c7
2023-09-12Bump version: 0.5.0.11-b7c9-dirty → 0.6.00.6.0Pau Espin Pedrol1-1/+1
Change-Id: I8d5e3ffd928fa65bc3d3b43553fcd6774a7812dc
2023-08-14octoi: Add force-send-all-ts modeHarald Welte7-10/+44
This new mode (can be enabled per account) will force the E1OIP protocol to always send all timeslots, i.e. not do any of the suppression of timeslots that do not exhibit any change to the previous E1 frame. Change-Id: I6d17d3829b2c1c62e701a1d8c021d93d93593613
2023-07-18e1d-ts-pipe: Assert that osmo_fd_register() succeedsHarald Welte1-1/+1
Fixes: CID#307497: Unchecked return value (CHECKED_RETURN) Change-Id: Ie2abd580e37d7d58c507d12105ec2130fb533ed9
2023-07-18octoi: Fix missing check of osmo_fsm_register() return valueHarald Welte1-2/+2
Fixes: CID#307511: Unchecked return value (CHECKED_RETURN) Change-Id: Ia474a6c078f1aec3d04be494a888ffe87b199f5a
2023-07-18proto_srv: Fix file descriptor and memory leak in error pathsHarald Welte1-0/+3
Fixes: CID#307517 Change-Id: I44e349eee5b0b54843762db8cadd6b9b1758faa4
2023-07-18Check return code of fcntl() in several plaacesHarald Welte2-3/+23
Fixes: CID#307539, CID#307533 Change-Id: I46843174eb4699a59421dc3f3b900a3894c67081
2023-05-02proto_clnt: use osmo_fd_close to close the socket on connection lossPhilipp Maier1-2/+1
When the socket is closed due to a connection loss, we currently use close(). This is not enough since this will not remove the file descriptor from the select loop. Let's use osmo_fd_close. Related: OS#5983 Change-Id: I702b944baf2ebbcc84b6a211e245a4a41627bde6
2023-04-20proto_clnt: close osmo-e1d control socket on connection lossPhilipp Maier1-1/+5
When osmo-e1d is terminated the socket file descriptor on the client side will get permanent POLLHUP events. This means that the registered callback gets called with flags OSMO_FD_READ but the received data will be of length zero. We must detect this situations and close the file descriptor on connection loss. Otherwise we would get called over and over again in an endless loop, resulting in 100% CPU usage. Related: OS#5983 Change-Id: I3e1a29a9701a9432f58ef7cfedc32c916203017a
2023-02-07Bump version: 0.4.0.26-8aba-dirty → 0.5.00.5.0Pau Espin Pedrol2-2/+2
Change-Id: I178d34a67cba0359b16fe27fa30b2145703a2909
2023-02-01DAHDI trunkdev supportHarald Welte13-12/+469
DAHDI trunkdev is a newly-introduced 'virtual trunk' character device which is used instead of a real hardware driver. This means that an application (such as osmo-e1d) can implement a virtual E1 trunk and receive and transmit E1 frame data which is exposed to DAHDI users just like the data from a real physical E1 span. In order to build DAHDI trunkdev support into osmo-e1d, you will need a special fork of dahdi containing the required support, currently the laforge/trunkdev branch of the following repository: https://gitea.osmocom.org/retronetworking/dahdi-linux Change-Id: Ib15a7313fcd63e1ed9f2f5b349df967bc4335ec2
2023-01-26Increasing max FIFO size for feature request 5875, adapting testsChristoph Lauter1-1/+1
Change-Id: Iae76d87cf436c80c005a2f8fce5a30f74f7e4545
2022-12-19osmo-e1d: Transition to use of 'telnet_init_default'arehbein2-2/+2
Related: OS#5809 Change-Id: I68fafc519d7c7ca9788bfcad7be1fadbb208cebe
2022-11-07doxygen API documentation for libosmo-e1dHarald Welte1-2/+80
If we actually expect 3rd party applications to use libosmo-e1d to talk to osmo-e1d, we'd better add some basic documentation on how this API shall be used. Change-Id: Ib4a97045bca276fbd3892f801898a436de7dc39b
2022-11-05avoid segfault in 'show interface' of absent icE1usbHarald Welte1-0/+6
Don't segfault when processing a "show interfaces" for an interface that is configured via VTY but not actually attached/found in the system: usb.c:693:29: runtime error: member access within null pointer of type 'struct e1_usb_intf_data' Depends: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/30019 Depends: https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/30020 Change-Id: I2ce990bb57f6ae4edb3a99a4b7bf26a49f362410
2022-11-03osmo-e1d: Add the usual '-V' / '--version' command line argumentHarald Welte1-1/+7
Change-Id: Ie2d79c44e580ffa6555f87b969206047ffb7eb6f
2022-11-02Differentiate between icE1usb and e1-tracer in log/vty outputHarald Welte2-5/+9
Now that we support the e1-tracer in addition to icE1usb, let's differentiate in the log output. Change-Id: Iea647b12d86c97cfacbc3df43010b9b94f0a97c7
2022-11-01usb.c: Bail out of e1-tracer doesn't accept set_configuration(2)Harald Welte1-2/+7
This likely means it's not an e1-tracer after all, or it's an old firmware that doesn't yet expose the e1d-compatible USB configuration. Related: OS#5734 Change-Id: If5a9bc20084d84885d5d97b4f982e94801612d24
2022-11-01osmo-e1d-pipe: Add command line option for --force open of timeslotHarald Welte1-3/+14
This exposes the existing capability of force-opening a timeslot via a command-line argument. Related: OS#5735 Change-Id: Ieefc89f2e48e9124ae744a587739ff3948110944
2022-11-01ctl: Prevent clients from opening TS0Harald Welte1-1/+1
This doesn't work, as the mux_demux.c code doesn't pass the TS0 bitstream to users anyway. So let's reject clients attempting this. Change-Id: Idb2d20da7de72dad38ae2fccdd7630677d0f0cc8
2022-11-01support for e1-tracer hardwareHarald Welte1-13/+45
Recent work on the e1-tracer firmware is introducing a set of USB descriptors (as configuration 2) that are mostly compatible to how osmo-e1d talks to icE1usb. The main difference is that there's only one ISO IN endpoint per USB interface, and no ISO OUT or ISU FB endpoints. So we introduce some minor adjustments here to accommodate that. Related: OS#5733 Closes: OS#5734 Change-Id: I855e18c0f229bd473123f96303e60ab2de90677f
2022-10-12usb: Claim and set interface alt-setting only for used linesSylvain Munaut1-15/+16
If a line is not auto-created, there is no point on claiming the matching interface and even less point setting the alt setting that will try to use USB isoc bandwith. With this you can no use only line 1 and not line 0 of a ice1usb for instance. While previously it would still "enable" line 0 and then line 1 would fail because on BW issues most of the case. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Iea5d72272f11875e7a32c78b60c188590deda831
2022-10-12octoi: Prevent segfault on 'show octoi-clients if a client has no lineSylvain Munaut1-2/+4
This can happen if the specified device in the config isn't plugged in for instance, no line is created ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I594463591f2945a04ccd708f16788034cc1dfc57
2022-10-06vty: Add option to disable GPS-DO loop and use manual tuning valuesSylvain Munaut3-0/+52
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I8668fe42e4c399f08696e497887120e501341f5a
2022-10-06usb: Fix ICE1USB_INTF_SET_GPSDO_MODE request parameterSylvain Munaut1-2/+2
This call takes its argument in wValue rather than as payload Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Ibeebe3184a4744bd0cd9f5a19db84c12fab18806
2022-10-06usb: Fix the length field of ICE1USB_INTF_SET_GPSDO_TUNE requestSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Ibf1b1440696902757f4b1c1d9c4d80c1da453a36
2022-10-06usb: Add support for new GPSDO status field "Accumulated error"Sylvain Munaut4-4/+23
Because we want to handle older firmwares too, we need to excepect we might get a smaller structure ! (We can't get a larger one since the wLength we send is limited to the structure we know) Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I4222bf22267f8343abf1e97546111ceb1c299846
2022-07-12octoi_srv_fsm: fix implicit fall-throughOliver Smith1-0/+1
Found by gcc (Debian 10.2.1-6) 10.2.1 20210110, which fails the build with --enable-werror because of this. Change-Id: Ib717df376a4b414f787168c2c632f04f0c51271b
2022-06-29Bump version: 0.3.0.72-bb13-dirty → 0.4.00.4.0Pau Espin Pedrol1-1/+1
Change-Id: Ia3b429acd866ab644a9d9a848d69bd9627dcd840
2022-05-08e1oip: Make batching-factor and prefill-frame-count configurableHarald Welte7-0/+62
This adds VTY commands at the 'account' level to configure those settings. They will only become active on the next [re]connect of the line. Change-Id: Ic455ef0ef82867db512e2ffdff24d9dd42d47eeb
2022-05-08e1oip: introduce #defines for BATCHING_FACTOR / PREFILL_COUNTHarald Welte2-2/+5
Change-Id: Ia0da9b038312b010bfdf88570733bf1bf004b7a8
2022-05-01octoi: Send ECHO_REQ every 10s and update the related stat_itemHarald Welte5-5/+83
As soon as an OCTOI connection gets into ACTIVE state, send a ECHO_REQ every 10s and compute the RTT at the time of receiving the response. Contrary to the initial idea, the stat item contains the RTT (round trip time) measured in micro-seconds. Changing this is not a problem as so far the RTT was always reported as '0', and 0ms == 0us. Change-Id: Id331319bff1cf6896fee37acc45846a2491ca92d
2022-05-01octoi: only memcpy() if it is present in _octoi_tx_echo()Harald Welte1-1/+2
If the caller specifies zero-length data or a NULL pointer, don't attempt to call memcpy() on that. Change-Id: I5f5ed937643162d6ef6ce0cf2908432c007943c1
2022-05-01e1oip: Add rate_ctr for rx + tx packet / byte countHarald Welte5-2/+63
This allows to monitor the traffic utilization of each e1oip line. Change-Id: Ifde6be0b7d3c5767b684cb8fbbc58bbd5cfb0714
2022-04-23e1oip: fix line counter descriptionsHarald Welte1-2/+2
The direction is wrong in two counter descriptions Change-Id: Ia294af4b30eec1b32c4b15892751d360608c8333