diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-09-21 07:26:08 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:40 -0400 |
commit | 00bd02027fc4a5cf92a3e538896b3642b40515df (patch) | |
tree | e5e2a72a467577a5a65be5886f96039c2f62a8af /drivers/ata/libata-scsi.c | |
parent | 453941455218a81eedcea5dbafa38b8815920a8c (diff) |
[libata] SCSI: improve FORMAT UNIT; minor code cleanups
* SAT specifies that FORMAT UNIT should be translated into a series
of READ and WRITE commands that zero the ATA device. That is far too
cumbersome to bother with.
Since we don't actually format the device, the old behavior of
always returning success was inaccurate. Change FORMAT UNIT from
returning success immediately (old behavior) to always returning
an error (new behavior).
* Add some comments around SYNCHRONIZE CACHE
* Shuffle scsi command code around a bit, so that things are close
to alphabetic order.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 79550908adcc..553488015e49 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2920,14 +2920,9 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | |||
2920 | args.done = done; | 2920 | args.done = done; |
2921 | 2921 | ||
2922 | switch(scsicmd[0]) { | 2922 | switch(scsicmd[0]) { |
2923 | /* no-op's, complete with success */ | 2923 | /* TODO: worth improving? */ |
2924 | case SYNCHRONIZE_CACHE: | 2924 | case FORMAT_UNIT: |
2925 | case REZERO_UNIT: | 2925 | ata_scsi_invalid_field(cmd, done); |
2926 | case SEEK_6: | ||
2927 | case SEEK_10: | ||
2928 | case TEST_UNIT_READY: | ||
2929 | case FORMAT_UNIT: /* FIXME: correct? */ | ||
2930 | ata_scsi_rbuf_fill(&args, ata_scsiop_noop); | ||
2931 | break; | 2926 | break; |
2932 | 2927 | ||
2933 | case INQUIRY: | 2928 | case INQUIRY: |
@@ -2985,6 +2980,20 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd, | |||
2985 | done(cmd); | 2980 | done(cmd); |
2986 | break; | 2981 | break; |
2987 | 2982 | ||
2983 | /* if we reach this, then writeback caching is disabled, | ||
2984 | * turning this into a no-op. | ||
2985 | */ | ||
2986 | case SYNCHRONIZE_CACHE: | ||
2987 | /* fall through */ | ||
2988 | |||
2989 | /* no-op's, complete with success */ | ||
2990 | case REZERO_UNIT: | ||
2991 | case SEEK_6: | ||
2992 | case SEEK_10: | ||
2993 | case TEST_UNIT_READY: | ||
2994 | ata_scsi_rbuf_fill(&args, ata_scsiop_noop); | ||
2995 | break; | ||
2996 | |||
2988 | case SEND_DIAGNOSTIC: | 2997 | case SEND_DIAGNOSTIC: |
2989 | tmp8 = scsicmd[1] & ~(1 << 3); | 2998 | tmp8 = scsicmd[1] & ~(1 << 3); |
2990 | if ((tmp8 == 0x4) && (!scsicmd[3]) && (!scsicmd[4])) | 2999 | if ((tmp8 == 0x4) && (!scsicmd[3]) && (!scsicmd[4])) |