History log of /haiku/src/add-ons/kernel/busses/scsi/virtio/VirtioSCSIController.cpp
Revision Date Author Comments
# 6d42b430 03-Oct-2023 Jérôme Duval <jerome.duval@gmail.com>

virtio: support modern devices

fixes #17239 #17238

Change-Id: Ia5b6347110a60fab18852079b30dca6301010474
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6995
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 66d6afec 31-Aug-2019 Michael Lotz <mmlr@mlotz.ch>

virtio_scsi: Abort requests on timeout.

Previously the CCB would never complete when a timeout occured, leading
to all further IO stopping.

Abort the request by setting the CCB status to aborted and handing the
CCB back to the SCSI layer. That one will then handle the error (and
possibly retrying). This is similar to how such errors are handled in
AHCI and the ATA stack.

Since it is now possible that we receive a completion interrupt for an
already aborted request, we need to keep track of what request the
interrupts belong to and only notify when the current one completes. As
there currently can't be multiple requests in flight, a simple counter
is used.

Change-Id: Ib80e146605efd2f81123803f424cc7f66f52a6c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1815
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 9a2911ca 01-Sep-2019 Michael Lotz <mmlr@mlotz.ch>

virtio: Rework queue_dequeue to return a boolean.

It previously returned the cookie directly, which made it impossible
to distinguish between a NULL cookie and the function not having
anything to dequeue. This lead to some code setting a cookie that was
not actually used.

Return the dequeue status as a boolean and provide the cookie with an
optionally handed in pointer instead and adjust all users.

Change-Id: Iaac1726ac4bc7ae42bb96b8f0915852b6def5822
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1814
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 85fbdab0 31-Aug-2019 Michael Lotz <mmlr@mlotz.ch>

virtio_scsi: Remove unused fExpectsInterrupt and its spinlock.

The value is never actually checked. The use of a condition variable
makes it redundant since it will already either have a waiting entry,
or not.

Change-Id: Iafaecb7f9e56a2cf8932e05b82aad2b350fbce1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1812
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# edf7f4cd 08-May-2018 Jérôme Duval <jerome.duval@gmail.com>

virtio_scsi: actually write the cdb size

instead of the sense size. Should help with #14133.


# 6e82e428 16-Apr-2018 Jérôme Duval <jerome.duval@gmail.com>

virtio: refactor to have a handler per queue.

* enable to iterate on available entries in one interrupt call.
* negociate -> negotiate, (void *) -> (void* ), thanks axel and philippe!

Change-Id: Ie2d290797abcbf4c0f3cb5bfff71d091bb800fa6


# 1fb59be1 14-Apr-2018 Jérôme Duval <jerome.duval@gmail.com>

Fix some usages of BStackOrHeapArray.

Validates the buffer with IsValid() before actually using it. Thanks Rene!


# 4b588b36 07-Apr-2018 Jérôme Duval <jerome.duval@gmail.com>

virtio_scsi: avoid unbounded stack usage in ExecuteRequest().


# 3aeed660 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949


# 17c55998 23-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

Virtio SCSI: add a description for CHANGE feature.


# 2f2f475b 18-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

virtio*: remove trailing spaces


# e598dee7 17-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

virtio_scsi: now handles events like capacity data changed.

* push event requests on the event queue, handles them.
* activate feature VIRTIO_SCSI_F_CHANGE.
* when a capacity data changed event is received, schedule a rescan of the scsi device node
on the scsi dpc queue. we find out unique child node and call the rescan_node() hook.
* Haiku only handles media changed events on removable devices, so the feature
only actually works when the device is defined as such, aka for QEMU the following option:
-device scsi-hd,drive=hd,removable=true


# ed4a8e4d 17-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

virtio: changed a bit the driver API by adding a driverCookie.

* the processing of requests in drivers is eased a bit with this change, but
this could be improved for instance by enabling a driver to dequeue items
in a service thread instead of the interrupt handler.
* made a few methods const.


# 82fda49e 02-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

Virtio: added a driver with basic support for SCSI devices.

* Here is the Qemu command line option for Virtio SCSI devices:
-drive if=none,id=hd,file=haiku.image -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd
* virtio_scsi.h is copied unchanged from FreeBSD, except for the _PACKED directive.


# 3aeed6607cd07762c0e709633c012b3a632dbad9 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949


# 17c55998dc49cc84c859f564fae0e0a442194e49 23-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

Virtio SCSI: add a description for CHANGE feature.


# 2f2f475b1d35e32e2afdefe624686d8ab5936c35 18-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

virtio*: remove trailing spaces


# e598dee7522bba2b525730cb6e888c5a69c8aead 17-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

virtio_scsi: now handles events like capacity data changed.

* push event requests on the event queue, handles them.
* activate feature VIRTIO_SCSI_F_CHANGE.
* when a capacity data changed event is received, schedule a rescan of the scsi device node
on the scsi dpc queue. we find out unique child node and call the rescan_node() hook.
* Haiku only handles media changed events on removable devices, so the feature
only actually works when the device is defined as such, aka for QEMU the following option:
-device scsi-hd,drive=hd,removable=true


# ed4a8e4d11d7972d6fb6f025c108915ad06c73af 17-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

virtio: changed a bit the driver API by adding a driverCookie.

* the processing of requests in drivers is eased a bit with this change, but
this could be improved for instance by enabling a driver to dequeue items
in a service thread instead of the interrupt handler.
* made a few methods const.


# 82fda49e52a6d4fe217de033c350fee60ce56bff 02-Jul-2013 Jérôme Duval <jerome.duval@gmail.com>

Virtio: added a driver with basic support for SCSI devices.

* Here is the Qemu command line option for Virtio SCSI devices:
-drive if=none,id=hd,file=haiku.image -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd
* virtio_scsi.h is copied unchanged from FreeBSD, except for the _PACKED directive.