aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c18
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)
1808static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, 1809static 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);