From owner-freebsd-usb@FreeBSD.ORG Fri Jan 7 08:49:22 2011 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 065C2106566C for ; Fri, 7 Jan 2011 08:49:21 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id 35BC08FC13 for ; Fri, 7 Jan 2011 08:49:20 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=47jFoQlQiPaXYvJJRPLdRbboc2AFRw6czTf8DabKp4c= c=1 sm=1 a=qRpGpGfCbFsA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=Cx8Rot64AAAA:8 a=r3EMUyYp5Y8n2xnT2skA:9 a=cYRv0jqdOAUTFYmjRFIA:7 a=4Ej2w--RHaIlRRMoABSqUbyS7TQA:4 a=wPNLvfGTeEIA:10 a=KjwHmLgMZ6QA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 71122301; Fri, 07 Jan 2011 09:49:19 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Fri, 7 Jan 2011 09:49:25 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <20110107010548.GA2858@icarus.home.lan> In-Reply-To: <20110107010548.GA2858@icarus.home.lan> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101070949.25185.hselasky@c2i.net> Cc: Jeremy Chadwick Subject: Re: usb_quirk.c - ordering of quirks 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, 07 Jan 2011 08:49:22 -0000 On Friday 07 January 2011 02:05:48 Jeremy Chadwick wrote: > (Please keep me CC'd as I am not subscribed to freebsd-usb) > > It seems recent commits/patches that people have commit have appended > things to the bottom of the quirks list, but I don't see any comments > indicating that their location is justified (e.g. probe order, etc.). > > Is there a particular reason for the lack of alphabetic ordering in > usb_quirk.c? Can they be re-alphabetised safely? > > The reason I ask: I was in the process of writing a USB quirk when I > found that PR 153599 already addressed my needs. However, the vendor ID > string ("Feiya") is no longer valid; Feiya was bought by Silicon Motion, > Inc. in 2002: http://www.siliconmotion.com/A2.D_About_us.php?s=3 > > So the usbdevs entry for FEIYA should be changed to SILICONMOTION and > refer to Silicon Motion, Inc. (which is both what USB-IF has as well as > the Manufacturer string in a device itself (see below)). > > I found that the quirks were in alphabetical order based on vendor name > (not vendor ID number), yet some weren't[2]. Reviewing CVS annotations > and associated PRs with patches didn't provide any answers. > > Let me know so I can submit appropriate patches and update appropriate > PRs. Thanks! Hi, Entries in usb/usbdevs must be sorted. Entries in usb/quirk/usb_quirk.c must not be sorted, but we try to keep them according to functionality, so that mass storage quirks are grouped and then alphabetical. This is not important. --HPS > > > [1]: > ugen7.2: at usbus7, cfg=0 > md=HOST spd=HIGH (480Mbps) pwr=ON > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0200 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x090c > idProduct = 0x6200 > bcdDevice = 0x0100 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0003 <12345678901234567890> > bNumConfigurations = 0x0001 > > [2]: > 448 USB_QUIRK(YEDATA, FLASHBUSTERU, 0x0081, 0xFFFF, > UQ_MSC_FORCE_WIRE_CBI_I, 449 UQ_MSC_FORCE_PROTO_UFI, > UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_FLOPPY_SPEED, 450 > UQ_MSC_NO_GETMAXLUN), > 451 USB_QUIRK(ZORAN, EX20DSC, 0x0000, 0xffff, > UQ_MSC_FORCE_WIRE_CBI, 452 UQ_MSC_FORCE_PROTO_ATAPI), > 453 USB_QUIRK(MEIZU, M6_SL, 0x0000, 0xffff, > UQ_MSC_FORCE_WIRE_BBB, 454 UQ_MSC_FORCE_PROTO_SCSI, > UQ_MSC_NO_INQUIRY, UQ_MSC_NO_SYNC_CACHE), 455 USB_QUIRK(ACTIONS, > MP4, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, 456 > UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), 457 > USB_QUIRK(ASUS, GMSC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), 458 > USB_QUIRK(CHIPSBANK, USBMEMSTICK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), > 459 USB_QUIRK(CHIPSBANK, USBMEMSTICK1, 0x0000, 0xffff, > UQ_MSC_NO_SYNC_CACHE), 460 USB_QUIRK(NEWLINK, USB2IDEBRIDGE, > 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE),