aboutsummaryrefslogtreecommitdiffstats
path: root/firmware
ModeNameSize
-rw-r--r--.gitignore39logstatsplainblame
d---------3com86logstatsplain
-rw-r--r--Makefile10354logstatsplainblame
-rw-r--r--README.AddingFirmware1460logstatsplainblame
-rw-r--r--WHENCE19719logstatsplainblame
d---------acenic80logstatsplain
d---------adaptec96logstatsplain
d---------advansys171logstatsplain
-rw-r--r--atmsar11.HEX19191logstatsplainblame
d---------av711079logstatsplain
d---------bnx2220logstatsplain
d---------cpia248logstatsplain
d---------cxgb3151logstatsplain
d---------dabusb86logstatsplain
d---------dsp56k87logstatsplain
d---------e100144logstatsplain
d---------edgeport188logstatsplain
d---------emi26119logstatsplain
d---------emi62152logstatsplain
d---------ess113logstatsplain
-rw-r--r--ihex2fw.c6351logstatsplainblame
-rw-r--r--intelliport2.bin.ihex94415logstatsplainblame
d---------kaweth196logstatsplain
d---------keyspan457logstatsplain
d---------keyspan_pda166logstatsplain
d---------korg42logstatsplain
-rw-r--r--mts_cdma.fw.ihex38098logstatsplainblame
-rw-r--r--mts_edge.fw.ihex38706logstatsplainblame
-rw-r--r--mts_gsm.fw.ihex38098logstatsplainblame
d---------myricom42logstatsplain
d---------ositech46logstatsplain
d---------qlogic168logstatsplain
d---------sb16253logstatsplain
d---------sun44logstatsplain
d---------tehuti40logstatsplain
-rw-r--r--ti_3410.fw.ihex37874logstatsplainblame
-rw-r--r--ti_5052.fw.ihex37872logstatsplainblame
d---------tigon129logstatsplain
-rw-r--r--tr_smctr.bin.ihex20952logstatsplainblame
d---------ttusb-budget48logstatsplain
d---------vicam40logstatsplain
-rw-r--r--whiteheat.HEX44908logstatsplainblame
-rw-r--r--whiteheat_loader.HEX12120logstatsplainblame
-rw-r--r--whiteheat_loader_debug.HEX17578logstatsplainblame
d---------yam82logstatsplain
d---------yamaha185logstatsplain
an class="hl opt">->n; } return count; } int msnd_fifo_read_io(msnd_fifo *f, char __iomem *buf, size_t len) { int count = 0; while ((count < len) && (f->len > 0)) { int nread; if (f->tail <= f->head) { nread = len - count; if (nread > f->n - f->head) nread = f->n - f->head; } else { nread = f->tail - f->head; if (nread > len - count) nread = len - count; } memcpy_toio(buf, f->data + f->head, nread); count += nread; buf += nread; f->len -= nread; f->head += nread; f->head %= f->n; } return count; } int msnd_fifo_read(msnd_fifo *f, char *buf, size_t len) { int count = 0; while ((count < len) && (f->len > 0)) { int nread; if (f->tail <= f->head) { nread = len - count; if (nread > f->n - f->head) nread = f->n - f->head; } else { nread = f->tail - f->head; if (nread > len - count) nread = len - count; } memcpy(buf, f->data + f->head, nread); count += nread; buf += nread; f->len -= nread; f->head += nread; f->head %= f->n; } return count; } static int msnd_wait_TXDE(multisound_dev_t *dev) { register unsigned int io = dev->io; register int timeout = 1000; while(timeout-- > 0) if (msnd_inb(io + HP_ISR) & HPISR_TXDE) return 0; return -EIO; } static int msnd_wait_HC0(multisound_dev_t *dev) { register unsigned int io = dev->io; register int timeout = 1000; while(timeout-- > 0) if (!(msnd_inb(io + HP_CVR) & HPCVR_HC)) return 0; return -EIO; } int msnd_send_dsp_cmd(multisound_dev_t *dev, BYTE cmd) { unsigned long flags; spin_lock_irqsave(&dev->lock, flags); if (msnd_wait_HC0(dev) == 0) { msnd_outb(cmd, dev->io + HP_CVR); spin_unlock_irqrestore(&dev->lock, flags); return 0; } spin_unlock_irqrestore(&dev->lock, flags); printk(KERN_DEBUG LOGNAME ": Send DSP command timeout\n"); return -EIO; } int msnd_send_word(multisound_dev_t *dev, unsigned char high, unsigned char mid, unsigned char low) { register unsigned int io = dev->io; if (msnd_wait_TXDE(dev) == 0) { msnd_outb(high, io + HP_TXH); msnd_outb(mid, io + HP_TXM); msnd_outb(low, io + HP_TXL); return 0; } printk(KERN_DEBUG LOGNAME ": Send host word timeout\n"); return -EIO; } int msnd_upload_host(multisound_dev_t *dev, char *bin, int len) { int i; if (len % 3 != 0) { printk(KERN_WARNING LOGNAME ": Upload host data not multiple of 3!\n"); return -EINVAL; } for (i = 0; i < len; i += 3) if (msnd_send_word(dev, bin[i], bin[i + 1], bin[i + 2]) != 0) return -EIO; msnd_inb(dev->io + HP_RXL); msnd_inb(dev->io + HP_CVR); return 0; } int msnd_enable_irq(multisound_dev_t *dev) { unsigned long flags; if (dev->irq_ref++) return 0; printk(KERN_DEBUG LOGNAME ": Enabling IRQ\n"); spin_lock_irqsave(&dev->lock, flags); if (msnd_wait_TXDE(dev) == 0) { msnd_outb(msnd_inb(dev->io + HP_ICR) | HPICR_TREQ, dev->io + HP_ICR); if (dev->type == msndClassic) msnd_outb(dev->irqid, dev->io + HP_IRQM); msnd_outb(msnd_inb(dev->io + HP_ICR) & ~HPICR_TREQ, dev->io + HP_ICR); msnd_outb(msnd_inb(dev->io + HP_ICR) | HPICR_RREQ, dev->io + HP_ICR); enable_irq(dev->irq); msnd_init_queue(dev->DSPQ, dev->dspq_data_buff, dev->dspq_buff_size); spin_unlock_irqrestore(&dev->lock, flags); return 0; } spin_unlock_irqrestore(&dev->lock, flags); printk(KERN_DEBUG LOGNAME ": Enable IRQ failed\n"); return -EIO; } int msnd_disable_irq(multisound_dev_t *dev) { unsigned long flags; if (--dev->irq_ref > 0) return 0; if (dev->irq_ref < 0) printk(KERN_DEBUG LOGNAME ": IRQ ref count is %d\n", dev->irq_ref); printk(KERN_DEBUG LOGNAME ": Disabling IRQ\n"); spin_lock_irqsave(&dev->lock, flags); if (msnd_wait_TXDE(dev) == 0) { msnd_outb(msnd_inb(dev->io + HP_ICR) & ~HPICR_RREQ, dev->io + HP_ICR); if (dev->type == msndClassic) msnd_outb(HPIRQ_NONE, dev->io + HP_IRQM); disable_irq(dev->irq); spin_unlock_irqrestore(&dev->lock, flags); return 0; } spin_unlock_irqrestore(&dev->lock, flags); printk(KERN_DEBUG LOGNAME ": Disable IRQ failed\n"); return -EIO; } #ifndef LINUX20 EXPORT_SYMBOL(msnd_register); EXPORT_SYMBOL(msnd_unregister); EXPORT_SYMBOL(msnd_init_queue); EXPORT_SYMBOL(msnd_fifo_init); EXPORT_SYMBOL(msnd_fifo_free); EXPORT_SYMBOL(msnd_fifo_alloc); EXPORT_SYMBOL(msnd_fifo_make_empty); EXPORT_SYMBOL(msnd_fifo_write_io); EXPORT_SYMBOL(msnd_fifo_read_io); EXPORT_SYMBOL(msnd_fifo_write); EXPORT_SYMBOL(msnd_fifo_read); EXPORT_SYMBOL(msnd_send_dsp_cmd); EXPORT_SYMBOL(msnd_send_word); EXPORT_SYMBOL(msnd_upload_host); EXPORT_SYMBOL(msnd_enable_irq); EXPORT_SYMBOL(msnd_disable_irq); #endif #ifdef MODULE MODULE_AUTHOR ("Andrew Veliath <andrewtv@usa.net>"); MODULE_DESCRIPTION ("Turtle Beach MultiSound Driver Base"); MODULE_LICENSE("GPL"); int init_module(void) { return 0; } void cleanup_module(void) { } #endif