From owner-freebsd-usb@FreeBSD.ORG Thu Aug 16 16:50:38 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 1A7EE16A417 for ; Thu, 16 Aug 2007 16:50:38 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from gateway.cybervisiontech.com.ua (gateway.cybervisiontech.com.ua [88.81.251.18]) by mx1.freebsd.org (Postfix) with ESMTP id 94A0F13C459 for ; Thu, 16 Aug 2007 16:50:37 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (hq.cybervisiontech.com [127.0.0.1]) by gateway.cybervisiontech.com.ua (Postfix) with ESMTP id 89465ED54F6; Thu, 16 Aug 2007 19:50:37 +0300 (EEST) X-Virus-Scanned: amavisd-new at cybervisiontech.com Received: from gateway.cybervisiontech.com.ua ([127.0.0.1]) by localhost (hq.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dpYxwvB89H96; Thu, 16 Aug 2007 19:50:36 +0300 (EEST) Received: from [10.2.1.87] (rein.cybervisiontech.com.ua [10.2.1.87]) by gateway.cybervisiontech.com.ua (Postfix) with ESMTP id 4C369ED54F0; Thu, 16 Aug 2007 19:50:36 +0300 (EEST) Message-ID: <46C4805A.9060306@icyb.net.ua> Date: Thu, 16 Aug 2007 19:50:34 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.6 (X11/20070803) MIME-Version: 1.0 To: Hans Petter Selasky References: <46C2D04A.30409@icyb.net.ua> <200708161815.47620.hselasky@c2i.net> <46C47AA3.4040809@icyb.net.ua> <200708161841.17660.hselasky@c2i.net> In-Reply-To: <200708161841.17660.hselasky@c2i.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Thu, 16 Aug 2007 16:50:38 -0000 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 = 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=STALLED 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: Standard Device Descriptor: bLength 18 bDescriptorType 01 bcdUSB 0200 bDeviceClass 00 bDeviceSubClass 00 bDeviceProtocol 00 bMaxPacketSize 16 idVendor 0b05 idProduct 420f bcdDevice 0000 iManufacturer 1 iProduct 2 iSerialNumber 3 bNumConfigurations 1 Configuration 0: Standard Configuration Descriptor: bLength 9 bDescriptorType 02 wTotalLength 32 bNumInterface 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 80 bMaxPower 250 (500 mA) Standard Interface Descriptor: bLength 9 bDescriptorType 04 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass ff bInterfaceSubClass ff bInterfaceProtocol ff iInterface 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 81 (in) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Standard Endpoint Descriptor: bLength 7 bDescriptorType 05 bEndpointAddress 02 (out) bmAttributes 02 (Bulk) wMaxPacketSize 64 bInterval 0 Codes Representing Languages by the Device: bLength 4 bDescriptorType 03 wLANGID[0] 0409 String (index 1): ASUS String (index 2): ASUS PPC String (index 3): f553b4ec-0dee-9dcc-7a63-40a7b4d674b9 -- Andriy Gapon