summaryrefslogtreecommitdiff
path: root/drivers/scsi/NCR5380.h
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-01-03 16:05:58 +1100
committerMartin K. Petersen <martin.petersen@oracle.com>2016-01-06 21:43:07 -0500
commit32b26a104237c1ba3575a6c8d47e46060cc416fb (patch)
tree436ad259aa17efdd392ee60a6a687efaa20ead13 /drivers/scsi/NCR5380.h
parent5299b3caf525c5a6cdebbe162733c8ff1692c4d0 (diff)
ncr5380: Use standard list data structure
The NCR5380 drivers have a home-spun linked list implementation for scsi_cmnd structs that uses cmd->host_scribble as a 'next' pointer. Adopt the standard list_head data structure and list operations instead. Remove the eh_abort_handler rather than convert it. Doing the conversion would only be churn because the existing EH handlers don't work and get replaced in a subsequent patch. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/NCR5380.h')
-rw-r--r--drivers/scsi/NCR5380.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index 87c2f2104e68..56252a5516d7 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
+#include <linux/list.h>
#include <linux/workqueue.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_eh.h>
@@ -254,8 +255,8 @@ struct NCR5380_hostdata {
#endif
unsigned char last_message; /* last message OUT */
struct scsi_cmnd *connected; /* currently connected cmnd */
- struct scsi_cmnd *issue_queue; /* waiting to be issued */
- struct scsi_cmnd *disconnected_queue; /* waiting for reconnect */
+ struct list_head unissued; /* waiting to be issued */
+ struct list_head disconnected; /* waiting for reconnect */
spinlock_t lock; /* protects this struct */
int flags;
struct scsi_eh_save ses;
@@ -277,6 +278,17 @@ struct NCR5380_hostdata {
#ifdef __KERNEL__
+struct NCR5380_cmd {
+ struct list_head list;
+};
+
+#define NCR5380_CMD_SIZE (sizeof(struct NCR5380_cmd))
+
+static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd *ncmd_ptr)
+{
+ return ((struct scsi_cmnd *)ncmd_ptr) - 1;
+}
+
#ifndef NDEBUG
#define NDEBUG (0)
#endif