summaryrefslogtreecommitdiffstats
path: root/hw/usb-hid.c
Commit message (Collapse)AuthorAgeFilesLines
* un-register kbd driver in case of USB kbd unplug.Jes Sorensen2010-06-141-2/+6
| | | | | | | | | If a USB keyboard is unplugged, the keyboard eventhandler is never removed, and events will continue to be passed through to the device, causing crashes or memory corruption. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* blockdev: Collect block device code in new blockdev.cMarkus Armbruster2010-06-041-0/+1
| | | | | | | Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Rewrite mouse handlers to use QTAILQ and to have an activation functionAnthony Liguori2010-03-191-4/+11
| | | | | | | | | | | | | | | | | | | | | And convert usb-hid to use it (to avoid regression with bisection) Right now, when we do info mice and we've added a usb tablet, we don't see it until the guest starts using the tablet. We implement this behavior in order to provide a means to delay registration of a mouse handler since we treat the last registered handler as the current handler. This is a usability problem though as we would like to give the user feedback that they've either 1) not added an absolute device 2) there is an absolute device but the guest isn't using it 3) we have an absolute device and it's active. By using QTAILQ and having an explicit activation function that moves the handler to the front of the queue, we can implement the same semantics as before with respect to automatically switching to usb tablet while providing the user with a whole lot more information. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kbd leds: usb kbdGerd Hoffmann2010-03-091-0/+8
| | | | | | | Add led status notification support to the usb kbd driver. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* USB HID does not support Set_IdleKevin O'Connor2010-02-191-2/+10
| | | | | | | | | | | | | | | I found that the QEMU USB keyboard support does not work properly with the Set_Idle command. Once a non-zero value is given to Set_Idle, then the keyboard reports an event on every poll - not based on the time issued in the Set_Idle command. I changed the code (see patch below) and it works for me. I'm not that familiar with the qemu internals, so I'm not sure if this is the best way to implement this feature. -Kevin Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make USB hid devices self-poweredRiku Voipio2009-12-181-1/+1
| | | | | | | Simplifies power budget negotiation. Signed-off-by: Riku Voipio <riku.voipio@nokia.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* qdev: Replace device names containing whitespaceMarkus Armbruster2009-12-121-6/+3
| | | | | | | | | | | | Device names with whitespace require quoting in the shell and in the monitor. Some of the offenders are also overly long. Some have a more convenient alias, some don't. The place for verbose device names is DeviceInfo member desc. The name should be short & sweet. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Separate USB product description from qdev nameMarkus Armbruster2009-12-121-0/+3
| | | | | | | | | | | | Using the qdev name for the product description makes for inconvenient qdev names. Put the product description in new USBDeviceInfo member product_desc. Make usb_qdev_init() use it. No user or guest visible change, since the value is still the same. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Rename USBDevice member devname to product_descMarkus Armbruster2009-12-121-1/+1
| | | | | | | It's not a device name, it's the USB product description string. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb-hid: use qdev for -usbdeviceGerd Hoffmann2009-10-301-0/+3
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: hook unplug into qdev, cleanups + fixes.Gerd Hoffmann2009-10-051-1/+0
| | | | | | | | | | | | | | | Hook into DeviceInfo->exit(). handle_destroy() must not free the state struct, this is handled by the new usb_qdev_exit() function now. qdev_free(usb_device) works now. Fix usb hub to qdev_free() all connected devices on unplug. Unplugging a usb hub works now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev/usb: add some convinience aliases.Gerd Hoffmann2009-09-091-0/+3
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev/usb: make qemu aware of usb busses.Gerd Hoffmann2009-09-091-15/+0
| | | | | | | | | | | | | | Move usb code from vl.c to usb-bus.c and make it use the new data structures added by qdev conversion. qemu usb core should be able to handle multiple USB busses just fine now (untested though). Kill some usb_*_init() legacy functions, use usb_create_simple() instead. Kill some FIXMEs added by the first qdev/usb patch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev/usb: add usb bus support to qdev, convert drivers.Gerd Hoffmann2009-09-091-44/+62
| | | | | | | | | | | | | | * Add USBBus. * Add USBDeviceInfo, move device callbacks here. * Add usb-qdev helper functions. * Switch drivers to qdev. TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs added by this patch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* hw: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori2009-02-051-6/+0
| | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
* fix usb-hid SET_IDLE behaviour (Stefano Stabellini)aliguori2009-01-071-2/+2
| | | | | | | | | | | | | | | | | | | the usb-hid spec states that the SET_IDLE request has a 16bit value, where the upper byte specifies the idle rate (currently unimplemented, we handle only the 0 case, meaning infinite duration) and the lower byte specifies the report id (0 means all reports). In our code we do idle = value, while it should be idle = "upper byte", especially if the guest issues a GET_IDLE, we should return only the idle rate while we are returning only the report id. In practice it doesn't make much difference because I have only seen SET_VALUE with both bytes set to 0 so far, but still it is wrong. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6211 c046a42c-6fe2-441c-8c8c-71466251a162
* Bluetooth HIDP emulation on top of usb-hid.c and L2CAP and SDP.balrog2008-09-291-8/+34
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5347 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix range in the hid report descriptor for USB tablet.balrog2008-09-151-2/+2
| | | | | | | | Should prevent the ugly wrapping due to a typo in an earlier commit. Fix by Gregor (gg@seh.de). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5232 c046a42c-6fe2-441c-8c8c-71466251a162
* Try to fix USB HID and make the HID reports readable.balrog2008-05-171-48/+71
| | | | | | | | | Decode HID report Items in the comments. Invert mouse wheel direction as per Alexander Graf's report and as we already do in the tablet. Clamp the Relative values to -127:127 as we claimed in the HID descriptors. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4482 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix USB and HID report descriptors for mouse and tablet.balrog2008-04-261-18/+17
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4253 c046a42c-6fe2-441c-8c8c-71466251a162
* Add mouse wheel in the usb-mouse HID Report (by Daniel Godás).balrog2008-01-141-1/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3906 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-1/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
* Pass correct pointer to HID keyboard event handler, fixes regression from ↵balrog2007-09-171-1/+1
| | | | | | IDLE mode introduction. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3180 c046a42c-6fe2-441c-8c8c-71466251a162
* find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in ↵ths2007-09-171-7/+7
| | | | | | the regex. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
* find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths2007-09-161-22/+22
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement HID idle mode (avoids flooding guest with useless updates).pbrook2007-09-091-11/+29
| | | | | | | Fix UHCI NACK bug. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3157 c046a42c-6fe2-441c-8c8c-71466251a162
* Add USB HID keyboard.balrog2007-06-221-45/+344
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2996 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix usb hid and mass-storage protocol revision, by Juergen Keil.ths2007-03-311-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2558 c046a42c-6fe2-441c-8c8c-71466251a162
* increase USB table poll intervalbellard2007-02-111-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2422 c046a42c-6fe2-441c-8c8c-71466251a162
* Dynamic handling of guest mice, by Lonnie Mendez.ths2007-01-051-3/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2290 c046a42c-6fe2-441c-8c8c-71466251a162
* SCSI and USB async IO support.pbrook2006-08-121-6/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
* usb destroy API change (Lonnie Mendez)bellard2006-07-191-7/+11
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2066 c046a42c-6fe2-441c-8c8c-71466251a162
* display device identifier string for user with info usb (Lonnie Mendez)bellard2006-06-261-0/+4
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2029 c046a42c-6fe2-441c-8c8c-71466251a162
* Rearrange SCSI disk emulation code.pbrook2006-05-251-1/+7
| | | | | | | Add USB mass storage device emulation. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1940 c046a42c-6fe2-441c-8c8c-71466251a162
* USB tablet support (Brad Campbell, Anthony Liguori)bellard2006-04-121-15/+205
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1810 c046a42c-6fe2-441c-8c8c-71466251a162
* added virtual USB mouse supportbellard2005-11-051-0/+347
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1599 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud