1. 18 6月, 2012 4 次提交
  2. 17 4月, 2012 1 次提交
    • G
      usb/vmstate: add parent dev path · eeb0cf9a
      Gerd Hoffmann 提交于
      ... to make vmstate id string truely unique with multiple host
      controllers, i.e. move from "1/usb-ptr" to "0000:00:01.3/1/usb-ptr"
      (usb tabled connected to piix3 uhci).
      
      This obviously breaks migration.  To handle this the usb bus
      property "full-path" is added.  When setting this to false old
      behavior is maintained.  This way current qemu will be compatible
      with old versions when started using '-M pc-$oldversion'.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      eeb0cf9a
  3. 13 3月, 2012 1 次提交
    • G
      usb: the big rename · f1ae32a1
      Gerd Hoffmann 提交于
      Reorganize usb source files.  Create a new hw/usb/ directory and move
      all usb source code to that place.  Also make filenames a bit more
      descriptive.  Host adapters are prefixed with "hch-" now, usb device
      emulations are prefixed with "dev-".  Fixup paths Makefile and include
      paths to make it compile.  No code changes.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      f1ae32a1
  4. 27 2月, 2012 1 次提交
  5. 15 2月, 2012 1 次提交
  6. 10 2月, 2012 2 次提交
    • G
      usb: kill handle_packet callback · 7f74a56b
      Gerd Hoffmann 提交于
      All drivers except usb-hub use usb_generic_handle_packet.  The only
      reason the usb hub has its own function is that it used to be called
      with packets which are intended for downstream devices.  With the new,
      separate device lookup step this doesn't happen any more, so the need
      for a different handle_packet callback is gone.
      
      So we can kill the handle_packet callback and just call
      usb_generic_handle_packet directly.  The special hub handling in
      usb_handle_packet() can go away for the same reason.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7f74a56b
    • G
      usb: add usb_find_device() · 73796fe6
      Gerd Hoffmann 提交于
      Add usb_find_device().  This function will check whenever a device with
      a specific address is connected to the specified port.  Usually this
      will just check state and address of the device hooked up to the port,
      but in case of a hub it will ask the hub to check all hub ports for a
      matching device.
      
      This patch doesn't put the code into use yet, see the following patches
      for details.
      
      The master plan is to separate device lookup and packet processing.
      Right now the usb code simply walks all devices, calls
      usb_handle_packet() on each until one accepts the packet (by returning
      something different that USB_RET_NODEV).  I want to have a device lookup
      first, then call usb_handle_packet() once, for the device which actually
      processes the packet.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      73796fe6
  7. 04 2月, 2012 3 次提交
  8. 28 1月, 2012 3 次提交
  9. 17 1月, 2012 1 次提交
    • G
      usb: add USBEndpoint · d8e17efd
      Gerd Hoffmann 提交于
      Start maintaining endpoint state at USBDevice level.  Add USBEndpoint
      struct and some helper functions to deal with it.  For now it contains
      the endpoint type only.  Moved over some bits from usb-linux.c
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d8e17efd
  10. 06 1月, 2012 1 次提交
  11. 15 12月, 2011 1 次提交
  12. 22 11月, 2011 2 次提交
  13. 07 9月, 2011 1 次提交
    • G
      usb: claim port at device initialization time. · 891fb2cd
      Gerd Hoffmann 提交于
      This patch makes qemu assign a port when creating the device, not when
      attaching it.  For most usb devices this isn't a noticable difference
      because they are in attached state all the time.
      
      The change affects usb-host devices which live in detached state while
      the real device is unplugged from the host.  They have a fixed port
      assigned all the time now instead of getting grabbing one on attach and
      releasing it at detach, i.e. they stop floating around at the usb bus.
      
      The change also allows to simplify usb-hub.  It doesn't need the
      handle_attach() callback any more to configure the downstream ports.
      This can be done at device initialitation time now.  The changed
      initialization order (first grab upstream port, then register downstream
      ports) also fixes some icky corner cases.  For example it is not possible
      any more to plug the hub into one of its own downstream ports.
      
      The usb host adapters must care too.  USBPort->dev being non-NULL
      doesn't imply any more the device is in attached state.  The host
      adapters must additionally check the USBPort->dev->attached flag.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      891fb2cd
  14. 21 8月, 2011 1 次提交
  15. 08 7月, 2011 1 次提交
  16. 05 7月, 2011 4 次提交
  17. 23 6月, 2011 3 次提交
  18. 14 6月, 2011 3 次提交
  19. 25 1月, 2011 2 次提交
    • B
      usb-bus: use snprintf · ea87e95f
      Blue Swirl 提交于
      Avoid this warning from OpenBSD linker:
        LINK  i386-softmmu/qemu
      ../usb-bus.o(.text+0x27c): In function `usb_get_fw_dev_path':
      /src/qemu/hw/usb-bus.c:294: warning: sprintf() is often misused,
      please use snprintf()
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      ea87e95f
    • G
      usb core: add migration support · c1ecb40a
      Gerd Hoffmann 提交于
      Yes, seriously.  There is no migration support at all for usb devices.
      They loose state, especially the device address, and stop responding
      because of that.  Oops.
      
      Luckily there is so much broken usb hardware out there that the guest
      usually just kicks the device hard (via port reset and
      reinitialization), then continues without a hitch.  So we got away with
      that in a surprising high number of cases.
      
      The arrival of remote wakeup (which enables autosuspend support) changes
      that picture though.  The usb devices also forget that it they are
      supposed to wakeup, so they don't do that.  The host also doesn't notice
      the device stopped working in case it suspended the device and thus
      expects it waking up instead of polling it.  Result is that your mouse
      is dead.
      
      Lets start fixing that.  Add a vmstate struct for USBDevice.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      c1ecb40a
  20. 12 1月, 2011 4 次提交
    • G
      usb: zap pdev from usbport · ace1318b
      Gerd Hoffmann 提交于
      It isn't needed any more.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      ace1318b
    • G
      usb: rewrite fw path, fix numbering · 70d31cb2
      Gerd Hoffmann 提交于
      This patch rewrites the firmware path code to use the physical port
      location tracking just added to the qemu usb core.  It also fixes the
      port numbering to start with "1" in the firmware path.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      70d31cb2
    • G
      usb: add port property. · 5f69076b
      Gerd Hoffmann 提交于
      This allows to explictily set the physical port where you want to
      plug the usb device.  Example:
      
        -device usb-tablet,bus=usb.0,port=2
      
      With explicit port addressing qemu can and will not automagically add
      USB Hubs.  This means that:
      
        (a) You can plug two devices of your choice into the two uhci
            root ports.
        (b) If you want plug in more that two devices you have to care
            about adding a hub yourself.
      
      Plugging a hub works this way:
      
        -device usb-hub,bus=usb.0,port=1
      
      Use this to add a device to the hub:
      
        -device usb-tablet,bus=usb.0,port=1.1
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      5f69076b
    • G
      usb: keep track of physical port address. · c7a2196a
      Gerd Hoffmann 提交于
      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: NGerd Hoffmann <kraxel@redhat.com>
      c7a2196a