Add api call osmo_st2_cardem_request_config2(struct cardemu_usb_msg_config *)
which contains a full cardemu_usb_msg_config.
Related: SYS#6946
Change-Id: Iacde63e667472a85a5f18cb4ca99dcfa1a84dd59
At the moment only APDUs are logged to GSMTAP. It is not uncommon that a
card is resetted by the UE multiple times during normal operation. When
the trace lacks the reset events (ATR) it becomes difficult to follow in
which state the card actually is. Let't mark reset events by sending the
ATR via GSMTAP (like simtrace2_sniff already does it)
Related: OS#6094
Change-Id: I6b4d82b6ee369c95eeca8f7d59478452395fbe54
osmo_apdu_segment_in() may return a negative number on receipt of
"unknown APDU case", and that would crash simtrace2-cardem-pcsc:
msgb(0x55d2cf7aa8a0): Not enough tailroom msgb_put
(allocated 920, head at 0, len 7, tailroom 1017 < want tailroom 65534)
backtrace() returned 19 addresses
Whenever osmo_apdu_segment_in() fails to recognize an APDU, the
communication is broken, because we don't know if we should continue
transmitting or receiving. Only a successful return value by would
allow us to know this. Do not crash, exit() gracefully.
Change-Id: I9e97b955a28ec886a429d744f9316e7e71be4481
Related: OS#5600
Previously, only simtrace2-sniff generated GSMTAP protocol traces.
Let's add the same functionality to simtrace2-cardem-pcsc.
Change-Id: Iba6adf41b480d127bf11ee361c66d80fe8296313
Closes: OS#5494
Sometimes I get LIBUSB_TRANSFER_ERROR particularly when the USB bus
is very busy. We shouldn't terminate the program, but simply resubmit
it. That's what we have multiple transfers for...
Change-Id: I77d7bc636c21171fcff7e70e87c0109cbaee9b51
We initialize a local variable to -1, and if the user specifies
no address from the command line, we use this in the interface match
struct, which uses a uint8_t. This means 255 ends up in there, and
as a result no usb interface ever matches unless the user explicitly
specifies the -A command line argument.
With this patch any absent -A argument will result in ifm.addr == 0,
which means "don't match on address", and which is what we want here.
Change-Id: Iffb5fa406ddef00c7c15570ffca2c109b98d7a2d
In some readers (at least CardMan 3121), the simtrace2-cardem firmware
claims there are power-up sequences where RESET is released before VCC
becomes active. Let's detect such spec-incompliant power-up sequences
and use them to trigger a cold reset of the card.
Change-Id: I682ac3d0c2b98749a6ed44f9a73e4b39354a4284
Closes: OS#5421
* drop log statements that are already in libosmo-simtrace2
* don't printf directly, but go via LOGCI
* make LOGCI use libosmocore logging
* configure libosmocore logging in a 'convenient' way
Change-Id: I6fa0da966e6d8e723c187404c17e90cfb3f3dd9f
This avoids related ASSERTs or error messages in case any of the
libosmocore / libosmousb API functions internally tries to log
something.
Change-Id: I611c435516856c5c8928d7810fd9a9b831adc199
This can lead to some fields not properly zero-initialized, fooling
our matching code into the application having requested certain
fields to match ('0' is usually assumed to be unspecified).
Change-Id: I304d55b584e37d9dccb75b24057bb682f799beb2
Add a new command to request that the simtrace2 firmware manipulate the
card detect signal, causing the downstream cellular modem to believe
that the SIM card has been inserted or removed, respectfully.
Change-Id: I8c79eb29379a789d9d0d21495e30d66ddbdfb022
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.
Change-Id: Ie0a3b2273383adbb3303faffd6ff96be7f4cae99
Apply various improvements from Martin Hauke, thanks!
* Put sover into a variable
* Sync BuildRequires with configure.ac
* Update libosmo-simtrace2 summary
* Use %make_build instead of make %{?_smp_mflags}
Change-Id: I35ce3865702f72365b38b0eaa8b28f332dabcd1f
Adjust the soname in the rpm recipe too, to fix:
error: File not found: /home/abuild/rpmbuild/BUILDROOT/simtrace2-0.8.0.202112100026-1.1.x86_64/usr/lib64/libosmo-simtrace2.so.0*
Change-Id: I748f44409ac736abbd5c18e31ae02d025dee2c77
This avoids
ERROR: osmo_log_info == NULL! You must call log_init() before using logging in log_check_level()
Change-Id: Id355ef33e10164f8e8eb40c2fd0b606bc8e9b6f7
This code already calls osmo_libusb_init further above in the top
of the main() function, so there's no use of calling libusb_init()
directly in the same function lines below.
Change-Id: I2e0c7446aaa644c5aae1059ce91ff9f729903cbc
We use other osmo_libusb_* functions later in the code, so it is best
to initialize the library via libosmousb, and not directly.
Change-Id: I2fd981935e1420e529f5dd8a98edd347c317284c
There is no obvious reason why the st should be stuck in cardem mode
without a working running util on the host side since there is no state
that is being kept, so switch back to using the local sim upon reset.
Change-Id: Ib622af0027d40b4e8afbb0fa0d3689f0dbfcac92
This adds support for the new ngff_cardem board, a board that
basically combines a ngff breakout board with a built-in SIMtrace2.
Cardem works, but depending on the modem it might need a adjusted ATR to
ensure a lower baud rate is used by the modem, high rates might lead
to weird power cycling of the card after a few transfers.
Trace was also tested and appears to work as expected.
Change-Id: Ia96124fbe8a752c98e7fd4096d542a3b2b9bc255
The simtrace-tool is a command line tool which can be used to e.g.
manually request a modem reset.
Change-Id: I3a8896ac2b3caef7590b51118359e5caed820a40
we shouldn't use a local copy of the device id list, which is already
outdated now that OCTSIMTEST support has been added to libosmo-st2
Change-Id: I2231006b94c33fe3b28ce37b0d54c67206751058
When the cardem detects a reset from the phone/modem, pass this on
to the actual card via the PC/SC reader. This is important to
reset the card state whenever requested by the stack/driver on the
phone/modem.
Change-Id: I7056476c5f81e8aa8f550afb86bf2380d1497ebb
Depends: libosmocore 20199da02d37a6d284915a27ec12641e79b8781c
Before this patch, we would always use either a hard-coded default
ATR from the source code, or we would use one that the user specified
on the command line.
The more sane default is to pass-through the real ATR of the card.
Change-Id: I75bf618a6b0d983727de4c2f19b4b48ec3e12af8
Closes: OS#5107
Requires: libosmocore.git 22117a7164012d6d88fc202cd63df79c6068484d
There's some code that wasnts to goto within the while loop, and there's
some other code that wants to goto after the while loop. Don't jump
from outside the while loop into the while loop.
Change-Id: Ic2a94ad034dd259f15712687443b569f0d18ff3f
* support Interrupt STATUS notifications
* use osmocom libusb abstraction
* use asynchronous URBs for interrupt + bulk
Change-Id: Ib04798572295f25477719124530b6584780c5b75
Use .tarball-version from the topdir, because it only gets written there
when generating the OBS package. Remove the duplicate git-version-gen
script and use the one from the topdir to generate a version string if
building from the git tree.
Related: OS#4413
Change-Id: I4b197a218ab44632ff182ffbd72e15c2b20db341
This renaming is to avoid any confusion with the osmo-remsim
project, living in its separate git repository.
The simtrace2-cardem-pcsc doesn't feature any 'remote' part. Rather,
it emulates the SIM card interface towards the device/phone/modem,
and forwards it to a local PC/SC card reader.
Change-Id: Ic15f0a89964a72fe3ab7a5145a073720f6207e24
The UDP based forwarding really only ever was a quick hack to
demonstrate the capabilities.
Meanwhile, we've had the proper osmo-remsim project implemented,
which provides a much more reliable and comprehensive way of
managing SIM card emulation devices (SIMtrace2, sysmoQMOD, ...)
and collection of card readers (sysmoOCTSIM or any other PC/SC
supported readers).
Hence, remove the "UDP forwarding part.
Change-Id: Ia4b9447b95872b6e0dda6dca644f1ed4a87355a0