diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-03-24 20:26:50 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:01 -0400 |
commit | a34c4e98367965402134f2e66c3cdc4416f109e4 (patch) | |
tree | f772e436ef6c54cede481c65a79fa2c8da943b3b /drivers | |
parent | 3bc6a26192d2548397a3e721d786cf8345ee54e1 (diff) |
[SCSI] scsi_debug: use scsi_build_sense_buffer
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Douglas Gilbert <dougg@torque.net>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 4f4c5b7bdef5..5f348e7b1184 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <scsi/scsi_device.h> | 46 | #include <scsi/scsi_device.h> |
47 | #include <scsi/scsi_host.h> | 47 | #include <scsi/scsi_host.h> |
48 | #include <scsi/scsicam.h> | 48 | #include <scsi/scsicam.h> |
49 | #include <scsi/scsi_eh.h> | ||
49 | 50 | ||
50 | #include <linux/stat.h> | 51 | #include <linux/stat.h> |
51 | 52 | ||
@@ -1808,22 +1809,13 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev) | |||
1808 | static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, | 1809 | static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, |
1809 | int asc, int asq) | 1810 | int asc, int asq) |
1810 | { | 1811 | { |
1811 | unsigned char * sbuff; | 1812 | unsigned char *sbuff; |
1812 | 1813 | ||
1813 | sbuff = devip->sense_buff; | 1814 | sbuff = devip->sense_buff; |
1814 | memset(sbuff, 0, SDEBUG_SENSE_LEN); | 1815 | memset(sbuff, 0, SDEBUG_SENSE_LEN); |
1815 | if (scsi_debug_dsense) { | 1816 | |
1816 | sbuff[0] = 0x72; /* descriptor, current */ | 1817 | scsi_build_sense_buffer(scsi_debug_dsense, sbuff, key, asc, asq); |
1817 | sbuff[1] = key; | 1818 | |
1818 | sbuff[2] = asc; | ||
1819 | sbuff[3] = asq; | ||
1820 | } else { | ||
1821 | sbuff[0] = 0x70; /* fixed, current */ | ||
1822 | sbuff[2] = key; | ||
1823 | sbuff[7] = 0xa; /* implies 18 byte sense buffer */ | ||
1824 | sbuff[12] = asc; | ||
1825 | sbuff[13] = asq; | ||
1826 | } | ||
1827 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) | 1819 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) |
1828 | printk(KERN_INFO "scsi_debug: [sense_key,asc,ascq]: " | 1820 | printk(KERN_INFO "scsi_debug: [sense_key,asc,ascq]: " |
1829 | "[0x%x,0x%x,0x%x]\n", key, asc, asq); | 1821 | "[0x%x,0x%x,0x%x]\n", key, asc, asq); |