aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 290e3b4d2aec..895d212864cd 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -4,6 +4,7 @@
4#include <linux/device.h> 4#include <linux/device.h>
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/workqueue.h>
7#include <asm/atomic.h> 8#include <asm/atomic.h>
8 9
9struct request_queue; 10struct request_queue;
@@ -73,7 +74,6 @@ struct scsi_device {
73 unsigned sector_size; /* size in bytes */ 74 unsigned sector_size; /* size in bytes */
74 75
75 void *hostdata; /* available to low-level driver */ 76 void *hostdata; /* available to low-level driver */
76 char devfs_name[256]; /* devfs junk */
77 char type; 77 char type;
78 char scsi_level; 78 char scsi_level;
79 char inq_periph_qual; /* PQ from INQUIRY data */ 79 char inq_periph_qual; /* PQ from INQUIRY data */
@@ -138,6 +138,8 @@ struct scsi_device {
138 struct device sdev_gendev; 138 struct device sdev_gendev;
139 struct class_device sdev_classdev; 139 struct class_device sdev_classdev;
140 140
141 struct execute_work ew; /* used to get process context on put */
142
141 enum scsi_device_state sdev_state; 143 enum scsi_device_state sdev_state;
142 unsigned long sdev_data[0]; 144 unsigned long sdev_data[0];
143} __attribute__((aligned(sizeof(unsigned long)))); 145} __attribute__((aligned(sizeof(unsigned long))));
@@ -154,6 +156,11 @@ struct scsi_device {
154#define scmd_printk(prefix, scmd, fmt, a...) \ 156#define scmd_printk(prefix, scmd, fmt, a...) \
155 dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a) 157 dev_printk(prefix, &(scmd)->device->sdev_gendev, fmt, ##a)
156 158
159enum scsi_target_state {
160 STARGET_RUNNING = 1,
161 STARGET_DEL,
162};
163
157/* 164/*
158 * scsi_target: representation of a scsi target, for now, this is only 165 * scsi_target: representation of a scsi target, for now, this is only
159 * used for single_lun devices. If no one has active IO to the target, 166 * used for single_lun devices. If no one has active IO to the target,
@@ -168,8 +175,13 @@ struct scsi_target {
168 unsigned int channel; 175 unsigned int channel;
169 unsigned int id; /* target id ... replace 176 unsigned int id; /* target id ... replace
170 * scsi_device.id eventually */ 177 * scsi_device.id eventually */
171 unsigned long create:1; /* signal that it needs to be added */ 178 unsigned int create:1; /* signal that it needs to be added */
179 unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */
180 /* means no lun present */
181
172 char scsi_level; 182 char scsi_level;
183 struct execute_work ew;
184 enum scsi_target_state state;
173 void *hostdata; /* available to low-level driver */ 185 void *hostdata; /* available to low-level driver */
174 unsigned long starget_data[0]; /* for the transport */ 186 unsigned long starget_data[0]; /* for the transport */
175 /* starget_data must be the last element!!!! */ 187 /* starget_data must be the last element!!!! */
@@ -249,6 +261,11 @@ extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
249 unsigned char *buffer, int len, int timeout, 261 unsigned char *buffer, int len, int timeout,
250 int retries, struct scsi_mode_data *data, 262 int retries, struct scsi_mode_data *data,
251 struct scsi_sense_hdr *); 263 struct scsi_sense_hdr *);
264extern int scsi_mode_select(struct scsi_device *sdev, int pf, int sp,
265 int modepage, unsigned char *buffer, int len,
266 int timeout, int retries,
267 struct scsi_mode_data *data,
268 struct scsi_sense_hdr *);
252extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, 269extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
253 int retries); 270 int retries);
254extern int scsi_device_set_state(struct scsi_device *sdev, 271extern int scsi_device_set_state(struct scsi_device *sdev,
@@ -281,6 +298,11 @@ extern int scsi_execute_async(struct scsi_device *sdev,
281 void (*done)(void *, char *, int, int), 298 void (*done)(void *, char *, int, int),
282 gfp_t gfp); 299 gfp_t gfp);
283 300
301static inline void scsi_device_reprobe(struct scsi_device *sdev)
302{
303 device_reprobe(&sdev->sdev_gendev);
304}
305
284static inline unsigned int sdev_channel(struct scsi_device *sdev) 306static inline unsigned int sdev_channel(struct scsi_device *sdev)
285{ 307{
286 return sdev->channel; 308 return sdev->channel;