From owner-freebsd-usb@FreeBSD.ORG Thu Oct 11 13:17:42 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 DC46916A41B for ; Thu, 11 Oct 2007 13:17:41 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by mx1.freebsd.org (Postfix) with ESMTP id A37A613C442 for ; Thu, 11 Oct 2007 13:17:41 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so394287nzf for ; Thu, 11 Oct 2007 06:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Ql1/p71jMfQokdoCMdGCW5hBWZBiWLAEPJh3ssLNKpM=; b=qRbE1iCqKf8iDjc41JK2o80AKOUX99KbJ7XrmCRg8Kk/cQCLiPVk8ki0hF3E7gTuX3frWrFTLtbVXCVF93+BDWdzKPbJbURYwQmT8TJ3wQsuGeyzPtVULaaqwMna4etL96WtNzAdzbjhf9inFhwbdiVle7YnB2K1JPzPN2sAxGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tghtwLpidWoxi3vROywZ09JnIuQxxoPnNAB5W5rNwwf0J75Kn6fmjshtszbAxj3e/J5CSpvrIhRAmqKf6Wo16lqvvD0b/BCsoCI7Jb2FSLUKRU1P0FjLMrvslz9Y2JuP0Eu+LtHn8bjPNVMRo9q3cZV9wp7K5y5p08UaZAopcRk= Received: by 10.115.108.1 with SMTP id k1mr2138194wam.1192108659023; Thu, 11 Oct 2007 06:17:39 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Thu, 11 Oct 2007 06:17:38 -0700 (PDT) Message-ID: Date: Thu, 11 Oct 2007 21:17:38 +0800 From: "Xiaofan Chen" To: "M. Warner Losh" In-Reply-To: <20071011.070249.2073896410.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071011.070249.2073896410.imp@bsdimp.com> Cc: freebsd-usb@freebsd.org Subject: Re: VID parser problem with usbdevs 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, 11 Oct 2007 13:17:42 -0000 On 10/11/07, M. Warner Losh wrote: > In message: > : ===[mcuee] ~/Desktop/build/fsusb/fsusb-0.1.11-2 # sudo usbdevs -v > : Controller /dev/usb1: > : addr 126: full speed, power 100 mA, config 1, product 0x000b(0x000b), > : I-Tuner Networks(0x04d8), rev 0.00 > : port 4 addr 126: full speed, power 100 mA, config 1, product > : 0x000b(0x000b), I-Tuner Networks(0x04d8), rev 0.00 > > While 4d8 is for microchip technology, we get the name that we print > here directly from the usb device itself. > What makes you think that the vendor ID is parsed wrong? > I have read the firmware source codes so I do not think there is anything called "I-Tuner" in the descriptors or anywhere in the firmware. 04d8/000b is the bootloader firmware VID/PID for Microchip PICDEM FS USB demo board. The following is the relevant descriptor. #pragma romdata /* Device Descriptor */ rom USB_DEV_DSC device_dsc= { sizeof(USB_DEV_DSC), // Size of this descriptor in bytes DSC_DEV, // DEVICE descriptor type 0x0200, // USB Spec Release Number in BCD format 0x00, // Class Code 0x00, // Subclass code 0x00, // Protocol code EP0_BUFF_SIZE, // Max packet size for EP0, see usbcfg.h 0x04D8, // Vendor ID 0x000b, // Product ID: PICDEM FS USB (Boot Mode) 0x0001, // Device release number in BCD format 0x00, // Manufacturer string index 0x00, // Product string index 0x00, // Device serial number string index 0x01 // Number of possible configurations }; /* Configuration 1 Descriptor */ CFG01= { /* Configuration Descriptor */ sizeof(USB_CFG_DSC), // Size of this descriptor in bytes DSC_CFG, // CONFIGURATION descriptor type sizeof(cfg01), // Total length of data for this cfg 1, // Number of interfaces in this cfg 1, // Index value of this configuration 0, // Configuration string index _DEFAULT, // Attributes, see usbdefs_std_dsc.h 50, // Max power consumption (2X mA) /* Interface Descriptor */ sizeof(USB_INTF_DSC), // Size of this descriptor in bytes DSC_INTF, // INTERFACE descriptor type 0, // Interface Number 0, // Alternate Setting Number 2, // Number of endpoints in this intf 0x00, // Class code 0x00, // Subclass code 0x00, // Protocol code 0, // Interface string index /* Endpoint Descriptors */ sizeof(USB_EP_DSC),DSC_EP,_EP01_OUT,_BULK,BOOT_EP_SIZE,0x00, sizeof(USB_EP_DSC),DSC_EP,_EP01_IN,_BULK,BOOT_EP_SIZE,0x00 }; rom struct{byte bLength;byte bDscType;word string[1];}sd000={ sizeof(sd000),DSC_STR,0x0409}; So I plug in PICkit 2, another Microchip product. It is fine. ===[mcuee] ~ # sudo usbdev -v addr 125: full speed, power 100 mA, config 1, PICkit 2 Microcontroller Programme r(0x0033), Microchip Technology Inc.(0x04d8), rev 0.01 port 2 addr 125: full speed, power 100 mA, config 1, PICkit 2 Microcontroller P rogrammer(0x0033), Microchip Technology Inc.(0x04d8), rev 0.01 Kind of strange. Xiaofan