From owner-freebsd-usb@FreeBSD.ORG Wed Oct 9 06:52:31 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 5CDC24D0 for ; Wed, 9 Oct 2013 06:52:31 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 1BEC42F12 for ; Wed, 9 Oct 2013 06:52:30 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 3EAF67A0D5; Wed, 9 Oct 2013 08:52:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 62C798F87D6; Wed, 9 Oct 2013 08:52:46 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l9RQn5faPGuB; Wed, 9 Oct 2013 08:52:45 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 2A2018F87D5; Wed, 9 Oct 2013 08:52:45 +0200 (CEST) Message-ID: <5254FD72.2050507@bitfrost.no> Date: Wed, 09 Oct 2013 08:53:38 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: "aseem.jolly" Subject: Re: USB device configuration References: <1381274499940-5850403.post@n5.nabble.com> In-Reply-To: <1381274499940-5850403.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Wed, 09 Oct 2013 06:52:31 -0000 On 10/09/13 01:21, aseem.jolly wrote: > *usb_set_device_state(udev, USB_STATE_CONFIGURED);* Hi, Beware that this state is tracked by: static void xhci_device_state_change(struct usb_device *udev) in dev/usb/controller/xhci.c And changing this value forth and back will trigger events in the XHCI driver at least. It sounds more like we should set the configured state, only and only if the configure function is successful at the end: done: if (err) unconfigure(); else usb_set_device_state(udev, USB_STATE_CONFIGURED); Anyhow, if a second configure event fails after a successful one, we are still in the configured state. --HPS