diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-03-24 20:26:52 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:02 -0400 |
commit | 11002fbcb472cf1176d97eac214df98f7c17f69c (patch) | |
tree | 0384a2615e3954b43a2b8422d776908a9faf5e1b /drivers/scsi/stex.c | |
parent | 526917641aa50eb852591cc3953a92374bedc836 (diff) |
[SCSI] stex: use scsi_build_sense_buffer
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Ed Lin <ed.lin@promise.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/stex.c')
-rw-r--r-- | drivers/scsi/stex.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 8c7b1830d9e8..f308a0308829 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <scsi/scsi_host.h> | 33 | #include <scsi/scsi_host.h> |
34 | #include <scsi/scsi_tcq.h> | 34 | #include <scsi/scsi_tcq.h> |
35 | #include <scsi/scsi_dbg.h> | 35 | #include <scsi/scsi_dbg.h> |
36 | #include <scsi/scsi_eh.h> | ||
36 | 37 | ||
37 | #define DRV_NAME "stex" | 38 | #define DRV_NAME "stex" |
38 | #define ST_DRIVER_VERSION "3.6.0000.1" | 39 | #define ST_DRIVER_VERSION "3.6.0000.1" |
@@ -362,22 +363,14 @@ static struct status_msg *stex_get_status(struct st_hba *hba) | |||
362 | return status; | 363 | return status; |
363 | } | 364 | } |
364 | 365 | ||
365 | static void stex_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq) | ||
366 | { | ||
367 | cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; | ||
368 | |||
369 | cmd->sense_buffer[0] = 0x70; /* fixed format, current */ | ||
370 | cmd->sense_buffer[2] = sk; | ||
371 | cmd->sense_buffer[7] = 18 - 8; /* additional sense length */ | ||
372 | cmd->sense_buffer[12] = asc; | ||
373 | cmd->sense_buffer[13] = ascq; | ||
374 | } | ||
375 | |||
376 | static void stex_invalid_field(struct scsi_cmnd *cmd, | 366 | static void stex_invalid_field(struct scsi_cmnd *cmd, |
377 | void (*done)(struct scsi_cmnd *)) | 367 | void (*done)(struct scsi_cmnd *)) |
378 | { | 368 | { |
369 | cmd->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION; | ||
370 | |||
379 | /* "Invalid field in cbd" */ | 371 | /* "Invalid field in cbd" */ |
380 | stex_set_sense(cmd, ILLEGAL_REQUEST, 0x24, 0x0); | 372 | scsi_build_sense_buffer(0, cmd->sense_buffer, ILLEGAL_REQUEST, 0x24, |
373 | 0x0); | ||
381 | done(cmd); | 374 | done(cmd); |
382 | } | 375 | } |
383 | 376 | ||