From owner-freebsd-usb@FreeBSD.ORG Fri Aug 17 18:15:21 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 DF3BC16A419 for ; Fri, 17 Aug 2007 18:15:21 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe11.swip.net [212.247.155.65]) by mx1.freebsd.org (Postfix) with ESMTP id 7B58013C491 for ; Fri, 17 Aug 2007 18:15:21 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [212.17.141.53] (account mc467741@c2i.net HELO [10.150.70.182]) by mailfe11.swip.net (CommuniGate Pro SMTP 5.1.10) with ESMTPA id 411863216; Fri, 17 Aug 2007 20:15:18 +0200 From: Hans Petter Selasky To: Andriy Gapon Date: Fri, 17 Aug 2007 20:15:24 +0200 User-Agent: KMail/1.9.7 References: <46C2D04A.30409@icyb.net.ua> <200708161841.17660.hselasky@c2i.net> <46C4805A.9060306@icyb.net.ua> In-Reply-To: <46C4805A.9060306@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200708172015.25928.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org 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: Fri, 17 Aug 2007 18:15:22 -0000 On Thursday 16 August 2007, Andriy Gapon wrote: > on 16/08/2007 19:41 Hans Petter Selasky said the following: > > On Thursday 16 August 2007, Andriy Gapon wrote: > >> on 16/08/2007 19:15 Hans Petter Selasky said the following: > >>> Hi, > >>> > >>> I would say that "usbd_set_config_index()" is more reliable and faster > >>> than "usbd_set_config_no()". I tried to get rid of > >>> all "usbd_set_config_no()". > >> > >> Hmm, then I am puzzled how my change from *_index() to *_no() helped in > >> my case. Maybe some parameters were incorrect, or maybe different > >> devices need different parameters and that's where _no() comes useful. > > > > What config number are you setting? > > > > Have you dumped the configuration of your device using "udesc_dump" > > (See /usr/ports/sysutils/udesc_dump) ? > > Thank you for bearing with me. > To reiterate: I was trying palm/uppc-kmod on amd64 6.2 with standard USB > stack. attach routine had the following line: > err =3D usbd_set_config_index(dev, UPPC_CONFIG_INDEX, 1); > where UPPC_CONFIG_INDEX is defined to 1. > It failed with: > kernel: ucom0: failed to set configuration, err=3DSTALLED > kernel: device_attach: ucom0 attach returned 6 > > My only change was from _index to _no and then it started to work. > Here's udesc_dump full output: > =46rom this you should set config index 0 or config no 1. Note the differen= ce! =2D-HPS