summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2011-05-311-1/+1
|\
| * pflash_cfi02: Fix a typo in debug code (TARGET_FMT_pld -> TARGET_FMT_plx)Stefan Weil2011-05-291-1/+1
| | | | | | | | | | | | | | Thanks to Tobias Hoffmann <th55@gmx.de> for this patch. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Merge remote-tracking branch 'amit/for-anthony' into stagingAnthony Liguori2011-05-313-71/+70
|\ \
| * | virtio-console: Simplify init callbacksMarkus Armbruster2011-05-271-26/+9
| | | | | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * | virtio-serial: Drop redundant VirtIOSerialPort member infoMarkus Armbruster2011-05-273-20/+32
| | | | | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * | virtio-serial: Drop useless property is_consoleMarkus Armbruster2011-05-272-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | All you could ever achieve with it is break stuff, so removing it should be safe. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * | virtio-serial: Clean up virtconsole detectionMarkus Armbruster2011-05-273-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtio-serial-bus needs to treat "virtconsole" devices specially. It uses VirtIOSerialPort member is_console to recognize them. It gets its value via property initialization. Cute hack, except it lets users mess with it: "-device virtconsole,is_console=0" isn't plugged into port 0 as it should. Move the flag to VirtIOSerialPortInfo. Keep the property for backward compatibility; its value has no effect. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * | virtio-serial: Plug memory leak on qdev exit()Markus Armbruster2011-05-271-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtio_serial_init() allocates the VirtIOSerialBus dynamically, but virtio_serial_exit() doesn't free it. Fix by getting rid of the allocation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
| * | virtio-serial-bus: use bh for unthrottlingAlon Levy2011-05-272-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calling flush_queued_data when unthrottling, schedule a bh. That way we can return immediately to the caller, and the flush uses the same call path as a have_data for callbackee. No migration change is required because bh are called from vm_stop. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
* | | Merge remote-tracking branch 'bonzini/scsi.2' into stagingAnthony Liguori2011-05-318-573/+860
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: hw/usb-msd.c
| * | | scsi: ignore LUN field in the CDBPaolo Bonzini2011-05-262-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LUN field in the CDB is a historical relic. Ignore it as reserved, which is what modern SCSI specifications actually say. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: rename arguments to the new callbacksPaolo Bonzini2011-05-264-37/+34
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | scsi: split command_complete callback in twoPaolo Bonzini2011-05-266-137/+168
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | esp: rename sense to statusPaolo Bonzini2011-05-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This mirrors the LSI patch that was recently committed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | scsi-generic: Handle queue fullPaolo Bonzini2011-05-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sg driver currently has a hardcoded limit of commands it can handle simultaneously. When this limit is reached the driver will return -EDOM. So we need to capture this to enable proper return values here. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: make write_data return voidPaolo Bonzini2011-05-263-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The return value is unused anyway. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi-disk: add data direction checkingHannes Reinecke2011-05-261-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scsi_req_parse() already provides for a data direction setting, so we should be using it to check for correct direction. And we should return the sense code 'INVALID FIELD IN CDB' in these cases. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: Implement 'get_sense' callbackHannes Reinecke2011-05-265-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The get_sense callback copies existing sense information into the provided buffer. This is required if sense information should be transferred together with the command response. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_get_bufPaolo Bonzini2011-05-266-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and remove some SCSIDevice variables or fields that now become unused. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_continuePaolo Bonzini2011-05-266-60/+46
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_newPaolo Bonzini2011-05-266-5/+10
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: do not call send_command directlyPaolo Bonzini2011-05-268-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: Update sense code handlingHannes Reinecke2011-05-264-67/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SCSI spec has a quite detailed list of sense codes available. It even mandates the use of specific ones for some failure cases. The current implementation just has one type of generic error which is actually a violation of the spec in certain cases. This patch introduces various predefined sense codes to have the sense code reporting more in line with the spec. On top of Hannes's patch I fixed the reply to REQUEST SENSE commands with DESC=0 and a small (<18) length. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: use scsi_req_completePaolo Bonzini2011-05-261-3/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_cancelPaolo Bonzini2011-05-268-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for when the request must be dropped in the void, but still memory should be freed. To this end, the devices register a second callback in SCSIBusOps. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_abortPaolo Bonzini2011-05-263-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers the case of canceling a request's I/O and still completing it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: commonize purging requestsPaolo Bonzini2011-05-264-32/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for canceling requests upon reset is already the same. Clean it up and move it to scsi-bus.c. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: Use 'SCSIRequest' directlyHannes Reinecke2011-05-268-252/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the SCSIRequest structure is abstracted away and cannot accessed directly from the driver. This requires the handler to do a lookup on an abstract 'tag' which identifies the SCSIRequest structure. With this patch the SCSIRequest structure is exposed to the driver. This allows use to use it directly as an argument to the SCSIDeviceInfo callback functions and remove the lookup. A new callback function 'alloc_req' is introduced matching 'free req'; unref'ing to free up resources after use is moved into the scsi_command_complete callbacks. This temporarily introduces a leak of requests that are cancelled, when they are removed from the queue and not from the driver. This is fixed later by introducing scsi_req_cancel. That patch in turn depends on this one, because the argument to scsi_req_cancel is a SCSIRequest. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | lsi: extract lsi_find_by_tagPaolo Bonzini2011-05-261-25/+38
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: reference-count requestsPaolo Bonzini2011-05-264-23/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the next patch, a device may hold SCSIRequest for an indefinite time. Split a rather big patch, and protect against access errors, by reference counting them. There is some ugliness in scsi_send_command implementation due to the need to unref the request when it fails. This will go away with the next patches, which move the unref'ing to the devices. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | scsi-generic: do not use a stale aiocbPaolo Bonzini2011-05-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a request is canceled after it has been completed, scsi_cancel_io would pass a stale aiocb to bdrv_aio_cancel. Avoid this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce SCSIBusOpsPaolo Bonzini2011-05-267-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are more operations than a SCSI bus can handle, besides completing commands. One example, which this series will introduce, is cleaning up after a request is cancelled. More long term, a "SCSI bus" can represent the LUNs attached to a target; in this case, while all commands will ultimately reach a logical unit, it is the target who is in charge of answering REPORT LUNs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
| * | | scsi: introduce scsi_req_dataPaolo Bonzini2011-05-264-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This abstracts calling the command_complete callback, reducing churn in the following patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi-generic: Remove bogus double completePaolo Bonzini2011-05-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scsi-generic scsi_read_complete() should not -both- call the client complete callback with SCSI_REASON_DATA -and- call scsi_command_complete(). The former will cause the client to queue a new read or write request, while the later will free the request data structure, thus causing the new read or write request to use a freed/stale structure when it completes. This patch fixes the bug, fixing a crash with scsi-generic & RHEL5.5 installer. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
| * | | scsi: add tracing of scsi requestsPaolo Bonzini2011-05-261-0/+6
| |/ / | | | | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
* | | Merge remote-tracking branch 'kraxel/usb.14.pull' into stagingAnthony Liguori2011-05-3118-80/+2263
|\ \ \ | |_|/ |/| |
| * | usb: add ehci adapterGerd Hoffmann2011-05-262-0/+2038
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch finally merges the EHCI host adapter aka USB 2.0 support. Based on the ehci bits collected @ git://git.kiszka.org/qemu.git ehci EHCI has a long out-of-tree history. Project was started by Mark Burkley, with contributions by Niels de Vos. David S. Ahern continued working on it. Kevin Wolf, Jan Kiszka and Vincent Palatin contributed bugfixes. /me (Gerd Hoffmann) picked it up where it left off, prepared the code for merge, fixed a few bugs and added basic user docs. Cc: David S. Ahern <daahern@cisco.com> Cc: Jan Kiszka <jan.kiszka@web.de> Cc: Kevin Wolf <mail@kevin-wolf.de> Cc: Vincent Palatin <vincent.palatin_qemu@m4x.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: move cancel callback to USBDeviceInfoGerd Hoffmann2011-05-263-18/+9
| | | | | | | | | | | | | | | | | | | | | Remove the cancel callback from the USBPacket struct, move it over to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: keep track of packet owner.Gerd Hoffmann2011-05-262-15/+35
| | | | | | | | | | | | | | | | | | Keep track of the device which owns the usb packet for async processing. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: add usb_handle_packetGerd Hoffmann2011-05-266-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | Add a usb_handle_packet function, put it into use everywhere. Right now it just calls dev->info->handle_packet(), that will change in future patches though. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-storage: don't call usb_packet_complete twiceGerd Hoffmann2011-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usb_msd_copy_data() may cause a recursive call to usb_msd_command_complete() which in turn may complete the packet, setting s->packet to NULL in case it does. Recheck s->packet before calling usb_packet_complete() to fix the double call. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-linux: use usb_generic_handle_packet()Hans de Goede2011-05-262-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | Make the linux usb host passthrough code use the usb_generic_handle_packet() function, rather then the curent DYI code. This removes 200 lines of almost identical code. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * | usb: Pass the packet to the device's handle_control callbackHans de Goede2011-05-2613-35/+38
| | | | | | | | | | | | | | | | | | | | | | | | This allows using the generic usb_generic_handle_packet function from device code which does ASYNC control requests (such as the linux host pass through code). Signed-off-by: Hans de Goede <hdegoede@redhat.com>
| * | Bug #757654: UHCI fails to signal stall response patchJan Vesely2011-05-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | UHCI host controller status register indicates error and an interrupt is triggered on BABBLE and STALL errors. Signed-off-by: Jan Vesely <jano.vesely@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: add support for "grouped" interfaces and the Interface Association ↵Brad Hards2011-05-263-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Descriptor This is used for some devices that have multiple interfaces that form a logic device. An example is Video Class, which has a Control interface and a Streaming interface. There can be additional interfaces on the same (physical) devices (e.g. a microphone), and Interface Association Descriptor handles this case. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: remove fallback to bNumInterfaces if no .nifBrad Hards2011-05-261-3/+2
| | | | | | | | | | | | | | | | | | | | | All callers have been updated. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: update config descriptors to identify number of interfacesBrad Hards2011-05-265-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Previously we relied on the .bNumInterfaces, but that won't always be accurate after the introduction of grouped interfaces. Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb: Add Interface Association Descriptor descriptor typeBrad Hards2011-05-261-0/+1
| |/ | | | | | | | | Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | bitbang_i2c: Fix spurious slave read after NACKMarcus Comstedt2011-05-281-1/+4
|/ | | | | | | | | After NACKing a read operation, a raising SCL should not trigger a new read from the slave. Introduce a new state which just waits for a stop or start condition after NACK. Signed-off-by: Marcus Comstedt <marcus@mc.pp.se> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
* Merge remote-tracking branch 'kraxel/CVE-2011-1751' into stagingAnthony Liguori2011-05-251-1/+3
|\
OpenPOWER on IntegriCloud