Subject: Re: New ESS Allegro-1 / Maestro3 driver
To: None <kgc@zhwin.ch>
From: Brook Milligan <brook@biology.nmsu.edu>
List: port-i386
Date: 12/06/2001 08:42:15
   I tried to incorporate the driver into my 1.5.2 kernel today.

I did more or less the same thing.  In the process I created a few
patches, which I sent back to Jared.  I hope he includes them in a new
release of the driver.  One of them (pcidevs.h), at least, may be
appropriate for inclusion in the native NetBSD code base.

In any case, here are my patches (and attendant comments) for review.
Have fun.

Thanks also to Jared for creating this in the first place.

Cheers,
Brook

===========================================================================
===========================================================================

The following patch provides a missing prototype in your code.

===========================================================================
--- esa.c.orig  Fri Sep 28 12:43:37 2001
+++ esa.c       Tue Nov 27 13:26:22 2001
@@ -88,6 +88,7 @@
 };

 int            esa_match __P((struct device *, struct cfdata *, void *));
+int            esa_pa_match __P((struct pci_attach_args *pa));
 void           esa_attach __P((struct device *, struct device *, void *));
 int            esa_detach __P((struct device *, int));

===========================================================================

The following code provides some missing magic numbers in the kernel
source.  This should probably be added to the native NetBSD source, if
only for completeness.  Note that I am not completely sure what the
most appropriate comments would be for these new entries.

===========================================================================

--- dev/pci/pcidevs.h.orig      Mon Jun 18 10:51:53 2001
+++ dev/pci/pcidevs.h   Tue Nov 27 13:17:09 2001
@@ -975,11 +975,13 @@
 #define        PCI_PRODUCT_ESSENTIAL_RR_GIGE   0x0005          /* RoadRunner Gig-E Interface */

 /* ESS Technology Inc products */
+#define        PCI_PRODUCT_ESSTECH_ALLEGRO1    0x1988          /* Allegro 1 PCI Audio Accelerator */
 #define        PCI_PRODUCT_ESSTECH_MAESTRO1    0x0100          /* Maestro 1 PCI Audio Accelerator */
 #define        PCI_PRODUCT_ESSTECH_MAESTRO2    0x1968          /* Maestro 2 PCI Audio Accelerator */
 #define        PCI_PRODUCT_ESSTECH_SOLO1       0x1969          /* Solo-1 PCI AudioDrive */
 #define        PCI_PRODUCT_ESSTECH_MAESTRO2E   0x1978          /* Maestro 2E PCI Audio Accelerator */
 #define        PCI_PRODUCT_ESSTECH_MAESTRO3    0x1998          /* Maestro 3 PCI Audio Accelerator */
+#define        PCI_PRODUCT_ESSTECH_MAESTRO3_2  0x199a          /* Maestro 3 PCI Audio Accelerator */
 #define        PCI_PRODUCT_ESSTECH_MAESTRO3MODEM       0x1999          /* Maestro 3 Modem */

 /* ESS Technology Inc products */
===========================================================================

The following code defines the additional kernel configuration
information for including your code into the kernel.  This should
probably remain out of the NetBSD code base, but would be appropriate
for some documentation.  Again, I'm not sure of the best comment for
this entry.

===========================================================================
--- ./dev/pci/files.pci.orig    Sun May  6 09:14:14 2001
+++ ./dev/pci/files.pci Tue Nov 27 12:34:36 2001
@@ -250,6 +250,11 @@
 attach esm at pci
 file   dev/pci/esm.c                   esm

+# ESS Allegro-1/Maestro-3 PCI AC97 Audio Accelerator
+device esa: audio, auconv, mulaw, ac97
+attach esa at pci
+file   dev/pci/esa.c                   esa
+
===========================================================================