Several issues :
- The reported length includes the CRC so it's minus 6 and
not minus 4. (2 for CRC, 4 for header)
- Cast length to int to make it signed so the minus works
- If the packet is empty, this would be negative (no header),
underflow, and then try to submit a giant number of frames
to the E1 hardware
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ib754e460290fe2e1551a0090e30a51846131d07d
Avoid hardcoded ids everywhere. This also prepares a bit for
multi-port support in the future.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I89c86ac6afd52dd19e3383b38c3311276a090d50
They might be used somewhere else ... just don't handle them, but
let someone else potentially do it.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Ie1bce4565d14d6635d4a32c2a08f64728132a75e
This way they can be used in other parts of the code more easily.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I565d9a43bc26b99bc385b46522e7da6a207b2412
It was pointed out that this should be 0 since we trigger
detach ourselves, we don't need a bus reset.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Id7051ce00863c03e3498f4bab0a7124938e197c0
Some of it was written before some of the helpers were provided
by the no2usb code and was never update. So instead of manually
setting up a bunch of stuff we make proper use of some of the provided
helpers.
Side effects:
- We recall e1_init(0,0) when enabling which happens to work
around a bug ... proper fix coming later.
- The 'dual BD' config for EP 0x81 and 0x83 is fixed. It didn't
matter before since we overwrote it anyway, but now it's used
and so needs to be correct.
- The descriptors don't have the isoc endpoints at all in the
"OFF" alt setting.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I33c92896acfba023abe0152d63dff3afe43b53cd
Scan over every odd E1 frame TS0 byte to check if the A-bit is set,
indicating a remote alarm. If so, set yellow LED and report via the
error flags communicated to the host by USB interrupt transfer.
Change-Id: Ic4f57cf79bd32cf75f81ef3073cb8d4a2d1857d8
Those are actually disabled right now, but since the submodule got
updated and the protocol struct/defines changed, this updates them
anyway so you can uncommend/enable them without causing a build
failure
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I1895702eac9c6c392f24327b12f9ba3651e3249a
Not much change in e1, just a typo fix that just triggered a warning.
In usb the only relevant change is a fix in the stack code that caused
GET_INTERFACE to fail for interfaces without alt-settings
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Idfe712f7a2173e5c5f9552f35136f1d732098139
We should use service-aliases and not the primary host name, as
that makes migration between machines hard.
Change-Id: Idd49f27c9b08c6cfd077f85276a3dedc4cf117ef
In Change-Id I319edb76dd74be6904395692ab1599fb8f1f9065 we had
changed the file naming of the firmware binaries from the somewhat
general fw_app*.bin format to icE1usb-fw*.bin, but the manual
was not updated accordingly.
Change-Id: I0cc2cd3f3f8f166b9409463fbd4b01e344cfe399
Prevent the following error (generating manuals seemed to work fine
regardless):
realpath: missing operand
Try 'realpath --help' for more information.
make: Nothing to be done for 'all'.
Change-Id: I72a62b86cba0dfd710f7e1c4c01a3c10710128d8
Instead of only relying on pkg-config, support the environment variable
and fallback path like in other Osmocom repositories too. The same
script is used in other Osmocom repositories where manuals are built
without autotools.
Related: OS#4912
Change-Id: Iecfbfc2a7588c316642aa37be637cf3c02f76ac4
AIS is an all-1 bit-pattern which is used by intermediate equipment
to indicate that the link somewhere upstream is lost.
Change-Id: Icc5a16ee44ecebe802c4cca0b6cc763a88b6cc05
So far we started on altsetting 0->1 transition, but we didn't stop
on the inverse 1->0 which typically happens when the host software
(osmo-e1d) stops.
Closes: OS#4676
Change-Id: I8e4817f68d8893ab2dc98fe93ce9a673e209ca63
This introduces a number of vendor-specific control requests for
configuration of the icE1usb from the host software.
Closes: OS#4675
Change-Id: I9d28566ba21a2a78def5e4a0ba07ecbc4a583aa9
Those clear bits are only set once at start-up and then later
explicitly. They shouldn't be stored with the user configuration
in state variables.
Change-Id: If38e86aefea7f1be4e1ff5a88860f8be593eeedc
* L2, L3 now 0805
* R6, R7 now 0402
* IC4 now ASEMB-12.000MHZ-LC-T
* RoHS state enabled again in scraper, not yet used in BOM
Change-Id: I4f1a82476ca84552efd71a47231e8b6ac02a3358
Whenever Rx is aligned, the green LED is permanently on.
Whenever Rx is not aligned, the green LED is blinking.
What's missing is to check for E1 clock ticks and turn the LED off
completely if there are no clock ticks.
Change-Id: I42d53544858dbbbae5206d9a62b08672966c9ebf
This should enable the host to detect discontinuities, and also know
when a multiframe starts.
Related: OS#4674
Change-Id: Ie0688647c56ebfc2e08de44f8ec569e1c2cd6a28
The position indicates where we are in terms of frame and multiframe.
The related code was ported over from e1-tracer.
Related: OS#4674
Change-Id: I9e59d86a2e8f4e85ca84c592438ad79966b49448
A value of '1' means _no_ CRC4 error observed. We got that right
in the receive side, but not in the transmit side so far
Change-Id: I5ef9ef3b9781da2f53f54253d31cdbf81957ea67
When encoding the CRC bit for Frame number 0 and 8 in the multiframe,
we must first move the CRC4 into those of the last SMF.
Change-Id: I088741fc4528f33b3b989ada0e21957456deedb6
From ITU-T G.704 Table 5A Note 4:
> Bits S a4 to S a8 (where these are not used) should be set to 1 on
> links crossing an international border.
Change-Id: Id55599a7152a90f85076de810db2a03ac6f3aac1
otherwise we'll get:
make: Entering directory '/build/doc/manuals'
Package osmo-gsm-manuals was not found in the pkg-config search path.
Perhaps you should add the directory containing `osmo-gsm-manuals.pc'
to the PKG_CONFIG_PATH environment variable
No package 'osmo-gsm-manuals' found
Change-Id: I9f3d6e74be9e0fe31a2ee7aad9869ed7568ff6dd
This resembles what we do for other firmware targets, such as simtrace2,
osmo-ccid-firmware, etc.
As we have multiple different firmware, hardware, gateware projects in
this repository, and they each may have separate tags, we now require
that there are project specific tags. So for example, tags with a
prefix of icE1usb-fw for the firmware versions.
symlinks for easy use by scripts etc. are generated, always pointing to
the last-built versioned filename.
Change-Id: Ia308587e36a79c27fdb285e369a9c921ee65995f