scsi_device.h (39fe5434cb9de5da40510028b17b96bc4eb312b3) scsi_device.h (a341cd0f6a0fde1f85fec9aa8f81f824ea4a3f92)
1#ifndef _SCSI_SCSI_DEVICE_H
2#define _SCSI_SCSI_DEVICE_H
3
4#include <linux/device.h>
5#include <linux/list.h>
6#include <linux/spinlock.h>
7#include <linux/workqueue.h>
8#include <linux/blkdev.h>

--- 32 unchanged lines hidden (view full) ---

41 * originate in the mid-layer) */
42 SDEV_OFFLINE, /* Device offlined (by error handling or
43 * user request */
44 SDEV_BLOCK, /* Device blocked by scsi lld. No scsi
45 * commands from user or midlayer should be issued
46 * to the scsi lld. */
47};
48
1#ifndef _SCSI_SCSI_DEVICE_H
2#define _SCSI_SCSI_DEVICE_H
3
4#include <linux/device.h>
5#include <linux/list.h>
6#include <linux/spinlock.h>
7#include <linux/workqueue.h>
8#include <linux/blkdev.h>

--- 32 unchanged lines hidden (view full) ---

41 * originate in the mid-layer) */
42 SDEV_OFFLINE, /* Device offlined (by error handling or
43 * user request */
44 SDEV_BLOCK, /* Device blocked by scsi lld. No scsi
45 * commands from user or midlayer should be issued
46 * to the scsi lld. */
47};
48
49enum scsi_device_event {
50 SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */
51
52 SDEV_EVT_LAST = SDEV_EVT_MEDIA_CHANGE,
53 SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1
54};
55
56struct scsi_event {
57 enum scsi_device_event evt_type;
58 struct list_head node;
59
60 /* put union of data structures, for non-simple event types,
61 * here
62 */
63};
64
49struct scsi_device {
50 struct Scsi_Host *host;
51 struct request_queue *request_queue;
52
53 /* the next two are protected by the host->host_lock */
54 struct list_head siblings; /* list of all devices on this host */
55 struct list_head same_target_siblings; /* just the devices sharing same target id */
56

--- 65 unchanged lines hidden (view full) ---

122 unsigned allow_restart:1; /* issue START_UNIT in error handler */
123 unsigned manage_start_stop:1; /* Let HLD (sd) manage start/stop */
124 unsigned no_uld_attach:1; /* disable connecting to upper level drivers */
125 unsigned select_no_atn:1;
126 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
127 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */
128 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
129
65struct scsi_device {
66 struct Scsi_Host *host;
67 struct request_queue *request_queue;
68
69 /* the next two are protected by the host->host_lock */
70 struct list_head siblings; /* list of all devices on this host */
71 struct list_head same_target_siblings; /* just the devices sharing same target id */
72

--- 65 unchanged lines hidden (view full) ---

138 unsigned allow_restart:1; /* issue START_UNIT in error handler */
139 unsigned manage_start_stop:1; /* Let HLD (sd) manage start/stop */
140 unsigned no_uld_attach:1; /* disable connecting to upper level drivers */
141 unsigned select_no_atn:1;
142 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
143 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */
144 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
145
146 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
147 struct list_head event_list; /* asserted events */
148 struct work_struct event_work;
149
130 unsigned int device_blocked; /* Device returned QUEUE_FULL. */
131
132 unsigned int max_device_blocked; /* what device_blocked counts down from */
133#define SCSI_DEFAULT_DEVICE_BLOCKED 3
134
135 atomic_t iorequest_cnt;
136 atomic_t iodone_cnt;
137 atomic_t ioerr_cnt;

--- 132 unchanged lines hidden (view full) ---

270 int modepage, unsigned char *buffer, int len,
271 int timeout, int retries,
272 struct scsi_mode_data *data,
273 struct scsi_sense_hdr *);
274extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
275 int retries);
276extern int scsi_device_set_state(struct scsi_device *sdev,
277 enum scsi_device_state state);
150 unsigned int device_blocked; /* Device returned QUEUE_FULL. */
151
152 unsigned int max_device_blocked; /* what device_blocked counts down from */
153#define SCSI_DEFAULT_DEVICE_BLOCKED 3
154
155 atomic_t iorequest_cnt;
156 atomic_t iodone_cnt;
157 atomic_t ioerr_cnt;

--- 132 unchanged lines hidden (view full) ---

290 int modepage, unsigned char *buffer, int len,
291 int timeout, int retries,
292 struct scsi_mode_data *data,
293 struct scsi_sense_hdr *);
294extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
295 int retries);
296extern int scsi_device_set_state(struct scsi_device *sdev,
297 enum scsi_device_state state);
298extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type,
299 gfp_t gfpflags);
300extern void sdev_evt_send(struct scsi_device *sdev, struct scsi_event *evt);
301extern void sdev_evt_send_simple(struct scsi_device *sdev,
302 enum scsi_device_event evt_type, gfp_t gfpflags);
278extern int scsi_device_quiesce(struct scsi_device *sdev);
279extern void scsi_device_resume(struct scsi_device *sdev);
280extern void scsi_target_quiesce(struct scsi_target *);
281extern void scsi_target_resume(struct scsi_target *);
282extern void scsi_scan_target(struct device *parent, unsigned int channel,
283 unsigned int id, unsigned int lun, int rescan);
284extern void scsi_target_reap(struct scsi_target *);
285extern void scsi_target_block(struct device *);

--- 81 unchanged lines hidden ---
303extern int scsi_device_quiesce(struct scsi_device *sdev);
304extern void scsi_device_resume(struct scsi_device *sdev);
305extern void scsi_target_quiesce(struct scsi_target *);
306extern void scsi_target_resume(struct scsi_target *);
307extern void scsi_scan_target(struct device *parent, unsigned int channel,
308 unsigned int id, unsigned int lun, int rescan);
309extern void scsi_target_reap(struct scsi_target *);
310extern void scsi_target_block(struct device *);

--- 81 unchanged lines hidden ---