mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
[usb] Remove Microsoft OS Descriptors 2. We will use version1.
Change-Id: I07fcb20c6ead0fcff3c06e0d9c2f1afb21f5949e
This commit is contained in:
@@ -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\
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user