Unix Technical Forum

eap testers required

This is a discussion on eap testers required within the mailing.openbsd.tech forums, part of the OpenBSD category; --> This diff introduces changes required to use MIDI with eap(4) from NetBSD. I would like it to be widely ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 08:28 AM
Jonathan Gray
 
Posts: n/a
Default eap testers required

This diff introduces changes required to use MIDI with eap(4) from
NetBSD. I would like it to be widely tested to ensure there are
no issues. I'm interested in reports from all eap users not
just those who would like to use MIDI.

Index: sys/arch/i386/conf/GENERIC
================================================== =================
RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.378
diff -u -r1.378 GENERIC
--- sys/arch/i386/conf/GENERIC 2004/09/16 10:37:21 1.378
+++ sys/arch/i386/conf/GENERIC 2004/09/26 16:58:03
@@ -499,6 +499,7 @@
midi* at ym?
midi* at mpu?
midi* at autri?
+midi* at eap?

# The spkr driver provides a simple tone interface to the built in speaker.
#spkr0 at pcppi? # PC speaker
Index: sys/dev/pci/eap.c
================================================== =================
RCS file: /cvs/src/sys/dev/pci/eap.c,v
retrieving revision 1.21
diff -u -r1.21 eap.c
--- sys/dev/pci/eap.c 2004/03/18 01:24:41 1.21
+++ sys/dev/pci/eap.c 2004/09/26 16:58:05
@@ -55,9 +55,12 @@
* ftp://download.intel.com/ial/scalabl...io/ac97r21.pdf
*/

+#include "midi.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/device.h>
#include <sys/proc.h>
@@ -67,6 +70,7 @@

#include <sys/audioio.h>
#include <dev/audio_if.h>
+#include <dev/midi_if.h>
#include <dev/mulaw.h>
#include <dev/auconv.h>
#include <dev/ic/ac97.h>
@@ -128,6 +132,13 @@
char sc_rrun;
#endif

+#if NMIDI > 0
+ void (*sc_iintr)(void *, int); /* midi input ready handler */
+ void (*sc_ointr)(void *); /* midi output ready handler */
+ void *sc_arg;
+ struct device *sc_mididev;
+#endif
+
u_short sc_port[AK_NPORTS]; /* mirror of the hardware setting */
u_int sc_record_source; /* recording source mask */
u_int sc_output_source; /* output source mask */
@@ -144,8 +155,10 @@
int eap_allocmem(struct eap_softc *, size_t, size_t, struct eap_dma *);
int eap_freemem(struct eap_softc *, struct eap_dma *);

+#define EWRITE1(sc, r, x) bus_space_write_1((sc)->iot, (sc)->ioh, (r), (x))
#define EWRITE2(sc, r, x) bus_space_write_2((sc)->iot, (sc)->ioh, (r), (x))
#define EWRITE4(sc, r, x) bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x))
+#define EREAD1(sc, r) bus_space_read_1((sc)->iot, (sc)->ioh, (r))
#define EREAD2(sc, r) bus_space_read_2((sc)->iot, (sc)->ioh, (r))
#define EREAD4(sc, r) bus_space_read_4((sc)->iot, (sc)->ioh, (r))

@@ -190,6 +203,13 @@
void eap1371_reset_codec(void *sc);
int eap1371_get_portnum_by_name(struct eap_softc *, char *, char *,
char *);
+#if NMIDI > 0
+void eap_midi_close(void *);
+void eap_midi_getinfo(void *, struct midi_info *);
+int eap_midi_open(void *, int, void (*)(void *, int),
+ void (*)(void *), void *);
+int eap_midi_output(void *, int);
+#endif

struct audio_hw_if eap1370_hw_if = {
eap_open,
@@ -249,6 +269,16 @@
eap_trigger_input,
};

+#if NMIDI > 0
+struct midi_hw_if eap_midi_hw_if = {
+ eap_midi_open,
+ eap_midi_close,
+ eap_midi_output,
+ eap_midi_getinfo,
+ 0, /* ioctl */
+};
+#endif
+
struct audio_device eap_device = {
"Ensoniq AudioPCI",
"",
@@ -690,6 +720,9 @@
}

audio_attach_mi(eap_hw_if, sc, &sc->sc_dev);
+#if NMIDI > 0
+ sc->sc_mididev = midi_attach_mi(&eap_midi_hw_if, sc, &sc->sc_dev);
+#endif
}

int
@@ -765,6 +798,18 @@
if (sc->sc_pintr)
sc->sc_pintr(sc->sc_parg);
}
+#if NMIDI > 0
+ if ((intr & EAP_I_UART) && sc->sc_iintr != NULL) {
+ u_int32_t data;
+
+ if (EREAD1(sc, EAP_UART_STATUS) & EAP_US_RXINT) {
+ while (EREAD1(sc, EAP_UART_STATUS) & EAP_US_RXRDY) {
+ data = EREAD1(sc, EAP_UART_DATA);
+ sc->sc_iintr(sc->sc_arg, data);
+ }
+ }
+ }
+#endif
return (1);
}

