patch-2.4.19 linux-2.4.19/drivers/scsi/aic7xxx/aic7xxx_osm.h
Next file: linux-2.4.19/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
Previous file: linux-2.4.19/drivers/scsi/aic7xxx/aic7xxx_osm.c
Back to the patch index
Back to the overall index
- Lines: 265
- Date:
Fri Aug 2 17:39:44 2002
- Orig file:
linux-2.4.18/drivers/scsi/aic7xxx/aic7xxx_osm.h
- Orig date:
Thu Oct 25 13:53:49 2001
diff -urN linux-2.4.18/drivers/scsi/aic7xxx/aic7xxx_osm.h linux-2.4.19/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -18,7 +18,7 @@
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_linux.h#72 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#82 $
*
* Copyright (c) 2000-2001 Adaptec Inc.
* All rights reserved.
@@ -55,7 +55,7 @@
* 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/aic7xxx_linux.h#72 $
+ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#82 $
*
*/
#ifndef _AIC7XXX_LINUX_H_
@@ -66,9 +66,11 @@
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/ioport.h>
-#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/version.h>
+#ifndef AHC_MODVERSION_FILE
+#define __NO_VERSION__
+#endif
#include <linux/module.h>
#include <asm/byteorder.h>
@@ -77,7 +79,11 @@
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#include <linux/interrupt.h> /* For tasklet support. */
#include <linux/config.h>
+#include <linux/slab.h>
+#else
+#include <linux/malloc.h>
#endif
/* Core SCSI definitions */
@@ -391,7 +397,7 @@
/********************************** Includes **********************************/
/* Host template and function declarations referenced by the template. */
-#include "aic7xxx_linux_host.h"
+#include "aic7xxx_host.h"
/* Core driver definitions */
#include "aic7xxx.h"
@@ -403,7 +409,7 @@
#include <linux/smp.h>
#endif
-#define AIC7XXX_DRIVER_VERSION "6.2.4"
+#define AIC7XXX_DRIVER_VERSION "6.2.8"
/**************************** Front End Queues ********************************/
/*
@@ -462,7 +468,7 @@
* The number of transactions currently
* queued to the device.
*/
- int active;
+ int active;
/*
* The currently allowed number of
@@ -472,18 +478,18 @@
* mode where the device may have more
* than one outstanding active transaction.
*/
- int openings;
+ int openings;
/*
* A positive count indicates that this
* device's queue is halted.
*/
- u_int qfrozen;
+ u_int qfrozen;
/*
* Cumulative command counter.
*/
- u_long commands_issued;
+ u_long commands_issued;
/*
* The number of tagged transactions when
@@ -491,21 +497,26 @@
* that have been successfully received by
* this device since the last QUEUE FULL.
*/
- u_int tag_success_count;
+ u_int tag_success_count;
#define AHC_TAG_SUCCESS_INTERVAL 50
- ahc_dev_flags flags;
+ ahc_dev_flags flags;
+
+ /*
+ * Per device timer.
+ */
+ struct timer_list timer;
/*
* The high limit for the tags variable.
*/
- u_int maxtags;
+ u_int maxtags;
/*
* The computed number of tags outstanding
* at the time of the last QUEUE FULL event.
*/
- u_int tags_on_last_queuefull;
+ u_int tags_on_last_queuefull;
/*
* How many times we have seen a queue full
@@ -513,7 +524,7 @@
* to stop our adaptive queue depth algorithm
* on devices with a fixed number of tags.
*/
- u_int last_queuefull_same_count;
+ u_int last_queuefull_same_count;
#define AHC_LOCK_TAGS_COUNT 50
/*
@@ -525,11 +536,11 @@
* if the AHC_DEV_PERIODIC_OTAG flag is set
* on this device.
*/
- u_int commands_since_idle_or_otag;
+ u_int commands_since_idle_or_otag;
#define AHC_OTAG_THRESH 500
- int lun;
- struct ahc_linux_target *target;
+ int lun;
+ struct ahc_linux_target *target;
};
struct ahc_linux_target {
@@ -538,6 +549,7 @@
int target;
int refcount;
struct ahc_transinfo last_tinfo;
+ struct ahc_softc *ahc;
};
/********************* Definitions Required by the Core ***********************/
@@ -554,6 +566,7 @@
*/
struct scb_platform_data {
struct ahc_linux_device *dev;
+ bus_addr_t buf_busaddr;
uint32_t xfer_len;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
uint32_t resid; /* Transfer residual */
@@ -575,13 +588,17 @@
TAILQ_HEAD(, ahc_linux_device) device_runq;
struct ahc_completeq completeq;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
spinlock_t spin_lock;
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ struct tasklet_struct runq_tasklet;
+#endif
u_int qfrozen;
struct timer_list reset_timer;
struct semaphore eh_sem;
struct Scsi_Host *host; /* pointer to scsi host */
+#define AHC_LINUX_NOIRQ ((uint32_t)~0)
uint32_t irq; /* IRQ for this adapter */
uint32_t bios_address;
uint32_t mem_busaddr; /* Mem Base Addr */
@@ -712,6 +729,12 @@
static __inline void ahc_done_lock(struct ahc_softc *, unsigned long *flags);
static __inline void ahc_done_unlock(struct ahc_softc *, unsigned long *flags);
+/* Lock held during ahc_list manipulation and ahc softc frees */
+extern spinlock_t ahc_list_spinlock;
+static __inline void ahc_list_lockinit(void);
+static __inline void ahc_list_lock(unsigned long *flags);
+static __inline void ahc_list_unlock(unsigned long *flags);
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,93)
static __inline void
ahc_lockinit(struct ahc_softc *ahc)
@@ -751,6 +774,25 @@
spin_unlock_irqrestore(&io_request_lock, *flags);
}
+static __inline void
+ahc_list_lockinit()
+{
+ spin_lock_init(&ahc_list_spinlock);
+}
+
+static __inline void
+ahc_list_lock(unsigned long *flags)
+{
+ *flags = 0;
+ spin_lock_irqsave(&ahc_list_spinlock, *flags);
+}
+
+static __inline void
+ahc_list_unlock(unsigned long *flags)
+{
+ spin_unlock_irqrestore(&ahc_list_spinlock, *flags);
+}
+
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) */
ahc_lockinit(struct ahc_softc *ahc)
@@ -771,6 +813,7 @@
restore_flags(*flags);
}
+static __inline void
ahc_done_lockinit(struct ahc_softc *ahc)
{
}
@@ -789,6 +832,25 @@
ahc_done_unlock(struct ahc_softc *ahc, unsigned long *flags)
{
}
+
+static __inline void
+ahc_list_lockinit()
+{
+}
+
+static __inline void
+ahc_list_lock(unsigned long *flags)
+{
+ *flags = 0;
+ save_flags(*flags);
+ cli();
+}
+
+static __inline void
+ahc_list_unlock(unsigned long *flags)
+{
+ restore_flags(*flags);
+}
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) */
/******************************* PCI Definitions ******************************/
@@ -843,7 +905,8 @@
ahc_power_state new_state);
/**************************** VL/EISA Routines ********************************/
int aic7770_linux_probe(Scsi_Host_Template *);
-int aic7770_map_registers(struct ahc_softc *ahc);
+int aic7770_map_registers(struct ahc_softc *ahc,
+ u_int port);
int aic7770_map_int(struct ahc_softc *ahc, u_int irq);
/******************************* PCI Routines *********************************/
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)