aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-12 06:35:23 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-12 06:37:32 -0400
commit365d46dc9be9b3c833990a06f3994b1987eda578 (patch)
tree9397d1304144a288411f2118707f44ff5e862fa6 /include/scsi/scsi_device.h
parent5dc64a3442b98eaa0e3730c35fcf00cf962a93e7 (diff)
parentfd048088306656824958e7783ffcee27e241b361 (diff)
Merge branch 'linus' into x86/xen
Conflicts: arch/x86/kernel/cpu/common.c arch/x86/kernel/process_64.c arch/x86/xen/enlighten.c
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 80b2e93c2936..b49e725be039 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -42,9 +42,11 @@ enum scsi_device_state {
42 * originate in the mid-layer) */ 42 * originate in the mid-layer) */
43 SDEV_OFFLINE, /* Device offlined (by error handling or 43 SDEV_OFFLINE, /* Device offlined (by error handling or
44 * user request */ 44 * user request */
45 SDEV_BLOCK, /* Device blocked by scsi lld. No scsi 45 SDEV_BLOCK, /* Device blocked by scsi lld. No
46 * commands from user or midlayer should be issued 46 * scsi commands from user or midlayer
47 * to the scsi lld. */ 47 * should be issued to the scsi
48 * lld. */
49 SDEV_CREATED_BLOCK, /* same as above but for created devices */
48}; 50};
49 51
50enum scsi_device_event { 52enum scsi_device_event {
@@ -384,10 +386,23 @@ static inline unsigned int sdev_id(struct scsi_device *sdev)
384#define scmd_id(scmd) sdev_id((scmd)->device) 386#define scmd_id(scmd) sdev_id((scmd)->device)
385#define scmd_channel(scmd) sdev_channel((scmd)->device) 387#define scmd_channel(scmd) sdev_channel((scmd)->device)
386 388
389/*
390 * checks for positions of the SCSI state machine
391 */
387static inline int scsi_device_online(struct scsi_device *sdev) 392static inline int scsi_device_online(struct scsi_device *sdev)
388{ 393{
389 return sdev->sdev_state != SDEV_OFFLINE; 394 return sdev->sdev_state != SDEV_OFFLINE;
390} 395}
396static inline int scsi_device_blocked(struct scsi_device *sdev)
397{
398 return sdev->sdev_state == SDEV_BLOCK ||
399 sdev->sdev_state == SDEV_CREATED_BLOCK;
400}
401static inline int scsi_device_created(struct scsi_device *sdev)
402{
403 return sdev->sdev_state == SDEV_CREATED ||
404 sdev->sdev_state == SDEV_CREATED_BLOCK;
405}
391 406
392/* accessor functions for the SCSI parameters */ 407/* accessor functions for the SCSI parameters */
393static inline int scsi_device_sync(struct scsi_device *sdev) 408static inline int scsi_device_sync(struct scsi_device *sdev)