Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=453941455218a81eedcea5dbafa38b8815920a8c
Commit:     453941455218a81eedcea5dbafa38b8815920a8c
Parent:     ad355b4628a19ba2af30409e13083edda221a5c9
Author:     Jeff Garzik <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 21 06:23:42 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:55:40 2007 -0400

    [libata] Slightly improved no-op REQUEST SENSE, SEND DIAGNOSTIC
    
    A few pedantic apps care about missing or lame "mandatory" SCSI
    commands, so
    
    REQUEST SENSE -- as we autosense, R.S. just returns zeroes
    
    SEND DIAGNOSTIC -- our default (no-op) self-test succeeds, all
                   other requests for testing fail.
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-scsi.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index b399662..7955090 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2912,6 +2912,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct 
scsi_cmnd *cmd,
 {
        struct ata_scsi_args args;
        const u8 *scsicmd = cmd->cmnd;
+       u8 tmp8;
 
        args.dev = dev;
        args.id = dev->id;
@@ -2926,7 +2927,6 @@ void ata_scsi_simulate(struct ata_device *dev, struct 
scsi_cmnd *cmd,
                case SEEK_10:
                case TEST_UNIT_READY:
                case FORMAT_UNIT:               /* FIXME: correct? */
-               case SEND_DIAGNOSTIC:           /* FIXME: correct? */
                        ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
                        break;
 
@@ -2979,8 +2979,19 @@ void ata_scsi_simulate(struct ata_device *dev, struct 
scsi_cmnd *cmd,
                        ata_scsi_rbuf_fill(&args, ata_scsiop_report_luns);
                        break;
 
-               /* mandatory commands we haven't implemented yet */
                case REQUEST_SENSE:
+                       ata_scsi_set_sense(cmd, 0, 0, 0);
+                       cmd->result = (DRIVER_SENSE << 24);
+                       done(cmd);
+                       break;
+
+               case SEND_DIAGNOSTIC:
+                       tmp8 = scsicmd[1] & ~(1 << 3);
+                       if ((tmp8 == 0x4) && (!scsicmd[3]) && (!scsicmd[4]))
+                               ata_scsi_rbuf_fill(&args, ata_scsiop_noop);
+                       else
+                               ata_scsi_invalid_field(cmd, done);
+                       break;
 
                /* all other commands */
                default:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to