From owner-svn-src-head@FreeBSD.ORG Tue Jan 6 16:49:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA3A91065680; Tue, 6 Jan 2009 16:49:12 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.freebsd.org (Postfix) with ESMTP id 51A618FC14; Tue, 6 Jan 2009 16:49:11 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=7_Zea3ffw2MA:10 a=tgiRRak4JjAA:10 a=rREUrScshOl7G2h6aTFPgw==:17 a=AzN79KX1Kj8eupxTqHsA:9 a=JCYPLtasg-RiWE6rUfEA:7 a=Dsjo9SA-XqrzBf6lB1XOTWryhd4A:4 a=9aOQ2cSd83gA:10 a=LY0hPdMaydYA:10 Received: from [62.73.248.227] (account mc467741@c2i.net [62.73.248.227] verified) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1073393546; Tue, 06 Jan 2009 17:49:09 +0100 From: Hans Petter Selasky To: Stanislav Sedov Date: Tue, 6 Jan 2009 17:51:26 +0100 User-Agent: KMail/1.9.7 References: <200901040012.n040C2gH040928@svn.freebsd.org> <200901061613.33687.hselasky@c2i.net> <20090106193844.c727cfb7.stas@FreeBSD.org> In-Reply-To: <20090106193844.c727cfb7.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901061751.27394.hselasky@c2i.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org Subject: Re: svn commit: r186730 - in head: lib/libusb20 sys/dev/usb2/controller sys/dev/usb2/core sys/dev/usb2/ethernet sys/dev/usb2/image sys/dev/usb2/include sys/dev/usb2/serial sys/dev/usb2/sound sys/dev/us... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jan 2009 16:49:13 -0000 On Tuesday 06 January 2009, Stanislav Sedov wrote: > On Tue, 6 Jan 2009 16:13:32 +0100 > > Hans Petter Selasky mentioned: > > Try: > > > > usbconfig -u 0 -a 2 set_config 1 > > This helps. Now ubsa attaches to the device. But I can't communicate > with it (no echo even). I see the following messages in the log: > ubsa_cfg_request:395: device request failed, err=USB_ERR_STALLED (ignored) > ubsa_cfg_request:395: device request failed, err=USB_ERR_STALLED (ignored) > ubsa_cfg_request:395: device request failed, err=USB_ERR_STALLED (ignored) > > > You can for example add a quirk for this, see "usbconfig -h | grep -i > > quirk". I know this is not so easy, but if you can make a general rule > > for when selecting another configuration, I will add it. > > Why not let the driver to set the config? Because: 1) it clashes with USB device side mode, where the config index is received from Host 2) Different device drivers might want different configurations. 3) The driver for the active configuration might not be loaded. > > > Could you dump me the descriptors of your USB device? > > > > usbconfig -u 0 -a 2 dump_curr_config_desc dump_device_desc > > Sure: > > ugen0.2: at usbus0, cfg=1 > md=HOST spd=FULL (12Mbps) pwr=ON > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0110 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x16d5 > idProduct = 0x6501 > bcdDevice = 0x0000 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0000 This is interesting: > bNumConfigurations = 0x0001 The device says it only has one configuration! So setting index 1 should not be allowed. Could you try to change the check in the ubsa2.c probe routine to check for config index 0 instead? Mostly config index 0 is used in USB devices. %cat *[ch] | grep -i "config.*Index" #define U3G_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != U3G_CONFIG_INDEX) { #define UARK_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != 0) { #define UBSA_CONFIG_INDEX 1 if (uaa->info.bConfigIndex != UBSA_CONFIG_INDEX) { #define UCHCOM_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UCHCOM_CONFIG_INDEX) { if (uaa->info.bConfigIndex != 0) { #define UFTDI_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UFTDI_CONFIG_INDEX) { #define UGENSA_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UGENSA_CONFIG_INDEX) { #define UIPAQ_CONFIG_INDEX 0 /* config number 1 */ if (uaa->info.bConfigIndex != UIPAQ_CONFIG_INDEX) { "config number: %d\n", alt_index); #define UMCT_CONFIG_INDEX 1 if (uaa->info.bConfigIndex != UMCT_CONFIG_INDEX) { #define UMOSCOM_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UMOSCOM_CONFIG_INDEX) { #define UPLCOM_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UPLCOM_CONFIG_INDEX) { #define UVISOR_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UVISOR_CONFIG_INDEX) { #define UVSCOM_CONFIG_INDEX 0 if (uaa->info.bConfigIndex != UVSCOM_CONFIG_INDEX) { Try changing "UBSA_CONFIG_INDEX" to zero. If it works I will commit a patch for this. > > Configuration index 1 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x003e > bNumInterfaces = 0x0002 > bConfigurationValue = 0x0001 > iConfiguration = 0x0000 > bmAttributes = 0x00a0 > bMaxPower = 0x00fa > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0000 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0003 > bInterfaceClass = 0x00ff > bInterfaceSubClass = 0x00ff > bInterfaceProtocol = 0x00ff > iInterface = 0x0003 When you cannot retrive the strings, I think your device is gone! (Crashed) --HPS