Commit Graph

51 Commits

Author SHA1 Message Date
Harald Welte
6d44c1fdd3 USB: Add manufacturer name string descriptor
... and use indexed array initializers for more safety/clarity
2015-11-07 19:01:30 +01:00
Harald Welte
8a5b580a72 CCID usb descriptor: We support 3V only, not 5V. 2015-11-07 18:53:43 +01:00
Harald Welte
ec4fe2358b Mark more local functions as static 2015-11-07 18:48:26 +01:00
Harald Welte
beb729391b USB descriptors: call it SIMtrace 2 and add spaces to strings 2015-11-07 18:35:41 +01:00
Harald Welte
8d6a5d8f89 move USBDDriverCallbacks_ConfigurationChanged() to main.c
This alows us to mark simtrace_config as static variable and keep all
code related to this variable local to main.c
2015-11-07 18:27:05 +01:00
Harald Welte
d4c1421c91 conf_func: Mark const and static.
const saves RAM, and static avoids namespace pollution.
2015-11-07 18:25:46 +01:00
Harald Welte
fefd571701 conf_func: Use named struct initializers and named array subscripts
As part of this, we also do away with the '-1' based array subscripts
2015-11-07 18:25:19 +01:00
Harald Welte
15d72cc631 add some comments on the conf_func members 2015-11-07 18:19:06 +01:00
Christina Quast
235409aa2e simtrace.h: Increased host to SIMtrace buf size
The host got stuck sometimes when large data frames had to be send
from the host program to SIMtrace. The printouts would just stop
if many large packets were received from the SIM card and needed
to be transferred to the mobile phone.
Increasing the buffer length removed the problem.
2015-06-24 16:05:39 +02:00
Christina Quast
3d8c093cb2 main: Increase timeout for USB configured state
When the timeout was too small, the main function would infinitely
loop around, restarting the board and waiting for the USB interface
to get configured. But since configuration seems to take more than
one second, it rarely succeeded.
Increasing the timeout makes the USB configuration finish in the
first try.
2015-06-24 16:02:52 +02:00
Christina Quast
bd5b8bd7f7 usb.c: Corrected grammatical mistake 2015-05-14 17:25:41 +02:00
Christina Quast
96025dbb69 phone.c: removed comments
Removed comment describing the typical first few packets between the
SIM card and phone I used for development and testing:
SuperSIM, Motorola C123
2015-05-08 17:31:14 +02:00
Christina Quast
049772e688 phone.c: Removed comment about wait time extension
Wait time extension commands are not implemented yet.
They are a nice-to-have for the future, since they would enable
the board to work with phones that expect a higher frequency.

With a wait time extension request towards the phone, SIMtrace could
signal the phone to wait for a longer time period while SIMtrace is
still waiting for a response from the SIM card.
2015-05-08 17:19:16 +02:00
Christina Quast
3735039b59 firmware, host: Changed vendor and product id
The code used a vendor and product id taken from Atmel example code.
Now it is changed to the vendor and product id, which was also previously
used in the original SIMtrace code.
2015-05-08 16:47:29 +02:00
Christina Quast
14f6399c03 tc_etu.c: Removed, because was never used
Since the host side does the parsing of the packets, (not the firmware,
as it was in the old simtrace version), we do not need to check for expired
max waiting time.
Instead, every byte received from the phone is filled into a ring buffer.
As soon as the USB endpoint to the host is not busy anymore, it is sent
to the host over the respective USB endpoint.
2015-05-08 16:45:28 +02:00
Christina Quast
5f83861b17 mitm.c: Removed unused commented out code 2015-05-08 16:45:28 +02:00
Christina Quast
560ade3239 main.c: Removed TC_Start/_Stop (was commented out)
Removed FIXME comment
Removed TC_Start, TC_Stop function call, which was commented out anyways.
2015-05-08 16:45:28 +02:00
Christina Quast
1b65ad0329 sniffer.c: Removed unused PR macro defnition 2015-05-08 16:45:28 +02:00
Christina Quast
0bf65dc0b6 usb.c: Removed FIXME comment
MITM does not support two interface settings.
The comment mixed up interface configurations and alternative
interface settings.
2015-05-08 16:45:28 +02:00
Christina Quast
bfd7354c86 usb.c: removed comment, named phone interface of MITM conf
String descriptor #0 always is the language descriptor.

The second USB interface is in the MITM configuration is
the interface to the phone.
2015-05-08 16:00:51 +02:00
Christina Quast
4a30a3700b Remove PR define, replace with TRACE_DEBUG
The define PR was introduced to switch quickly between TRACE levels
for specific debug print messages.

