diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 20:31:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 20:31:27 -0400 |
commit | 0481990b758628e12f4b0a9e15094e70cefc7cd1 (patch) | |
tree | 67a4b4b7acc6a688b87ef2a2d3ec0e296e6e480c /include/scsi/scsi_host.h | |
parent | db400b3c4ee89d384d9163836a55577abdae772d (diff) | |
parent | 17fa53da1239b8712c5cebbd72a74c713b6c2db9 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6
Diffstat (limited to 'include/scsi/scsi_host.h')
-rw-r--r-- | include/scsi/scsi_host.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 81d5234f6771..916144be208b 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -429,12 +429,15 @@ struct scsi_host_template { | |||
429 | }; | 429 | }; |
430 | 430 | ||
431 | /* | 431 | /* |
432 | * shost states | 432 | * shost state: If you alter this, you also need to alter scsi_sysfs.c |
433 | * (for the ascii descriptions) and the state model enforcer: | ||
434 | * scsi_host_set_state() | ||
433 | */ | 435 | */ |
434 | enum { | 436 | enum scsi_host_state { |
435 | SHOST_ADD, | 437 | SHOST_CREATED = 1, |
436 | SHOST_DEL, | 438 | SHOST_RUNNING, |
437 | SHOST_CANCEL, | 439 | SHOST_CANCEL, |
440 | SHOST_DEL, | ||
438 | SHOST_RECOVERY, | 441 | SHOST_RECOVERY, |
439 | }; | 442 | }; |
440 | 443 | ||
@@ -464,12 +467,10 @@ struct Scsi_Host { | |||
464 | struct task_struct * ehandler; /* Error recovery thread. */ | 467 | struct task_struct * ehandler; /* Error recovery thread. */ |
465 | struct semaphore * eh_wait; /* The error recovery thread waits | 468 | struct semaphore * eh_wait; /* The error recovery thread waits |
466 | on this. */ | 469 | on this. */ |
467 | struct completion * eh_notify; /* wait for eh to begin or end */ | ||
468 | struct semaphore * eh_action; /* Wait for specific actions on the | 470 | struct semaphore * eh_action; /* Wait for specific actions on the |
469 | host. */ | 471 | host. */ |
470 | unsigned int eh_active:1; /* Indicates the eh thread is awake and active if | 472 | unsigned int eh_active:1; /* Indicates the eh thread is awake and active if |
471 | this is true. */ | 473 | this is true. */ |
472 | unsigned int eh_kill:1; /* set when killing the eh thread */ | ||
473 | wait_queue_head_t host_wait; | 474 | wait_queue_head_t host_wait; |
474 | struct scsi_host_template *hostt; | 475 | struct scsi_host_template *hostt; |
475 | struct scsi_transport_template *transportt; | 476 | struct scsi_transport_template *transportt; |
@@ -575,7 +576,7 @@ struct Scsi_Host { | |||
575 | unsigned int irq; | 576 | unsigned int irq; |
576 | 577 | ||
577 | 578 | ||
578 | unsigned long shost_state; | 579 | enum scsi_host_state shost_state; |
579 | 580 | ||
580 | /* ldm bits */ | 581 | /* ldm bits */ |
581 | struct device shost_gendev; | 582 | struct device shost_gendev; |
@@ -633,6 +634,7 @@ extern void scsi_remove_host(struct Scsi_Host *); | |||
633 | extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); | 634 | extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); |
634 | extern void scsi_host_put(struct Scsi_Host *t); | 635 | extern void scsi_host_put(struct Scsi_Host *t); |
635 | extern struct Scsi_Host *scsi_host_lookup(unsigned short); | 636 | extern struct Scsi_Host *scsi_host_lookup(unsigned short); |
637 | extern const char *scsi_host_state_name(enum scsi_host_state); | ||
636 | 638 | ||
637 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); | 639 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); |
638 | 640 | ||
@@ -646,6 +648,15 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) | |||
646 | return shost->shost_gendev.parent; | 648 | return shost->shost_gendev.parent; |
647 | } | 649 | } |
648 | 650 | ||
651 | /** | ||
652 | * scsi_host_scan_allowed - Is scanning of this host allowed | ||
653 | * @shost: Pointer to Scsi_Host. | ||
654 | **/ | ||
655 | static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) | ||
656 | { | ||
657 | return shost->shost_state == SHOST_RUNNING; | ||
658 | } | ||
659 | |||
649 | extern void scsi_unblock_requests(struct Scsi_Host *); | 660 | extern void scsi_unblock_requests(struct Scsi_Host *); |
650 | extern void scsi_block_requests(struct Scsi_Host *); | 661 | extern void scsi_block_requests(struct Scsi_Host *); |
651 | 662 | ||
@@ -663,5 +674,6 @@ extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *); | |||
663 | /* legacy interfaces */ | 674 | /* legacy interfaces */ |
664 | extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); | 675 | extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); |
665 | extern void scsi_unregister(struct Scsi_Host *); | 676 | extern void scsi_unregister(struct Scsi_Host *); |
677 | extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state); | ||
666 | 678 | ||
667 | #endif /* _SCSI_SCSI_HOST_H */ | 679 | #endif /* _SCSI_SCSI_HOST_H */ |