projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull sim-fixes into release branch
[powerpc.git]
/
include
/
scsi
/
scsi_host.h
diff --git
a/include/scsi/scsi_host.h
b/include/scsi/scsi_host.h
index
db9914a
..
916144b
100644
(file)
--- a/
include/scsi/scsi_host.h
+++ b/
include/scsi/scsi_host.h
@@
-429,12
+429,15
@@
struct scsi_host_template {
};
/*
};
/*
- * shost states
+ * shost state: If you alter this, you also need to alter scsi_sysfs.c
+ * (for the ascii descriptions) and the state model enforcer:
+ * scsi_host_set_state()
*/
*/
-enum {
- SHOST_
ADD
,
- SHOST_
DEL
,
+enum
scsi_host_state
{
+ SHOST_
CREATED = 1
,
+ SHOST_
RUNNING
,
SHOST_CANCEL,
SHOST_CANCEL,
+ SHOST_DEL,
SHOST_RECOVERY,
};
SHOST_RECOVERY,
};
@@
-464,12
+467,10
@@
struct Scsi_Host {
struct task_struct * ehandler; /* Error recovery thread. */
struct semaphore * eh_wait; /* The error recovery thread waits
on this. */
struct task_struct * ehandler; /* Error recovery thread. */
struct semaphore * eh_wait; /* The error recovery thread waits
on this. */
- struct completion * eh_notify; /* wait for eh to begin or end */
struct semaphore * eh_action; /* Wait for specific actions on the
host. */
unsigned int eh_active:1; /* Indicates the eh thread is awake and active if
this is true. */
struct semaphore * eh_action; /* Wait for specific actions on the
host. */
unsigned int eh_active:1; /* Indicates the eh thread is awake and active if
this is true. */
- unsigned int eh_kill:1; /* set when killing the eh thread */
wait_queue_head_t host_wait;
struct scsi_host_template *hostt;
struct scsi_transport_template *transportt;
wait_queue_head_t host_wait;
struct scsi_host_template *hostt;
struct scsi_transport_template *transportt;
@@
-575,7
+576,7
@@
struct Scsi_Host {
unsigned int irq;
unsigned int irq;
-
unsigned long
shost_state;
+
enum scsi_host_state
shost_state;
/* ldm bits */
struct device shost_gendev;
/* ldm bits */
struct device shost_gendev;
@@
-633,6
+634,7
@@
extern void scsi_remove_host(struct Scsi_Host *);
extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
extern void scsi_host_put(struct Scsi_Host *t);
extern struct Scsi_Host *scsi_host_lookup(unsigned short);
extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
extern void scsi_host_put(struct Scsi_Host *t);
extern struct Scsi_Host *scsi_host_lookup(unsigned short);
+extern const char *scsi_host_state_name(enum scsi_host_state);
extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
@@
-641,15
+643,18
@@
static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
shost->host_lock = lock;
}
shost->host_lock = lock;
}
-static inline void scsi_set_device(struct Scsi_Host *shost,
- struct device *dev)
+static inline struct device *scsi_get_device(struct Scsi_Host *shost)
{
{
-
shost->shost_gendev.parent = dev
;
+
return shost->shost_gendev.parent
;
}
}
-static inline struct device *scsi_get_device(struct Scsi_Host *shost)
+/**
+ * scsi_host_scan_allowed - Is scanning of this host allowed
+ * @shost: Pointer to Scsi_Host.
+ **/
+static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
{
{
-
return shost->shost_gendev.parent
;
+
return shost->shost_state == SHOST_RUNNING
;
}
extern void scsi_unblock_requests(struct Scsi_Host *);
}
extern void scsi_unblock_requests(struct Scsi_Host *);
@@
-669,5
+674,6
@@
extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *);
/* legacy interfaces */
extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
extern void scsi_unregister(struct Scsi_Host *);
/* legacy interfaces */
extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
extern void scsi_unregister(struct Scsi_Host *);
+extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state);
#endif /* _SCSI_SCSI_HOST_H */
#endif /* _SCSI_SCSI_HOST_H */