summaryrefslogtreecommitdiff
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libsas.h6
-rw-r--r--include/scsi/scsi_common.h8
-rw-r--r--include/scsi/scsi_device.h9
-rw-r--r--include/scsi/scsi_host.h10
4 files changed, 22 insertions, 11 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index e76f5744941b..c7017ae76c61 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -62,10 +62,6 @@ enum discover_event {
/* ---------- Expander Devices ---------- */
-#define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj)
-#define to_dev_attr(_attr) container_of(_attr, struct domain_dev_attribute,\
- attr)
-
enum routing_attribute {
DIRECT_ROUTING,
SUBTRACTIVE_ROUTING,
@@ -709,6 +705,7 @@ void sas_task_abort(struct sas_task *);
int sas_eh_abort_handler(struct scsi_cmnd *cmd);
int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
int sas_eh_target_reset_handler(struct scsi_cmnd *cmd);
+enum scsi_timeout_action sas_eh_timed_out(struct scsi_cmnd *cmd);
extern void sas_target_destroy(struct scsi_target *);
extern int sas_sdev_init(struct scsi_device *);
@@ -747,6 +744,7 @@ void sas_notify_phy_event(struct asd_sas_phy *phy, enum phy_event event,
.this_id = -1, \
.eh_device_reset_handler = sas_eh_device_reset_handler, \
.eh_target_reset_handler = sas_eh_target_reset_handler, \
+ .eh_timed_out = sas_eh_timed_out, \
.target_destroy = sas_target_destroy, \
.ioctl = sas_ioctl, \
diff --git a/include/scsi/scsi_common.h b/include/scsi/scsi_common.h
index fb58715fac86..00c8a16d3cd2 100644
--- a/include/scsi/scsi_common.h
+++ b/include/scsi/scsi_common.h
@@ -10,6 +10,14 @@
#include <uapi/linux/pr.h>
#include <scsi/scsi_proto.h>
+/* From the standard INQUIRY data description in SPC-6. */
+#define INQUIRY_VENDOR_OFFSET 8
+#define INQUIRY_VENDOR_LEN 8
+#define INQUIRY_MODEL_OFFSET 16
+#define INQUIRY_MODEL_LEN 16
+#define INQUIRY_REVISION_OFFSET 32
+#define INQUIRY_REVISION_LEN 4
+
enum scsi_pr_type {
SCSI_PR_WRITE_EXCLUSIVE = 0x01,
SCSI_PR_EXCLUSIVE_ACCESS = 0x03,
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index d32f5841f4f8..8694eeadd753 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -7,6 +7,7 @@
#include <linux/workqueue.h>
#include <linux/blk-mq.h>
#include <scsi/scsi.h>
+#include <scsi/scsi_common.h>
#include <linux/atomic.h>
#include <linux/sbitmap.h>
@@ -137,9 +138,9 @@ struct scsi_device {
struct mutex inquiry_mutex;
unsigned char inquiry_len; /* valid bytes in 'inquiry' */
unsigned char * inquiry; /* INQUIRY response data */
- const char * vendor; /* [back_compat] point into 'inquiry' ... */
- const char * model; /* ... after scan; point to static string */
- const char * rev; /* ... "nullnullnullnull" before scan */
+ char vendor[INQUIRY_VENDOR_LEN + 1];
+ char model[INQUIRY_MODEL_LEN + 1];
+ char rev[INQUIRY_REVISION_LEN + 1];
#define SCSI_DEFAULT_VPD_LEN 255 /* default SCSI VPD page size (max) */
struct scsi_vpd __rcu *vpd_pg0;
@@ -407,7 +408,6 @@ void scsi_attach_vpd(struct scsi_device *sdev);
void scsi_cdl_check(struct scsi_device *sdev);
int scsi_cdl_enable(struct scsi_device *sdev, bool enable);
-extern struct scsi_device *scsi_device_from_queue(struct request_queue *q);
extern int __must_check scsi_device_get(struct scsi_device *);
extern void scsi_device_put(struct scsi_device *);
extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *,
@@ -571,6 +571,7 @@ void scsi_put_internal_cmd(struct scsi_cmnd *scmd);
extern void sdev_disable_disk_events(struct scsi_device *sdev);
extern void sdev_enable_disk_events(struct scsi_device *sdev);
extern int scsi_vpd_lun_id(struct scsi_device *, char *, size_t);
+extern int scsi_vpd_lun_serial(struct scsi_device *, char *, size_t);
extern int scsi_vpd_tpg_id(struct scsi_device *, int *);
#ifdef CONFIG_PM
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index f6e12565a81d..f6b286fa59f2 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -660,6 +660,10 @@ struct Scsi_Host {
*/
unsigned nr_hw_queues;
unsigned nr_maps;
+
+ /* Asynchronous scan in progress */
+ bool async_scan __guarded_by(&scan_mutex);
+
unsigned active_mode:2;
/*
@@ -678,9 +682,6 @@ struct Scsi_Host {
/* Task mgmt function in progress */
unsigned tmf_in_progress:1;
- /* Asynchronous scan in progress */
- unsigned async_scan:1;
-
/* Don't resume host in EH */
unsigned eh_noresume:1;
@@ -749,6 +750,9 @@ struct Scsi_Host {
*/
struct device *dma_dev;
+ /* Used for an rcu-synchronizing eh wakeup */
+ struct work_struct eh_work;
+
/* Delay for runtime autosuspend */
int rpm_autosuspend_delay;