UPSTREAM: drm: bridge/dw_hdmi: add atomic API support
[firefly-linux-kernel-4.4.55.git] / drivers / scsi / 3w-xxxx.c
index 8843ad783b41e59ecdab7efbdd2a5acbaae3857a..2940bd769936cd7f75d2d20adc324914b0df4b84 100644 (file)
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_tcq.h>
 #include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_eh.h>
 #include "3w-xxxx.h"
 
 /* Globals */
@@ -522,19 +523,6 @@ static ssize_t tw_show_stats(struct device *dev, struct device_attribute *attr,
        return len;
 } /* End tw_show_stats() */
 
-/* This function will set a devices queue depth */
-static int tw_change_queue_depth(struct scsi_device *sdev, int queue_depth,
-                                int reason)
-{
-       if (reason != SCSI_QDEPTH_DEFAULT)
-               return -EOPNOTSUPP;
-
-       if (queue_depth > TW_Q_LENGTH-2)
-               queue_depth = TW_Q_LENGTH-2;
-       scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth);
-       return queue_depth;
-} /* End tw_change_queue_depth() */
-
 /* Create sysfs 'stats' entry */
 static struct device_attribute tw_host_stats_attr = {
        .attr = {
@@ -1980,7 +1968,8 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c
                        printk(KERN_NOTICE "3w-xxxx: scsi%d: Unknown scsi opcode: 0x%x\n", tw_dev->host->host_no, *command);
                        tw_dev->state[request_id] = TW_S_COMPLETED;
                        tw_state_request_finish(tw_dev, request_id);
-                       SCpnt->result = (DID_BAD_TARGET << 16);
+                       SCpnt->result = (DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
+                       scsi_build_sense_buffer(1, SCpnt->sense_buffer, ILLEGAL_REQUEST, 0x20, 0);
                        done(SCpnt);
                        retval = 0;
        }
@@ -2238,7 +2227,7 @@ static struct scsi_host_template driver_template = {
        .queuecommand           = tw_scsi_queue,
        .eh_host_reset_handler  = tw_scsi_eh_reset,
        .bios_param             = tw_scsi_biosparam,
-       .change_queue_depth     = tw_change_queue_depth,
+       .change_queue_depth     = scsi_change_queue_depth,
        .can_queue              = TW_Q_LENGTH-2,
        .slave_configure        = tw_slave_configure,
        .this_id                = -1,