From 43bac408c63f0d48affc9beacc689b5fa19c79fa Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Fri, 1 Dec 2023 10:55:19 +0800 Subject: [PATCH] fl16: Remove MSOS2 descriptor Signed-off-by: Daniel Schaefer --- tmk_core/protocol/chibios/usb_main.c | 4 ++++ tmk_core/protocol/usb_descriptor.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 746a5129e0..674f4c313e 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -74,6 +74,7 @@ static void keyboard_idle_timer_cb(struct ch_virtual_timer *, void *arg); report_keyboard_t keyboard_report_sent = {{0}}; report_mouse_t mouse_report_sent = {0}; +#if defined(MSOS2_CAP) static uint8_t msos_descriptor_set[] __attribute__((aligned(4))) = { // // Microsoft OS 2.0 Descriptor Set Header @@ -105,6 +106,7 @@ static uint8_t msos_descriptor_set[] __attribute__((aligned(4))) = { 0x04, 0x00, // wPropertyDataLength – 4 bytes 0x00, 0x00, 0x00, 0x00 // PropertyData - 0x00000001 }; +#endif union { uint8_t report_id; @@ -767,6 +769,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) { return TRUE; } +#if defined(MSOS2_CAP) /* Handle Vendor Specific Request */ //if (((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_VENDOR) && ((usbp->setup[0] & USB_RTYPE_RECIPIENT_MASK) == USB_RTYPE_RECIPIENT_DEVICE)) { // Type=Vendor, Direction=Host2Dev, Recipient=Device @@ -792,6 +795,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) { return TRUE; } //dprint("zoid: After\n"); +#endif for (int i = 0; i < NUM_USB_DRIVERS; i++) { if (drivers.array[i].config.int_in) { diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 262787b792..51f5f228fd 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -493,8 +493,13 @@ const USB_Descriptor_Bos_t PROGMEM BosDescriptor = { }, // 3 Bytes (=> 5 Bytes) // Value must be header + each cap +#if defined(MSOS2_CAP) .TotalLength = 0x0028, .NumDeviceCaps = 0x02, +#else + .TotalLength = 0x000C, + .NumDeviceCaps = 0x01, +#endif .Usb20ExtensionDevCap = { // 2 Bytes (=> 7 Bytes) @@ -507,6 +512,7 @@ const USB_Descriptor_Bos_t PROGMEM BosDescriptor = { .Bytes = {0x00, 0x00, 0x00, 0x00}, }, +#ifdef MSOS2_CAP // 28 Bytes (0x1C) .MsosCap = { // 2 Bytes (=> 7 Bytes) @@ -531,6 +537,7 @@ const USB_Descriptor_Bos_t PROGMEM BosDescriptor = { .AltEnumCode = 0, }}, }, +#endif }; #ifndef USB_MAX_POWER_CONSUMPTION