Statistics
| Branch: | Revision:

root / hw / scsi-defs.h @ 26ca8c06

History | View | Annotate | Download (10.7 kB)

# Date Author Comment
cb9c377f 12/19/2012 09:31 am Paolo Bonzini

janitor: add guards to headers

Signed-off-by: Paolo Bonzini <>

e4b65262 08/03/2012 10:55 pm Cong Meng

scsi: add support for ATA_PASSTHROUGH_xx scsi command

Correct the command names of opcode 0x85 and 0xa1, and calculate
their xfer size from CDB.

Signed-off-by: Cong Meng <>
Signed-off-by: Paolo Bonzini <>

15e58a21 07/02/2012 12:27 pm Christian Hoff

scsi: Fix LOAD_UNLOAD

Change operation code of LOAD_UNLOAD command to 0x1b as described in
section 7.3 of the SCSI Stream Commands spec.

Signed-off-by: Christian Hoff <>
Signed-off-by: Christian Borntraeger <>...

40723a99 07/02/2012 12:27 pm Christian Hoff

scsi: Add basic support for SCSI media changer commands.

This adds basic support for SCSI media changer commands.
Not all commands are supported as of now, but enough to cover
basic functionality.

Signed-off-by: Christian Hoff <>...

9ce1bb2d 07/02/2012 12:27 pm Christian Hoff

scsi: Fix transfer length for READ POSITION commands.

The transfer length depends on the specific service action
code, as defined in the SCSI stream commands spec section 7.7.
Up to now only the extended form was supported.

Signed-off-by: Christian Hoff <>...

1a4f0c3a 07/02/2012 11:18 am Paolo Bonzini

scsi-disk: implement READ DISC INFORMATION

This command is not necessary for CD-ROM and DVD-ROM, but some versions of
udev trip on its absence.

Cc: Kevin Wolf <>
Cc: Markus Armbruster <>
Signed-off-by: Paolo Bonzini <>

065c2599 05/07/2012 09:44 am Paolo Bonzini

scsi: parse 16-byte tape CDBs

The transfer length for these commands is different from the transfer
length of the corresponding disk commands, so parse it specially.

Signed-off-by: Paolo Bonzini <>

3e46d87d 04/19/2012 05:26 pm Paolo Bonzini

scsi: add SANITIZE command

Signed-off-by: Paolo Bonzini <>

00a01ad4 11/18/2011 02:57 pm Paolo Bonzini

scsi: update list of commands

Add more commands and their names, and remove SEEK which is obsolete.
Instead, use SET_CAPACITY which is still in SSC.

Tested-by: Thomas Schmitt <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

67cc61e4 10/28/2011 08:25 pm Paolo Bonzini

atapi/scsi: unify definitions for MMC

The definitions in ide/internal.h are duplicates, since ATAPI commands
actually come from SCSI. Use the ones in scsi-defs.h and move the
missing ones there. Two exceptions:

- MODE_PAGE_WRITE_PARMS conflicts with the "flexible disk geometry"...

f0f992e6 10/28/2011 08:25 pm Paolo Bonzini

atapi: move GESN definitions to scsi-defs.h

As a complement to the previous patch, move definitions for GET EVENT
STATUS NOTIFICATION from the two functions to scsi-defs.h.

The NCR_* constants are just bit values corresponding to the ENC_*
values, with no offsets even, so keep just one copy....

b6c251ab 10/28/2011 08:25 pm Paolo Bonzini

scsi-disk: add stubs for more MMC commands

This patch adds a few stub implementations for MMC commands to
scsi-disk, to be filled in later in the series. It also adds to
scsi-defs.h constants for commands implemented by ide/atapi.c,
when missing.

Signed-off-by: Paolo Bonzini <>...

f6515262 09/06/2011 04:14 pm Paolo Bonzini

scsi: refine constants for READ CAPACITY 16

Rename SERVICE_ACTION_IN to SERVICE_ACTION_IN_16 to distinguish
from the 12-byte CDB variant, and add a constant for the subcommand.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

6dc06f08 08/12/2011 04:31 pm Paolo Bonzini

scsi: add support for unit attention conditions

Unit attention conditions override any sense data the device already
has. Their signaling and clearing is handled entirely by the SCSIBus
code, and they are completely transparent to the SCSIDevices.

Signed-off-by: Paolo Bonzini <>...

fdaef069 08/12/2011 04:30 pm Paolo Bonzini

scsi: move handling of REPORT LUNS and invalid LUNs to common code

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

3790372c 08/01/2011 01:10 pm Hannes Reinecke

