#define __MEGARAID_H__
#include <linux/spinlock.h>
-
+#include <linux/mutex.h>
#define MEGARAID_VERSION \
- "v2.00.3 (Release Date: Wed Feb 19 08:51:30 EST 2003)\n"
+ "v2.00.4 (Release Date: Thu Feb 9 08:51:30 EST 2006)\n"
/*
* Driver features - change the values to enable or disable features in the
u8 mbox[18]; /* 16 bytes + 2 status bytes */
mega_passthru pthru;
#if BITS_PER_LONG == 32
- char *data; /* buffer <= 4096 for 0x80 commands */
+ char __user *data; /* buffer <= 4096 for 0x80 commands */
char pad[4];
#endif
#if BITS_PER_LONG == 64
- char *data;
+ char __user *data;
#endif
} __attribute__ ((packed));
u32 adapno; /* adapter number */
union {
u8 __raw_mbox[18];
- caddr_t __uaddr; /* xferaddr for non-mbox cmds */
+ void __user *__uaddr; /* xferaddr for non-mbox cmds */
}__ua;
#define uioc_rmbox __ua.__raw_mbox
#define MBOX(uioc) ((megacmd_t *)&((uioc).__ua.__raw_mbox[0]))
-#define MBOX_P(uioc) ((megacmd_t *)&((uioc)->__ua.__raw_mbox[0]))
+#define MBOX_P(uioc) ((megacmd_t __user *)&((uioc)->__ua.__raw_mbox[0]))
#define uioc_uaddr __ua.__uaddr
u32 xferlen; /* xferlen for DCMD and non-mbox
clustering is available */
u32 flag;
- unsigned long base;
+ unsigned long base;
+ void __iomem *mmio_base;
/* mbox64 with mbox not aligned on 16-byte boundry */
mbox64_t *una_mbox64;
scb_t int_scb;
Scsi_Cmnd int_scmd;
- struct semaphore int_mtx; /* To synchronize the internal
+ struct mutex int_mtx; /* To synchronize the internal
commands */
- wait_queue_head_t int_waitq; /* wait queue for internal
+ struct completion int_waitq; /* wait queue for internal
cmds */
int has_cluster; /* cluster support on this HBA */
#define MEGA_BULK_DATA 0x0001
#define MEGA_SGLIST 0x0002
-/*
- * lockscope definitions, callers can specify the lock scope with this data
- * type. LOCK_INT would mean the caller has not acquired the lock before
- * making the call and LOCK_EXT would mean otherwise.
- */
-typedef enum { LOCK_INT, LOCK_EXT } lockscope_t;
-
/*
* Parameters for the io-mapped controllers
*/
const char *megaraid_info (struct Scsi_Host *);
static int mega_query_adapter(adapter_t *);
-static inline int issue_scb(adapter_t *, scb_t *);
+static int issue_scb(adapter_t *, scb_t *);
static int mega_setup_mailbox(adapter_t *);
static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *);
-static inline scb_t *mega_allocate_scb(adapter_t *, Scsi_Cmnd *);
static void __mega_runpendq(adapter_t *);
-static inline void mega_runpendq(adapter_t *);
static int issue_scb_block(adapter_t *, u_char *);
-static irqreturn_t megaraid_isr_memmapped(int, void *, struct pt_regs *);
-static irqreturn_t megaraid_isr_iomapped(int, void *, struct pt_regs *);
+static irqreturn_t megaraid_isr_memmapped(int, void *);
+static irqreturn_t megaraid_isr_iomapped(int, void *);
static void mega_free_scb(adapter_t *, scb_t *);
static int mega_build_sglist (adapter_t *adapter, scb_t *scb,
u32 *buffer, u32 *length);
-static inline int mega_busywait_mbox (adapter_t *);
static int __mega_busywait_mbox (adapter_t *);
static void mega_rundoneq (adapter_t *);
-static inline void mega_cmd_done(adapter_t *, u8 [], int, int);
+static void mega_cmd_done(adapter_t *, u8 [], int, int);
static inline void mega_free_sgl (adapter_t *adapter);
static void mega_8_to_40ld (mraid_inquiry *inquiry,
mega_inquiry3 *enquiry3, mega_product_info *);
static int megadev_open (struct inode *, struct file *);
static int megadev_ioctl (struct inode *, struct file *, unsigned int,
unsigned long);
-static int mega_m_to_n(void *, nitioctl_t *);
-static int mega_n_to_m(void *, megacmd_t *);
+static int mega_m_to_n(void __user *, nitioctl_t *);
+static int mega_n_to_m(void __user *, megacmd_t *);
static int mega_init_scb (adapter_t *);
static int mega_adapinq(adapter_t *, dma_addr_t);
static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t);
-static inline caddr_t mega_allocate_inquiry(dma_addr_t *, struct pci_dev *);
-static inline void mega_free_inquiry(caddr_t, dma_addr_t, struct pci_dev *);
-static inline int make_local_pdev(adapter_t *, struct pci_dev **);
-static inline void free_local_pdev(struct pci_dev *);
static int mega_support_ext_cdb(adapter_t *);
static mega_passthru* mega_prepare_passthru(adapter_t *, scb_t *,
scb_t *, Scsi_Cmnd *, int, int);
static void mega_enum_raid_scsi(adapter_t *);
static void mega_get_boot_drv(adapter_t *);
-static inline int mega_get_ldrv_num(adapter_t *, Scsi_Cmnd *, int);
static int mega_support_random_del(adapter_t *);
static int mega_del_logdrv(adapter_t *, int);
static int mega_do_del_logdrv(adapter_t *, int);
static void mega_get_max_sgl(adapter_t *);
-static int mega_internal_command(adapter_t *, lockscope_t, megacmd_t *,
- mega_passthru *);
+static int mega_internal_command(adapter_t *, megacmd_t *, mega_passthru *);
static void mega_internal_done(Scsi_Cmnd *);
static int mega_support_cluster(adapter_t *);
#endif