]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/esp_scsi.h
[SCSI] esp: Fix OOPS in esp_reset_cleanup().
[linux-2.6-omap-h63xx.git] / drivers / scsi / esp_scsi.h
index 8d4a6690401f9bd11dbf23296f4ed6fb8a072246..655e0b2240bf497eb9529723beea4c3e2118b542 100644 (file)
 #define ESP_TIMEO_CONST       8192
 #define ESP_NEG_DEFP(mhz, cfact) \
         ((ESP_BUS_TIMEOUT * ((mhz) / 1000)) / (8192 * (cfact)))
-#define ESP_MHZ_TO_CYCLE(mhertz)  ((1000000000) / ((mhertz) / 1000))
+#define ESP_HZ_TO_CYCLE(hertz)  ((1000000000) / ((hertz) / 1000))
 #define ESP_TICK(ccf, cycle)  ((7682 * (ccf) * (cycle) / 1000))
 
 /* For slow to medium speed input clock rates we shoot for 5mb/s, but for high
@@ -240,9 +240,9 @@ struct esp_cmd_priv {
                int             num_sg;
        } u;
 
-       unsigned int            cur_residue;
+       int                     cur_residue;
        struct scatterlist      *cur_sg;
-       unsigned int            tot_residue;
+       int                     tot_residue;
 };
 #define ESP_CMD_PRIV(CMD)      ((struct esp_cmd_priv *)(&(CMD)->SCp))
 
@@ -322,6 +322,7 @@ struct esp_target_data {
        u8                      nego_goal_tags;
 
        struct scsi_target      *starget;
+       int                     starget_ref;
 };
 
 struct esp_event_ent {
@@ -368,6 +369,12 @@ struct esp_driver_ops {
         */
        int (*irq_pending)(struct esp *esp);
 
+       /* Return the maximum allowable size of a DMA transfer for a
+        * given buffer.
+        */
+       u32 (*dma_length_limit)(struct esp *esp, u32 dma_addr,
+                               u32 dma_len);
+
        /* Reset the DMA engine entirely.  On return, ESP interrupts
         * should be enabled.  Often the interrupt enabling is
         * controlled in the DMA engine.
@@ -471,6 +478,7 @@ struct esp {
 #define ESP_FLAG_DOING_SLOWCMD 0x00000004
 #define ESP_FLAG_WIDE_CAPABLE  0x00000008
 #define ESP_FLAG_QUICKIRQ_CHECK        0x00000010
+#define ESP_FLAG_DISABLE_SYNC  0x00000020
 
        u8                      select_state;
 #define ESP_SELECT_NONE                0x00 /* Not selecting */
@@ -517,8 +525,6 @@ struct esp {
        struct sbus_dma         *dma;
 };
 
-#define host_to_esp(host)      ((struct esp *)(host)->hostdata)
-
 /* A front-end driver for the ESP chip should do the following in
  * it's device probe routine:
  * 1) Allocate the host and private area using scsi_host_alloc()