scsi: Remove references to SET_WINDOW

SET_WINDOW command is vendor-specific only.
So we shouldn't try to emulate it.

Signed-off-by: Hannes Reinecke <>
Signed-off-by: Kevin Wolf <>

8bd3e139 08/01/2011 01:10 pm Hannes Reinecke

scsi: Remove REZERO_UNIT emulation

REZERO_UNIT command is obsolete. Remove support for it.

Signed-off-by: Hannes Reinecke <>
Signed-off-by: Kevin Wolf <>

5e30a07d 08/01/2011 01:10 pm Hannes Reinecke

scsi: Sanitize command definitions

Sanitize SCSI command definitions.
Add _10 suffix to READ_CAPACITY, WRITE_VERIFY, VERIFY, READ_LONG,
WRITE_LONG, and WRITE_SAME.
Add new command definitions for LOCATE_10, UNMAP, VARLENGTH_CDB,
WRITE_FILEMARKS_16, EXTENDED_COPY, ATA_PASSTHROUGH, ACCESS_CONTROL_IN,...

f37bd73b 08/01/2011 01:10 pm Hannes Reinecke

scsi-disk: Remove 'drive_kind'

Instead of using its own definitions scsi-disk should
be using the device type of the parent device.

Signed-off-by: Hannes Reinecke <>
Signed-off-by: Kevin Wolf <>

ea3bd56f 12/17/2010 05:11 pm Christoph Hellwig

scsi-disk: support WRITE SAME (16) with unmap bit

Support discards via the WRITE SAME command with the unmap bit set, and
tell the initiator about the support for it via the block limit and the
new thin provisioning EVPD pages. Also fix the comment which incorrectly...

f0171327 11/25/2010 01:00 pm Hannes Reinecke

scsi: Return SAM status codes

Traditionally, the linux stack is using SCSI status codes
which are shifted by one as compared to those defined in SAM.
A SCSI emulation should naturally return the SAM defined codes,
not the linux ones.
So to avoid any confusion this patch modifies the existing...

c7126d5b 06/22/2010 03:38 pm Nicholas Bellinger

scsi-bus: Add MAINTENANCE_IN and MAINTENANCE_OUT SCSIRequest xfer and mode assignments

This patch updates hw/scsi-bus.c to add MAINTENANCE_IN and MAINTENANCE_OUT case in
scsi_req_length() for TYPE_ROM with MMC commands. It also adds the MAINTENANCE_OUT
case in scsi_req_xfer_mode() to set SCSI_XFER_TO_DEV for outgoing write data....

70539e18 03/07/2010 05:48 pm Blue Swirl

Update to a hopefully more future proof FSF address

See also 8167ee883931cb20c6264fc19d040ce2dc6ceaaa,
530e7615ce3c01882e582c84dc6304ab98a3d5c5 and
fad6cb1a565bb73f83fc0e2654489457b489e436.

Signed-off-by: Blue Swirl <>

38215553 12/03/2009 05:41 pm Gerd Hoffmann

scsi-disk: restruct emulation: GET_CONFIGURATION

Move GET_CONFIGURATION emulation from scsi_send_command() to
scsi_disk_emulate_command().

Also add GET_CONFIGURATION to scsi-defs.h and scsi_command_name().

Signed-off-by: Gerd Hoffmann <>...

5dd90e2a 12/03/2009 05:41 pm Gerd Hoffmann

scsi-disk: restruct emulation: SERVICE_ACTION_IN

Move SERVICE_ACTION_IN emulation from scsi_send_command() to
scsi_disk_emulate_command().

Also add SERVICE_ACTION_IN to scsi-defs.h and scsi_command_name().

Signed-off-by: Gerd Hoffmann <>...

39ec9a50 12/03/2009 05:41 pm Gerd Hoffmann

scsi-disk: restruct emulation: REPORT_LUNS

Move REPORT_LUNS emulation from scsi_send_command() to
scsi_disk_emulate_command().

Also add REPORT_LUNS to scsi-defs.h and scsi_command_name().

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

bd536cf3 12/03/2009 05:41 pm Gerd Hoffmann

scsi: add read/write 16 commands.

Add READ_16 + friends to scsi-defs.h, scsi_command_name() and the
request parsing helper functions.

Use them in scsi-disk.c too.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

0d65e1f8 12/03/2009 05:41 pm Gerd Hoffmann

scsi: add scsi-defs.h

Largely based on <scsi/scsi.h> from linux. Added into the tree so we
can use the defines everywhere, not just in scsi-generic.c (which is
linux-specific).

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>