usb: Add a speedmask to devices

This is used to indicate at which speed[s] the device can operate,
so that this can be checked to match the ports capabilities when it gets
attached to a bus.

Note that currently all usb1 emulated device claim to be fullspeed, this
seems to not cause any problems, but still seems wrong, because with real
hardware keyboards, mice and tablets usually are lo-speed, so reporting these
as fullspeed devices seems wrong.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2011-05-27 14:27:18 +02:00 committed by Gerd Hoffmann
parent fa19bf831b
commit ba3f9bfba9
5 changed files with 17 additions and 0 deletions

View file

@ -168,7 +168,10 @@ struct USBDevice {
char *port_path;
void *opaque;
/* Actual connected speed */
int speed;
/* Supported speeds, not in info because it may be variable (hostdevs) */
int speedmask;
uint8_t addr;
char product_desc[32];
int auto_attach;