aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_cmnd.h8
-rw-r--r--include/scsi/scsi_host.h24
-rw-r--r--include/scsi/scsi_transport_spi.h6
3 files changed, 31 insertions, 7 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 9957f16dcc5d..bed4b7c9be99 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -51,12 +51,16 @@ struct scsi_cmnd {
51 * printk's to use ->pid, so that we can kill this field. 51 * printk's to use ->pid, so that we can kill this field.
52 */ 52 */
53 unsigned long serial_number; 53 unsigned long serial_number;
54 /*
55 * This is set to jiffies as it was when the command was first
56 * allocated. It is used to time how long the command has
57 * been outstanding
58 */
59 unsigned long jiffies_at_alloc;
54 60
55 int retries; 61 int retries;
56 int allowed; 62 int allowed;
57 int timeout_per_command; 63 int timeout_per_command;
58 int timeout_total;
59 int timeout;
60 64
61 unsigned char cmd_len; 65 unsigned char cmd_len;
62 unsigned char old_cmd_len; 66 unsigned char old_cmd_len;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 81d5234f6771..ac1b6125e3ae 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 */
434enum { 436enum 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
@@ -575,7 +578,7 @@ struct Scsi_Host {
575 unsigned int irq; 578 unsigned int irq;
576 579
577 580
578 unsigned long shost_state; 581 enum scsi_host_state shost_state;
579 582
580 /* ldm bits */ 583 /* ldm bits */
581 struct device shost_gendev; 584 struct device shost_gendev;
@@ -633,6 +636,7 @@ extern void scsi_remove_host(struct Scsi_Host *);
633extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); 636extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
634extern void scsi_host_put(struct Scsi_Host *t); 637extern void scsi_host_put(struct Scsi_Host *t);
635extern struct Scsi_Host *scsi_host_lookup(unsigned short); 638extern struct Scsi_Host *scsi_host_lookup(unsigned short);
639extern const char *scsi_host_state_name(enum scsi_host_state);
636 640
637extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 641extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
638 642
@@ -646,6 +650,15 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
646 return shost->shost_gendev.parent; 650 return shost->shost_gendev.parent;
647} 651}
648 652
653/**
654 * scsi_host_scan_allowed - Is scanning of this host allowed
655 * @shost: Pointer to Scsi_Host.
656 **/
657static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
658{
659 return shost->shost_state == SHOST_RUNNING;
660}
661
649extern void scsi_unblock_requests(struct Scsi_Host *); 662extern void scsi_unblock_requests(struct Scsi_Host *);
650extern void scsi_block_requests(struct Scsi_Host *); 663extern void scsi_block_requests(struct Scsi_Host *);
651 664
@@ -663,5 +676,6 @@ extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *);
663/* legacy interfaces */ 676/* legacy interfaces */
664extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); 677extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
665extern void scsi_unregister(struct Scsi_Host *); 678extern void scsi_unregister(struct Scsi_Host *);
679extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state);
666 680
667#endif /* _SCSI_SCSI_HOST_H */ 681#endif /* _SCSI_SCSI_HOST_H */
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index a30d6cd4c0e8..6bdc4afb2483 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -39,6 +39,7 @@ struct spi_transport_attrs {
39 unsigned int rd_strm:1; /* Read streaming enabled */ 39 unsigned int rd_strm:1; /* Read streaming enabled */
40 unsigned int rti:1; /* Retain Training Information */ 40 unsigned int rti:1; /* Retain Training Information */
41 unsigned int pcomp_en:1;/* Precompensation enabled */ 41 unsigned int pcomp_en:1;/* Precompensation enabled */
42 unsigned int hold_mcs:1;/* Hold Margin Control Settings */
42 unsigned int initial_dv:1; /* DV done to this target yet */ 43 unsigned int initial_dv:1; /* DV done to this target yet */
43 unsigned long flags; /* flags field for drivers to use */ 44 unsigned long flags; /* flags field for drivers to use */
44 /* Device Properties fields */ 45 /* Device Properties fields */
@@ -78,6 +79,7 @@ struct spi_host_attrs {
78#define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm) 79#define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm)
79#define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti) 80#define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti)
80#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en) 81#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en)
82#define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs)
81#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv) 83#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv)
82 84
83#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync) 85#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync)
@@ -114,8 +116,11 @@ struct spi_function_template {
114 void (*set_rti)(struct scsi_target *, int); 116 void (*set_rti)(struct scsi_target *, int);
115 void (*get_pcomp_en)(struct scsi_target *); 117 void (*get_pcomp_en)(struct scsi_target *);
116 void (*set_pcomp_en)(struct scsi_target *, int); 118 void (*set_pcomp_en)(struct scsi_target *, int);
119 void (*get_hold_mcs)(struct scsi_target *);
120 void (*set_hold_mcs)(struct scsi_target *, int);
117 void (*get_signalling)(struct Scsi_Host *); 121 void (*get_signalling)(struct Scsi_Host *);
118 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type); 122 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type);
123 int (*deny_binding)(struct scsi_target *);
119 /* The driver sets these to tell the transport class it 124 /* The driver sets these to tell the transport class it
120 * wants the attributes displayed in sysfs. If the show_ flag 125 * wants the attributes displayed in sysfs. If the show_ flag
121 * is not set, the attribute will be private to the transport 126 * is not set, the attribute will be private to the transport
@@ -130,6 +135,7 @@ struct spi_function_template {
130 unsigned long show_rd_strm:1; 135 unsigned long show_rd_strm:1;
131 unsigned long show_rti:1; 136 unsigned long show_rti:1;
132 unsigned long show_pcomp_en:1; 137 unsigned long show_pcomp_en:1;
138 unsigned long show_hold_mcs:1;
133}; 139};
134 140
135struct scsi_transport_template *spi_attach_transport(struct spi_function_template *); 141struct scsi_transport_template *spi_attach_transport(struct spi_function_template *);