V4L/DVB (7121): Renames videobuf lock to vb_lock
[sfrench/cifs-2.6.git] / include / scsi / scsi_host.h
index 0fd4746ee39d4437e788c37b9a7f59d9b65dc11a..530ff4c553f86a1b307b8f3259ed1bf0a09b283e 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/types.h>
 #include <linux/workqueue.h>
 #include <linux/mutex.h>
+#include <scsi/scsi.h>
 
 struct request_queue;
 struct block_device;
@@ -25,12 +26,15 @@ struct blk_queue_tags;
  * NONE: Self evident. Host adapter is not capable of scatter-gather.
  * ALL:         Means that the host adapter module can do scatter-gather,
  *      and that there is no limit to the size of the table to which
- *      we scatter/gather data.
+ *      we scatter/gather data.  The value we set here is the maximum
+ *      single element sglist.  To use chained sglists, the adapter
+ *      has to set a value beyond ALL (and correctly use the chain
+ *      handling API.
  * Anything else:  Indicates the maximum number of chains that can be
  *      used in one scatter-gather request.
  */
 #define SG_NONE 0
-#define SG_ALL 0xff
+#define SG_ALL SCSI_MAX_SG_SEGMENTS
 
 #define MODE_UNKNOWN 0x00
 #define MODE_INITIATOR 0x01
@@ -39,9 +43,6 @@ struct blk_queue_tags;
 #define DISABLE_CLUSTERING 0
 #define ENABLE_CLUSTERING 1
 
-#define DISABLE_SG_CHAINING 0
-#define ENABLE_SG_CHAINING 1
-
 enum scsi_eh_timer_return {
        EH_NOT_HANDLED,
        EH_HANDLED,
@@ -136,9 +137,9 @@ struct scsi_host_template {
         * the done callback is invoked.
         *
         * This is called to inform the LLD to transfer
-        * cmd->request_bufflen bytes. The cmd->use_sg speciefies the
+        * scsi_bufflen(cmd) bytes. scsi_sg_count(cmd) speciefies the
         * number of scatterlist entried in the command and
-        * cmd->request_buffer contains the scatterlist.
+        * scsi_sglist(cmd) returns the scatterlist.
         *
         * return values: see queuecommand
         *
@@ -283,39 +284,45 @@ struct scsi_host_template {
         * If the host wants to be called before the scan starts, but
         * after the midlayer has set up ready for the scan, it can fill
         * in this function.
+        *
+        * Status: OPTIONAL
         */
        void (* scan_start)(struct Scsi_Host *);
 
        /*
-        * fill in this function to allow the queue depth of this host
-        * to be changeable (on a per device basis).  returns either
+        * Fill in this function to allow the queue depth of this host
+        * to be changeable (on a per device basis).  Returns either
         * the current queue depth setting (may be different from what
         * was passed in) or an error.  An error should only be
         * returned if the requested depth is legal but the driver was
         * unable to set it.  If the requested depth is illegal, the
         * driver should set and return the closest legal queue depth.
         *
+        * Status: OPTIONAL
         */
        int (* change_queue_depth)(struct scsi_device *, int);
 
        /*
-        * fill in this function to allow the changing of tag types
+        * Fill in this function to allow the changing of tag types
         * (this also allows the enabling/disabling of tag command
         * queueing).  An error should only be returned if something
         * went wrong in the driver while trying to set the tag type.
         * If the driver doesn't support the requested tag type, then
         * it should set the closest type it does support without
         * returning an error.  Returns the actual tag type set.
+        *
+        * Status: OPTIONAL
         */
        int (* change_queue_type)(struct scsi_device *, int);
 
        /*
-        * This function determines the bios parameters for a given
+        * This function determines the BIOS parameters for a given
         * harddisk.  These tend to be numbers that are made up by
         * the host adapter.  Parameters:
         * size, device, list (heads, sectors, cylinders)
         *
-        * Status: OPTIONAL */
+        * Status: OPTIONAL
+        */
        int (* bios_param)(struct scsi_device *, struct block_device *,
                        sector_t, int []);
 
@@ -354,7 +361,7 @@ struct scsi_host_template {
 
        /*
         * This determines if we will use a non-interrupt driven
-        * or an interrupt driven scheme,  It is set to the maximum number
+        * or an interrupt driven scheme.  It is set to the maximum number
         * of simultaneous commands a given host adapter will accept.
         */
        int can_queue;
@@ -375,12 +382,12 @@ struct scsi_host_template {
        unsigned short sg_tablesize;
 
        /*
-        * If the host adapter has limitations beside segment count
+        * Set this if the host adapter has limitations beside segment count.
         */
        unsigned short max_sectors;
 
        /*
-        * dma scatter gather segment boundary limit. a segment crossing this
+        * DMA scatter gather segment boundary limit. A segment crossing this
         * boundary will be split in two.
         */
        unsigned long dma_boundary;
@@ -389,7 +396,7 @@ struct scsi_host_template {
         * This specifies "machine infinity" for host templates which don't
         * limit the transfer size.  Note this limit represents an absolute
         * maximum, and may be over the transfer limits allowed for
-        * individual devices (e.g. 256 for SCSI-1)
+        * individual devices (e.g. 256 for SCSI-1).
         */
 #define SCSI_DEFAULT_MAX_SECTORS       1024
 
@@ -416,12 +423,12 @@ struct scsi_host_template {
        unsigned supported_mode:2;
 
        /*
-        * true if this host adapter uses unchecked DMA onto an ISA bus.
+        * True if this host adapter uses unchecked DMA onto an ISA bus.
         */
        unsigned unchecked_isa_dma:1;
 
        /*
-        * true if this host adapter can make good use of clustering.
+        * True if this host adapter can make good use of clustering.
         * I originally thought that if the tablesize was large that it
         * was a waste of CPU cycles to prepare a cluster list, but
         * it works out that the Buslogic is faster if you use a smaller
@@ -431,7 +438,7 @@ struct scsi_host_template {
        unsigned use_clustering:1;
 
        /*
-        * True for emulated SCSI host adapters (e.g. ATAPI)
+        * True for emulated SCSI host adapters (e.g. ATAPI).
         */
        unsigned emulated:1;
 
@@ -441,21 +448,12 @@ struct scsi_host_template {
        unsigned skip_settle_delay:1;
 
        /*
-        * ordered write support
+        * True if we are using ordered write support.
         */
        unsigned ordered_tag:1;
 
        /*
-        * true if the low-level driver can support sg chaining. this
-        * will be removed eventually when all the drivers are
-        * converted to support sg chaining.
-        *
-        * Status: OBSOLETE
-        */
-       unsigned use_sg_chaining:1;
-
-       /*
-        * Countdown for host blocking with no commands outstanding
+        * Countdown for host blocking with no commands outstanding.
         */
        unsigned int max_host_blocked;
 
@@ -534,8 +532,8 @@ struct Scsi_Host {
        struct scsi_transport_template *transportt;
 
        /*
-        * area to keep a shared tag map (if needed, will be
-        * NULL if not)
+        * Area to keep a shared tag map (if needed, will be
+        * NULL if not).
         */
        struct blk_queue_tag    *bqt;
 
@@ -598,7 +596,6 @@ struct Scsi_Host {
        unsigned unchecked_isa_dma:1;
        unsigned use_clustering:1;
        unsigned use_blk_tcq:1;
-       unsigned use_sg_chaining:1;
 
        /*
         * Host has requested that no further requests come through for the
@@ -609,16 +606,16 @@ struct Scsi_Host {
        /*
         * Host uses correct SCSI ordering not PC ordering. The bit is
         * set for the minority of drivers whose authors actually read
-        * the spec ;)
+        * the spec ;).
         */
        unsigned reverse_ordering:1;
 
        /*
-        * ordered write support
+        * Ordered write support
         */
        unsigned ordered_tag:1;
 
-       /* task mgmt function in progress */
+       /* Task mgmt function in progress */
        unsigned tmf_in_progress:1;
 
        /* Asynchronous scan in progress */