#include <linux/module.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/raid_class.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_tcq.h>
#include "myrb.h"
static struct raid_template *myrb_raid_template;
static void myrb_monitor(struct work_struct *work);
static inline void myrb_translate_devstate(void *DeviceState);
static inline int myrb_logical_channel(struct Scsi_Host *shost)
{ … }
static struct myrb_devstate_name_entry { … } myrb_devstate_name_list[] = …;
static const char *myrb_devstate_name(enum myrb_devstate state)
{ … }
static struct myrb_raidlevel_name_entry { … } myrb_raidlevel_name_list[] = …;
static const char *myrb_raidlevel_name(enum myrb_raidlevel level)
{ … }
static bool myrb_create_mempools(struct pci_dev *pdev, struct myrb_hba *cb)
{ … }
static void myrb_destroy_mempools(struct myrb_hba *cb)
{ … }
static inline void myrb_reset_cmd(struct myrb_cmdblk *cmd_blk)
{ … }
static void myrb_qcmd(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk)
{ … }
static unsigned short myrb_exec_cmd(struct myrb_hba *cb,
struct myrb_cmdblk *cmd_blk)
{ … }
static unsigned short myrb_exec_type3(struct myrb_hba *cb,
enum myrb_cmd_opcode op, dma_addr_t addr)
{ … }
static unsigned short myrb_exec_type3D(struct myrb_hba *cb,
enum myrb_cmd_opcode op, struct scsi_device *sdev,
struct myrb_pdev_state *pdev_info)
{ … }
static char *myrb_event_msg[] = …;
static void myrb_get_event(struct myrb_hba *cb, unsigned int event)
{ … }
static void myrb_get_errtable(struct myrb_hba *cb)
{ … }
static unsigned short myrb_get_ldev_info(struct myrb_hba *cb)
{ … }
static unsigned short myrb_get_rbld_progress(struct myrb_hba *cb,
struct myrb_rbld_progress *rbld)
{ … }
static void myrb_update_rbld_progress(struct myrb_hba *cb)
{ … }
static void myrb_get_cc_progress(struct myrb_hba *cb)
{ … }
static void myrb_bgi_control(struct myrb_hba *cb)
{ … }
static unsigned short myrb_hba_enquiry(struct myrb_hba *cb)
{ … }
static unsigned short myrb_set_pdev_state(struct myrb_hba *cb,
struct scsi_device *sdev, enum myrb_devstate state)
{ … }
static bool myrb_enable_mmio(struct myrb_hba *cb, mbox_mmio_init_t mmio_init_fn)
{ … }
static int myrb_get_hba_config(struct myrb_hba *cb)
{ … }
static void myrb_unmap(struct myrb_hba *cb)
{ … }
static void myrb_cleanup(struct myrb_hba *cb)
{ … }
static int myrb_host_reset(struct scsi_cmnd *scmd)
{ … }
static int myrb_pthru_queuecommand(struct Scsi_Host *shost,
struct scsi_cmnd *scmd)
{ … }
static void myrb_inquiry(struct myrb_hba *cb,
struct scsi_cmnd *scmd)
{ … }
static void
myrb_mode_sense(struct myrb_hba *cb, struct scsi_cmnd *scmd,
struct myrb_ldev_info *ldev_info)
{ … }
static void myrb_request_sense(struct myrb_hba *cb,
struct scsi_cmnd *scmd)
{ … }
static void myrb_read_capacity(struct myrb_hba *cb, struct scsi_cmnd *scmd,
struct myrb_ldev_info *ldev_info)
{ … }
static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
struct scsi_cmnd *scmd)
{ … }
static int myrb_queuecommand(struct Scsi_Host *shost,
struct scsi_cmnd *scmd)
{ … }
static int myrb_ldev_slave_alloc(struct scsi_device *sdev)
{ … }
static int myrb_pdev_slave_alloc(struct scsi_device *sdev)
{ … }
static int myrb_slave_alloc(struct scsi_device *sdev)
{ … }
static int myrb_slave_configure(struct scsi_device *sdev)
{ … }
static void myrb_slave_destroy(struct scsi_device *sdev)
{ … }
static int myrb_biosparam(struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int geom[])
{ … }
static ssize_t raid_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t raid_state_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(raid_state);
static ssize_t raid_level_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(raid_level);
static ssize_t rebuild_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t rebuild_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(rebuild);
static ssize_t consistency_check_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static ssize_t consistency_check_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(consistency_check);
static ssize_t ctlr_num_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(ctlr_num);
static ssize_t firmware_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(firmware);
static ssize_t model_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(model);
static ssize_t flush_cache_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(flush_cache);
static struct attribute *myrb_sdev_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static struct attribute *myrb_shost_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct scsi_host_template myrb_template = …;
static int myrb_is_raid(struct device *dev)
{ … }
static void myrb_get_resync(struct device *dev)
{ … }
static void myrb_get_state(struct device *dev)
{ … }
static struct raid_function_template myrb_raid_functions = …;
static void myrb_handle_scsi(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk,
struct scsi_cmnd *scmd)
{ … }
static void myrb_handle_cmdblk(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk)
{ … }
static void myrb_monitor(struct work_struct *work)
{ … }
static bool myrb_err_status(struct myrb_hba *cb, unsigned char error,
unsigned char parm0, unsigned char parm1)
{ … }
static inline void DAC960_LA_hw_mbox_new_cmd(void __iomem *base)
{ … }
static inline void DAC960_LA_ack_hw_mbox_status(void __iomem *base)
{ … }
static inline void DAC960_LA_reset_ctrl(void __iomem *base)
{ … }
static inline void DAC960_LA_mem_mbox_new_cmd(void __iomem *base)
{ … }
static inline bool DAC960_LA_hw_mbox_is_full(void __iomem *base)
{ … }
static inline bool DAC960_LA_init_in_progress(void __iomem *base)
{ … }
static inline void DAC960_LA_ack_hw_mbox_intr(void __iomem *base)
{ … }
static inline void DAC960_LA_ack_intr(void __iomem *base)
{ … }
static inline bool DAC960_LA_hw_mbox_status_available(void __iomem *base)
{ … }
static inline void DAC960_LA_enable_intr(void __iomem *base)
{ … }
static inline void DAC960_LA_disable_intr(void __iomem *base)
{ … }
static inline void DAC960_LA_write_cmd_mbox(union myrb_cmd_mbox *mem_mbox,
union myrb_cmd_mbox *mbox)
{ … }
static inline void DAC960_LA_write_hw_mbox(void __iomem *base,
union myrb_cmd_mbox *mbox)
{ … }
static inline unsigned short DAC960_LA_read_status(void __iomem *base)
{ … }
static inline bool
DAC960_LA_read_error_status(void __iomem *base, unsigned char *error,
unsigned char *param0, unsigned char *param1)
{ … }
static inline unsigned short
DAC960_LA_mbox_init(struct pci_dev *pdev, void __iomem *base,
union myrb_cmd_mbox *mbox)
{ … }
static int DAC960_LA_hw_init(struct pci_dev *pdev,
struct myrb_hba *cb, void __iomem *base)
{ … }
static irqreturn_t DAC960_LA_intr_handler(int irq, void *arg)
{ … }
static struct myrb_privdata DAC960_LA_privdata = …;
static inline void DAC960_PG_hw_mbox_new_cmd(void __iomem *base)
{ … }
static inline void DAC960_PG_ack_hw_mbox_status(void __iomem *base)
{ … }
static inline void DAC960_PG_reset_ctrl(void __iomem *base)
{ … }
static inline void DAC960_PG_mem_mbox_new_cmd(void __iomem *base)
{ … }
static inline bool DAC960_PG_hw_mbox_is_full(void __iomem *base)
{ … }
static inline bool DAC960_PG_init_in_progress(void __iomem *base)
{ … }
static inline void DAC960_PG_ack_hw_mbox_intr(void __iomem *base)
{ … }
static inline void DAC960_PG_ack_intr(void __iomem *base)
{ … }
static inline bool DAC960_PG_hw_mbox_status_available(void __iomem *base)
{ … }
static inline void DAC960_PG_enable_intr(void __iomem *base)
{ … }
static inline void DAC960_PG_disable_intr(void __iomem *base)
{ … }
static inline void DAC960_PG_write_cmd_mbox(union myrb_cmd_mbox *mem_mbox,
union myrb_cmd_mbox *mbox)
{ … }
static inline void DAC960_PG_write_hw_mbox(void __iomem *base,
union myrb_cmd_mbox *mbox)
{ … }
static inline unsigned short
DAC960_PG_read_status(void __iomem *base)
{ … }
static inline bool
DAC960_PG_read_error_status(void __iomem *base, unsigned char *error,
unsigned char *param0, unsigned char *param1)
{ … }
static inline unsigned short
DAC960_PG_mbox_init(struct pci_dev *pdev, void __iomem *base,
union myrb_cmd_mbox *mbox)
{ … }
static int DAC960_PG_hw_init(struct pci_dev *pdev,
struct myrb_hba *cb, void __iomem *base)
{ … }
static irqreturn_t DAC960_PG_intr_handler(int irq, void *arg)
{ … }
static struct myrb_privdata DAC960_PG_privdata = …;
static inline void DAC960_PD_hw_mbox_new_cmd(void __iomem *base)
{ … }
static inline void DAC960_PD_ack_hw_mbox_status(void __iomem *base)
{ … }
static inline void DAC960_PD_reset_ctrl(void __iomem *base)
{ … }
static inline bool DAC960_PD_hw_mbox_is_full(void __iomem *base)
{ … }
static inline bool DAC960_PD_init_in_progress(void __iomem *base)
{ … }
static inline void DAC960_PD_ack_intr(void __iomem *base)
{ … }
static inline bool DAC960_PD_hw_mbox_status_available(void __iomem *base)
{ … }
static inline void DAC960_PD_enable_intr(void __iomem *base)
{ … }
static inline void DAC960_PD_disable_intr(void __iomem *base)
{ … }
static inline void DAC960_PD_write_cmd_mbox(void __iomem *base,
union myrb_cmd_mbox *mbox)
{ … }
static inline unsigned char
DAC960_PD_read_status_cmd_ident(void __iomem *base)
{ … }
static inline unsigned short
DAC960_PD_read_status(void __iomem *base)
{ … }
static inline bool
DAC960_PD_read_error_status(void __iomem *base, unsigned char *error,
unsigned char *param0, unsigned char *param1)
{ … }
static void DAC960_PD_qcmd(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk)
{ … }
static int DAC960_PD_hw_init(struct pci_dev *pdev,
struct myrb_hba *cb, void __iomem *base)
{ … }
static irqreturn_t DAC960_PD_intr_handler(int irq, void *arg)
{ … }
static struct myrb_privdata DAC960_PD_privdata = …;
static inline void myrb_translate_enquiry(void *enq)
{ … }
static inline void myrb_translate_devstate(void *state)
{ … }
static inline void myrb_translate_to_rw_command(struct myrb_cmdblk *cmd_blk)
{ … }
static inline void myrb_translate_from_rw_command(struct myrb_cmdblk *cmd_blk)
{ … }
static void DAC960_P_qcmd(struct myrb_hba *cb, struct myrb_cmdblk *cmd_blk)
{ … }
static int DAC960_P_hw_init(struct pci_dev *pdev,
struct myrb_hba *cb, void __iomem *base)
{ … }
static irqreturn_t DAC960_P_intr_handler(int irq, void *arg)
{ … }
static struct myrb_privdata DAC960_P_privdata = …;
static struct myrb_hba *myrb_detect(struct pci_dev *pdev,
const struct pci_device_id *entry)
{ … }
static int myrb_probe(struct pci_dev *dev, const struct pci_device_id *entry)
{ … }
static void myrb_remove(struct pci_dev *pdev)
{ … }
static const struct pci_device_id myrb_id_table[] = …;
MODULE_DEVICE_TABLE(pci, myrb_id_table);
static struct pci_driver myrb_pci_driver = …;
static int __init myrb_init_module(void)
{ … }
static void __exit myrb_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(myrb_cleanup_module);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;