#define PSEUDO_DMA #define UNSAFE /* Not unsafe for PAS16 -- use it */ #define PDEBUG 0 /* * This driver adapted from Drew Eckhardt's Trantor T128 driver * * Copyright 1993, Drew Eckhardt * Visionary Computing * (Unix and Linux consulting and custom programming) * drew@colorado.edu * +1 (303) 666-5836 * * ( Based on T128 - DISTRIBUTION RELEASE 3. ) * * Modified to work with the Pro Audio Spectrum/Studio 16 * by John Weidman. * * * For more information, please consult * * Media Vision * (510) 770-8600 * (800) 348-7116 */ /* * The card is detected and initialized in one of several ways : * 1. Autoprobe (default) - There are many different models of * the Pro Audio Spectrum/Studio 16, and I only have one of * them, so this may require a little tweaking. An interrupt * is triggered to autoprobe for the interrupt line. Note: * with the newer model boards, the interrupt is set via * software after reset using the default_irq for the * current board number. * * 2. With command line overrides - pas16=port,irq may be * used on the LILO command line to override the defaults. * * 3. With the PAS16_OVERRIDE compile time define. This is * specified as an array of address, irq tuples. Ie, for * one board at the default 0x388 address, IRQ10, I could say * -DPAS16_OVERRIDE={{0x388, 10}} * NOTE: Untested. * * 4. When included as a module, with arguments passed on the command line: * pas16_irq=xx the interrupt * pas16_addr=xx the port * e.g. "modprobe pas16 pas16_addr=0x388 pas16_irq=5" * * Note that if the override methods are used, place holders must * be specified for other boards in the system. * * * Configuration notes : * The current driver does not support interrupt sharing with the * sound portion of the card. If you use the same irq for the * scsi port and sound you will have problems. Either use * a different irq for the scsi port or don't use interrupts * for the scsi port. * * If you have problems with your card not being recognized, use * the LILO command line override. Try to get it recognized without * interrupts. Ie, for a board at the default 0x388 base port, * boot: linux pas16=0x388,0 * * NO_IRQ (0) should be specified for no interrupt, * IRQ_AUTO (254) to autoprobe for an IRQ line if overridden * on the command line. */ #include #include #include #include #include #include #include #include #include #include #include #include "pas16.h" #define AUTOPROBE_IRQ #include "NCR5380.h" static unsigned short pas16_addr = 0; static int pas16_irq = 0; static const int scsi_irq_translate[] = { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 }; /* The default_irqs array contains values used to set the irq into the * board via software (as must be done on newer model boards without * irq jumpers on the board). The first value in the array will be * assigned to logical board 0, the next to board 1, etc. */ static int default_irqs[] __initdata = { PAS16_DEFAULT_BOARD_1_IRQ, PAS16_DEFAULT_BOARD_2_IRQ, PAS16_DEFAULT_BOARD_3_IRQ, PAS16_DEFAULT_BOARD_4_IRQ }; static struct override { unsigned short io_port; int irq; } overrides #ifdef PAS16_OVERRIDE [] __initdata = PAS16_OVERRIDE; #else [4] __
#
#
backports.ssl-match-hostname==3.5.0.1  # via websocket-client
requests==2.13.0          # via socketio-client
six==1.10.0               # via socketio-client, websocket-client
socketIO-client==0.7.2
websocket-client==0.40.0  # via socketio-client
{ register unsigned char *d = dst; register unsigned short reg = (unsigned short) (instance->io_port + P_DATA_REG_OFFSET); register int i = len; int ii = 0; struct NCR5380_hostdata *hostdata = shost_priv(instance); while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) ) ++ii; insb( reg, d, i ); if ( inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) { outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET); printk("scsi%d : watchdog timer fired in NCR5380_pread()\n", instance->host_no); return -1; } if (ii > hostdata->spin_max_r) hostdata->spin_max_r = ii; return 0; } /* * Function : int NCR5380_pwrite (struct Scsi_Host *instance, * unsigned char *src, int len) * * Purpose : Fast 5380 pseudo-dma write function, transfers len bytes from * src * * Inputs : src = source, len = length in bytes * * Returns : 0 on success, non zero on a failure such as a watchdog * timeout. */ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src, int len) { register unsigned char *s = src; register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET); register int i = len; int ii = 0; struct NCR5380_hostdata *hostdata = shost_priv(instance); while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) ) ++ii; outsb( reg, s, i ); if (inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) { outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET); printk("scsi%d : watchdog timer fired in NCR5380_pwrite()\n", instance->host_no); return -1; } if (ii > hostdata->spin_max_w) hostdata->spin_max_w = ii; return 0; } #include "NCR5380.c" static int pas16_release(struct Scsi_Host *shost) { if (shost->irq != NO_IRQ) free_irq(shost->irq, shost); NCR5380_exit(shost); if (shost->io_port && shost->n_io_port) release_region(shost->io_port, shost->n_io_port); scsi_unregister(shost); return 0; } static struct scsi_host_template driver_template = { .name = "Pro Audio Spectrum-16 SCSI", .detect = pas16_detect, .release = pas16_release, .proc_name = "pas16", .show_info = pas16_show_info, .write_info = pas16_write_info, .info = pas16_info, .queuecommand = pas16_queue_command, .eh_abort_handler = pas16_abort, .eh_bus_reset_handler = pas16_bus_reset, .bios_param = pas16_biosparam, .can_queue = CAN_QUEUE, .this_id = 7, .sg_tablesize = SG_ALL, .cmd_per_lun = CMD_PER_LUN, .use_clustering = DISABLE_CLUSTERING, }; #include "scsi_module.c" #ifdef MODULE module_param(pas16_addr, ushort, 0); module_param(pas16_irq, int, 0); #endif MODULE_LICENSE("GPL");