aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-11-09HACK; e1d-fr-testlaforge/framerelayHarald Welte6-0/+811
Change-Id: I31486c77609398093cc535eeafb20be9e95d8b03
2020-11-09raw_testHarald Welte4-0/+86
Change-Id: I47cf9f3e347645fbd9ac4802ae978aba3ebb0107
2020-10-18Use OSMO_FD_* instead of deprecated BSC_FD_*Harald Welte2-3/+3
Change-Id: I7d0972705e898fd75cda3e92104c67c56ec166d5
2020-09-20make sure a given timeslot can only be opened once (by default)Harald Welte5-5/+37
Align the behavior of osmo-e1d with that of DAHDI: If a timeslot is opened once, it cannot be opened again by anyone until it is closed by the current owner. This way we'd have the same failure semantics in DAHDI vs. osmo-e1d, which is very useful in case of misconfiguration when osmo-bsc + osmo-mgw would "fight" over a timeslot. Add a osmo_e1dp_client_ts_open_force() function that allows to override and get back the original behavior. Closes: OS#4654 Change-Id: Ib25adf827ec41e74de15e0e4fdcfc9bcc9a32e58
2020-09-11e1-prbs-test: Add support for osmo-e1dHarald Welte2-14/+68
This allows e1-prbs-test to not only use DAHDI devices, but also osmo-e1d supported devices Change-Id: I0e88f2b056db931b0e442567efa9a8d270abb9f2
2020-09-11src/ctl.c: Log NOTICE messages whenever client send unexpected requestsHarald Welte1-5/+16
Change-Id: Icd47de13ab84b89ce5fb21c24713bae760611d32
2020-09-01usb: Don't pass negative length values to e1_line_demux_in()Harald Welte1-0/+2
every so often, the USB transfer completes without data (due to "unlucky" time alignment between E1 and USB frame clock). Don't call the demuxer in that case. Otherwise the user is confused by error messages like <0001> intf_line.c:467 (I0:L0) IN ERROR: -4 Change-Id: Ia99f97c2cca44d15a83a54cebe884b343ec44f46
2020-07-22make RAW read buffer size configurable (instead of hard-coded 160)Harald Welte5-10/+20
When opening a timeslot, the client can now specify the (from application perspective) timeslot read buffer size. This breaks ABI, but then we're still at a point where only prototype hardware exists, so we can get away with it. Change-Id: I6d603778cce14c5d72fe5f54904905ea7e66d7ff
2020-07-22add comment about first byte of E1DP_MAGICHarald Welte1-0/+2
Change-Id: I7b0a59211521ec631512e6cac7a65e2a2172d538
2020-07-22implement buffering to chunks in E1->application directionHarald Welte3-2/+66
Existing applications (such as those written for DAHDI) expect to be reading data in buffer/chunk sizes. For example OsmoNITB: It doesn't want to execute an expensive read/recv syscall to receive 11 bytes, if it needs at least 160 bytes. Change-Id: I807671bc6f2acaef740ce215b8d8abcb5dce2640
2020-07-20cosmetic: create HDLC specific sub-structure within e1_tsHarald Welte3-29/+31
This groups all HDLC-specific members together, in preparation of adding more fields for other modes. Change-Id: Ide0577c25836252862153b4f24da550bee013687
2020-07-15Add new E1DP_CMD_LINE_CONFIG for switching channelized/superchannelHarald Welte5-0/+122
This adds the related code to the server and client side of the CTL interface to switch a line between CHANNELIZED and SUPERCHANNEL. Change-Id: I765b5c3bc9e07b2353f8647e8260ff95df3727e6
2020-07-14actually implement the superchannel modeHarald Welte3-59/+172
In superchannel mode, all 31 TS are grouped together. There is no way to enable it yet, see next patch. Change-Id: Id340b1925471f427deb6cda7eb54e80dfc71faec
2020-07-14introduce concept of superchannel to data structuresHarald Welte4-6/+33
We treat the superchannel as an extra, separate timeslot. Initially I thought of simply re-using TS1, but keeping the superchannel separate ensures that it doesn't inherit any state (like half-sent HDLC frames) from another timeslot when we switch between the modes at runtime. Change-Id: I0aacf251e155de2bb6ad03ffc4181067b22f1c90
2020-07-12_e1_rx_hdlcfs: const-ify input buffer argumentHarald Welte1-1/+1
Change-Id: If772487124e26bafea23b451536b3b556d4c088c
2020-07-12Fix HDLC-FCS transmit sideHarald Welte1-1/+1
If we are not able to read more packets from the user application, the recv/read call will return 0 and set errno = EAGAIN. In this situation we cannot bail out but still ask the HDLC code to generate output (sequences of flag octets). If we fail to do that, we will transmit all-ones pattern instaed of all-flag octets. Change-Id: Id3bc76f1956138dcd9cb7b499f7251cd94af1329
2020-07-11Use SOCK_STREAM sockets for E1_TS_MODE_RAWHarald Welte2-7/+15
SEQPACKET is great for preserving message boundaries on signaling channels that use HDLC. However, its semantics, particularly regarding truncation, are sub-optimal for RAW slots containing raw user bitstreams (typically TRAU frames or PCM audio data). So let's use SOCK_STREAM for RAW and keep SEQPACKET for HDLCFCS. Closes: OS#4663 Change-Id: I1767ceaa5d2a008db0009b8027667a71c0fdc0f1
2020-07-11print E1DP Mode as string, not in numeric formatHarald Welte3-2/+3
Change-Id: I4d221a45bdd5d85b3ab6eaa35d67683b50bea21f
2020-07-11Detect truncated reads on SOCK_SEQPACKET socketsHarald Welte1-2/+16
Related: OS#4663 Change-Id: Ie143d3d56a68fda97cb9f5107a27f9beb043a2a4
2020-07-09usb.c: Fix error introducing Tx underflowsHarald Welte1-1/+1
In Change-Id I7d4d4ab39cb3e7e6a7eb8e738a367122eb3fbee2 I inroduced a bug that would cause e1_usb_xfer_out() to return four bytes too little, which in turn causes E1 Tx underflows to happen in the device firmware. Change-Id: I71675d4de781421286f0d1febedfdb1f7b523c38
2020-07-09add missing call to logging_vty_add_cmds() during startupHarald Welte1-0/+2
Otherwise, the usual logging related VTY commands are absent. Change-Id: I07038dfb204301bb1696ca312b2ec29671b86ae5
2020-07-09migrate to proper allocated USB Product IDHarald Welte1-1/+1
The 0xe1e1 was a neat hack in the early days, but now 0x6145 has been allocated within the Openmoko USB VendorID. The current device firmware already uses the new ProductID, let's change it here, too. Change-Id: Iea6087ce02c931c796d9c9cae89cdf5b5e0b28c5
2020-07-02Bump version: 0.1.0.1-8e1e → 0.1.10.1.1Harald Welte1-0/+6
Change-Id: I4544ad93856355b084a6ee8353438a3ec20097c0
2020-07-01Makefile.am: Don't put LIBS into CFLAGSHarald Welte1-1/+1
this was accidentially introduced in Change-Id I47b6e4efaad52e68e2b50a7993076f3706f86628 and causese build failures on some targets: libtool: link: gcc -Wall -Wno-unused-result -pthread -I/usr/include/ -I/usr/include/libusb-1.0 -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z -Wl,relro -o .libs/osmo-e1d-pipe e1d-ts-pipe.o /usr/lib/x86_64-linux-gnu/libosmovty.so /usr/lib/x86_64-linux-gnu/libosmousb.so -ltalloc /usr/lib/x86_64-linux-gnu/libosmocore.so ./.libs/libosmo-e1d.so -pthread /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libosmousb.so: undefined reference to `libusb_open' Change-Id: I09fc640847e2701ea13a0afa759e8cc0ed75cab9
2020-07-01Bump version: 0.0.1.2-7731 → 0.1.00.1.0Harald Welte1-0/+8
Change-Id: I1a73ef1c6db1e5ccec4fbe29a94a26bce4f5d1a9
2020-07-01debian: Remove dependency to libosmo-abis; remove explicit libosmocore versionHarald Welte1-3/+1
Change-Id: Icee48755142a90dac9843c9230a3b23551815fc1
2020-07-01debian: Fix packaging of libosmo-e1dHarald Welte1-0/+0
dpkg-shlibdeps: error: cannot find library libosmo-e1d.so.0 needed by debian/osmo-e1d/usr/bin/osmo-e1d (ELF format: 'elf32-i386' abi: '0101000300000000'; RPATH: '') Change-Id: Iaacd17aa69e56b21b925710d63b699c2e7ede12a
2020-07-01debian/control: Add missing dependency to libusb-1.0-0-devHarald Welte1-0/+1
Change-Id: I65c4693ea88a0417574258d4df99c6ec1755ee0d
2020-07-01add systemd service/unit0.0.1Harald Welte6-0/+43
Change-Id: I956cd9e7ff378a6372524175a1c83416be45610b
2020-07-01debian packagingHarald Welte11-0/+161
Change-Id: Idac376e92f95ab8beef506e9617227f1c7277838
2020-07-01proto*.[ch]: Don't refer to GPL if license is LGPLHarald Welte6-18/+12
while at it, also change from physical address to URL. Change-Id: I60a25f802a7b4535f7d47bb04b9f36194ea4e290
2020-06-30add git-version-gen to EXTRA_DISTHarald Welte1-0/+1
Change-Id: I874e7c323e0700c3282cb992dfaf1853bdc3a8c8
2020-06-30add example configurationsHarald Welte6-0/+41
Change-Id: I25c28f7a1eeb4deaebba3b2fd593cbbdceb1fa07
2020-06-30vty: Print actual driver name instead of FIXMEHarald Welte1-1/+2
Change-Id: I6f909cc493417f9e156672024f879a7294b4d816
2020-06-30Add osmo-e1d-pipe utilityHarald Welte3-0/+219
This adds the 'osmo-e1d-pipe' utlility program, which can be used as a command-line client to open a given E1 timeslot and connect it to stdin/stdout. This in turn allows to rediect file input/output via the shell. Change-Id: Ib9d55af786c87e15465b8e73493680b35afb5913
2020-06-29Add virtual pair of E1 interfacesHarald Welte6-9/+232
The idea is to generate a pair of virtual E1 interfaces (each with identical number of lines), where each line A:n is connected to line B:n of the pair and vice-versa. This allows to test E1 using applications back to back against each other, without any physical E1 circuits in between. Change-Id: If42c959556b17d543762546eb45dd69d25f715f2
2020-06-29actually set the back-pointer from timeslot to lineHarald Welte1-0/+1
'struct e1_ts' always had a back-pointer to the line it is part of, but apparently this was never initialized so far. Change-Id: I5e6c8189bf5aa4af26d6cd6c6d288a149ed7fa66
2020-06-29extend logging (log more noteworthy events)Harald Welte2-2/+16
Let's log some more events that might happen. Change-Id: I37fd290f0f0621fbf6e20e33fa709efc14df94c7
2020-06-29Always log context (interface/line/timeslot) when availableHarald Welte3-12/+21
We always want to know as much context as possible. Which exact timeslot on which line of which interface ha logged something? Change-Id: I3d8909b396928ed3c023b8ac47fa9ec72c99e681
2020-06-29close timeslot socket if read or write returns negativeHarald Welte1-4/+23
If the user application has closed the timeslot socket, we will get error returns from read/write calls, which we must use to clean up the daemon-side state for this timeslot. Change-Id: I2e3e5010f36e916b4c8908af91447b3d3661123f
2020-06-29proto.h: Share default socket path between client and daemonHarald Welte2-1/+3
This way clients and daemon don't have to be manually configured to use the same default socket path. Change-Id: Ibc5bc1bc59056ebaf0f6072de0ff08c2f3bb5457
2020-06-29add e1_line_destroy() / e1_intf_destroy() functionsHarald Welte2-0/+35
Change-Id: I5425d22288d7239063d621bddfe81e9cf21f1a5b
2020-06-29Export _e1d_ts_stop() function inside daemonHarald Welte2-3/+7
Change-Id: If3ceca05d4fdf1e33d926061f30fce6bfa8e0357
2020-06-29ctl.c: Fix off-by-one: FD=0 is a valid file descriptorHarald Welte1-1/+1
It is possible that fd=0 (stdin) is closed in a daemon scenario, and subsequently fd=0 is reused for other files/sockets. Change-Id: Id8279f04373e891009224bab34a4d1d886520fea
2020-06-29_e1_line_new(): Initialize timeslot fd to -1Harald Welte1-1/+3
Otherwise we might up ending up doing plenty of unintended close(0) in _e1d_ts_stop() Change-Id: I6b88a3ff7d650a0caa242e6ac60d7778564e237c
2020-06-29introduce notion of 'driver'Harald Welte3-0/+12
Change-Id: Ic168e25f2622b397bac2c133ec35f4a0a38f859b
2020-06-29change list ordering for list of interfaces / linesHarald Welte1-4/+4
By using llist_add_tail(), we add new elements at the end of the list, rather than inserting at front. Among other things, this has the added benefit that when the VTY prints information on lines, they are printed in numerically ascending orrder (0,1,2, ...) and not the reverse. Change-Id: I07a6ba706f855a29b4e33b1a6b008e0d2f11b6f3
2020-06-29VTY interface supportHarald Welte6-9/+238
Let's add a VTY interface on TCP port 4269. The purpose is - for now - not for configuration storage, but for state introspection. Change-Id: I47b6e4efaad52e68e2b50a7993076f3706f86628
2020-06-29libosmo-e1d: Add value_string for msg_type and modeHarald Welte2-0/+20
Change-Id: I72807f8eb2dcfaaba2819969c7aa62a4a1a79966
2020-06-29move from printf() debug output to libosmocore loggingHarald Welte4-8/+19
Change-Id: I6b652554c472c0fa7d180b533ef1ed4b92b49ab9