@@ -1641,3 +1686,68 @@

return (sc->flags);
}
+#if NMIDI > 0
+int
+eap_midi_open(void *addr, int flags,
+ void (*iintr)(void *, int),
+ void (*ointr)(void *),
+ void *arg)
+{
+ struct eap_softc *sc = addr;
+ u_int32_t uctrl;
+
+ sc->sc_iintr = iintr;
+ sc->sc_ointr = ointr;
+ sc->sc_arg = arg;
+
+ EWRITE4(sc, EAP_ICSC, EREAD4(sc, EAP_ICSC) | EAP_UART_EN);
+ uctrl = 0;
+ if (flags & FREAD)
+ uctrl |= EAP_UC_RXINTEN;
+#if 0
+ /* I don't understand ../midi.c well enough to use output interrupts */
+ if (flags & FWRITE)
+ uctrl |= EAP_UC_TXINTEN; */
+#endif
+ EWRITE1(sc, EAP_UART_CONTROL, uctrl);
+
+ return (0);
+}
+
+void
+eap_midi_close(void *addr)
+{
+ struct eap_softc *sc = addr;
+
+ tsleep(sc, PWAIT, "eapclm", hz/10); /* give uart a chance to drain */
+ EWRITE1(sc, EAP_UART_CONTROL, 0);
+ EWRITE4(sc, EAP_ICSC, EREAD4(sc, EAP_ICSC) & ~EAP_UART_EN);
+
+ sc->sc_iintr = 0;
+ sc->sc_ointr = 0;
+}
+
+int
+eap_midi_output(void *addr, int d)
+{
+ struct eap_softc *sc = addr;
+ int x;
+
+ for (x = 0; x != MIDI_BUSY_WAIT; x++) {
+ if (EREAD1(sc, EAP_UART_STATUS) & EAP_US_TXRDY) {
+ EWRITE1(sc, EAP_UART_DATA, d);
+ return (0);
+ }
+ delay(MIDI_BUSY_DELAY);
+ }
+ return (EIO);
+}
+
+void
+eap_midi_getinfo(void *addr, struct midi_info *mi)
+{
+ mi->name = "AudioPCI MIDI UART";
+ mi->props = MIDI_PROP_CAN_INPUT;
+}
+
+#endif
Index: sys/dev/pci/files.pci
================================================== =================
RCS file: /cvs/src/sys/dev/pci/files.pci,v
retrieving revision 1.159
diff -u -r1.159 files.pci
--- sys/dev/pci/files.pci 2004/09/16 09:14:02 1.159
+++ sys/dev/pci/files.pci 2004/09/26 16:58:07
@@ -82,7 +82,7 @@
file dev/pci/iop_pci.c iop_pci

# Ensoniq AudioPCI S5016, 1371
-device eap: audio, auconv, mulaw, ac97
+device eap: audio, auconv, mulaw, ac97, midibus
attach eap at pci
file dev/pci/eap.c eap

Index: share/man/man4/eap.4
================================================== =================
RCS file: /cvs/src/share/man/man4/eap.4,v
retrieving revision 1.11
diff -u -r1.11 eap.4
--- share/man/man4/eap.4 2004/03/21 19:50:44 1.11
+++ share/man/man4/eap.4 2004/09/26 16:58:07
@@ -41,6 +41,7 @@
.Sh SYNOPSIS
.Cd "eap* at pci? dev ? function ?"
.Cd "audio* at eap?"
+.Cd "midi* at eap?"
.Sh DESCRIPTION
The
.Nm
@@ -53,6 +54,7 @@
.Xr ac97 4 ,
.Xr audio 4 ,
.Xr intro 4 ,
+.Xr midi 4 ,
.Xr pci 4
.Sh HISTORY
The
@@ -60,4 +62,4 @@
device driver appeared in
.Ox 2.6 .
.Sh BUGS
-The "FM" DAC and MIDI port are not supported.
+The "FM" DAC is not supported.
Index: share/man/man4/midi.4
================================================== =================
RCS file: /cvs/src/share/man/man4/midi.4,v
retrieving revision 1.17
diff -u -r1.17 midi.4
--- share/man/man4/midi.4 2004/03/21 19:47:59 1.17
+++ share/man/man4/midi.4 2004/09/26 16:58:07
@@ -40,6 +40,7 @@
.Nd device-independent MIDI driver layer
.Sh SYNOPSIS
.Cd "midi* at autri?"
+.Cd "midi* at eap?"
.Cd "midi* at mpu?"
.Cd "midi* at opl?"
.Cd "midi* at pcppi?"
@@ -105,6 +106,7 @@
.Xr ossaudio 3 ,
.Xr audio 4 ,
.Xr autri 4 ,
+.Xr eap 4 ,
.Xr mpu 4 ,
.Xr opl 4 ,
.Xr pcppi 4 ,

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:07 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com