diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-10 13:46:28 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-10 13:46:28 -0400 |
commit | 2f058256cb64e346f4fb4499ff4e0f1c2791a4b4 (patch) | |
tree | 91e06602f4d3abb6812ea8c9bc9ba4501e14c84e /include/scsi | |
parent | 0274aa2506fd2fe89a58dd6cd64d3b3f7b976af8 (diff) | |
parent | 86b3786078d63242d3194ffc58ae8dae1d1bbef3 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi.h | 4 | ||||
-rw-r--r-- | include/scsi/scsi_cmnd.h | 5 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 3 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 6 | ||||
-rw-r--r-- | include/scsi/sg_request.h | 26 |
5 files changed, 30 insertions, 14 deletions
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index baba3405b03d..6cb1e2788d8b 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -28,7 +28,7 @@ extern const unsigned char scsi_command_size[8]; | |||
28 | * SCSI device types | 28 | * SCSI device types |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define MAX_SCSI_DEVICE_CODE 14 | 31 | #define MAX_SCSI_DEVICE_CODE 15 |
32 | extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | 32 | extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; |
33 | 33 | ||
34 | /* | 34 | /* |
@@ -214,8 +214,8 @@ static inline int scsi_status_is_good(int status) | |||
214 | * - treated as TYPE_DISK */ | 214 | * - treated as TYPE_DISK */ |
215 | #define TYPE_MEDIUM_CHANGER 0x08 | 215 | #define TYPE_MEDIUM_CHANGER 0x08 |
216 | #define TYPE_COMM 0x09 /* Communications device */ | 216 | #define TYPE_COMM 0x09 /* Communications device */ |
217 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | ||
218 | #define TYPE_RAID 0x0c | 217 | #define TYPE_RAID 0x0c |
218 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ | ||
219 | #define TYPE_RBC 0x0e | 219 | #define TYPE_RBC 0x0e |
220 | #define TYPE_NO_LUN 0x7f | 220 | #define TYPE_NO_LUN 0x7f |
221 | 221 | ||
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 07f5c699eaa7..9957f16dcc5d 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -31,14 +31,11 @@ struct scsi_cmnd { | |||
31 | int sc_magic; | 31 | int sc_magic; |
32 | 32 | ||
33 | struct scsi_device *device; | 33 | struct scsi_device *device; |
34 | unsigned short state; | ||
35 | unsigned short owner; | ||
36 | struct scsi_request *sc_request; | 34 | struct scsi_request *sc_request; |
37 | 35 | ||
38 | struct list_head list; /* scsi_cmnd participates in queue lists */ | 36 | struct list_head list; /* scsi_cmnd participates in queue lists */ |
39 | 37 | ||
40 | struct list_head eh_entry; /* entry for the host eh_cmd_q */ | 38 | struct list_head eh_entry; /* entry for the host eh_cmd_q */ |
41 | int eh_state; /* Used for state tracking in error handlr */ | ||
42 | int eh_eflags; /* Used by error handlr */ | 39 | int eh_eflags; /* Used by error handlr */ |
43 | void (*done) (struct scsi_cmnd *); /* Mid-level done function */ | 40 | void (*done) (struct scsi_cmnd *); /* Mid-level done function */ |
44 | 41 | ||
@@ -80,8 +77,6 @@ struct scsi_cmnd { | |||
80 | * sense info */ | 77 | * sense info */ |
81 | unsigned short use_sg; /* Number of pieces of scatter-gather */ | 78 | unsigned short use_sg; /* Number of pieces of scatter-gather */ |
82 | unsigned short sglist_len; /* size of malloc'd scatter-gather list */ | 79 | unsigned short sglist_len; /* size of malloc'd scatter-gather list */ |
83 | unsigned short abort_reason; /* If the mid-level code requests an | ||
84 | * abort, this is the reason. */ | ||
85 | unsigned bufflen; /* Size of data buffer */ | 80 | unsigned bufflen; /* Size of data buffer */ |
86 | void *buffer; /* Data buffer */ | 81 | void *buffer; /* Data buffer */ |
87 | 82 | ||
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 63c91dd85ca1..835af8ecbb7c 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -9,7 +9,7 @@ | |||
9 | struct request_queue; | 9 | struct request_queue; |
10 | struct scsi_cmnd; | 10 | struct scsi_cmnd; |
11 | struct scsi_mode_data; | 11 | struct scsi_mode_data; |
12 | 12 | struct scsi_lun; | |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * sdev state: If you alter this, you also need to alter scsi_sysfs.c | 15 | * sdev state: If you alter this, you also need to alter scsi_sysfs.c |
@@ -243,6 +243,7 @@ extern void scsi_target_reap(struct scsi_target *); | |||
243 | extern void scsi_target_block(struct device *); | 243 | extern void scsi_target_block(struct device *); |
244 | extern void scsi_target_unblock(struct device *); | 244 | extern void scsi_target_unblock(struct device *); |
245 | extern void scsi_remove_target(struct device *); | 245 | extern void scsi_remove_target(struct device *); |
246 | extern void int_to_scsilun(unsigned int, struct scsi_lun *); | ||
246 | extern const char *scsi_device_state_name(enum scsi_device_state); | 247 | extern const char *scsi_device_state_name(enum scsi_device_state); |
247 | extern int scsi_is_sdev_device(const struct device *); | 248 | extern int scsi_is_sdev_device(const struct device *); |
248 | extern int scsi_is_target_device(const struct device *); | 249 | extern int scsi_is_target_device(const struct device *); |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index db9914adeac9..81d5234f6771 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -641,12 +641,6 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock) | |||
641 | shost->host_lock = lock; | 641 | shost->host_lock = lock; |
642 | } | 642 | } |
643 | 643 | ||
644 | static inline void scsi_set_device(struct Scsi_Host *shost, | ||
645 | struct device *dev) | ||
646 | { | ||
647 | shost->shost_gendev.parent = dev; | ||
648 | } | ||
649 | |||
650 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) | 644 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) |
651 | { | 645 | { |
652 | return shost->shost_gendev.parent; | 646 | return shost->shost_gendev.parent; |
diff --git a/include/scsi/sg_request.h b/include/scsi/sg_request.h new file mode 100644 index 000000000000..57ff525bdd3b --- /dev/null +++ b/include/scsi/sg_request.h | |||
@@ -0,0 +1,26 @@ | |||
1 | typedef struct scsi_request Scsi_Request; | ||
2 | |||
3 | static Scsi_Request *dummy_cmdp; /* only used for sizeof */ | ||
4 | |||
5 | typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */ | ||
6 | unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */ | ||
7 | unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */ | ||
8 | unsigned bufflen; /* Size of (aggregate) data buffer */ | ||
9 | unsigned b_malloc_len; /* actual len malloc'ed in buffer */ | ||
10 | void *buffer; /* Data buffer or scatter list (k_use_sg>0) */ | ||
11 | char dio_in_use; /* 0->indirect IO (or mmap), 1->dio */ | ||
12 | unsigned char cmd_opcode; /* first byte of command */ | ||
13 | } Sg_scatter_hold; | ||
14 | |||
15 | typedef struct sg_request { /* SG_MAX_QUEUE requests outstanding per file */ | ||
16 | Scsi_Request *my_cmdp; /* != 0 when request with lower levels */ | ||
17 | struct sg_request *nextrp; /* NULL -> tail request (slist) */ | ||
18 | struct sg_fd *parentfp; /* NULL -> not in use */ | ||
19 | Sg_scatter_hold data; /* hold buffer, perhaps scatter list */ | ||
20 | sg_io_hdr_t header; /* scsi command+info, see <scsi/sg.h> */ | ||
21 | unsigned char sense_b[sizeof (dummy_cmdp->sr_sense_buffer)]; | ||
22 | char res_used; /* 1 -> using reserve buffer, 0 -> not ... */ | ||
23 | char orphan; /* 1 -> drop on sight, 0 -> normal */ | ||
24 | char sg_io_owned; /* 1 -> packet belongs to SG_IO */ | ||
25 | volatile char done; /* 0->before bh, 1->before read, 2->read */ | ||
26 | } Sg_request; | ||