From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlFu7-0008Sa-N5 for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:25:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlFu6-0002Fi-6d for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:25:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlFu5-0002FX-V4 for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:25:30 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBJ9PSdo017167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 Dec 2012 04:25:28 -0500 Message-ID: <50D18895.3040201@redhat.com> Date: Wed, 19 Dec 2012 10:27:49 +0100 From: Hans de Goede MIME-Version: 1.0 References: <1355492147-5023-1-git-send-email-hdegoede@redhat.com> <1355492147-5023-27-git-send-email-hdegoede@redhat.com> <50D0717B.7040103@redhat.com> In-Reply-To: <50D0717B.7040103@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 26/26] usbredir: Add support for buffered bulk input List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Hi, On 12/18/2012 02:36 PM, Gerd Hoffmann wrote: > Hi, > > Added patches 1-25 to the usb queue (using v2 of patch 10). > >> hw/usb/redirect-ftdi-ids.h | 1255 ++++++++++++++++++++++++++++++++++++++++++ >> hw/usb/redirect-pl2303-ids.h | 150 +++++ >> hw/usb/redirect-usb-ids.h | 910 ++++++++++++++++++++++++++++++ > > Where does this come from? Linux kernel I guess? These 2 are 1 on 1 copies from the kernel: hw/usb/redirect-ftdi-ids.h | 1255 ++++++++++++++++++++++++++++++++++++++++++ hw/usb/redirect-pl2303-ids.h | 150 +++++ They contain "boring" stuff like: #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ Which allows me to easily copy the id tables from the kernel drivers (.c files). This one: hw/usb/redirect-usb-ids.h Contains the usb-id tables copied from the kernel, as stated in the comments: /* * Silicon Laboratories CP210x USB to RS232 serial adapter ids * copied from linux/drivers/usb/serial/cp210x.c * * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) */ { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */ > What is the procedure to update them? I've defined my own version of the USB_DEVICE macro, after that the tables are just 1 on 1 copies from the kernel tree, with s// / So updating them can be done by emptying the list and then copying in the new list from the latest kernel, this is an (easy) manual procedure for now. > I also think this shouldn't be tied to redir, I think it is better to > have a hw/usb/quirks.c file where the device id database and helper > functions to match devices against the list are living. Makes sense, one problem I see though is that right now I've 2 id tables, named usbredir_raw_serial_ids and usbredir_ftdi_serial_ids since ftdi based adapters need some extra special handling (a quirk to the quirk). Once we start working with quirk tables it makes sense to have 1 large table with an extra uint32_t field which contains the actual quirks as bitmask. All perfectly sensible, but this breaks the easy copy and paste syncing of the tables from the Linux kernel ... So any good ideas for this from you ? Regards, Hans