header cleaning: don't include smp_lock.h when not used
[safe/jmp/linux-2.6] / drivers / scsi / aic7xxx / aic79xx_osm.h
index 46edcf3..ad9761b 100644 (file)
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#137 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#166 $
  *
  */
 #ifndef _AIC79XX_LINUX_H_
 #define _AIC79XX_LINUX_H_
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
-#include <linux/smp_lock.h>
-#include <linux/version.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -95,7 +92,6 @@
 #endif
 
 /********************************** Misc Macros *******************************/
-#define        roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
 #define        powerof2(x)     ((((x)-1)&(x))==0)
 
 /************************* Forward Declarations *******************************/
@@ -120,7 +116,6 @@ typedef struct scsi_cmnd      *ahd_io_ctx_t;
 
 /************************* Configuration Data *********************************/
 extern uint32_t aic79xx_allow_memio;
-extern int aic79xx_detect_complete;
 extern struct scsi_host_template aic79xx_driver_template;
 
 /***************************** Bus Space/DMA **********************************/
@@ -230,7 +225,6 @@ typedef struct timer_list ahd_timer_t;
 typedef void ahd_linux_callback_t (u_long);  
 static __inline void ahd_timer_reset(ahd_timer_t *timer, int usec,
                                     ahd_callback_t *func, void *arg);
-static __inline void ahd_scb_timer_reset(struct scb *scb, u_int usec);
 
 static __inline void
 ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg)
@@ -245,47 +239,10 @@ ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg)
        add_timer(timer);
 }
 
-static __inline void
-ahd_scb_timer_reset(struct scb *scb, u_int usec)
-{
-       mod_timer(&scb->io_ctx->eh_timeout, jiffies + (usec * HZ)/1000000);
-}
-
 /***************************** SMP support ************************************/
 #include <linux/spinlock.h>
 
-#define AHD_SCSI_HAS_HOST_LOCK 1
-
-#define AIC79XX_DRIVER_VERSION "1.3.11"
-
-/**************************** Front End Queues ********************************/
-/*
- * Data structure used to cast the Linux struct scsi_cmnd to something
- * that allows us to use the queue macros.  The linux structure has
- * plenty of space to hold the links fields as required by the queue
- * macros, but the queue macors require them to have the correct type.
- */
-struct ahd_cmd_internal {
-       /* Area owned by the Linux scsi layer. */
-       uint8_t private[offsetof(struct scsi_cmnd, SCp.Status)];
-       union {
-               STAILQ_ENTRY(ahd_cmd)   ste;
-               LIST_ENTRY(ahd_cmd)     le;
-               TAILQ_ENTRY(ahd_cmd)    tqe;
-       } links;
-       uint32_t                        end;
-};
-
-struct ahd_cmd {
-       union {
-               struct ahd_cmd_internal icmd;
-               struct scsi_cmnd        scsi_cmd;
-       } un;
-};
-
-#define acmd_icmd(cmd) ((cmd)->un.icmd)
-#define acmd_scsi_cmd(cmd) ((cmd)->un.scsi_cmd)
-#define acmd_links un.icmd.links
+#define AIC79XX_DRIVER_VERSION "3.0"
 
 /*************************** Device Data Structures ***************************/
 /*
@@ -297,16 +254,12 @@ struct ahd_cmd {
  */
 
 typedef enum {
-       AHD_DEV_UNCONFIGURED     = 0x01,
        AHD_DEV_FREEZE_TIL_EMPTY = 0x02, /* Freeze queue until active == 0 */
-       AHD_DEV_TIMER_ACTIVE     = 0x04, /* Our timer is active */
        AHD_DEV_Q_BASIC          = 0x10, /* Allow basic device queuing */
        AHD_DEV_Q_TAGGED         = 0x20, /* Allow full SCSI2 command queueing */
        AHD_DEV_PERIODIC_OTAG    = 0x40, /* Send OTAG to prevent starvation */
-       AHD_DEV_SLAVE_CONFIGURED = 0x80  /* slave_configure() has been called */
 } ahd_linux_dev_flags;
 
-struct ahd_linux_target;
 struct ahd_linux_device {
        TAILQ_ENTRY(ahd_linux_device) links;
 
@@ -386,12 +339,6 @@ struct ahd_linux_device {
 #define AHD_OTAG_THRESH        500
 };
 
-struct ahd_linux_target {
-       struct scsi_device       *sdev[AHD_NUM_LUNS];
-       struct ahd_transinfo      last_tinfo;
-       struct ahd_softc         *ahd;
-};
-
 /********************* Definitions Required by the Core ***********************/
 /*
  * Number of SG segments we require.  So long as the S/G segments for
@@ -424,17 +371,12 @@ struct ahd_platform_data {
        struct scsi_target *starget[AHD_NUM_TARGETS]; 
 
        spinlock_t               spin_lock;
-       u_int                    qfrozen;
-       struct timer_list        reset_timer;
-       struct semaphore         eh_sem;
+       struct completion       *eh_done;
        struct Scsi_Host        *host;          /* pointer to scsi host */
 #define AHD_LINUX_NOIRQ        ((uint32_t)~0)
        uint32_t                 irq;           /* IRQ for this adapter */
        uint32_t                 bios_address;
        uint32_t                 mem_busaddr;   /* Mem Base Addr */
-       uint64_t                 hw_dma_mask;
-#define        AHD_SCB_UP_EH_SEM 0x1
-       uint32_t                 flags;
 };
 
 /************************** OS Utility Wrappers *******************************/
