aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic>2005-04-18 14:45:00 -0400
committerJames Bottomley <jejb@titanic>2005-04-18 14:45:00 -0400
commitc46f2ffb9e7fce7208c2639790e1ade42e00b146 (patch)
tree284912295d46a861930d0619788a650f56c2a29b /include/scsi
parentc2a9331c62216e222a08de8dd58559367fef0af6 (diff)
parentf59114b7b5dc677bbd7cc7e26a5fcb3572a3445c (diff)
merge by hand (scsi_device.h)
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi.h11
-rw-r--r--include/scsi/scsi_cmnd.h28
-rw-r--r--include/scsi/scsi_device.h3
-rw-r--r--include/scsi/scsi_host.h10
4 files changed, 30 insertions, 22 deletions
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 1d54c063ae52..659ecf48fb4a 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -295,6 +295,8 @@ struct scsi_lun {
295#define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */ 295#define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */
296#define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */ 296#define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */
297#define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ 297#define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */
298#define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also
299 * without decrementing the retry count */
298#define DRIVER_OK 0x00 /* Driver status */ 300#define DRIVER_OK 0x00 /* Driver status */
299 301
300/* 302/*
@@ -360,6 +362,15 @@ struct scsi_lun {
360#define sense_error(sense) ((sense) & 0xf) 362#define sense_error(sense) ((sense) & 0xf)
361#define sense_valid(sense) ((sense) & 0x80); 363#define sense_valid(sense) ((sense) & 0x80);
362 364
365/*
366 * default timeouts
367*/
368#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ)
369#define START_STOP_TIMEOUT (60 * HZ)
370#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)
371#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ)
372#define READ_DEFECT_DATA_TIMEOUT (60 * HZ )
373
363 374
364#define IDENTIFY_BASE 0x80 375#define IDENTIFY_BASE 0x80
365#define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\ 376#define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 9d9871c28abd..07f5c699eaa7 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -43,21 +43,17 @@ struct scsi_cmnd {
43 void (*done) (struct scsi_cmnd *); /* Mid-level done function */ 43 void (*done) (struct scsi_cmnd *); /* Mid-level done function */
44 44
45 /* 45 /*
46 * A SCSI Command is assigned a nonzero serial_number when internal_cmnd 46 * A SCSI Command is assigned a nonzero serial_number before passed
47 * passes it to the driver's queue command function. The serial_number 47 * to the driver's queue command function. The serial_number is
48 * is cleared when scsi_done is entered indicating that the command has 48 * cleared when scsi_done is entered indicating that the command
49 * been completed. If a timeout occurs, the serial number at the moment 49 * has been completed. It currently doesn't have much use other
50 * of timeout is copied into serial_number_at_timeout. By subsequently 50 * than printk's. Some lldd's use this number for other purposes.
51 * comparing the serial_number and serial_number_at_timeout fields 51 * It's almost certain that such usages are either incorrect or
52 * during abort or reset processing, we can detect whether the command 52 * meaningless. Please kill all usages other than printk's. Also,
53 * has already completed. This also detects cases where the command has 53 * as this number is always identical to ->pid, please convert
54 * completed and the SCSI Command structure has already being reused 54 * printk's to use ->pid, so that we can kill this field.
55 * for another command, so that we can avoid incorrectly aborting or
56 * resetting the new command.
57 * The serial number is only unique per host.
58 */ 55 */
59 unsigned long serial_number; 56 unsigned long serial_number;
60 unsigned long serial_number_at_timeout;
61 57
62 int retries; 58 int retries;
63 int allowed; 59 int allowed;
@@ -65,12 +61,6 @@ struct scsi_cmnd {
65 int timeout_total; 61 int timeout_total;
66 int timeout; 62 int timeout;
67 63
68 /*
69 * We handle the timeout differently if it happens when a reset,
70 * abort, etc are in process.
71 */
72 unsigned volatile char internal_timeout;
73
74 unsigned char cmd_len; 64 unsigned char cmd_len;
75 unsigned char old_cmd_len; 65 unsigned char old_cmd_len;
76 enum dma_data_direction sc_data_direction; 66 enum dma_data_direction sc_data_direction;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index fe9571d2e306..c018020d9160 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -44,7 +44,8 @@ struct scsi_device {
44 struct list_head same_target_siblings; /* just the devices sharing same target id */ 44 struct list_head same_target_siblings; /* just the devices sharing same target id */
45 45
46 /* this is now protected by the request_queue->queue_lock */ 46 /* this is now protected by the request_queue->queue_lock */
47 volatile unsigned short device_busy; /* commands actually active on low-level */ 47 unsigned int device_busy; /* commands actually active on
48 * low-level. protected by queue_lock. */
48 spinlock_t list_lock; 49 spinlock_t list_lock;
49 struct list_head cmd_list; /* queue of in use SCSI Command structures */ 50 struct list_head cmd_list; /* queue of in use SCSI Command structures */
50 struct list_head starved_entry; 51 struct list_head starved_entry;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 27f2c4e8943a..1cee1e100943 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -448,8 +448,14 @@ struct Scsi_Host {
448 wait_queue_head_t host_wait; 448 wait_queue_head_t host_wait;
449 struct scsi_host_template *hostt; 449 struct scsi_host_template *hostt;
450 struct scsi_transport_template *transportt; 450 struct scsi_transport_template *transportt;
451 volatile unsigned short host_busy; /* commands actually active on low-level */ 451
452 volatile unsigned short host_failed; /* commands that failed. */ 452 /*
453 * The following two fields are protected with host_lock;
454 * however, eh routines can safely access during eh processing
455 * without acquiring the lock.
456 */
457 unsigned int host_busy; /* commands actually active on low-level */
458 unsigned int host_failed; /* commands that failed. */
453 459
454 unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ 460 unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */
455 int resetting; /* if set, it means that last_reset is a valid value */ 461 int resetting; /* if set, it means that last_reset is a valid value */