]> err.no Git - linux-2.6/blobdiff - include/scsi/scsi_host.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/lenb/to-linus
[linux-2.6] / include / scsi / scsi_host.h
index 1cee1e100943dafe00c14d5329b73659062a4d1a..81d5234f67711314cb51e33738c5c165ca9e39b7 100644 (file)
@@ -10,6 +10,7 @@ struct block_device;
 struct module;
 struct scsi_cmnd;
 struct scsi_device;
+struct scsi_target;
 struct Scsi_Host;
 struct scsi_host_cmd_pool;
 struct scsi_transport_template;
@@ -227,6 +228,30 @@ struct scsi_host_template {
         */
        void (* slave_destroy)(struct scsi_device *);
 
+       /*
+        * Before the mid layer attempts to scan for a new device attached
+        * to a target where no target currently exists, it will call this
+        * entry in your driver.  Should your driver need to allocate any
+        * structs or perform any other init items in order to send commands
+        * to a currently unused target, then this is where you can perform
+        * those allocations.
+        *
+        * Return values: 0 on success, non-0 on failure
+        *
+        * Status: OPTIONAL
+        */
+       int (* target_alloc)(struct scsi_target *);
+
+       /*
+        * Immediately prior to deallocating the target structure, and
+        * after all activity to attached scsi devices has ceased, the
+        * midlayer calls this point so that the driver may deallocate
+        * and terminate any references to the target.
+        *
+        * Status: OPTIONAL
+        */
+       void (* target_destroy)(struct scsi_target *);
+
        /*
         * fill in this function to allow the queue depth of this host
         * to be changeable (on a per device basis).  returns either
@@ -616,12 +641,6 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
        shost->host_lock = lock;
 }
 
-static inline void scsi_set_device(struct Scsi_Host *shost,
-                                   struct device *dev)
-{
-        shost->shost_gendev.parent = dev;
-}
-
 static inline struct device *scsi_get_device(struct Scsi_Host *shost)
 {
         return shost->shost_gendev.parent;