aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/3w-9xxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/3w-9xxx.c')
-rw-r--r--drivers/scsi/3w-9xxx.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 36c21b19e5d7..e9788f55ab13 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -76,6 +76,7 @@
76 Fix bug in twa_get_param() on 4GB+. 76 Fix bug in twa_get_param() on 4GB+.
77 Use pci_resource_len() for ioremap(). 77 Use pci_resource_len() for ioremap().
78 2.26.02.012 - Add power management support. 78 2.26.02.012 - Add power management support.
79 2.26.02.013 - Fix bug in twa_load_sgl().
79*/ 80*/
80 81
81#include <linux/module.h> 82#include <linux/module.h>
@@ -90,6 +91,7 @@
90#include <linux/time.h> 91#include <linux/time.h>
91#include <linux/mutex.h> 92#include <linux/mutex.h>
92#include <linux/smp_lock.h> 93#include <linux/smp_lock.h>
94#include <linux/slab.h>
93#include <asm/io.h> 95#include <asm/io.h>
94#include <asm/irq.h> 96#include <asm/irq.h>
95#include <asm/uaccess.h> 97#include <asm/uaccess.h>
@@ -100,7 +102,7 @@
100#include "3w-9xxx.h" 102#include "3w-9xxx.h"
101 103
102/* Globals */ 104/* Globals */
103#define TW_DRIVER_VERSION "2.26.02.012" 105#define TW_DRIVER_VERSION "2.26.02.013"
104static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT]; 106static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
105static unsigned int twa_device_extension_count; 107static unsigned int twa_device_extension_count;
106static int twa_major = -1; 108static int twa_major = -1;
@@ -186,8 +188,12 @@ static ssize_t twa_show_stats(struct device *dev,
186} /* End twa_show_stats() */ 188} /* End twa_show_stats() */
187 189
188/* This function will set a devices queue depth */ 190/* This function will set a devices queue depth */
189static int twa_change_queue_depth(struct scsi_device *sdev, int queue_depth) 191static int twa_change_queue_depth(struct scsi_device *sdev, int queue_depth,
192 int reason)
190{ 193{
194 if (reason != SCSI_QDEPTH_DEFAULT)
195 return -EOPNOTSUPP;
196
191 if (queue_depth > TW_Q_LENGTH-2) 197 if (queue_depth > TW_Q_LENGTH-2)
192 queue_depth = TW_Q_LENGTH-2; 198 queue_depth = TW_Q_LENGTH-2;
193 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth); 199 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth);
@@ -732,7 +738,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
732 break; 738 break;
733 case TW_IOCTL_GET_COMPATIBILITY_INFO: 739 case TW_IOCTL_GET_COMPATIBILITY_INFO:
734 tw_ioctl->driver_command.status = 0; 740 tw_ioctl->driver_command.status = 0;
735 /* Copy compatiblity struct into ioctl data buffer */ 741 /* Copy compatibility struct into ioctl data buffer */
736 tw_compat_info = (TW_Compatibility_Info *)tw_ioctl->data_buffer; 742 tw_compat_info = (TW_Compatibility_Info *)tw_ioctl->data_buffer;
737 memcpy(tw_compat_info, &tw_dev->tw_compat_info, sizeof(TW_Compatibility_Info)); 743 memcpy(tw_compat_info, &tw_dev->tw_compat_info, sizeof(TW_Compatibility_Info));
738 break; 744 break;
@@ -1378,10 +1384,12 @@ static void twa_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_comm
1378 newcommand = &full_command_packet->command.newcommand; 1384 newcommand = &full_command_packet->command.newcommand;
1379 newcommand->request_id__lunl = 1385 newcommand->request_id__lunl =
1380 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id)); 1386 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id));
1381 newcommand->sg_list[0].address = TW_CPU_TO_SGL(dma_handle + sizeof(TW_Ioctl_Buf_Apache) - 1); 1387 if (length) {
1382 newcommand->sg_list[0].length = cpu_to_le32(length); 1388 newcommand->sg_list[0].address = TW_CPU_TO_SGL(dma_handle + sizeof(TW_Ioctl_Buf_Apache) - 1);
1389 newcommand->sg_list[0].length = cpu_to_le32(length);
1390 }
1383 newcommand->sgl_entries__lunh = 1391 newcommand->sgl_entries__lunh =
1384 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->sgl_entries__lunh), 1)); 1392 cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->sgl_entries__lunh), length ? 1 : 0));
1385 } else { 1393 } else {
1386 oldcommand = &full_command_packet->command.oldcommand; 1394 oldcommand = &full_command_packet->command.oldcommand;
1387 oldcommand->request_id = request_id; 1395 oldcommand->request_id = request_id;