Now, it all became debug output, since it is not needed in normal
operation.
2015-05-08 15:34:45 +02:00
Christina Quast
9dbf1c90ac main.c: Set green LED when USB is configured 2015-05-06 08:46:32 +02:00
Christina Quast
cb646bc729 command to change fidi send by host 2015-05-03 14:21:26 +02:00
Christina Quast
be235275fa Added not working PTS parsing to host communication 2015-05-02 17:56:32 +02:00
Christina Quast
7a7f98c9f2 ringbuf.c: rbuf peek function 2015-05-02 17:53:13 +02:00
Christina Quast
bf12a6f79e iso7816_uart: starting point for pts parsing 2015-05-02 13:22:07 +02:00
Christina Quast
4bec8d8e26 host_communication.c: printf becomes TRACE_DEBUG 2015-04-21 23:03:59 +02:00
Christina Quast
e4cbfe6f47 Moved ISR_PhoneRST into iso code file and simtrace header 2015-04-20 13:07:28 +02:00
Christina Quast
3d5e3ab612 simtrace_iso7816.c: Remove unused _ISO7816_Init 2015-04-20 12:20:50 +02:00
Christina Quast
4b8149363a iso7816_4.c: CLK div differs for Master and Slave
Attention: Each init function has to enable and disable receiver and
transmitter on its own!
2015-04-17 18:50:25 +02:00
Christina Quast
ad215aaf66 ccid.c: removed SMARTCARD_CONNECT_PIN check (always defined) 2015-04-16 15:00:07 +02:00
Christina Quast
2379ac8e32 main.c: Removed double declaration of var i 2015-04-16 11:09:37 +02:00
Christina Quast
ec9c09e9b9 Moved global Usart state into usart struct 2015-04-16 10:45:39 +02:00
Christina Quast
911bf26a55 sniffer.c: Enable/disable interrupts in init/exit function 2015-04-13 22:39:11 +02:00
Christina Quast
d52201f6db phone.c: Enable/disable interrupts on init/exit 2015-04-13 22:38:05 +02:00
Christina Quast
dcce4c3244 phone.c: Callback routine for reenabling RST interrupt 2015-04-13 22:20:12 +02:00
Christina Quast
de68867402 main.c: Reset board if USB not configured 2015-04-12 15:20:57 +02:00
Christina Quast
b595e7cb53 Merge branch 'new_iso_init' (sniffer not working)
Conflicts:
	firmware/src_simtrace/phone.c
	firmware/src_simtrace/simtrace.h
2015-04-12 13:31:01 +02:00
Christina Quast
2b8a18bf3a Sniffer with ringbuf, works SOMETIMES
* Sniffer uses phone endpoints for communication and the ringbuffer
    routines the phone communication uses
* Most times the Usart1 interrupt is not triggered, and therefore
    no values are recorded
2015-04-12 09:31:36 +02:00
Christina Quast
5c6a299c71 phone.c: Sniffer bus config make switch 2015-04-11 20:03:14 +02:00
Christina Quast
611bea8b4b tc_etu: Corrected compiler warning 2015-04-11 18:15:51 +02:00
Christina Quast
4db82e092f ringbuffer implementation 2015-04-11 18:15:27 +02:00
Christina Quast
2ee3ec73f4 tc_etu.c: Fixed PIN initialisation compiler waring 2015-04-11 12:27:46 +02:00
Christina Quast
542f9183bb basic ringbuffer implementation 2015-04-11 09:31:15 +02:00
Christina Quast
87ddfa8c23 phone.c: Bug fix: USB err format string interchanged 2015-04-11 08:44:40 +02:00
Christina Quast
e24b9ace89 ISO7816_Init: Initialized with USART
* ISO7816_Init: Takes Usart_info and CLK_SLAVE/CLK_MASTER as param
* ISO7816_SendChar, ISO7816_GetChar: Usart_info is passed
* ISO7816_Set_Reset_Pin function for CCID part
* iso7816_4.c: BOARD_ISO7816_BASE_USART replaced by USART_SIM
* Redundant _ISO7816_Init, _ISO7816_SendChar, _ISO7816_GetChar
    functions removed
* All simtrace modes use iso7816_4.c functions instead of redefined
    _ISO7816_xxx functions
2015-04-10 17:44:49 +02:00
Christina Quast
3eab56e079 ISO7816_Init with more parameters, slave/master clock 2015-04-10 15:38:49 +02:00
Christina Quast
95d6616ba1 Split init into configure and init
* Implemented configure, init, exit functions:
    When a configuration is changed, interrupts for reset pins
    should be disabled

* Moved variables shared between code files to simtrace.h
2015-04-09 22:38:47 +02:00
Christina Quast
bf464ae566 Moved ccid related files to bord related folders 2015-04-09 19:47:45 +02:00
Christina Quast
6b02775638 phone.c: Check return values of USB_Write 2015-04-09 19:47:27 +02:00