1. 25 10月, 2012 3 次提交
  2. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  3. 05 10月, 2012 1 次提交
  4. 31 8月, 2012 1 次提交
    • G
      usb: unique packet ids · e983395d
      Gerd Hoffmann 提交于
      This patch adds IDs to usb packets.  Those IDs are (a) supposed to be
      unique for the lifecycle of a packet (from packet setup until the packet
      is either completed or canceled) and (b) stable across migration.
      
      uhci, ohci, ehci and xhci use the guest physical address of the transfer
      descriptor for this.
      
      musb needs a different approach because there is no transfer descriptor.
      But musb also doesn't support pipelining, so we have never more than one
      packet per endpoint in flight.  So we go create an ID based on endpoint
      and device address.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      e983395d
  5. 28 6月, 2012 1 次提交
  6. 13 3月, 2012 3 次提交
    • W
      usb-ohci: DMA writeback bug fixes · 86e18cae
      Wei Yang 提交于
      This patch fixes two bugs in the OHCI device where the device writes
      back data to system memory that should be exclusively under the
      control of the guest side driver.
      
      In OHCI specification Section 5.2.7, it mentioned "In all cases, Host
      Controller Driver is responsible for the insertion and removal of all
      Endpoint Descriptors in the various Host Controller Endpoint
      Descriptor lists".  In the ohci_frame_boundary(), ohci_put_hcca()
      writes the entire hcca back including the interrupt ED lists which
      should be under driver control. This violates the specification and
      can race with a host driver updating that list at the same time.
      
      In the OHCI Spec Section 4.6, Transfer Descriptor Queue Processing, it
      mentioned "Since the TD pointed to by TailP is not accessed by the HC,
      the Host Controller Driver can initialize that TD and link at least
      one other to it without creating a coherency or synchronization
      problem".  While the function ohci_put_ed() writes the entire endpoint
      descriptor back including the TailP which should under driver
      control. This violate the specification and can race with a host
      driver updating the TD list at the same time.
      
      In each case the solution is to make sure we don't write data which is
      under driver control.
      
      Cc: Gerd Hoffman <kraxel@redhat.com>
      Signed-off-by: NWei Yang <weiyang@linux.vnet.ibm.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      86e18cae
    • G
      usb: zap hw/ush-{ohic,uhci}.h + init wrappers · afb9a60e
      Gerd Hoffmann 提交于
      Remove the uhci and ohci init wrappers, which all wrapped a
      pci_create_simple() one-liner.  Switch callsites to call
      pci_create_simple directly.  Remove the header files where
      the wrappers where declared.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      afb9a60e
    • 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
  7. 07 3月, 2012 1 次提交
    • H
      usb: add USB_RET_IOERROR · d61000a8
      Hans de Goede 提交于
      We already have USB_RET_NAK, but that means that a device does not want
      to send/receive right now. But with host / network redirection we can
      actually have a transaction fail due to some io error, rather then ie
      the device just not having any data atm.
      
      This patch adds a new error code named USB_RET_IOERROR for this, and uses
      it were appropriate.
      
      Notes:
      -Currently all usb-controllers handle this the same as NODEV, but that
       may change in the future, OHCI could indicate a CRC error instead for example.
      -This patch does not touch hw/usb-musb.c, that is because the code in there
       handles STALL and NAK specially and has a if status < 0 generic catch all
       for all other errors
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d61000a8
  8. 15 2月, 2012 1 次提交
  9. 10 2月, 2012 4 次提交
    • G
      usb: Set USBEndpoint in usb_packet_setup(). · 079d0b7f
      Gerd Hoffmann 提交于
      With the separation of the device lookup (via usb_find_device) and
      packet processing we can lookup device and endpoint before setting up
      the usb packet.  So we can initialize USBPacket->ep early and keep it
      valid for the whole lifecycle of the USBPacket.  Also the devaddr and
      devep fields are not needed any more.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      079d0b7f
    • G
      usb: USBPacket: add status, rename owner -> ep · f53c398a
      Gerd Hoffmann 提交于
      Add enum to track the status of USBPackets, use that instead of the
      owner pointer to figure whenever a usb packet is currently in flight
      or not.  Add some more packet status sanity checks.  Also rename the
      USBEndpoint pointer from "owner" to "ep".
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      f53c398a
    • G
      usb-ohci: switch to usb_find_device() · 993048bb
      Gerd Hoffmann 提交于
      Switch over OHCI to use the new usb_find_device()
      function for device lookup.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      993048bb
    • G
      usb: kill USB_MSG_RESET · d28f4e2d
      Gerd Hoffmann 提交于
      The USB subsystem pipes internal reset notifications through
      usb_handle_packet() with a special magic PID.  This indirection
      is a pretty pointless excercise as it ends up being handled by
      usb_generic_handle_packet anyway.
      
      Replace the USB_MSG_RESET with a usb_device_reset() function
      which can be called directly.  Also rename the existing usb_reset()
      function to usb_port_reset() to avoid confusion.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d28f4e2d
  10. 04 2月, 2012 1 次提交
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      Anthony Liguori 提交于
      This was done in a mostly automated fashion.  I did it in three steps and then
      rebased it into a single step which avoids repeatedly touching every file in
      the tree.
      
      The first step was a sed-based addition of the parent type to the subclass
      registration functions.
      
      The second step was another sed-based removal of subclass registration functions
      while also adding virtual functions from the base class into a class_init
      function as appropriate.
      
      Finally, a python script was used to convert the DeviceInfo structures and
      qdev_register_subclass functions to TypeInfo structures, class_init functions,
      and type_register_static calls.
      
      We are almost fully converted to QOM after this commit.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      39bffca2
  11. 28 1月, 2012 4 次提交
  12. 17 1月, 2012 1 次提交
  13. 06 1月, 2012 1 次提交
    • A
      usb-ohci: td.cbp incorrectly updated near page end · fd891c93
      Andriy Gapon 提交于
      The current code that updates the cbp value after a transfer looks like this:
      td.cbp += ret;
      if ((td.cbp & 0xfff) + ret > 0xfff) {
      	<handle page overflow>
      because the 'ret' value is effectively added twice the check may fire too early
      when the overflow hasn't happened yet.
      
      Below is one of the possible changes that correct the behavior:
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      fd891c93
  14. 28 11月, 2011 1 次提交
  15. 13 10月, 2011 3 次提交
  16. 20 9月, 2011 1 次提交
  17. 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
  18. 08 8月, 2011 1 次提交
  19. 04 8月, 2011 1 次提交
    • G
      usb: use iovecs in USBPacket · 4f4321c1
      Gerd Hoffmann 提交于
      Zap data pointer from USBPacket, add a QEMUIOVector instead.
      Add a bunch of helper functions to manage USBPacket data.
      Switch over users to the new interface.
      
      Note that USBPacket->len was used for two purposes:  First to
      pass in the buffer size and second to return the number of
      transfered bytes or the status code on async transfers.  There
      is a new result variable for the latter.  A new status code
      was added to catch uninitialized result.
      
      Nobody creates iovecs with more than one element (yet).
      Some users are (temporarely) limited to iovecs with a single
      element to keep the patch size as small as possible.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4f4321c1
  20. 29 7月, 2011 1 次提交
  21. 08 7月, 2011 1 次提交
  22. 05 7月, 2011 4 次提交
  23. 23 6月, 2011 1 次提交
  24. 14 6月, 2011 2 次提交