Skip to content

Commit

Permalink
Merge branch 'pr_74'
Browse files Browse the repository at this point in the history
Fix Windows 1809 communication issue

Tests:

1. Ubuntu 18.04:
  libnitrokey Python tests (v3.4.1-24-g57773ad, current master),

2. Nitrokey App:
  Test on Ubuntu 18.04,
  Test on Fedora 29,
  Test on Windows 10 1809 (App + EV + OpenSC: pkcs11-tool -L),
  Test on Windows 10 1803 (App + EV + OpenSC: pkcs11-tool -L),
  Test on macOSX 10.13.6.
  • Loading branch information
szszszsz committed Nov 23, 2018
2 parents 9f1c19f + 1fb9597 commit 905976e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 42 deletions.
58 changes: 20 additions & 38 deletions src/SOFTWARE_FRAMEWORK/DRIVERS/USBB/ENUM/DEVICE/usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,44 +61,26 @@
#define KEYBOARD_FEATURE_COUNT 64

const U8 usb_hid_report_descriptor_keyboard[USB_HID_REPORT_DESC_KEYBOARD] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
0xa1, 0x01, // COLLECTION (Application)
// 0x85, 0x01, // REPORT_ID (1)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x95, 0x05, // REPORT_COUNT (5)
0x75, 0x01, // REPORT_SIZE (1)
0x05, 0x08, // USAGE_PAGE (LEDs)
0x19, 0x01, // USAGE_MINIMUM (Num Lock)
0x29, 0x05, // USAGE_MAXIMUM (Kana)
0x91, 0x02, // OUTPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x03, // REPORT_SIZE (3)
0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
0x95, 0x06, // REPORT_COUNT (6)
0x75, 0x08, // REPORT_SIZE (8)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x65, // LOGICAL_MAXIMUM (101)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x09, 0x03, // USAGE (Keyboard ErrorUndefine)
0x75, 0x08, // REPORT_SIZE (8)
0x95, KEYBOARD_FEATURE_COUNT, // REPORT_COUNT (64)
0xB1, 0x02, // FEATURE (Data,Var,Abs)

0xc0, // END_COLLECTION
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor-Defined)
0x09, 0x01, // USAGE (Vendor)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // USAGE (Input Report Data)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x40, // REPORT_COUNT (64)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x09, 0x02, // USAGE(Output Report Data)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x40, // REPORT_COUNT (64)
0x91, 0x02, // OUTPUT (Data,Var,Abs)
0x09, 0x02, // USAGE (Keyboard ErrorUndefine)
0x75, 0x08, // REPORT_SIZE (8)
0x95, KEYBOARD_FEATURE_COUNT, // REPORT_COUNT (64)
0xB1, 0x02, // FEATURE (Data,Var,Abs) */
0xc0, // END_COLLECTION
};

// usb_user_device_descriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@



#define RELEASE_NUMBER 0x0100
#define RELEASE_NUMBER 0x0101
#define MAN_INDEX 0x01
#define PROD_INDEX 0x02
#define SN_INDEX 0x03
Expand Down Expand Up @@ -262,7 +262,7 @@
#define KB_NB_ENDPOINT 1 // ! The number of endpoints this interface has
#define KB_INTERFACE_CLASS HID_CLASS // ! HID Class
#define KB_INTERFACE_SUB_CLASS NO_SUBCLASS // !
#define KB_INTERFACE_PROTOCOL KEYBOARD_PROTOCOL // !
#define KB_INTERFACE_PROTOCOL GENERIC_PROTOCOL // !
#define KB_INTERFACE_INDEX 0

// Keyboard HID descriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extern const S_usb_product_string_descriptor usb_user_product_string_descriptor;
extern const S_usb_serial_number usb_user_serial_number;
extern const S_usb_language_id usb_user_language_id;

#define USB_HID_REPORT_DESC_KEYBOARD 71
#define USB_HID_REPORT_DESC_KEYBOARD 42
extern const U8 usb_hid_report_descriptor_keyboard[USB_HID_REPORT_DESC_KEYBOARD];

// ! @defgroup specific_request USB device specific requests
Expand Down
1 change: 1 addition & 0 deletions src/SOFTWARE_FRAMEWORK/SERVICES/USB/usb_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
// ! @{
#define HID_CLASS 0x03
#define BOOT_SUBCLASS 0x01
#define GENERIC_PROTOCOL 0x00
#define KEYBOARD_PROTOCOL 0x01
#define MOUSE_PROTOCOL 0x02
// ! @}
Expand Down
2 changes: 1 addition & 1 deletion src/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// #include "portmacro.h" Don't use is here, system crashes

#define VERSION_MAJOR 0 // 255 = debug version
#define VERSION_MINOR 52 // 0 = development
#define VERSION_MINOR 53 // 0 = development

#define INTERNAL_VERSION_NR 0

Expand Down

0 comments on commit 905976e

Please sign in to comment.