Commit Graph

7 Commits

Author SHA1 Message Date
Harald Welte
349c54bc3b req_ctx: LF -> CR+LF 2016-02-29 21:35:24 +01:00
Harald Welte
ebbb645f4b req_ctx: Fix allocation (allocate 1 block, not all) and call _init() 2016-02-29 17:57:51 +01:00
Harald Welte
f672e9d63a req_ctx: Convert from hand-coded linked lists to linuxlist.h
This also removes the actual queuing code from req_ctx, and
leaves this to the caller.  Only tw out of the existing states actually
required the ordering requirement enforced by the qeue, and in the
future we will need to have per-endpoint queues anyway.  Both means it
is better to manage queues outside the req_ctx, and leve that as a pure
memory allocator.
2016-02-29 14:10:22 +01:00
Harald Welte
4dc3db7beb req_ctx: Use only 10 small buffers, and no large ones 2016-02-28 19:32:01 +01:00
Harald Welte
29f8f0e5d4 improvements in req_ctx debugging 2016-02-28 12:44:30 +01:00
Harald Welte
836990d244 req_ctx: Fix compiler warnings 2015-11-14 17:38:04 +01:00
Harald Welte
9d3e38242c initial commit of more code towards card emulation
I couldn't help but to spend my sunday on working towards card
emulation, including
* various state machines in the target about ISO7816 states
* tc_etu timer import from simtrace1
* req_ctx import from simtrace1 (needs renaming and simplifiation)
* USB protocol description as cardemu_prot.h
* some host-based testing code to test the state machines

The code seems to work fine throughout card reset, sending ATR and
receiving the TPDU header of the first APDU, up to the point where it
marks the TPDU header as to-be-transmitted over th bulk-in endpoint.

Sending the ATR must be done inside the firmware for timing
requirements.

From that point onwards, the host needs to respond at the very least
with a procedure byte, and some indication whether or not the card
emulator should continue to transmit data (card->reader), or receive
data (reader->card).

The code is intentionally not hooked up yet with the USB logic nor with
the UART.  I want host-based testing completed before doing that.
2015-11-09 00:50:54 +01:00