diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-01-03 00:05:58 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-01-06 21:43:07 -0500 |
commit | 32b26a104237c1ba3575a6c8d47e46060cc416fb (patch) | |
tree | 436ad259aa17efdd392ee60a6a687efaa20ead13 /drivers/scsi/NCR5380.h | |
parent | 5299b3caf525c5a6cdebbe162733c8ff1692c4d0 (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.h | 16 |
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 @@ | |||
24 | 24 | ||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/list.h> | ||
27 | #include <linux/workqueue.h> | 28 | #include <linux/workqueue.h> |
28 | #include <scsi/scsi_dbg.h> | 29 | #include <scsi/scsi_dbg.h> |
29 | #include <scsi/scsi_eh.h> | 30 | #include <scsi/scsi_eh.h> |
@@ -254,8 +255,8 @@ struct NCR5380_hostdata { | |||
254 | #endif | 255 | #endif |
255 | unsigned char last_message; /* last message OUT */ | 256 | unsigned char last_message; /* last message OUT */ |
256 | struct scsi_cmnd *connected; /* currently connected cmnd */ | 257 | struct scsi_cmnd *connected; /* currently connected cmnd */ |
257 | struct scsi_cmnd *issue_queue; /* waiting to be issued */ | 258 | struct list_head unissued; /* waiting to be issued */ |
258 | struct scsi_cmnd *disconnected_queue; /* waiting for reconnect */ | 259 | struct list_head disconnected; /* waiting for reconnect */ |
259 | spinlock_t lock; /* protects this struct */ | 260 | spinlock_t lock; /* protects this struct */ |
260 | int flags; | 261 | int flags; |
261 | struct scsi_eh_save ses; | 262 | struct scsi_eh_save ses; |
@@ -277,6 +278,17 @@ struct NCR5380_hostdata { | |||
277 | 278 | ||
278 | #ifdef __KERNEL__ | 279 | #ifdef __KERNEL__ |
279 | 280 | ||
281 | struct NCR5380_cmd { | ||
282 | struct list_head list; | ||
283 | }; | ||
284 | |||
285 | #define NCR5380_CMD_SIZE (sizeof(struct NCR5380_cmd)) | ||
286 | |||
287 | static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd *ncmd_ptr) | ||
288 | { | ||
289 | return ((struct scsi_cmnd *)ncmd_ptr) - 1; | ||
290 | } | ||
291 | |||
280 | #ifndef NDEBUG | 292 | #ifndef NDEBUG |
281 | #define NDEBUG (0) | 293 | #define NDEBUG (0) |
282 | #endif | 294 | #endif |