diff --git a/ion/src/device/usb/Makefile b/ion/src/device/usb/Makefile index c59a6b262..eb8616637 100644 --- a/ion/src/device/usb/Makefile +++ b/ion/src/device/usb/Makefile @@ -17,12 +17,12 @@ 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\ url_descriptor.o\ webusb_platform_descriptor.o\ - winusb_platform_descriptor.o\ ) USB_DFU_XIP_FLASH := 0 diff --git a/ion/src/device/usb/stack/winusb_platform_descriptor.cpp b/ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp similarity index 60% rename from ion/src/device/usb/stack/winusb_platform_descriptor.cpp rename to ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp index 39867dff9..bd4148ee6 100644 --- a/ion/src/device/usb/stack/winusb_platform_descriptor.cpp +++ b/ion/src/device/usb/stack/microsoft_os_platform_descriptor.cpp @@ -1,12 +1,12 @@ -#include "winusb_platform_descriptor.h" +#include "microsoft_os_platform_descriptor.h" namespace Ion { namespace USB { namespace Device { -constexpr uint8_t WinUSBPlatformDescriptor::k_winUSBUUID[]; +constexpr uint8_t MicrosoftOSPlatformDescriptor::k_microsoftOSUUID[]; -void WinUSBPlatformDescriptor::push(Channel * c) const { +void MicrosoftOSPlatformDescriptor::push(Channel * c) const { PlatformDeviceCapabilityDescriptor::push(c); c->push(m_dwWindowsVersion); c->push(m_wMSOSDescriptorSetTotalLength); @@ -14,7 +14,7 @@ void WinUSBPlatformDescriptor::push(Channel * c) const { c->push(m_bAltEnumCode); } -uint8_t WinUSBPlatformDescriptor::bLength() const { +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/winusb_platform_descriptor.h b/ion/src/device/usb/stack/microsoft_os_platform_descriptor.h similarity index 73% rename from ion/src/device/usb/stack/winusb_platform_descriptor.h rename to ion/src/device/usb/stack/microsoft_os_platform_descriptor.h index 94107ad99..bd8229ff2 100644 --- a/ion/src/device/usb/stack/winusb_platform_descriptor.h +++ b/ion/src/device/usb/stack/microsoft_os_platform_descriptor.h @@ -1,5 +1,5 @@ -#ifndef ION_DEVICE_USB_STACK_WINUSB_PLATFORM_DESCRIPTOR_H -#define ION_DEVICE_USB_STACK_WINUSB_PLATFORM_DESCRIPTOR_H +#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" @@ -12,10 +12,10 @@ namespace Device { * Different sets of descriptors can be sent to different Windows versions, but * we use one descriptor set only. */ -class WinUSBPlatformDescriptor : public PlatformDeviceCapabilityDescriptor { +class MicrosoftOSPlatformDescriptor : public PlatformDeviceCapabilityDescriptor { public: - constexpr WinUSBPlatformDescriptor(uint16_t wMSOSDescriptorSetTotalLength, uint8_t bMS_VendorCode) : - PlatformDeviceCapabilityDescriptor(k_winUSBUUID), + 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), @@ -28,7 +28,7 @@ protected: private: /* Little-endian encoding of {D8DD60DF-4589-4CC7-9CD2-659D9E648A9F}. * See Microsoft OS 2.0 Descriptors Specification. */ - constexpr static uint8_t k_winUSBUUID[] = { + 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