/*----------------------------------------------------------------*/ /* Qlogic linux driver - work in progress. No Warranty express or implied. Use at your own risk. Support Tort Reform so you won't have to read all these silly disclaimers. Copyright 1994, Tom Zerucha. [email protected] Additional Code, and much appreciated help by Michael A. Griffith [email protected] Thanks to Eric Youngdale and Dave Hinds for loadable module and PCMCIA help respectively, and for suffering through my foolishness during the debugging process. Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994 (you can reference it, but it is incomplete and inaccurate in places) Version 0.46 1/30/97 - kernel 1.2.0+ Functions as standalone, loadable, and PCMCIA driver, the latter from Dave Hinds' PCMCIA package. Cleaned up 26/10/2002 by Alan Cox <[email protected]> as part of the 2.5 SCSI driver cleanup and audit. This driver still needs work on the following - Non terminating hardware waits - Some layering violations with its pcmcia stub Redistributable under terms of the GNU General Public License For the avoidance of doubt the "preferred form" of this code is one which is in an open non patent encumbered format. Where cryptographic key signing forms part of the process of creating an executable the information including keys needed to generate an equivalently functional executable are deemed to be part of the source code. */ #include <linux/module.h> #include <linux/blkdev.h> /* to get disk capacity */ #include <linux/kernel.h> #include <linux/string.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/proc_fs.h> #include <linux/unistd.h> #include <linux/spinlock.h> #include <linux/stat.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/dma.h> #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_host.h> #include <scsi/scsi_tcq.h> #include "qlogicfas408.h" /*----------------------------------------------------------------*/ static int qlcfg5 = …; /* 15625/512 */ static int qlcfg6 = …; static int qlcfg7 = …; static int qlcfg8 = …; static int qlcfg9 = …; static int qlcfgc = …; /*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/ /* local functions */ /*----------------------------------------------------------------*/ /* error recovery - reset everything */ static void ql_zap(struct qlogicfas408_priv *priv) { … } /* * Do a pseudo-dma tranfer */ static int ql_pdma(struct qlogicfas408_priv *priv, int phase, char *request, int reqlen) { … } /* * Wait for interrupt flag (polled - not real hardware interrupt) */ static int ql_wai(struct qlogicfas408_priv *priv) { … } /* * Initiate scsi command - queueing handler * caller must hold host lock */ static void ql_icmd(struct scsi_cmnd *cmd) { … } /* * Process scsi command - usually after interrupt */ static void ql_pcmd(struct scsi_cmnd *cmd) { … } /* * Interrupt handler */ static void ql_ihandl(void *dev_id) { … } irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id) { … } /* * Queued command */ static int qlogicfas408_queuecommand_lck(struct scsi_cmnd *cmd) { … } DEF_SCSI_QCMD(…) /* * Return bios parameters */ int qlogicfas408_biosparam(struct scsi_device *disk, struct block_device *dev, sector_t capacity, int ip[]) { … } /* * Abort a command in progress */ int qlogicfas408_abort(struct scsi_cmnd *cmd) { … } /* * Reset SCSI bus * FIXME: This function is invoked with cmd = NULL directly by * the PCMCIA qlogic_stub code. This wants fixing */ int qlogicfas408_host_reset(struct scsi_cmnd *cmd) { … } /* * Return info string */ const char *qlogicfas408_info(struct Scsi_Host *host) { … } /* * Get type of chip */ int qlogicfas408_get_chip_type(int qbase, int int_type) { … } /* * Perform initialization tasks */ void qlogicfas408_setup(int qbase, int id, int int_type) { … } /* * Checks if this is a QLogic FAS 408 */ int qlogicfas408_detect(int qbase, int int_type) { … } /* * Disable interrupts */ void qlogicfas408_disable_ints(struct qlogicfas408_priv *priv) { … } /* * Init and exit functions */ static int __init qlogicfas408_init(void) { … } static void __exit qlogicfas408_exit(void) { … } MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; module_init(qlogicfas408_init); module_exit(qlogicfas408_exit); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…); EXPORT_SYMBOL(…);