From 28c6cfbade867004cb1680cf43c4e98dbf93eb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 29 Mar 2018 15:54:51 +0200 Subject: [PATCH] [usb] Remove Microsoft OS Descriptors 2. We will use version1. Change-Id: I07fcb20c6ead0fcff3c06e0d9c2f1afb21f5949e --- ion/src/device/usb/Makefile | 1 - .../microsoft_os_platform_descriptor.cpp | 23 ---------- .../stack/microsoft_os_platform_descriptor.h | 44 ------------------- 3 files changed, 68 deletions(-) delete mode 100644 ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp delete mode 100644 ion/src/device/usb/stack/microsoft_os_platform_descriptor.h diff --git a/ion/src/device/usb/Makefile b/ion/src/device/usb/Makefile index eb8616637..7021537ae 100644 --- a/ion/src/device/usb/Makefile +++ b/ion/src/device/usb/Makefile @@ -17,7 +17,6 @@ usb_objs += $(addprefix ion/src/device/usb/stack/, \ dfu_functional_descriptor.o\ interface_descriptor.o\ language_id_string_descriptor.o \ - microsoft_os_platform_descriptor.o\ platform_device_capability_descriptor.o\ streamable.o\ string_descriptor.o\ diff --git a/ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp b/ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp deleted file mode 100644 index bd4148ee6..000000000 --- a/ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "microsoft_os_platform_descriptor.h" - -namespace Ion { -namespace USB { -namespace Device { - -constexpr uint8_t MicrosoftOSPlatformDescriptor::k_microsoftOSUUID[]; - -void MicrosoftOSPlatformDescriptor::push(Channel * c) const { - PlatformDeviceCapabilityDescriptor::push(c); - c->push(m_dwWindowsVersion); - c->push(m_wMSOSDescriptorSetTotalLength); - c->push(m_bMS_VendorCode); - c->push(m_bAltEnumCode); -} - -uint8_t MicrosoftOSPlatformDescriptor::bLength() const { - return PlatformDeviceCapabilityDescriptor::bLength() + sizeof(uint32_t) + sizeof(uint16_t) + 2*sizeof(uint8_t); -} - -} -} -} diff --git a/ion/src/device/usb/stack/microsoft_os_platform_descriptor.h b/ion/src/device/usb/stack/microsoft_os_platform_descriptor.h deleted file mode 100644 index bd8229ff2..000000000 --- a/ion/src/device/usb/stack/microsoft_os_platform_descriptor.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef ION_DEVICE_USB_STACK_MICROSOFT_OS_PLATFORM_DESCRIPTOR_H -#define ION_DEVICE_USB_STACK_MICROSOFT_OS_PLATFORM_DESCRIPTOR_H - -#include "platform_device_capability_descriptor.h" - -namespace Ion { -namespace USB { -namespace Device { - -/* We add Microsoft OS Descriptors to automatically use WinUSB drivers when the - * calculator is plugged to a Windows computer. - * Different sets of descriptors can be sent to different Windows versions, but - * we use one descriptor set only. */ - -class MicrosoftOSPlatformDescriptor : public PlatformDeviceCapabilityDescriptor { -public: - constexpr MicrosoftOSPlatformDescriptor(uint16_t wMSOSDescriptorSetTotalLength, uint8_t bMS_VendorCode) : - PlatformDeviceCapabilityDescriptor(k_microsoftOSUUID), - m_dwWindowsVersion(0x06030000), // Windows 8.1, it cannot be lower - m_wMSOSDescriptorSetTotalLength(wMSOSDescriptorSetTotalLength), - m_bMS_VendorCode(bMS_VendorCode), - m_bAltEnumCode(0) // No alternative enumeration descriptors set - { - } -protected: - void push(Channel * c) const override; - virtual uint8_t bLength() const override; -private: - /* Little-endian encoding of {D8DD60DF-4589-4CC7-9CD2-659D9E648A9F}. - * See Microsoft OS 2.0 Descriptors Specification. */ - constexpr static uint8_t k_microsoftOSUUID[] = { - 0xDF, 0x60, 0xDD, 0xD8, 0x89, 0x45, 0xC7, 0x4C, - 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F}; - uint32_t m_dwWindowsVersion; // Minimum version of Windows that the descriptor set can be applied to - uint16_t m_wMSOSDescriptorSetTotalLength; - uint8_t m_bMS_VendorCode; - uint8_t m_bAltEnumCode; -}; - -} -} -} - -#endif