fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / scsi / aic7xxx / aic7xxx.h
index ef1214c..954c7c2 100644 (file)
@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#79 $
+ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#85 $
  *
  * $FreeBSD$
  */
@@ -54,14 +54,6 @@ struct scb_platform_data;
 struct seeprom_descriptor;
 
 /****************************** Useful Macros *********************************/
-#ifndef MAX
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef MIN
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 #ifndef TRUE
 #define TRUE 1
 #endif
@@ -69,8 +61,6 @@ struct seeprom_descriptor;
 #define FALSE 0
 #endif
 
-#define NUM_ELEMENTS(array) (sizeof(array) / sizeof(*array))
-
 #define ALL_CHANNELS '\0'
 #define ALL_TARGETS_MASK 0xFFFF
 #define INITIATOR_WILDCARD     (~0)
@@ -233,6 +223,7 @@ typedef enum {
        AHC_TARGETMODE  = 0x20000,      /* Has tested target mode support */
        AHC_MULTIROLE   = 0x40000,      /* Space for two roles at a time */
        AHC_REMOVABLE   = 0x80000,      /* Hot-Swap supported */
+       AHC_HVD         = 0x100000,     /* HVD rather than SE */
        AHC_AIC7770_FE  = AHC_FENONE,
        /*
         * The real 7850 does not support Ultra modes, but there are
@@ -243,7 +234,7 @@ typedef enum {
         */
        AHC_AIC7850_FE  = AHC_SPIOCAP|AHC_AUTOPAUSE|AHC_TARGETMODE|AHC_ULTRA,
        AHC_AIC7860_FE  = AHC_AIC7850_FE,
-       AHC_AIC7870_FE  = AHC_TARGETMODE,
+       AHC_AIC7870_FE  = AHC_TARGETMODE|AHC_AUTOPAUSE,
        AHC_AIC7880_FE  = AHC_AIC7870_FE|AHC_ULTRA,
        /*
         * Although we have space for both the initiator and
@@ -346,7 +337,6 @@ typedef enum {
                                          * controller.
                                          */
        AHC_NEWEEPROM_FMT     = 0x4000,
-       AHC_RESOURCE_SHORTAGE = 0x8000,
        AHC_TQINFIFO_BLOCKED  = 0x10000,  /* Blocked waiting for ATIOs */
        AHC_INT50_SPEEDFLEX   = 0x20000,  /*
                                           * Internal 50pin connector
@@ -521,7 +511,7 @@ struct ahc_dma_seg {
 
 struct sg_map_node {
        bus_dmamap_t             sg_dmamap;
-       bus_addr_t               sg_physaddr;
+       dma_addr_t               sg_physaddr;
        struct ahc_dma_seg*      sg_vaddr;
        SLIST_ENTRY(sg_map_node) links;
 };
@@ -584,7 +574,7 @@ struct scb {
        struct scb_platform_data *platform_data;
        struct sg_map_node       *sg_map;
        struct ahc_dma_seg       *sg_list;
-       bus_addr_t                sg_list_phys;
+       dma_addr_t                sg_list_phys;
        u_int                     sg_count;/* How full ahc_dma_seg is */
 };
 
@@ -611,10 +601,10 @@ struct scb_data {
         */
        bus_dma_tag_t    hscb_dmat;     /* dmat for our hardware SCB array */
        bus_dmamap_t     hscb_dmamap;
-       bus_addr_t       hscb_busaddr;
+       dma_addr_t       hscb_busaddr;
        bus_dma_tag_t    sense_dmat;
        bus_dmamap_t     sense_dmamap;
-       bus_addr_t       sense_busaddr;
+       dma_addr_t       sense_busaddr;
        bus_dma_tag_t    sg_dmat;       /* dmat for our sg segments */
        SLIST_HEAD(, sg_map_node) sg_maps;
        uint8_t numscbs;
@@ -1024,9 +1014,6 @@ struct ahc_softc {
        struct cs                *critical_sections;
        u_int                     num_critical_sections;
 
-       /* Links for chaining softcs */
-       TAILQ_ENTRY(ahc_softc)    links;
-
        /* Channel Names ('A', 'B', etc.) */
        char                      channel;
        char                      channel_b;
@@ -1069,14 +1056,14 @@ struct ahc_softc {
        bus_dma_tag_t             parent_dmat;
        bus_dma_tag_t             shared_data_dmat;
        bus_dmamap_t              shared_data_dmamap;
-       bus_addr_t                shared_data_busaddr;
+       dma_addr_t                shared_data_busaddr;
 
        /*
         * Bus address of the one byte buffer used to
         * work-around a DMA bug for chips <= aic7880
         * in target mode.
         */
-       bus_addr_t                dma_bug_buf;
+       dma_addr_t                dma_bug_buf;
 
        /* Number of enabled target mode device on this card */
        u_int                     enabled_luns;
@@ -1111,9 +1098,6 @@ struct ahc_softc {
        uint16_t                  user_tagenable;/* Tagged Queuing allowed */
 };
 
-TAILQ_HEAD(ahc_softc_tailq, ahc_softc);
-extern struct ahc_softc_tailq ahc_tailq;
-
 /************************ Active Device Information ***************************/
 typedef enum {
        ROLE_UNKNOWN,
@@ -1143,8 +1127,6 @@ struct ahc_pci_identity {
        char                    *name;
        ahc_device_setup_t      *setup;
 };
-extern struct ahc_pci_identity ahc_pci_ident_table[];
-extern const u_int ahc_num_pci_devs;
 
 /***************************** VL/EISA Declarations ***************************/
 struct aic7770_identity {
@@ -1199,8 +1181,6 @@ void                       ahc_intr_enable(struct ahc_softc *ahc, int enable);
 void                    ahc_pause_and_flushwork(struct ahc_softc *ahc);
 int                     ahc_suspend(struct ahc_softc *ahc); 
 int                     ahc_resume(struct ahc_softc *ahc);
-void                    ahc_softc_insert(struct ahc_softc *);
-struct ahc_softc       *ahc_find_softc(struct ahc_softc *ahc);
 void                    ahc_set_unit(struct ahc_softc *, int);
 void                    ahc_set_name(struct ahc_softc *, char *);
 void                    ahc_alloc_scbs(struct ahc_softc *ahc);
@@ -1299,6 +1279,7 @@ typedef enum {
 } ahc_queue_alg;
 
 void                   ahc_set_tags(struct ahc_softc *ahc,
+                                    struct scsi_cmnd *cmd,
                                     struct ahc_devinfo *devinfo,
                                     ahc_queue_alg alg);