#ifndef __MEGARAID_H__
#define __MEGARAID_H__
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <scsi/scsi_cmnd.h>
#define MEGARAID_VERSION …
#define MEGA_HAVE_COALESCING …
#define MEGA_HAVE_CLUSTERING …
#define MEGA_HAVE_STATS …
#define MEGA_HAVE_ENH_PROC …
#define MAX_DEV_TYPE …
#define PCI_DEVICE_ID_DISCOVERY …
#define PCI_DEVICE_ID_PERC4_DI …
#define PCI_DEVICE_ID_PERC4_QC_VERDE …
#define HBA_SIGNATURE …
#define HBA_SIGNATURE_471 …
#define HBA_SIGNATURE_64BIT …
#define MBOX_BUSY_WAIT …
#define DEFAULT_INITIATOR_ID …
#define MAX_SGLIST …
#define MIN_SGLIST …
#define MAX_COMMANDS …
#define CMDID_INT_CMDS …
#define MAX_CDB_LEN …
#define MAX_EXT_CDB_LEN …
#define DEF_CMD_PER_LUN …
#define MAX_CMD_PER_LUN …
#define MAX_FIRMWARE_STATUS …
#define MAX_XFER_PER_CMD …
#define MAX_SECTORS_PER_IO …
#define MAX_LOGICAL_DRIVES_40LD …
#define FC_MAX_PHYSICAL_DEVICES …
#define MAX_LOGICAL_DRIVES_8LD …
#define MAX_CHANNELS …
#define MAX_TARGET …
#define MAX_PHYSICAL_DRIVES …
#define MAX_ROW_SIZE_40LD …
#define MAX_ROW_SIZE_8LD …
#define MAX_SPAN_DEPTH …
#define NVIRT_CHAN …
struct mbox_out { … } __attribute__ ((packed));
struct mbox_in { … } __attribute__ ((packed));
mbox_t;
mbox64_t;
#define MAX_REQ_SENSE_LEN …
mega_passthru;
mega_ext_passthru;
mega_sgl64;
mega_sglist;
scb_t;
#define SCB_FREE …
#define SCB_ACTIVE …
#define SCB_PENDQ …
#define SCB_ISSUED …
#define SCB_ABORT …
#define SCB_RESET …
mega_product_info;
struct notify { … } __attribute__ ((packed));
#define MAX_NOTIFY_SIZE …
#define CUR_NOTIFY_SIZE …
mega_inquiry3;
mega_adp_info;
mega_ldrv_info;
mega_pdrv_info;
mraid_inquiry;
mraid_ext_inquiry;
adp_device;
adp_span_40ld;
adp_span_8ld;
logdrv_param;
logdrv_40ld;
logdrv_8ld;
phys_drv;
disk_array_40ld;
disk_array_8ld;
#define IOCTL_MAX_DATALEN …
struct uioctl_t { … } __attribute__ ((packed));
#define MAX_CONTROLLERS …
struct mcontroller { … };
megacmd_t;
#define MEGAIOC_MAGIC …
#define MEGAIOC_QNADAP …
#define MEGAIOC_QDRVRVER …
#define MEGAIOC_QADAPINFO …
#define MKADAP(adapno) …
#define GETADAP(mkadap) …
#define VENDOR_SPECIFIC_COMMANDS …
#define MEGA_INTERNAL_CMD …
#define USCSICMD …
#define UIOC_RD …
#define UIOC_WR …
#define MBOX_CMD …
#define GET_DRIVER_VER …
#define GET_N_ADAP …
#define GET_ADAP_INFO …
#define GET_CAP …
#define GET_STATS …
nitioctl_t;
megastat_t;
struct private_bios_data { … } __attribute__ ((packed));
#define MEGA_MBOXCMD_LREAD …
#define MEGA_MBOXCMD_LWRITE …
#define MEGA_MBOXCMD_PASSTHRU …
#define MEGA_MBOXCMD_ADPEXTINQ …
#define MEGA_MBOXCMD_ADAPTERINQ …
#define MEGA_MBOXCMD_LREAD64 …
#define MEGA_MBOXCMD_LWRITE64 …
#define MEGA_MBOXCMD_PASSTHRU64 …
#define MEGA_MBOXCMD_EXTPTHRU …
#define MAIN_MISC_OPCODE …
#define GET_MAX_SG_SUPPORT …
#define FC_NEW_CONFIG …
#define NC_SUBOP_PRODUCT_INFO …
#define NC_SUBOP_ENQUIRY3 …
#define ENQ3_GET_SOLICITED_FULL …
#define OP_DCMD_READ_CONFIG …
#define NEW_READ_CONFIG_8LD …
#define READ_CONFIG_8LD …
#define FLUSH_ADAPTER …
#define FLUSH_SYSTEM …
#define FC_DEL_LOGDRV …
#define OP_SUP_DEL_LOGDRV …
#define OP_GET_LDID_MAP …
#define OP_DEL_LOGDRV …
#define IS_BIOS_ENABLED …
#define GET_BIOS …
#define CHNL_CLASS …
#define GET_CHNL_CLASS …
#define SET_CHNL_CLASS …
#define CH_RAID …
#define CH_SCSI …
#define BIOS_PVT_DATA …
#define GET_BIOS_PVT_DATA …
#define MEGA_GET_TARGET_ID …
#define MEGA_CLUSTER_OP …
#define MEGA_GET_CLUSTER_MODE …
#define MEGA_CLUSTER_CMD …
#define MEGA_RESERVE_LD …
#define MEGA_RELEASE_LD …
#define MEGA_RESET_RESERVATIONS …
#define MEGA_RESERVATION_STATUS …
#define MEGA_RESERVE_PD …
#define MEGA_RELEASE_PD …
#define MEGA_BATT_MODULE_MISSING …
#define MEGA_BATT_LOW_VOLTAGE …
#define MEGA_BATT_TEMP_HIGH …
#define MEGA_BATT_PACK_MISSING …
#define MEGA_BATT_CHARGE_MASK …
#define MEGA_BATT_CHARGE_DONE …
#define MEGA_BATT_CHARGE_INPROG …
#define MEGA_BATT_CHARGE_FAIL …
#define MEGA_BATT_CYCLES_EXCEEDED …
#define PDRV_UNCNF …
#define PDRV_ONLINE …
#define PDRV_FAILED …
#define PDRV_RBLD …
#define PDRV_HOTSPARE …
#define RDRV_OFFLINE …
#define RDRV_DEGRADED …
#define RDRV_OPTIMAL …
#define RDRV_DELETED …
#define NO_READ_AHEAD …
#define READ_AHEAD …
#define ADAP_READ_AHEAD …
#define WRMODE_WRITE_THRU …
#define WRMODE_WRITE_BACK …
#define CACHED_IO …
#define DIRECT_IO …
struct megaraid_cmd_priv { … };
#define SCSI_LIST(scp) …
struct scsi_cmd_and_priv { … };
static inline struct scsi_cmnd *
megaraid_to_scsi_cmd(struct megaraid_cmd_priv *cmd_priv)
{ … }
adapter_t;
struct mega_hbas { … };
#define IN_ABORT …
#define IN_RESET …
#define BOARD_MEMMAP …
#define BOARD_IOMAP …
#define BOARD_40LD …
#define BOARD_64BIT …
#define INTR_VALID …
#define PCI_CONF_AMISIG …
#define PCI_CONF_AMISIG64 …
#define MEGA_DMA_TYPE_NONE …
#define MEGA_BULK_DATA …
#define MEGA_SGLIST …
#define CMD_PORT …
#define ACK_PORT …
#define TOGGLE_PORT …
#define INTR_PORT …
#define MBOX_BUSY_PORT …
#define MBOX_PORT0 …
#define MBOX_PORT1 …
#define MBOX_PORT2 …
#define MBOX_PORT3 …
#define ENABLE_MBOX_REGION …
#define ISSUE_BYTE …
#define ACK_BYTE …
#define ENABLE_INTR_BYTE …
#define DISABLE_INTR_BYTE …
#define VALID_INTR_BYTE …
#define MBOX_BUSY_BYTE …
#define ENABLE_MBOX_BYTE …
#define issue_command(adapter) …
#define irq_state(adapter) …
#define set_irq_state(adapter, value) …
#define irq_ack(adapter) …
#define irq_enable(adapter) …
#define irq_disable(adapter) …
const char *megaraid_info (struct Scsi_Host *);
static int mega_query_adapter(adapter_t *);
static int issue_scb(adapter_t *, scb_t *);
static int mega_setup_mailbox(adapter_t *);
static int megaraid_queue (struct Scsi_Host *, struct scsi_cmnd *);
static scb_t * mega_build_cmd(adapter_t *, struct scsi_cmnd *, int *);
static void __mega_runpendq(adapter_t *);
static int issue_scb_block(adapter_t *, u_char *);
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 megaraid_abort(struct scsi_cmnd *);
static int megaraid_reset(struct scsi_cmnd *);
static int megaraid_abort_and_reset(adapter_t *, struct scsi_cmnd *, int);
static int megaraid_biosparam(struct scsi_device *, struct block_device *,
sector_t, int []);
static int mega_build_sglist (adapter_t *adapter, scb_t *scb,
u32 *buffer, u32 *length);
static int __mega_busywait_mbox (adapter_t *);
static void mega_rundoneq (adapter_t *);
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 file *, unsigned int, unsigned long);
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_is_bios_enabled (adapter_t *);
#ifdef CONFIG_PROC_FS
static void mega_create_proc_entry(int, struct proc_dir_entry *);
static int mega_adapinq(adapter_t *, dma_addr_t);
static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t);
#endif
static int mega_support_ext_cdb(adapter_t *);
static mega_passthru* mega_prepare_passthru(adapter_t *, scb_t *,
struct scsi_cmnd *, int, int);
static mega_ext_passthru* mega_prepare_extpassthru(adapter_t *,
scb_t *, struct scsi_cmnd *, int, int);
static void mega_enum_raid_scsi(adapter_t *);
static void mega_get_boot_drv(adapter_t *);
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 *, megacmd_t *, mega_passthru *);
static int mega_support_cluster(adapter_t *);
#endif