1. 26 4月, 2012 1 次提交
    • G
      usb: add serial number generator · 9d55d1ad
      Gerd Hoffmann 提交于
      This patch adds a function which creates unique serial numbers for usb
      devices and puts it into use.  Windows guests tend to become unhappy if
      they find two identical usb devices in the system.  Effects range from
      non-functional devices (with yellow exclamation mark in device manager)
      to BSODs.  Handing out unique serial numbers to devices fixes this.
      
      With this patch applied almost all emulated devices get a generated,
      unique serial number.  There are two exceptions:
      
       * usb-storage devices will prefer a user-specified serial number
         and will only get a generated number in case the serial property
         is unset.
       * usb-hid devices keep the fixed serial number "42" as it is used
         to signal "remote wakeup actually works".
         See commit 7b074a22Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9d55d1ad
  2. 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
  3. 08 3月, 2012 1 次提交
  4. 27 2月, 2012 1 次提交
  5. 15 2月, 2012 1 次提交
  6. 10 2月, 2012 3 次提交
    • G
      usb: pass USBEndpoint to usb_wakeup · 7567b51f
      Gerd Hoffmann 提交于
      Devices must specify which endpoint has data to transfer now.
      The plan is to use the usb_wakeup() not only for remove wakeup support,
      but for "data ready" signaling in general, so we can move away from
      constant polling to event driven usb device emulation.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7567b51f
    • 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: 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
  7. 04 2月, 2012 3 次提交
  8. 28 1月, 2012 3 次提交
  9. 13 1月, 2012 1 次提交
  10. 07 9月, 2011 2 次提交
  11. 03 9月, 2011 1 次提交
    • S
      Use new macro QEMU_PACKED for packed structures · 541dc0d4
      Stefan Weil 提交于
      Most changes were made using these commands:
      
      git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
      git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'
      git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/'
      git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/'
      git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/'
      
      Whitespace in linux-user/syscall_defs.h was fixed manually
      to avoid warnings from scripts/checkpatch.pl.
      
      Manual changes were also applied to hw/pc.c.
      
      I did not fix indentation with tabs in block/vvfat.c.
      The patch will show 4 errors with scripts/checkpatch.pl.
      Signed-off-by: NStefan Weil <weil@mail.berlios.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      541dc0d4
  12. 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
  13. 24 7月, 2011 1 次提交
  14. 24 6月, 2011 1 次提交
  15. 23 6月, 2011 1 次提交
    • H
      usb: Add a speedmask to devices · ba3f9bfb
      Hans de Goede 提交于
      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: NGerd Hoffmann <kraxel@redhat.com>
      ba3f9bfb
  16. 14 6月, 2011 1 次提交
  17. 01 6月, 2011 1 次提交
  18. 26 5月, 2011 1 次提交
  19. 07 4月, 2011 1 次提交
  20. 04 4月, 2011 1 次提交
  21. 02 4月, 2011 1 次提交
    • A
      usb-ccid: add CCID bus · 36707144
      Alon Levy 提交于
      A CCID device is a smart card reader. It is a USB device, defined at [1].
      This patch introduces the usb-ccid device that is a ccid bus. Next patches will
      introduce two card types to use it, a passthru card and an emulated card.
      
       [1] http://www.usb.org/developers/devclass_docs/DWG_Smart-Card_CCID_Rev110.
      Signed-off-by: NAlon Levy <alevy@redhat.com>
      
      ---
      
      changes from v20->v21: (Jes Sorenson review)
       * cosmetic changes - fix multi line comments.
       * reorder fields in USBCCIDState
       * add reference to COPYING
       * add --enable-smartcard and --disable-smartcard here (moved
       from last patch)
      
      changes from v19->v20:
       * checkpatch.pl
      
      changes from v18->v19:
       * merged: ccid.h: add copyright, fix define and remove non C89 comments
       * add qdev.desc
      
      changes from v15->v16:
      
      Behavioral changes:
       * fix abort on client answer after card remove
       * enable migration
       * remove side affect code from asserts
       * return consistent self-powered state
       * mask out reserved bits in ccid_set_parameters
       * add missing abRFU in SetParameters (no affect on linux guest)
      
      whitefixes / comments / consts defines:
       * remove stale comment
       * remove ccid_print_pending_answers if no DEBUG_CCID
       * replace printf's with DPRINTF, remove DEBUG_CCID, add verbosity defines
       * use error_report
       * update copyright (most of the code is not original)
       * reword known bug comment
       * add missing closing quote in comment
       * add missing whitespace on one line
       * s/CCID_SetParameter/CCID_SetParameters/
       * add comments
       * use define for max packet size
      
      Comment for "return consistent self-powered state":
      
      the Configuration Descriptor bmAttributes claims we are self powered,
      but we were returning not self powered to USB_REQ_GET_STATUS control message.
      
      In practice, this message is not sent by a linux 2.6.35.10-74.fc14.x86_64
      guest (not tested on other guests), unless you issue lsusb -v as root (for
      example).
      36707144