From patchwork Thu Sep 4 10:21:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 385795 X-Patchwork-Delegate: l.majewski@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AD8AC1400B5 for ; Thu, 4 Sep 2014 20:22:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CF639A76B0; Thu, 4 Sep 2014 12:22:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jJhc2yOPfjDZ; Thu, 4 Sep 2014 12:22:01 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 74EB7A76EB; Thu, 4 Sep 2014 12:21:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1AE78A76EB for ; Thu, 4 Sep 2014 12:21:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6mMFczg2rwOp for ; Thu, 4 Sep 2014 12:21:50 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from pollux.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by theia.denx.de (Postfix) with ESMTP id 45672A76B0 for ; Thu, 4 Sep 2014 12:21:47 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id A31D512FF; Thu, 4 Sep 2014 12:21:41 +0200 (CEST) From: Heiko Schocher To: u-boot@lists.denx.de Date: Thu, 4 Sep 2014 12:21:40 +0200 Message-Id: <1409826100-24834-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.8.3.1 Cc: Marek Vasut , Roger Meier Subject: [U-Boot] [PATCH] dfu, usb: set usb descriptor to values defined in dfu spec 1.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here: http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf Signed-off-by: Heiko Schocher Cc: Lukasz Majewski Cc: Marek Vasut Cc: Roger Meier --- before this patch, "dfu-util -l" showed: Bus 002 Device 114: ID 0908:02c5 Siemens AG Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 2 Communications bDeviceSubClass 2 Abstract (modem) bDeviceProtocol 0 None bMaxPacketSize0 64 idVendor 0x0908 Siemens AG idProduct 0x02c5 bcdDevice 0.00 iManufacturer 1 Siemens AG with this patch: Bus 002 Device 089: ID 0908:02c5 Siemens AG Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0908 Siemens AG idProduct 0x02c5 bcdDevice 0.00 iManufacturer 1 Siemens AG iProduct 2 USB download gadget which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with the DFU spezifikation. --- drivers/usb/gadget/f_dfu.c | 5 +++-- drivers/usb/gadget/g_dnl.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c index 9128add..9429e50 100644 --- a/drivers/usb/gadget/f_dfu.c +++ b/drivers/usb/gadget/f_dfu.c @@ -83,8 +83,9 @@ static struct usb_descriptor_header *dfu_runtime_descs[] = { static const struct usb_qualifier_descriptor dev_qualifier = { .bLength = sizeof dev_qualifier, .bDescriptorType = USB_DT_DEVICE_QUALIFIER, - .bcdUSB = __constant_cpu_to_le16(0x0200), - .bDeviceClass = USB_CLASS_VENDOR_SPEC, + .bcdUSB = __constant_cpu_to_le16(0x0110), + .bDeviceClass = USB_CLASS_PER_INTERFACE, + .bDeviceSubClass = 0x00, .bNumConfigurations = 1, }; diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index dd95afe..bcca965 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -57,9 +57,9 @@ static struct usb_device_descriptor device_desc = { .bLength = sizeof device_desc, .bDescriptorType = USB_DT_DEVICE, - .bcdUSB = __constant_cpu_to_le16(0x0200), - .bDeviceClass = USB_CLASS_COMM, - .bDeviceSubClass = 0x02, /*0x02:CDC-modem , 0x00:CDC-serial*/ + .bcdUSB = __constant_cpu_to_le16(0x0110), + .bDeviceClass = USB_CLASS_PER_INTERFACE, + .bDeviceSubClass = 0x00, /*0x02:CDC-modem , 0x00:CDC-serial*/ .idVendor = __constant_cpu_to_le16(CONFIG_G_DNL_VENDOR_NUM), .idProduct = __constant_cpu_to_le16(CONFIG_G_DNL_PRODUCT_NUM),