@@ -553,8 +495,6 @@ ahd_insb(struct ahd_softc * ahd, long port, uint8_t *array, int count)
 int            ahd_linux_register_host(struct ahd_softc *,
                                        struct scsi_host_template *);
 
-uint64_t       ahd_linux_get_memsize(void);
-
 /*************************** Pretty Printing **********************************/
 struct info_str {
        char *buffer;
@@ -563,21 +503,7 @@ struct info_str {
        int pos;
 };
 
-void   ahd_format_transinfo(struct info_str *info,
-                            struct ahd_transinfo *tinfo);
-
 /******************************** Locking *************************************/
-/* Lock protecting internal data structures */
-static __inline void ahd_lockinit(struct ahd_softc *);
-static __inline void ahd_lock(struct ahd_softc *, unsigned long *flags);
-static __inline void ahd_unlock(struct ahd_softc *, unsigned long *flags);
-
-/* Lock held during ahd_list manipulation and ahd softc frees */
-extern spinlock_t ahd_list_spinlock;
-static __inline void ahd_list_lockinit(void);
-static __inline void ahd_list_lock(unsigned long *flags);
-static __inline void ahd_list_unlock(unsigned long *flags);
-
 static __inline void
 ahd_lockinit(struct ahd_softc *ahd)
 {
@@ -596,24 +522,6 @@ ahd_unlock(struct ahd_softc *ahd, unsigned long *flags)
        spin_unlock_irqrestore(&ahd->platform_data->spin_lock, *flags);
 }
 
-static __inline void
-ahd_list_lockinit(void)
-{
-       spin_lock_init(&ahd_list_spinlock);
-}
-
-static __inline void
-ahd_list_lock(unsigned long *flags)
-{
-       spin_lock_irqsave(&ahd_list_spinlock, *flags);
-}
-
-static __inline void
-ahd_list_unlock(unsigned long *flags)
-{
-       spin_unlock_irqrestore(&ahd_list_spinlock, *flags);
-}
-
 /******************************* PCI Definitions ******************************/
 /*
  * PCIM_xxx: mask to locate subfield in register
@@ -668,8 +576,6 @@ ahd_list_unlock(unsigned long *flags)
 #define PCIXM_STATUS_MAXCRDS   0x1C00  /* Maximum Cumulative Read Size */
 #define PCIXM_STATUS_RCVDSCEM  0x2000  /* Received a Split Comp w/Error msg */
 
-extern struct pci_driver aic79xx_pci_driver;
-
 typedef enum
 {
        AHD_POWER_STATE_D0,
@@ -930,8 +836,6 @@ int ahd_platform_alloc(struct ahd_softc *ahd, void *platform_arg);
 void   ahd_platform_free(struct ahd_softc *ahd);
 void   ahd_platform_init(struct ahd_softc *ahd);
 void   ahd_platform_freeze_devq(struct ahd_softc *ahd, struct scb *scb);
-void   ahd_freeze_simq(struct ahd_softc *ahd);
-void   ahd_release_simq(struct ahd_softc *ahd);
 
 static __inline void
 ahd_freeze_scb(struct scb *scb)
@@ -942,18 +846,16 @@ ahd_freeze_scb(struct scb *scb)
         }
 }
 
-void   ahd_platform_set_tags(struct ahd_softc *ahd,
+void   ahd_platform_set_tags(struct ahd_softc *ahd, struct scsi_device *sdev,
                              struct ahd_devinfo *devinfo, ahd_queue_alg);
 int    ahd_platform_abort_scbs(struct ahd_softc *ahd, int target,
                                char channel, int lun, u_int tag,
                                role_t role, uint32_t status);
 irqreturn_t
-       ahd_linux_isr(int irq, void *dev_id, struct pt_regs * regs);
-void   ahd_platform_flushwork(struct ahd_softc *ahd);
-int    ahd_softc_comp(struct ahd_softc *, struct ahd_softc *);
+       ahd_linux_isr(int irq, void *dev_id);
 void   ahd_done(struct ahd_softc*, struct scb*);
 void   ahd_send_async(struct ahd_softc *, char channel,
-                      u_int target, u_int lun, ac_code, void *);
+                      u_int target, u_int lun, ac_code);
 void   ahd_print_path(struct ahd_softc *, struct scb *);
 
 #ifdef CONFIG_PCI