History | View | Annotate | Download (20.3 kB)
scsi: pass residual amount to command_complete
With the upcoming sglist support, HBAs will not see any transfer_datacall and will not have a way to detect short transfers. So pass theresidual amount of data upon command completion.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qom: Unify type registration
Replace device_init() with generalized type_init().
While at it, unify naming convention: type_init([$prefix_]register_types)Also, type_init() is a function, so add preceding blank line wherenecessary and don't put a semicolon after the closing brace....
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
sysbus: apic: ioapic: convert to QEMU Object Model
This converts three devices because apic and ioapic are subclasses of sysbus.Converting subclasses independently of their base class is prohibitively hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sysbus: rename sysbus_init_mmio_region() to sysbus_init_mmio()
Signed-off-by: Avi Kivity <avi@redhat.com>
esp: convert to memory API
[benoit: fix]
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>Signed-off-by: Avi Kivity <avi@redhat.com>
scsi: move tcq/ndev to SCSIBusOps (now SCSIBusInfo)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi: remove devs array from SCSIBus
Change the devs array into a linked list, and add a scsi_device_findfunction to navigate the children list instead. This lets the SCSIbus use more complex addressing, and HBAs can talk to the correct devicewhen there are multiple LUNs per target....
scsi: allow arbitrary LUNs
This only requires changes in two places: in SCSIBus, we need to lookfor a free LUN if somebody creates a device with a pre-existing scsi-idbut the default LUN (-1, meaning "search for a free spot"); in vSCSI,we need to actually parse the LUN according to the SCSI spec....
scsi: add channel to addressing
This also requires little more than adding the new argument toscsi_device_find, and the qdev property. All devices by defaultend up on channel 0.
ESP: convert to trace framework
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
esp: avoid structure holes spotted by pahole
Report from pahole on amd64 host:struct ESPState { SysBusDevice busdev; /* 0 5648 / / --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- / uint32_t it_shift; / 5648 4 */...
scsi: pass cdb already to scsi_req_new
Right now the CDB is not passed to the SCSIBus until scsi_req_enqueue.Passing it to scsi_req_new will let scsi_req_new dispatch common requeststhrough different reqops.
Moving the memcpy to scsi_req_new is a hack that will go away as...
scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the commandfrom the driver. So we should make that explicit byreplacing 'tag' with a driver-defined pointer 'hba_private'.This saves the lookup for driver handling several commands...
esp: cancel current request only if some request is in flight
This bug was introduced in 94d3f98a3f3caddd7875f9a11776daeb84962a7b:scsi_cancel_io was checking if some request was pending before tryingto cancel it, while scsi_req_cancel always cancels the request....
esp: correctly fill bus id with requested lun
This bug showed up after 1455084ea2c48abf23c4e4e15e378ee43457f381, andmay be seen only on operating systems not using DMA to give commandsto SCSI adapter.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
esp: rename sense to status
This mirrors the LSI patch that was recently committed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: split command_complete callback in two
scsi: rename arguments to the new callbacks
scsi: do not call send_command directly
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: introduce scsi_req_new
scsi: introduce scsi_req_continue
scsi: introduce scsi_req_get_buf
... and remove some SCSIDevice variables or fields that now become unused.
scsi: Use 'SCSIRequest' directly
Currently the SCSIRequest structure is abstracted away and cannot accesseddirectly from the driver. This requires the handler to do a lookup onan abstract 'tag' which identifies the SCSIRequest structure.
With this patch the SCSIRequest structure is exposed to the driver. This...
scsi: introduce scsi_req_cancel
This is for when the request must be dropped in the void,but still memory should be freed. To this end, the devicesregister a second callback in SCSIBusOps.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
ESP: fix ESP DMA access when DMA is not enabled
Sending ESP a command caused it to trigger DMA immediatelyeven if DMA was not enabled at the DMA controller.
Add a signal from DMA controller to ESP to tell ESP about changes inDMA enable bit. Also use the correct function for setting up GPIO outputs....
scsi: scsi_bus_legacy_handle_cmdline() can fail, fix callers
None of its callers checks for failure. scsi_hot_add() can crashbecause of that:
(qemu) drive_add 4 if=scsi,format=host_device,file=/dev/sg1scsi-generic: scsi generic interface too oldSegmentation fault (core dumped)...
esp: lower IRQ on soft reset
42f1ced228c9b616cfa2b69846025271618e4ef5 removed irq loweringduring reset. However, for chip reset command and DMA reset signal,its actually the correct thing to do.
Lower IRQ on soft reset only.
esp: use CamelCaseFunc for function types
ESP: improve IRQ debugging
scsi: move scsi.h -> esp.h
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: move scsi-disk.h -> scsi.h
sparc32 (mostly): remove unneeded calls to device reset
esp: convert to reset + vmsd
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
switch scsi bus to inplace allocation.
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
ESP: convert to VMState
qdev/scsi: add scsi bus support to qdev, convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,......
esp: handle "select without attention"
Up to now "select without attention" was handled the same way as"select with attention". According to
http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt
select without ATN sends the CDB (Command Descriptor Block) directly,...
esp (sparc32) Extra scsi data.
ESP: Message Accepted (12)ESP: Transfer status (sense=0)ESP: read reg5: 0x20ESP: read reg4: 0x07ESP: read reg7: 0x02Extra scsi data. Fatal error.
It looks like "Message Accepted" shouldn't write a response. At least...
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
Make CPURead/WriteFunc structure 'const'
ESP: implement Transfer Pad
ESP: Implement select without ATN, fix comments
Sparc32: move sparc32_dma init to sun4m.c
Also connect ESP and Lance reset signals to DMA.
esp: fix interrupt register read
Read of interrupt register should clear it and also sequence step and status.
qdev: rework device properties.
This patch is a major overhaul of the device properties. The propertiesare saved directly in the device state struct now, the linked list ofproperty values is gone.
Advantages: * We don't have to maintain the list with the property values....
Revert "Introduce reset notifier order"
This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (andupdates later added users of qemu_register_reset), we solved theproblem it originally addressed less invasively.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Don't set IRQs on device reset and loadvm/savevm
Remove io_index argument from cpu_register_io_memory()
The parameter is always zero except when registering the three internalio regions (ROM, unassigned, notdirty). Remove the parameter to reducethe API's power, thus facilitating future change.
Signed-off-by: Avi Kivity <avi@redhat.com>...
Remove qdev irq sink handling
We have both IRQ sinks and GPIO inputs. These are in principle exactlythe same thing, so remove the former.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Introduce reset notifier order
Add the parameter 'order' to qemu_register_reset and sort callbacks onregistration. On system reset, callbacks with lower order will beinvoked before those with higher order. Update all existing users to thestandard order 0....
ESP SCSI qdev conversion
Replace gcc variadic macro extension with C99 version
hw: remove error handling from qemu_malloc() callers (Avi Kivity)
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
Remove address masking
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5853 c046a42c-6fe2-441c-8c8c-71466251a162
Fix ICCS command (Herve Poussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5818 c046a42c-6fe2-441c-8c8c-71466251a162
Fix 'enable selection' command (esp_4_ensel.diff)Indicate success after 'enable selection' command
Signed-off-by: Herve Poussineau <hpoussin@reactos.org>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5814 c046a42c-6fe2-441c-8c8c-71466251a162
Fix command len detection (esp_3_cmdlen.diff)When command is not DMA, TCMID and TCLO registers are not filled. Use command buffer len instead
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5813 c046a42c-6fe2-441c-8c8c-71466251a162
Fix configuration 2 register (esp_2_cfg2.diff):According to http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt,"Any bit pattern written to this register may be read back and should be identical"
Signed-off-by: Herve Poussineau <hpoussin@reactos.org>...
Misc fixes (Herve Poussineau)- Fix internal fifo size (16 bytes), according to http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt- Fix values of STAT_MI and STAT_MO- Give a scsi ID to adapter, and prevent this ID to be used by devices...
Resurrect the safe part of r5274
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5401 c046a42c-6fe2-441c-8c8c-71466251a162
Sun ss20 OBP does 32bit register access to esp (Robert Reif)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5394 c046a42c-6fe2-441c-8c8c-71466251a162
Revert r5274 which breaks savevm/loadvm
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5321 c046a42c-6fe2-441c-8c8c-71466251a162
Add signed versions of save/load functions
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5274 c046a42c-6fe2-441c-8c8c-71466251a162
Suppress OpenBSD warning messages for leftover fifo bytes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4791 c046a42c-6fe2-441c-8c8c-71466251a162
Fix compilation warning
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4638 c046a42c-6fe2-441c-8c8c-71466251a162
Fix compiler warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4404 c046a42c-6fe2-441c-8c8c-71466251a162
Fix irq handling (Hervé Poussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4245 c046a42c-6fe2-441c-8c8c-71466251a162
ESP: Add it_shift parameter (Hervé Poussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4186 c046a42c-6fe2-441c-8c8c-71466251a162
Let ESP SCSI adapter to be usable outside sun4m (Herv�oussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4007 c046a42c-6fe2-441c-8c8c-71466251a162
Register only valid register access widths
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3881 c046a42c-6fe2-441c-8c8c-71466251a162
Real SCSI device passthrough (v4), by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3851 c046a42c-6fe2-441c-8c8c-71466251a162
SCSI cleanup, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3797 c046a42c-6fe2-441c-8c8c-71466251a162
Add -drive parameter, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 c046a42c-6fe2-441c-8c8c-71466251a162
Name the magic constants, wrap long lines
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3751 c046a42c-6fe2-441c-8c8c-71466251a162
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
More detabification
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3338 c046a42c-6fe2-441c-8c8c-71466251a162
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in 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 files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
Use qemu_irq for a reset signal between DMA and ESP/Lance
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3120 c046a42c-6fe2-441c-8c8c-71466251a162
Enable Selection command (NetBSD)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3117 c046a42c-6fe2-441c-8c8c-71466251a162
Use qemu_irqs between dma controllers and esp, lance
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2873 c046a42c-6fe2-441c-8c8c-71466251a162
Split DMA controller in twoFix register size related bugs
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2869 c046a42c-6fe2-441c-8c8c-71466251a162
Use full 36-bit physical address space on SS10
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2830 c046a42c-6fe2-441c-8c8c-71466251a162
Fix Sparc32 device save methods
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2657 c046a42c-6fe2-441c-8c8c-71466251a162
Fix SCSI cdrom boot, thanks Blue Swirl.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2278 c046a42c-6fe2-441c-8c8c-71466251a162
SPARC SCSI fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2158 c046a42c-6fe2-441c-8c8c-71466251a162
Separate the DMA controllers - Convert ESP to new DMA methods (Blue Swirl)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2143 c046a42c-6fe2-441c-8c8c-71466251a162
SCSI TCQ support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2139 c046a42c-6fe2-441c-8c8c-71466251a162
ESP DMA fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2110 c046a42c-6fe2-441c-8c8c-71466251a162
SCSI and USB async IO support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
SATN fixes (Blue Swirl).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1947 c046a42c-6fe2-441c-8c8c-71466251a162
SCSI lun probing fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1945 c046a42c-6fe2-441c-8c8c-71466251a162
Fix partial transfer bug.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1943 c046a42c-6fe2-441c-8c8c-71466251a162
Rearrange SCSI disk emulation code.Add USB mass storage device emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1940 c046a42c-6fe2-441c-8c8c-71466251a162