mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
usb: keep track of physical port address.
Add a path string to USBPort. Add usb_port_location() function to set the physical location of the usb port. Update all drivers implementing usb ports to call it. Update the monitor commands to print it. Wind it up in qdev. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
fa7935c1e1
commit
c7a2196a4f
6 changed files with 39 additions and 3 deletions
11
hw/usb-hub.c
11
hw/usb-hub.c
|
@ -256,6 +256,16 @@ static void usb_hub_wakeup(USBDevice *dev)
|
|||
}
|
||||
}
|
||||
|
||||
static void usb_hub_handle_attach(USBDevice *dev)
|
||||
{
|
||||
USBHubState *s = DO_UPCAST(USBHubState, dev, dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_PORTS; i++) {
|
||||
usb_port_location(&s->ports[i].port, dev->port, i+1);
|
||||
}
|
||||
}
|
||||
|
||||
static void usb_hub_handle_reset(USBDevice *dev)
|
||||
{
|
||||
/* XXX: do it */
|
||||
|
@ -542,6 +552,7 @@ static struct USBDeviceInfo hub_info = {
|
|||
.usb_desc = &desc_hub,
|
||||
.init = usb_hub_initfn,
|
||||
.handle_packet = usb_hub_handle_packet,
|
||||
.handle_attach = usb_hub_handle_attach,
|
||||
.handle_reset = usb_hub_handle_reset,
|
||||
.handle_control = usb_hub_handle_control,
|
||||
.handle_data = usb_hub_handle_data,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue