Commit graph

100 commits

Author SHA1 Message Date
jaseg
70d8dcb6f6 Confirmed pairing works 2018-11-12 12:48:47 +09:00
jaseg
2f4f3e13aa Handshake working with new abstractions 2018-11-12 11:59:11 +09:00
jaseg
42d4bebde7 Basic input demo working on qubes
This commit was typed with it ^_^
2018-11-08 21:53:25 +09:00
jaseg
9252eac840 Add proof-of-concept packet loss recovery through nonce search 2018-11-08 20:27:25 +09:00
jaseg
21be46a0b5 HID report transmission partially works now
partially i.e. if you attach the keyboard before the noise handshake. I
suspect some memory corruption somewhere.
2018-11-08 19:53:11 +09:00
jaseg
e4e2318804 Break out noise.c and packet_interface.c 2018-11-08 19:01:10 +09:00
jaseg
333d94bf9f Noise handshake working 2018-11-08 16:35:31 +09:00
jaseg
050d49a56b Noise integration compiles 2018-11-08 15:41:46 +09:00
jaseg
8ee5f4ce6a Hacked together a packetizing mode for hex serial utility 2018-11-06 21:29:40 +09:00
jaseg
51e08c3c89 Add nice hexdumpy serial utility 2018-11-06 21:17:29 +09:00
jaseg
985710d517 COBS/binary suport added, abstraction improved 2018-11-06 17:18:34 +09:00
jaseg
09893c47d1 Proper print abstraction and ring buffer works 2018-11-06 14:21:10 +09:00
jaseg
5009a15280 DMA-supported LOG_PRINTF works 2018-11-06 09:15:37 +09:00
jaseg
5b4c295d00 Some UART logging work 2018-11-05 10:02:51 +09:00
jaseg
7c8490211b Make demo work with STM32F4 board from aliexpress for SecureHID project 2018-11-01 16:39:56 +09:00
Amir Hammad
7e5d99e18f Merge pull request #6 from amirhammad/usbh_config
Fix missing usbh_config.h in the cmake project
2016-09-11 20:18:27 +02:00
Amir Hammad
d1689b4701 Fix missing usbh_config.h in the cmake project
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 20:14:51 +02:00
Amir Hammad
1a9a954fe6 Merge pull request #5 from amirhammad/fix-g++-compiler
Fix CXX compiler
2016-09-11 20:13:23 +02:00
Amir Hammad
aa93d64f9f Fix CXX compiler
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 20:09:01 +02:00
Amir Hammad
5e714edfa6 Merge pull request #4 from amirhammad/core-refactor
Major rework
2016-09-11 13:40:59 +02:00
Amir Hammad
b7167bf2af lld: add mask with epdir
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
4415d960c3 use default case instead of handling other packet statuses explicitely
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
bacf8ecdbb xbox: remove warning about unused variable
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
2c81d1a3e6 drivers: remove redundant forward declaration of usbh_dev_driver_t
It is already declared in usbh_core.h

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
b055665fb0 lld: remove not used error_count field in channel struct
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
d7f23c7a8f lld: simplify stm32f4_usbh_port_channel_setup
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
8946cb522b lld: rework low level driver initialization
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
decb2d817d use forward declaration for usbh_dev_driver_t
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:48 +02:00
Amir Hammad
e635674ab0 Doc: set HAVE_DOT property
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
1d1b697bc6 use NULL instead of 0 for assigning null pointer
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
bc8dd60b2e midi: rename prefix of static functions
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
63446f99fc lld: don't enable channel on write nack, return EAGAIN instead
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
b895498df9 hub: use common code to remove device
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
c9869466dd remove detection of hang
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
fe54644237 HUB: make use of control wrappers + use enums
Until now, hardcoded numbers were used as states.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
66b801b01e hid: use control wrapper to simplify hid report writes
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
2c23090d49 core: use new control wrapper to set configuration to device
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
7c4ae8d7aa core: use new control wrapper to read device descriptor
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
d4c74c55c3 core: use new control wrapper to set device's address
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
c4e6f3b55b core: add helper state machine for control read/write
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
6d9ee8e9a6 add DISABLE_LOW_LEVEL ifdef in hub device driver
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
58fec7a17c Drop need for the set configuration request in dev drivers
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
a75535e52b core: Simplify device removes
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:47 +02:00
Amir Hammad
1d08641a15 Added travis.yml
and badge

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:31:34 +02:00
Amir Hammad
3d68ea2807 make hid_mouse driver generic HID driver
+ keyboard support
+ SET_REPORT commands - usually leds on keyboards (WIP)

- missing parsing of HID report descriptor

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:30:13 +02:00
Amir Hammad
ed70a1efa3 Switch to cmake build system
* use tinyprintf
* ability to configure project via ccmake

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-11 13:30:10 +02:00
Amir Hammad
28ccd32608 core: adjust search for the device driver
in finding compatibility there are 3 steps how to find
out whether the provided device driver supports currently
inserted device.

1. compare fields in the driver info structure
If there is a match (all CHECK_PARTIAL_COMPATIBILITY() macros return true),
we proceed to step 2.
If all device drivers are searched, but none is compatible ->
that means no device driver is available for currently inserted device.

2. try to call driver's init function.
If it return non-null pointer to data we may proceed to the step 3.
Otherwise, we continue in the loop handling step 1.

3. call analyze descriptor for all descriptors. When it returns true,
it means success and that the driver supports current device. From now on
poll function is allowed to be called.
If all descriptors were provided to the analyze_descriptor method and
it still returns false, it means device driver is not initialized and
should not be used with this device.

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-08 07:54:06 +02:00
Amir Hammad
4aa69b4eaf make usbh_packet->data of union type
out: const void *
in: void *

Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-08 07:54:06 +02:00
Amir Hammad
e0fbb799bd usbh_core refactor
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-08 07:54:06 +02:00
Amir Hammad
3493c1c087 fix bmRequestType field - use of defines
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
2016-09-01 10:36:36 +02:00