From ad9225bdd34230e13333be5d4c29e4f96abc9b2b Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Thu, 4 Jan 2018 20:12:48 +1100 Subject: Update copyrights for 2018. --- Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c') diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index e42b31860..494150349 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2018. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2018 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted -- cgit v1.2.3 From e9d9fcde04411001ba8dff07b512fdc46ce13e47 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 22 Apr 2018 16:08:12 +1000 Subject: Add MS OS Compatibility descriptors to RNDIS demos for driverless install on Windows. --- .../Device/ClassDriver/RNDISEthernet/Descriptors.c | 51 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c') diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 494150349..8e709cee9 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -46,7 +46,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, - .USBSpecification = VERSION_BCD(1,1,0), + .USBSpecification = VERSION_BCD(2,0,0), .Class = CDC_CSCP_CDCClass, .SubClass = CDC_CSCP_NoSpecificSubclass, .Protocol = CDC_CSCP_NoSpecificProtocol, @@ -55,7 +55,7 @@ const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = .VendorID = 0x03EB, .ProductID = 0x204C, - .ReleaseNumber = VERSION_BCD(0,0,1), + .ReleaseNumber = VERSION_BCD(0,0,2), .ManufacturerStrIndex = STRING_ID_Manufacturer, .ProductStrIndex = STRING_ID_Product, @@ -192,6 +192,32 @@ const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR */ const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"LUFA RNDIS CDC Demo"); +/** Microsoft OS Compatibility string descriptor. This is a special string descriptor that Microsoft based OS hosts + * will query at string descriptor ID 0xEE on initial enumeration, to test if the device supports the Microsoft OS + * Compatibility descriptor extensions (used to give the host additional information on the device's general class + * compatibility for driver-less installation). + */ +const USB_Descriptor_String_t PROGMEM MSConpatibilityString = USB_STRING_DESCRIPTOR_ARRAY('M','S','F','T','1','0','0', VENDOR_REQUEST_ID_MS_COMPAT); + +/** Microsoft OS Compatibility 1.0 descriptor. This is a special descriptor returned by the device on vendor request + * from the host, giving the OS additional compatibility information. This allows the host to automatically install + * the appropriate driver for various devices which share a common USB class (in this case RNDIS, which uses the + * CDC-ACM class usually used by virtual to serial adapters). + */ +const USB_Descriptor_MSCompatibility_t PROGMEM MSCompatibilityDescriptor = + { + .dwLength = sizeof(USB_Descriptor_MSCompatibility_t), + .bcdVersion = VERSION_BCD(1,0,0), + .wIndex = 4, + .bCount = 1, + .bReserved = { 0 }, + .bFirstInterfaceNumber = INTERFACE_ID_CDC_CCI, + .bReserved2 = 1, // Must always be 1 according to spec + .compatibleID = "RNDIS", + .subCompatibleID = "5162001", + .bReserved3 = { 0 }, + }; + /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" * documentation) by the application code so that the address and size of a requested descriptor can be given * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function @@ -233,6 +259,10 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, Address = &ProductString; Size = pgm_read_byte(&ProductString.Header.Size); break; + case STRING_ID_MS_Compat: + Address = &MSConpatibilityString; + Size = pgm_read_byte(&MSConpatibilityString.Header.Size); + break; } break; @@ -242,3 +272,20 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, return Size; } +/** Sends the special Microsoft OS Compatibility Descriptor to the host PC, if + * the host is requesting it. + */ +void CheckIfMSCompatibilityDescriptorRequest(void) +{ + if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE)) + { + if (USB_ControlRequest.bRequest == VENDOR_REQUEST_ID_MS_COMPAT) + { + Endpoint_ClearSETUP(); + + /* Write the OS compatibility descriptor to the control endpoint */ + Endpoint_Write_Control_PStream_LE(&MSCompatibilityDescriptor, sizeof(MSCompatibilityDescriptor)); + Endpoint_ClearOUT(); + } + } +} -- cgit v1.2.3 From 45ab627b4a06f7d0186d7263c1afd30ef4a80dcd Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 22 Apr 2018 16:10:55 +1000 Subject: Update all project manufacturer strings with a generic title. --- Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c') diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 8e709cee9..aef886856 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -184,7 +184,7 @@ const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARR * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device * Descriptor. */ -const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera"); +const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"LUFA Library"); /** Product descriptor string. This is a Unicode string containing the product's details in human readable form, * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device -- cgit v1.2.3 From 16f4492eb4783f3821155d87907ad0db7be9cc90 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 17 Jun 2018 13:55:06 +1000 Subject: Move class-specific functional descriptor definitions to their respective classes. --- Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c') diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index aef886856..e9679f3f7 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -104,7 +104,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .CDC_Functional_Header = { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface}, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = CDC_DTYPE_CSInterface}, .Subtype = CDC_DSUBTYPE_CSInterface_Header, .CDCSpecification = VERSION_BCD(1,1,0), @@ -112,7 +112,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .CDC_Functional_ACM = { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface}, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = CDC_DTYPE_CSInterface}, .Subtype = CDC_DSUBTYPE_CSInterface_ACM, .Capabilities = 0x00, @@ -120,7 +120,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .CDC_Functional_Union = { - .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface}, + .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = CDC_DTYPE_CSInterface}, .Subtype = CDC_DSUBTYPE_CSInterface_Union, .MasterInterfaceNumber = INTERFACE_ID_CDC_CCI, -- cgit v1.2.3 From 101ed6b74e0d6549e53a7c8216147af37ffc70df Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 8 Jan 2019 19:59:41 +1100 Subject: Documentation: Update copyrights to 2019. --- Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c') diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index e9679f3f7..7679286e5 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2018. + Copyright (C) Dean Camera, 2019. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2018 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2019 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted -- cgit v1.2.3