Merge tag 'soc-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[firefly-linux-kernel-4.4.55.git] / include / scsi / scsi_device.h
index d65fbec2533d67a08c14a7b324a30b706c75808d..4e845b80efd33464c719da6f56f7c36a3957a6a1 100644 (file)
@@ -113,6 +113,12 @@ struct scsi_device {
        const char * vendor;            /* [back_compat] point into 'inquiry' ... */
        const char * model;             /* ... after scan; point to static string */
        const char * rev;               /* ... "nullnullnullnull" before scan */
+
+#define SCSI_VPD_PG_LEN                255
+       int vpd_pg83_len;
+       unsigned char *vpd_pg83;
+       int vpd_pg80_len;
+       unsigned char *vpd_pg80;
        unsigned char current_tag;      /* current tag */
        struct scsi_target      *sdev_target;   /* used only for single_lun */
 
@@ -235,12 +241,24 @@ struct scsi_dh_data {
 #define sdev_printk(prefix, sdev, fmt, a...)   \
        dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
 
+#define sdev_dbg(sdev, fmt, a...) \
+       dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
+
 #define scmd_printk(prefix, scmd, fmt, a...)                           \
         (scmd)->request->rq_disk ?                                     \
        sdev_printk(prefix, (scmd)->device, "[%s] " fmt,                \
                    (scmd)->request->rq_disk->disk_name, ##a) :         \
        sdev_printk(prefix, (scmd)->device, fmt, ##a)
 
+#define scmd_dbg(scmd, fmt, a...)                                         \
+       do {                                                               \
+               if ((scmd)->request->rq_disk)                              \
+                       sdev_dbg((scmd)->device, "[%s] " fmt,              \
+                                (scmd)->request->rq_disk->disk_name, ##a);\
+               else                                                       \
+                       sdev_dbg((scmd)->device, fmt, ##a);                \
+       } while (0)
+
 enum scsi_target_state {
        STARGET_CREATED = 1,
        STARGET_RUNNING,
@@ -257,7 +275,7 @@ struct scsi_target {
        struct list_head        siblings;
        struct list_head        devices;
        struct device           dev;
-       unsigned int            reap_ref; /* protected by the host lock */
+       struct kref             reap_ref; /* last put renders target invisible */
        unsigned int            channel;
        unsigned int            id; /* target id ... replace
                                     * scsi_device.id eventually */
@@ -284,7 +302,6 @@ struct scsi_target {
 #define SCSI_DEFAULT_TARGET_BLOCKED    3
 
        char                    scsi_level;
-       struct execute_work     ew;
        enum scsi_target_state  state;
        void                    *hostdata; /* available to low-level driver */
        unsigned long           starget_data[0]; /* for the transport */
@@ -309,6 +326,7 @@ extern int scsi_add_device(struct Scsi_Host *host, uint channel,
 extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh);
 extern void scsi_remove_device(struct scsi_device *);
 extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh);
+void scsi_attach_vpd(struct scsi_device *sdev);
 
 extern int scsi_device_get(struct scsi_device *);
 extern void scsi_device_put(struct scsi_device *);