Lines Matching +full:no +full:- +full:memory +full:- +full:wc

1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (C) by Paul Barton-Davis 1998-1999
5 * copyright (C) by Hannu Savolainen 1993-1996
14 * of GUS patches during loading, and full user-level access to all
15 * WaveFront commands. It tries to provide semi-intelligent patch and
36 loading. if non-zero, then during driver loading, the
80 checks on-board RAM.
87 MODULE_PARM_DESC(wf_raw, "if non-zero, assume that we need to boot the OS");
89 MODULE_PARM_DESC(fx_raw, "if non-zero, assume that the FX process needs help");
107 /* if WF_DEBUG not defined, no run-time debugging messages will
118 if ((dev->debug & (cond)) == (cond)) { \
152 { 0x02, "Out of sample memory" },
156 { 0x0B, "No sample load request pending" },
175 { WFC_MISYNTH_OFF, "disable midi-in to synth", 0, 0, NEEDS_ACK },
176 { WFC_MISYNTH_ON, "enable midi-in to synth", 0, 0, NEEDS_ACK },
212 { WFC_REPORT_FREE_MEMORY, "report free memory", 4, 0, 0 },
225 { WFC_NOOP, "the no-op command", 0, 0, NEEDS_ACK },
263 return inb (dev->status_port); in wavefront_status()
311 return inb (dev->data_port); in wavefront_read()
315 return -1; in wavefront_read()
323 outb (data, dev->data_port); in wavefront_write()
329 return -1; in wavefront_write()
348 /* Hack to handle the one variable-size write command. See in snd_wavefront_cmd()
354 wfcmd->write_cnt = (unsigned long) rbuf; in snd_wavefront_cmd()
359 cmd, wfcmd->action, wfcmd->read_cnt, in snd_wavefront_cmd()
360 wfcmd->write_cnt, wfcmd->need_ack); in snd_wavefront_cmd()
365 cmd, wfcmd->action); in snd_wavefront_cmd()
369 if (wfcmd->write_cnt > 0) { in snd_wavefront_cmd()
372 wfcmd->write_cnt, cmd); in snd_wavefront_cmd()
374 for (i = 0; i < wfcmd->write_cnt; i++) { in snd_wavefront_cmd()
378 i, cmd, wfcmd->action); in snd_wavefront_cmd()
387 if (wfcmd->read_cnt > 0) { in snd_wavefront_cmd()
390 wfcmd->read_cnt, cmd); in snd_wavefront_cmd()
392 for (i = 0; i < wfcmd->read_cnt; i++) { in snd_wavefront_cmd()
394 if ((c = wavefront_read (dev)) == -1) { in snd_wavefront_cmd()
397 i, cmd, wfcmd->action); in snd_wavefront_cmd()
404 if ((c = wavefront_read (dev)) == -1) { in snd_wavefront_cmd()
410 wfcmd->action); in snd_wavefront_cmd()
417 wfcmd->cmd == WFC_IDENTIFY_SAMPLE_TYPE) { in snd_wavefront_cmd()
422 wfcmd->cmd == WFC_UPLOAD_PATCH) { in snd_wavefront_cmd()
427 wfcmd->cmd == WFC_UPLOAD_PROGRAM) { in snd_wavefront_cmd()
441 wfcmd->action); in snd_wavefront_cmd()
454 if ((wfcmd->read_cnt == 0 && wfcmd->write_cnt == 0) || wfcmd->need_ack) { in snd_wavefront_cmd()
467 if (ack == -1) { in snd_wavefront_cmd()
470 cmd, wfcmd->action); in snd_wavefront_cmd()
474 int err = -1; /* something unknown */ in snd_wavefront_cmd()
478 if ((err = wavefront_read (dev)) == -1) { in snd_wavefront_cmd()
482 cmd, wfcmd->action); in snd_wavefront_cmd()
488 cmd, wfcmd->action, ack, err, in snd_wavefront_cmd()
491 return -err; in snd_wavefront_cmd()
497 cmd, wfcmd->action); in snd_wavefront_cmd()
502 cmd, wfcmd->action, wfcmd->read_cnt, in snd_wavefront_cmd()
503 wfcmd->write_cnt, wfcmd->need_ack); in snd_wavefront_cmd()
518 the x86 side as 8-32 bit values. Sometimes, we need to munge data
521 different functions for munging and 2 for de-munging. This avoids
522 weird casting and worrying about bit-level offsets.
550 for (i = src_size - 1; i >= 0; i--) { in demunge_int32()
607 dev->sample_status[sample_num] = WF_ST_EMPTY; in wavefront_delete_sample()
625 return -1; in wavefront_get_sample_status()
628 sc_real = sc_alias = sc_multi = dev->samples_used = 0; in wavefront_get_sample_status()
638 dev->sample_status[i] = WF_ST_EMPTY; in wavefront_get_sample_status()
642 dev->sample_status[i] = (WF_SLOT_FILLED|rbuf[0]); in wavefront_get_sample_status()
645 dev->sample_status[i] |= WF_SLOT_ROM; in wavefront_get_sample_status()
668 dev->samples_used++; in wavefront_get_sample_status()
673 "%d empty\n", dev->samples_used, sc_real, sc_alias, sc_multi, in wavefront_get_sample_status()
674 WF_MAX_SAMPLE - dev->samples_used); in wavefront_get_sample_status()
697 dev->patch_status[i] |= WF_SLOT_FILLED; in wavefront_get_patch_status()
699 dev->sample_status in wavefront_get_patch_status()
700 [p->sample_number|(p->sample_msb<<7)] |= in wavefront_get_patch_status()
704 dev->patch_status[i] = 0; in wavefront_get_patch_status()
708 dev->patch_status[i] = 0; in wavefront_get_patch_status()
716 if (dev->patch_status[i] & WF_SLOT_FILLED) { in wavefront_get_patch_status()
719 if (dev->patch_status[i] & WF_SLOT_USED) { in wavefront_get_patch_status()
744 dev->prog_status[i] |= WF_SLOT_USED; in wavefront_get_program_status()
751 dev->patch_status in wavefront_get_program_status()
757 dev->prog_status[i] = 0; in wavefront_get_program_status()
761 dev->prog_status[i] = 0; in wavefront_get_program_status()
766 if (dev->prog_status[i]) { in wavefront_get_program_status()
784 header->number); in wavefront_send_patch()
786 if (header->number >= ARRAY_SIZE(dev->patch_status)) in wavefront_send_patch()
787 return -EINVAL; in wavefront_send_patch()
789 dev->patch_status[header->number] |= WF_SLOT_FILLED; in wavefront_send_patch()
791 bptr = munge_int32 (header->number, buf, 2); in wavefront_send_patch()
792 munge_buf ((unsigned char *)&header->hdr.p, bptr, WF_PATCH_BYTES); in wavefront_send_patch()
796 return -EIO; in wavefront_send_patch()
810 header->number); in wavefront_send_program()
812 if (header->number >= ARRAY_SIZE(dev->prog_status)) in wavefront_send_program()
813 return -EINVAL; in wavefront_send_program()
815 dev->prog_status[header->number] = WF_SLOT_USED; in wavefront_send_program()
822 if (header->hdr.pr.layer[i].mute) { in wavefront_send_program()
823 dev->patch_status[header->hdr.pr.layer[i].patch_number] |= in wavefront_send_program()
832 buf[0] = header->number; in wavefront_send_program()
833 munge_buf ((unsigned char *)&header->hdr.pr, &buf[1], WF_PROGRAM_BYTES); in wavefront_send_program()
837 return -EIO; in wavefront_send_program()
850 snd_printk ("can't get memory stats.\n"); in wavefront_freemem()
851 return -1; in wavefront_freemem()
864 /* samples are downloaded via a 16-bit wide i/o port in wavefront_send_sample()
865 (you could think of it as 2 adjacent 8-bit wide ports in wavefront_send_sample()
869 which are given in 8-bit units (bytes), need to be in wavefront_send_sample()
889 header->size ? "" : "header ", in wavefront_send_sample()
890 header->number, header->subkey, in wavefront_send_sample()
891 header->size, in wavefront_send_sample()
892 (unsigned long) header->dataptr); in wavefront_send_sample()
894 if (header->number == WAVEFRONT_FIND_FREE_SAMPLE_SLOT) { in wavefront_send_sample()
898 return -ENOMEM; in wavefront_send_sample()
901 header->number = x; in wavefront_send_sample()
904 if (header->number >= WF_MAX_SAMPLE) in wavefront_send_sample()
905 return -EINVAL; in wavefront_send_sample()
907 if (header->size) { in wavefront_send_sample()
922 is done purely at user level: there is no WFB parser in in wavefront_send_sample()
932 if (dev->rom_samples_rdonly) { in wavefront_send_sample()
933 if (dev->sample_status[header->number] & WF_SLOT_ROM) { in wavefront_send_sample()
936 header->number); in wavefront_send_sample()
937 return -EACCES; in wavefront_send_sample()
941 wavefront_delete_sample (dev, header->number); in wavefront_send_sample()
944 if (header->size) { in wavefront_send_sample()
945 dev->freemem = wavefront_freemem (dev); in wavefront_send_sample()
947 if (dev->freemem < (int)header->size) { in wavefront_send_sample()
948 snd_printk ("insufficient memory to " in wavefront_send_sample()
950 header->size); in wavefront_send_sample()
951 return -ENOMEM; in wavefront_send_sample()
956 skip = WF_GET_CHANNEL(&header->hdr.s); in wavefront_send_sample()
958 if (skip > 0 && header->hdr.s.SampleResolution != LINEAR_16BIT) { in wavefront_send_sample()
960 "possible on 16-bit samples"); in wavefront_send_sample()
961 return -EINVAL; in wavefront_send_sample()
997 WF_GET_CHANNEL (&header->hdr.s), in wavefront_send_sample()
1002 WF_SET_CHANNEL(&header->hdr.s, 0); in wavefront_send_sample()
1009 length = header->size / 2; in wavefront_send_sample()
1018 shptr = munge_int32 (header->number, shptr, 2); in wavefront_send_sample()
1020 if (header->size) { in wavefront_send_sample()
1028 shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleStartOffset), in wavefront_send_sample()
1030 shptr = munge_int32 (*((u32 *) &header->hdr.s.loopStartOffset), in wavefront_send_sample()
1032 shptr = munge_int32 (*((u32 *) &header->hdr.s.loopEndOffset), in wavefront_send_sample()
1034 shptr = munge_int32 (*((u32 *) &header->hdr.s.sampleEndOffset), in wavefront_send_sample()
1042 shptr = munge_int32 (header->hdr.s.FrequencyBias, shptr, 3); in wavefront_send_sample()
1046 good-faith guess at where it starts. in wavefront_send_sample()
1049 shptr = munge_int32 (*(&header->hdr.s.FrequencyBias+1), in wavefront_send_sample()
1053 header->size ? in wavefront_send_sample()
1057 header->size ? "" : "header "); in wavefront_send_sample()
1058 return -EIO; in wavefront_send_sample()
1061 if (header->size == 0) { in wavefront_send_sample()
1074 if ((length - written) > max_blksize) { in wavefront_send_sample()
1077 /* round to nearest 16-byte value */ in wavefront_send_sample()
1078 blocksize = ALIGN(length - written, 8); in wavefront_send_sample()
1084 return -EIO; in wavefront_send_sample()
1096 if (WF_SAMPLE_IS_8BIT(&header->hdr.s)) { in wavefront_send_sample()
1129 if (i < blocksize - 1) { in wavefront_send_sample()
1130 outw (sample_short, dev->block_port); in wavefront_send_sample()
1132 outw (sample_short, dev->last_block_port); in wavefront_send_sample()
1141 if (dma_ack == -1) { in wavefront_send_sample()
1144 return -EIO; in wavefront_send_sample()
1149 return -EIO; in wavefront_send_sample()
1154 dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_SAMPLE); in wavefront_send_sample()
1172 header->number, in wavefront_send_alias()
1173 header->hdr.a.OriginalSample); in wavefront_send_alias()
1175 if (header->number >= WF_MAX_SAMPLE) in wavefront_send_alias()
1176 return -EINVAL; in wavefront_send_alias()
1178 munge_int32 (header->number, &alias_hdr[0], 2); in wavefront_send_alias()
1179 munge_int32 (header->hdr.a.OriginalSample, &alias_hdr[2], 2); in wavefront_send_alias()
1180 munge_int32 (*((unsigned int *)&header->hdr.a.sampleStartOffset), in wavefront_send_alias()
1182 munge_int32 (*((unsigned int *)&header->hdr.a.loopStartOffset), in wavefront_send_alias()
1184 munge_int32 (*((unsigned int *)&header->hdr.a.loopEndOffset), in wavefront_send_alias()
1186 munge_int32 (*((unsigned int *)&header->hdr.a.sampleEndOffset), in wavefront_send_alias()
1188 munge_int32 (header->hdr.a.FrequencyBias, &alias_hdr[20], 3); in wavefront_send_alias()
1189 munge_int32 (*(&header->hdr.a.FrequencyBias+1), &alias_hdr[23], 2); in wavefront_send_alias()
1193 return -EIO; in wavefront_send_alias()
1196 dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_ALIAS); in wavefront_send_alias()
1208 if (header->number >= WF_MAX_SAMPLE) in wavefront_send_multisample()
1209 return -EINVAL; in wavefront_send_multisample()
1213 return -ENOMEM; in wavefront_send_multisample()
1215 munge_int32 (header->number, &msample_hdr[0], 2); in wavefront_send_multisample()
1222 num_samples = (1<<(header->hdr.ms.NumberOfSamples&7)); in wavefront_send_multisample()
1223 msample_hdr[2] = (unsigned char) header->hdr.ms.NumberOfSamples; in wavefront_send_multisample()
1226 header->number, in wavefront_send_multisample()
1227 header->hdr.ms.NumberOfSamples, in wavefront_send_multisample()
1232 i, header->hdr.ms.SampleNumber[i]); in wavefront_send_multisample()
1233 munge_int32 (header->hdr.ms.SampleNumber[i], in wavefront_send_multisample()
1247 return -EIO; in wavefront_send_multisample()
1250 dev->sample_status[header->number] = (WF_SLOT_FILLED|WF_ST_MULTISAMPLE); in wavefront_send_multisample()
1265 munge_int32 (header->number, number, 2); in wavefront_fetch_multisample()
1269 return -EIO; in wavefront_fetch_multisample()
1273 header->number, log_ns[0]); in wavefront_fetch_multisample()
1275 header->hdr.ms.NumberOfSamples = log_ns[0]; in wavefront_fetch_multisample()
1285 if ((val = wavefront_read (dev)) == -1) { in wavefront_fetch_multisample()
1288 return -EIO; in wavefront_fetch_multisample()
1292 if ((val = wavefront_read (dev)) == -1) { in wavefront_fetch_multisample()
1295 return -EIO; in wavefront_fetch_multisample()
1299 header->hdr.ms.SampleNumber[i] = in wavefront_fetch_multisample()
1303 i, header->hdr.ms.SampleNumber[i]); in wavefront_fetch_multisample()
1315 wavefront_drum *drum = &header->hdr.d; in wavefront_send_drum()
1320 header->number, drum->PatchNumber); in wavefront_send_drum()
1322 drumbuf[0] = header->number & 0x7f; in wavefront_send_drum()
1330 return -EIO; in wavefront_send_drum()
1343 if (!(dev->sample_status[i] & WF_SLOT_FILLED)) { in wavefront_find_free_sample()
1347 snd_printk ("no free sample slots!\n"); in wavefront_find_free_sample()
1348 return -1; in wavefront_find_free_sample()
1359 if (!(dev->patch_status[i] & WF_SLOT_FILLED)) {
1363 snd_printk ("no free patch slots!\n");
1364 return -1;
1376 return -ENOMEM; in wavefront_load_patch()
1378 if (copy_from_user (header, addr, sizeof(wavefront_patch_info) - in wavefront_load_patch()
1381 err = -EFAULT; in wavefront_load_patch()
1389 header->subkey, in wavefront_load_patch()
1390 header->number, in wavefront_load_patch()
1391 header->size); in wavefront_load_patch()
1393 switch (header->subkey) { in wavefront_load_patch()
1394 case WF_ST_SAMPLE: /* sample or sample_header, based on patch->size */ in wavefront_load_patch()
1396 if (copy_from_user (&header->hdr.s, header->hdrptr, in wavefront_load_patch()
1398 err = -EFAULT; in wavefront_load_patch()
1402 err = wavefront_send_sample (dev, header, header->dataptr, 0); in wavefront_load_patch()
1407 if (copy_from_user (&header->hdr.s, header->hdrptr, in wavefront_load_patch()
1409 err = -EFAULT; in wavefront_load_patch()
1418 if (copy_from_user (&header->hdr.a, header->hdrptr, in wavefront_load_patch()
1420 err = -EFAULT; in wavefront_load_patch()
1428 if (copy_from_user (&header->hdr.d, header->hdrptr, in wavefront_load_patch()
1430 err = -EFAULT; in wavefront_load_patch()
1438 if (copy_from_user (&header->hdr.p, header->hdrptr, in wavefront_load_patch()
1440 err = -EFAULT; in wavefront_load_patch()
1448 if (copy_from_user (&header->hdr.pr, header->hdrptr, in wavefront_load_patch()
1450 err = -EFAULT; in wavefront_load_patch()
1459 header->subkey); in wavefront_load_patch()
1460 err = -EINVAL; in wavefront_load_patch()
1470 WaveFront: hardware-dependent interface
1507 wavefront_control *wc) in wavefront_synth_control() argument
1510 snd_wavefront_t *dev = &acard->wavefront; in wavefront_synth_control()
1515 "cmd 0x%x\n", wc->cmd); in wavefront_synth_control()
1517 /* Pre-handling of or for various commands */ in wavefront_synth_control()
1519 switch (wc->cmd) { in wavefront_synth_control()
1523 outb (0x80|0x20, dev->control_port); in wavefront_synth_control()
1524 dev->interrupts_are_midi = 1; in wavefront_synth_control()
1529 outb (0x80|0x40|0x20, dev->control_port); in wavefront_synth_control()
1530 dev->interrupts_are_midi = 1; in wavefront_synth_control()
1534 wc->rbuf[0] = dev->interrupts_are_midi; in wavefront_synth_control()
1538 dev->rom_samples_rdonly = wc->wbuf[0]; in wavefront_synth_control()
1539 wc->status = 0; in wavefront_synth_control()
1543 i = wc->wbuf[0] | (wc->wbuf[1] << 7); in wavefront_synth_control()
1547 wc->status = EINVAL; in wavefront_synth_control()
1548 return -EINVAL; in wavefront_synth_control()
1550 wc->rbuf[0] = dev->sample_status[i]; in wavefront_synth_control()
1551 wc->status = 0; in wavefront_synth_control()
1555 dev->debug = wc->wbuf[0]; in wavefront_synth_control()
1556 snd_printk ("debug = 0x%x\n", dev->debug); in wavefront_synth_control()
1560 munge_int32 (*((u32 *) wc->wbuf), patchnumbuf, 2); in wavefront_synth_control()
1561 memcpy (wc->wbuf, patchnumbuf, 2); in wavefront_synth_control()
1568 wc->status = wavefront_fetch_multisample in wavefront_synth_control()
1569 (dev, (wavefront_patch_info *) wc->rbuf); in wavefront_synth_control()
1575 wc->status = EINVAL; in wavefront_synth_control()
1576 return -EINVAL; in wavefront_synth_control()
1579 wc->status = snd_wavefront_cmd (dev, wc->cmd, wc->rbuf, wc->wbuf); in wavefront_synth_control()
1581 /* Post-handling of certain commands. in wavefront_synth_control()
1584 so that the user-level doesn't have to think about it. in wavefront_synth_control()
1587 if (wc->status == 0) { in wavefront_synth_control()
1588 switch (wc->cmd) { in wavefront_synth_control()
1590 we are always current with the user-level view in wavefront_synth_control()
1595 dev->freemem = demunge_int32 (wc->rbuf, 4); in wavefront_synth_control()
1599 demunge_buf (wc->rbuf, wc->rbuf, WF_PATCH_BYTES); in wavefront_synth_control()
1603 demunge_buf (wc->rbuf, wc->rbuf, WF_PROGRAM_BYTES); in wavefront_synth_control()
1607 demunge_buf (wc->rbuf, wc->rbuf, WF_DRUM_BYTES - 1); in wavefront_synth_control()
1611 process_sample_hdr (wc->rbuf); in wavefront_synth_control()
1637 if (!try_module_get(hw->card->module)) in snd_wavefront_synth_open()
1638 return -EFAULT; in snd_wavefront_synth_open()
1639 file->private_data = hw; in snd_wavefront_synth_open()
1647 module_put(hw->card->module); in snd_wavefront_synth_release()
1659 wavefront_control *wc; in snd_wavefront_synth_ioctl() local
1663 card = (struct snd_card *) hw->card; in snd_wavefront_synth_ioctl()
1666 return -ENODEV; in snd_wavefront_synth_ioctl()
1667 if (snd_BUG_ON(!card->private_data)) in snd_wavefront_synth_ioctl()
1668 return -ENODEV; in snd_wavefront_synth_ioctl()
1670 acard = card->private_data; in snd_wavefront_synth_ioctl()
1671 dev = &acard->wavefront; in snd_wavefront_synth_ioctl()
1676 return -EIO; in snd_wavefront_synth_ioctl()
1681 wc = memdup_user(argp, sizeof(*wc)); in snd_wavefront_synth_ioctl()
1682 if (IS_ERR(wc)) in snd_wavefront_synth_ioctl()
1683 return PTR_ERR(wc); in snd_wavefront_synth_ioctl()
1685 if (wavefront_synth_control (acard, wc) < 0) in snd_wavefront_synth_ioctl()
1686 err = -EIO; in snd_wavefront_synth_ioctl()
1687 else if (copy_to_user (argp, wc, sizeof (*wc))) in snd_wavefront_synth_ioctl()
1688 err = -EFAULT; in snd_wavefront_synth_ioctl()
1691 kfree(wc); in snd_wavefront_synth_ioctl()
1695 return -EINVAL; in snd_wavefront_synth_ioctl()
1703 /* WaveFront: interface for card-level wavefront module */
1709 snd_wavefront_t *dev = &card->wavefront; in snd_wavefront_internal_interrupt()
1714 doing busy and/or sleep-waiting. Alas, it appears that once in snd_wavefront_internal_interrupt()
1728 firmware prevents RX-ready interrupts. in snd_wavefront_internal_interrupt()
1735 spin_lock(&dev->irq_lock); in snd_wavefront_internal_interrupt()
1736 dev->irq_ok = 1; in snd_wavefront_internal_interrupt()
1737 dev->irq_cnt++; in snd_wavefront_internal_interrupt()
1738 spin_unlock(&dev->irq_lock); in snd_wavefront_internal_interrupt()
1739 wake_up(&dev->interrupt_sleeper); in snd_wavefront_internal_interrupt()
1776 bits = -1; in snd_wavefront_interrupt_bits()
1790 spin_lock_irq(&dev->irq_lock); in wavefront_should_cause_interrupt()
1791 add_wait_queue(&dev->interrupt_sleeper, &wait); in wavefront_should_cause_interrupt()
1792 dev->irq_ok = 0; in wavefront_should_cause_interrupt()
1794 spin_unlock_irq(&dev->irq_lock); in wavefront_should_cause_interrupt()
1795 while (!dev->irq_ok && time_before(jiffies, timeout)) { in wavefront_should_cause_interrupt()
1810 bits = snd_wavefront_interrupt_bits (dev->irq); in wavefront_reset_to_cleanliness()
1814 outb (0x0, dev->control_port); in wavefront_reset_to_cleanliness()
1819 Bit 7 - Enable IRQ Driver in wavefront_reset_to_cleanliness()
1820 0 - Tri-state the Wave-Board drivers for the PC Bus IRQs in wavefront_reset_to_cleanliness()
1821 1 - Enable IRQ selected by bits 5:3 to be driven onto the PC Bus. in wavefront_reset_to_cleanliness()
1823 Bit 6 - MIDI Interface Select in wavefront_reset_to_cleanliness()
1825 0 - Use the MIDI Input from the 26-pin WaveBlaster in wavefront_reset_to_cleanliness()
1827 1 - Use the MIDI Input from the 9-pin D connector as the in wavefront_reset_to_cleanliness()
1830 Bits 5:3 - IRQ Selection in wavefront_reset_to_cleanliness()
1831 0 0 0 - IRQ 2/9 in wavefront_reset_to_cleanliness()
1832 0 0 1 - IRQ 5 in wavefront_reset_to_cleanliness()
1833 0 1 0 - IRQ 12 in wavefront_reset_to_cleanliness()
1834 0 1 1 - IRQ 15 in wavefront_reset_to_cleanliness()
1835 1 0 0 - Reserved in wavefront_reset_to_cleanliness()
1836 1 0 1 - Reserved in wavefront_reset_to_cleanliness()
1837 1 1 0 - Reserved in wavefront_reset_to_cleanliness()
1838 1 1 1 - Reserved in wavefront_reset_to_cleanliness()
1840 Bits 2:1 - Reserved in wavefront_reset_to_cleanliness()
1841 Bit 0 - Disable Boot ROM in wavefront_reset_to_cleanliness()
1842 0 - memory accesses to 03FC30-03FFFFH utilize the internal Boot ROM in wavefront_reset_to_cleanliness()
1843 1 - memory accesses to 03FC30-03FFFFH are directed to external in wavefront_reset_to_cleanliness()
1849 plus external 9-pin MIDI interface selected in wavefront_reset_to_cleanliness()
1852 outb (0x80 | 0x40 | bits, dev->data_port); in wavefront_reset_to_cleanliness()
1872 dev->control_port, in wavefront_reset_to_cleanliness()
1879 if (!dev->irq_ok) { in wavefront_reset_to_cleanliness()
1880 snd_printk ("intr not received after h/w un-reset.\n"); in wavefront_reset_to_cleanliness()
1891 seconds - with 12MB of RAM on a Tropez+, it takes a lot in wavefront_reset_to_cleanliness()
1897 XXX Interesting question: why is no RX interrupt received first ? in wavefront_reset_to_cleanliness()
1901 dev->data_port, ramcheck_time*HZ); in wavefront_reset_to_cleanliness()
1903 if (!dev->irq_ok) { in wavefront_reset_to_cleanliness()
1904 snd_printk ("post-RAM-check interrupt not received.\n"); in wavefront_reset_to_cleanliness()
1909 snd_printk ("no response to HW version cmd.\n"); in wavefront_reset_to_cleanliness()
1913 if ((hwv[0] = wavefront_read (dev)) == -1) { in wavefront_reset_to_cleanliness()
1924 if ((hwv[0] = wavefront_read (dev)) == -1) { in wavefront_reset_to_cleanliness()
1925 snd_printk ("on-board RAM test failed " in wavefront_reset_to_cleanliness()
1928 snd_printk ("on-board RAM test failed " in wavefront_reset_to_cleanliness()
1937 if ((hwv[1] = wavefront_read (dev)) == -1) { in wavefront_reset_to_cleanliness()
1961 err = request_firmware(&firmware, path, dev->card->dev); in wavefront_download_firmware()
1968 buf = firmware->data; in wavefront_download_firmware()
1982 if (firmware->size < len + section_length) { in wavefront_download_firmware()
1991 for (; section_length; section_length--) { in wavefront_download_firmware()
2003 err = inb(dev->data_port); in wavefront_download_firmware()
2036 if (dev->israw) { in wavefront_do_reset()
2041 dev->israw = 0; in wavefront_do_reset()
2044 this is non-obvious, and was determined by in wavefront_do_reset()
2045 using port-IO tracing in DOSemu and some in wavefront_do_reset()
2052 dev->data_port, in wavefront_do_reset()
2055 if (!dev->irq_ok) { in wavefront_do_reset()
2056 snd_printk ("no post-OS interrupt.\n"); in wavefront_do_reset()
2063 dev->data_port, (10*HZ)); in wavefront_do_reset()
2065 if (!dev->irq_ok) { in wavefront_do_reset()
2066 snd_printk ("no post-OS interrupt(2).\n"); in wavefront_do_reset()
2070 /* OK, no (RX/TX) interrupts any more, but leave mute in wavefront_do_reset()
2074 outb (0x80|0x40, dev->control_port); in wavefront_do_reset()
2077 /* SETUPSND.EXE asks for sample memory config here, but since i in wavefront_do_reset()
2078 have no idea how to interpret the result, we'll forget in wavefront_do_reset()
2082 if ((dev->freemem = wavefront_freemem (dev)) < 0) { in wavefront_do_reset()
2086 snd_printk ("available DRAM %dk\n", dev->freemem / 1024); in wavefront_do_reset()
2091 dev->debug = 0; in wavefront_do_reset()
2109 outb (0x0, dev->control_port); in wavefront_do_reset()
2110 dev->interrupts_are_midi = 0; in wavefront_do_reset()
2124 if (dev->israw) { in snd_wavefront_start()
2131 if (dev->israw || fx_raw) { in snd_wavefront_start()
2133 return -1; in snd_wavefront_start()
2138 dev->has_fx = (snd_wavefront_fx_detect (dev) == 0); in snd_wavefront_start()
2140 if (dev->has_fx && fx_raw) { in snd_wavefront_start()
2148 /* Start normal operation: unreset, master interrupt enabled, no mute in snd_wavefront_start()
2151 outb (0x80|0x40|0x20, dev->control_port); in snd_wavefront_start()
2161 snd_wavefront_t *dev = &card->wavefront; in snd_wavefront_detect()
2167 dev->israw = 0; in snd_wavefront_detect()
2168 dev->has_fx = 0; in snd_wavefront_detect()
2169 dev->debug = debug_default; in snd_wavefront_detect()
2170 dev->interrupts_are_midi = 0; in snd_wavefront_detect()
2171 dev->irq_cnt = 0; in snd_wavefront_detect()
2172 dev->rom_samples_rdonly = 1; in snd_wavefront_detect()
2176 dev->fw_version[0] = rbuf[0]; in snd_wavefront_detect()
2177 dev->fw_version[1] = rbuf[1]; in snd_wavefront_detect()
2186 dev->hw_version[0] = rbuf[0]; in snd_wavefront_detect()
2187 dev->hw_version[1] = rbuf[1]; in snd_wavefront_detect()
2189 snd_printk ("not raw, but no " in snd_wavefront_detect()
2191 return -1; in snd_wavefront_detect()
2198 dev->israw = 1; in snd_wavefront_detect()
2203 dev->israw = 1; in snd_wavefront_detect()
2204 snd_printk ("no response to firmware probe, assume raw.\n"); in snd_wavefront_detect()