From owner-freebsd-usb@FreeBSD.ORG Thu Oct 10 08:09:53 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 75ACFE94 for ; Thu, 10 Oct 2013 08:09:53 +0000 (UTC) (envelope-from aseem.jolly@gmail.com) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 012C82841 for ; Thu, 10 Oct 2013 08:09:52 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id x55so2066093wes.22 for ; Thu, 10 Oct 2013 01:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jeneiBNWGsIPhOzcOtu85bym9ToCD0skHW8fNsXBS8w=; b=x5r7l7IyvyHnVMxIr/s/6peqYvOevIbOpPRIWIr2S5j2+LCnUv26x+q2cOzgVABlPo 9PYkIeea+vzptPhvfMbr9FEOgurLXekVpy3nC5ecupfPTn2UqNyiqlE+t8onhLAoWgKR qaBYksoAY2SUBqvT+Eju+va5QcjWD4Zw1P8pstCnx0WUaAfRLVlZviE5ReusEuJ6M6Bg MaqO1QwNO2Pds12JcO+cxvPAWAKS4PDA4w5rUwyBsBF+MEeuZdwpZKXMY490rkphPsd0 vqHFp3LxdgpkZ3vaaJnai0jLRN4HjiPmWgH3lA2DvvDgeABw10xSOH9pCcbVfGaIaRCn 5oVw== MIME-Version: 1.0 X-Received: by 10.194.21.104 with SMTP id u8mr278726wje.63.1381392591199; Thu, 10 Oct 2013 01:09:51 -0700 (PDT) Received: by 10.194.56.72 with HTTP; Thu, 10 Oct 2013 01:09:51 -0700 (PDT) In-Reply-To: <52565C69.905@bitfrost.no> References: <1381274499940-5850403.post@n5.nabble.com> <5254FD72.2050507@bitfrost.no> <1381342263797-5850596.post@n5.nabble.com> <525649BB.2060906@bitfrost.no> <1381390376377-5850751.post@n5.nabble.com> <52565C69.905@bitfrost.no> Date: Thu, 10 Oct 2013 01:09:51 -0700 Message-ID: Subject: Re: USB device configuration From: aseem jolly To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Oct 2013 08:09:53 -0000 The device I am talking about has one configuration only. I was planning to take bus trace or usbdump since I am not seeing it again so I don't think that would help now. On Thu, Oct 10, 2013 at 12:51 AM, Hans Petter Selasky wrote: > Hi, > > > On 10/10/13 09:32, aseem.jolly wrote: > >> It is allowed to set the configuration multiple times. Refer to USB >>> 2.0 specification. >>> >> > > >> In what possible scenario would we want to set the configuration again? I >> know USB 2.0 specification allows it. I have also tried to modify the code >> and have sent SET_CONFIGURATION request to the device multiple times, and >> device didn't report any error. >> > > Some devices have multiple configurations with different interfaces, which > the application selects depending on the use-case. Many devices only have > one configuration. > > >> Or do you mean different configurations of a device, if a device supports >> more that one configuration? >> >> >> Is this making a difference for you? >>> >> I have scene a case in which we were unable to attach the umass driver to >> the device but since USB_DEBUG was not enabled at that time so I was not >> able to get more information out of it and being extremely intermittent in >> nature, I am not able to reproduce it again. I am trying to figure out the >> possible scenarios in which we might end up not attaching the driver to >> the >> device. I believe if we are not able to select a configuration then we >> don't >> attach the driver to the device. >> >> In usb_unconfigure func: >> >> udev->curr_config_no = USB_UNCONFIG_NO; >> udev->curr_config_index = USB_UNCONFIG_INDEX >> >> In usb_probe_and_attach func: >> if (udev->curr_config_index == USB_UNCONFIG_INDEX) { >> /* do nothing - no configuration has been set */ >> goto done; >> } >> >> From the console logs, it is clear that SET_ADDRESS went successfully, >>> have >>> >> noticed that we have assigned a ugen name to the device and also request >> to >> get the String descriptors(Product, Manufacturer etc) went successfully so >> that make me believe that there might be an error in performing >> SET_CONFIGURATION request. Do you have any other suggestions? >> > > You can use "usbdump" to figure out exactly what went wrong with regard to > USB requests. That might get you a clearer picture of what's going on. > > --HPS > >