#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/spinlock.h>
#include <scsi/scsi.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_transport.h>
#include "sym_glue.h"
#include "sym_nvram.h"
#define NAME53C …
#define NAME53C8XX …
struct sym_driver_setup sym_driver_setup = …;
unsigned int sym_debug_flags = …;
static char *excl_string;
static char *safe_string;
module_param_named(cmd_per_lun, sym_driver_setup.max_tag, ushort, 0);
module_param_named(burst, sym_driver_setup.burst_order, byte, 0);
module_param_named(led, sym_driver_setup.scsi_led, byte, 0);
module_param_named(diff, sym_driver_setup.scsi_diff, byte, 0);
module_param_named(irqm, sym_driver_setup.irq_mode, byte, 0);
module_param_named(buschk, sym_driver_setup.scsi_bus_check, byte, 0);
module_param_named(hostid, sym_driver_setup.host_id, byte, 0);
module_param_named(verb, sym_driver_setup.verbose, byte, 0);
module_param_named(debug, sym_debug_flags, uint, 0);
module_param_named(settle, sym_driver_setup.settle_delay, byte, 0);
module_param_named(nvram, sym_driver_setup.use_nvram, byte, 0);
module_param_named(excl, excl_string, charp, 0);
module_param_named(safe, safe_string, charp, 0);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
static void sym2_setup_params(void)
{ … }
static struct scsi_transport_template *sym2_transport_template = …;
struct sym_ucmd { … };
#define SYM_UCMD_PTR(cmd) …
#define SYM_SOFTC_PTR(cmd) …
void sym_xpt_done(struct sym_hcb *np, struct scsi_cmnd *cmd)
{ … }
void sym_xpt_async_bus_reset(struct sym_hcb *np)
{ … }
static int sym_xerr_cam_status(int cam_status, int x_status)
{ … }
void sym_set_cam_result_error(struct sym_hcb *np, struct sym_ccb *cp, int resid)
{ … }
static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd *cmd)
{ … }
static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd)
{ … }
static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
{ … }
int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
{ … }
static void sym_timer(struct sym_hcb *np)
{ … }
void sym_log_bus_error(struct Scsi_Host *shost)
{ … }
static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd)
{ … }
static DEF_SCSI_QCMD(sym53c8xx_queue_command)
static irqreturn_t sym53c8xx_intr(int irq, void *dev_id)
{ … }
static void sym53c8xx_timer(struct timer_list *t)
{ … }
#define SYM_EH_ABORT …
#define SYM_EH_DEVICE_RESET …
static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd)
{ … }
static int sym53c8xx_eh_target_reset_handler(struct scsi_cmnd *cmd)
{ … }
static int sym53c8xx_eh_bus_reset_handler(struct scsi_cmnd *cmd)
{ … }
static int sym53c8xx_eh_host_reset_handler(struct scsi_cmnd *cmd)
{ … }
static void sym_tune_dev_queuing(struct sym_tcb *tp, int lun, u_short reqtags)
{ … }
static int sym53c8xx_slave_alloc(struct scsi_device *sdev)
{ … }
static int sym53c8xx_slave_configure(struct scsi_device *sdev)
{ … }
static void sym53c8xx_slave_destroy(struct scsi_device *sdev)
{ … }
static const char *sym53c8xx_info (struct Scsi_Host *host)
{ … }
#ifdef SYM_LINUX_PROC_INFO_SUPPORT
#ifdef SYM_LINUX_USER_COMMAND_SUPPORT
struct sym_usrcmd { … };
#define UC_SETSYNC …
#define UC_SETTAGS …
#define UC_SETDEBUG …
#define UC_SETWIDE …
#define UC_SETFLAG …
#define UC_SETVERBOSE …
#define UC_RESETDEV …
#define UC_CLEARDEV …
static void sym_exec_user_command (struct sym_hcb *np, struct sym_usrcmd *uc)
{ … }
static int sym_skip_spaces(char *ptr, int len)
{ … }
static int get_int_arg(char *ptr, int len, u_long *pv)
{ … }
static int is_keyword(char *ptr, int len, char *verb)
{ … }
#define SKIP_SPACES(ptr, len) …
#define GET_INT_ARG(ptr, len, v) …
static int sym_user_command(struct Scsi_Host *shost, char *buffer, int length)
{ … }
#endif
static int sym_show_info(struct seq_file *m, struct Scsi_Host *shost)
{ … }
#endif
static void sym_iounmap_device(struct sym_device *device)
{ … }
static void sym_free_resources(struct sym_hcb *np, struct pci_dev *pdev,
int do_free_irq)
{ … }
static struct Scsi_Host *sym_attach(const struct scsi_host_template *tpnt, int unit,
struct sym_device *dev)
{ … }
#if SYM_CONF_NVRAM_SUPPORT
static void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)
{ … }
#else
static inline void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)
{
}
#endif
static int sym_check_supported(struct sym_device *device)
{ … }
static int sym_check_raid(struct sym_device *device)
{ … }
static int sym_set_workarounds(struct sym_device *device)
{ … }
static int sym_iomap_device(struct sym_device *device)
{ … }
static void sym_config_pqs(struct pci_dev *pdev, struct sym_device *sym_dev)
{ … }
static int sym_detach(struct Scsi_Host *shost, struct pci_dev *pdev)
{ … }
static const struct scsi_host_template sym2_template = …;
static int attach_count;
static int sym2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void sym2_remove(struct pci_dev *pdev)
{ … }
static pci_ers_result_t sym2_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
{ … }
static pci_ers_result_t sym2_io_slot_dump(struct pci_dev *pdev)
{ … }
static void sym2_reset_workarounds(struct pci_dev *pdev)
{ … }
static pci_ers_result_t sym2_io_slot_reset(struct pci_dev *pdev)
{ … }
static void sym2_io_resume(struct pci_dev *pdev)
{ … }
static void sym2_get_signalling(struct Scsi_Host *shost)
{ … }
static void sym2_set_offset(struct scsi_target *starget, int offset)
{ … }
static void sym2_set_period(struct scsi_target *starget, int period)
{ … }
static void sym2_set_width(struct scsi_target *starget, int width)
{ … }
static void sym2_set_dt(struct scsi_target *starget, int dt)
{ … }
#if 0
static void sym2_set_iu(struct scsi_target *starget, int iu)
{
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
struct sym_hcb *np = sym_get_hcb(shost);
struct sym_tcb *tp = &np->target[starget->id];
if (iu)
tp->tgoal.iu = tp->tgoal.dt = 1;
else
tp->tgoal.iu = 0;
tp->tgoal.check_nego = 1;
}
static void sym2_set_qas(struct scsi_target *starget, int qas)
{
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
struct sym_hcb *np = sym_get_hcb(shost);
struct sym_tcb *tp = &np->target[starget->id];
if (qas)
tp->tgoal.dt = tp->tgoal.qas = 1;
else
tp->tgoal.qas = 0;
tp->tgoal.check_nego = 1;
}
#endif
static struct spi_function_template sym2_transport_functions = …;
static struct pci_device_id sym2_id_table[] = …;
MODULE_DEVICE_TABLE(pci, sym2_id_table);
static const struct pci_error_handlers sym2_err_handler = …;
static struct pci_driver sym2_driver = …;
static int __init sym2_init(void)
{ … }
static void __exit sym2_exit(void)
{ … }
module_init(…) …;
module_exit(sym2_exit);