From owner-freebsd-usb@FreeBSD.ORG Wed Aug 15 15:41:44 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B75716A421 for ; Wed, 15 Aug 2007 15:41:44 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 09D7713C457 for ; Wed, 15 Aug 2007 15:41:38 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [194.248.135.20] (account mc467741@c2i.net HELO laptop.lan) by mailfe08.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 576879002; Wed, 15 Aug 2007 17:41:37 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Wed, 15 Aug 2007 17:41:47 +0200 User-Agent: KMail/1.9.7 References: <46C2D04A.30409@icyb.net.ua> In-Reply-To: <46C2D04A.30409@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708151741.47907.hselasky@c2i.net> Cc: Andriy Gapon Subject: Re: usbd_set_config_no vs. usbd_set_config_index X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2007 15:41:44 -0000 On Wednesday 15 August 2007, Andriy Gapon wrote: > I am curious about a difference between usbd_set_config_no and > usbd_set_config_index. My reason is such: I am trying to use > palm/uppc-kmod to talk to my pocket pc device via usb. When I used the > port in its original shape it gave me the following error each time I > plugged the device: > kernel: ucom0: failed to set configuration, err=STALLED > kernel: device_attach: ucom0 attach returned 6 > > Then, to mimic some other driver I simply changed > usbd_set_config_index() to usbd_set_config_no() in the code, and voila: > kernel: ucom0: ASUS ASUS Windows Mobile Device, rev > 2.00/0.00, addr 3 (rt) > > I am now trying to get synce to actually work. > But I am really curious what my change really did, and I am totally > ignorant about our usb code. > BTW: > FreeBSD 6.2-RELEASE-p3 amd64 > > Thank you in advance for my education. Hi, usbd_set_config_no will search for a matching bConfiguration value. usbd_set_config_index will set the configuration by physical index: 0, 1, 2 ... --HPS