Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2000 08:20:02 -0800 (PST)
From:      Nick Hibma <n_hibma@calcaphon.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/17453: Added sys/pci/ device identification for Aureal Sound Cards
Message-ID:  <200003181620.IAA60111@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/17453; it has been noted by GNATS.

From: Nick Hibma <n_hibma@calcaphon.com>
To: lioux@uol.com.br
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/17453: Added sys/pci/ device identification for Aureal
 Sound Cards
Date: Sat, 18 Mar 2000 16:11:31 +0000 (GMT)

 This would open the door to add all the PCI devices to it. We might as
 well create some sort of generic function and table for a complete list
 and have the drivers use that table instead.
 
 I've already written the makedevlist.pl script for it that creates the
 stub files in your kernel compile directory, but will have to find some 
 time to finish that work before I can commit it.
 
 Nick
 
 On 18 Mar 2000 lioux@uol.com.br wrote:
 
 > 
 > >Number:         17453
 > >Category:       kern
 > >Synopsis:       Added sys/pci/ device identification for Aureal Sound Cards
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          change-request
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Fri Mar 17 19:30:01 PST 2000
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Mario Sergio Fujikawa Ferreira
 > >Release:        FreeBSD 5.0-CURRENT i386
 > >Organization:
 > >Environment:
 > 
 > Should work cleanly with the latest 4.0-current, 4.0-release, 4.0-stable and,
 > probably, 5.0-current.
 > 
 > >Description:
 > 
 > I added a simple identification function for pci sound cards. In
 > fact, it is just a simplified copy of the const char* pci_vga_match(device_t)
 > function renamed const char* pci_snd_match(device_t).
 > 
 > It only tests for aureal cards as of now (I only own this one), identifies
 > the proper chipset and names the appropriate type.
 > 
 > If it can identify both the vendor and the chip, outputs accordingly;
 > if it only identifies the vendor, output that alongside the identification
 > codes. Otherwise, it says it does not recognize the device.
 > Just like pci_vga_match().
 > 
 > However, inside the loop (vendor && chip) && (type == 0),
 > I named type = "Sound Card Device" which I am not sure is the correct
 > nomenclature.
 > 
 > It is working on my computer right now. Nevertheless, either Mr. Stanglmeier
 > or Mr. Esser should examine this little piece of code.
 > 
 > The information was obtained from Aureal website. The following
 > pages/softwares were used:
 > ++ VortexID - http://support.a3d.com/utilities/index.htm
 > + To get the type definitions, just used the HTML page.
 > 
 > ++ Linux Aureal Drivers - http://linux.a3d.com/Drivers/au88xx-1.0.5.tar.gz
 > + To get the chip and vendor ids/definitions, just used the vortex.c src
 > code.
 > 
 > I do believe that it is all public domain information. :)
 > That's just a source quote for cross examination.
 > 
 > >How-To-Repeat:
 > 
 > Use the following patch at /usr/src
 > 
 > >Fix:
 > 
 > diff -u sys/pci/pci.c /tmp/aureal/pci.c
 > --- sys/pci/pci.c	Fri Mar 17 23:50:38 2000
 > +++ /tmp/aureal/pci.c	Fri Mar 17 22:06:41 2000
 > @@ -1237,6 +1237,7 @@
 >  	desc = pci_ata_match(child);
 >  	if (!desc) desc = pci_usb_match(child);
 >  	if (!desc) desc = pci_vga_match(child);
 > +	if (!desc) desc = pci_snd_match(child);
 >  	if (!desc) {
 >  		desc = "unknown card";
 >  		unknown++;
 > diff -u sys/pci/pcisupport.c /tmp/aureal/pcisupport.c
 > --- sys/pci/pcisupport.c	Fri Mar 17 23:50:38 2000
 > +++ /tmp/aureal/pcisupport.c	Fri Mar 17 23:31:24 2000
 > @@ -1831,6 +1831,61 @@
 >  	return type;
 >  }
 >  
 > +
 > +const char* pci_snd_match(device_t dev)
 > +{
 > +	u_int id = pci_get_devid(dev);
 > +	const char *vendor, *chip, *type;
 > +
 > +	vendor = chip = type = 0;
 > +	switch (id & 0xffff) {
 > +	case 0x12eb:
 > +		vendor = "Aureal";
 > +		switch (id >> 16) {
 > +		case 0x0001:
 > +			chip = "Au8820";
 > +			type = "Vortex1"; break;
 > +		case 0x0002:
 > +			chip = "Au8830";
 > +			type = "Vortex2 SuperQuad or SQ2500"; break;	
 > +		case 0x0003:
 > +			chip = "Au8810";
 > +			type = "Vortex Advantage or SQ1500"; break;
 > +		default:
 > +			chip = "Au88xx"; break;
 > +		}
 > +		break;
 > +	}
 > +
 > +	if (vendor && chip) {
 > +		char *buf;
 > +		int len;
 > +
 > +		if (type == 0)
 > +			type = "Sound Card Device";
 > +
 > +		len = strlen(vendor) + strlen(chip) + strlen(type) + 4;
 > +		MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
 > +		if (buf)
 > +			sprintf(buf, "%s %s %s", vendor, chip, type);
 > +		return buf;
 > +	}
 > +
 > +	if (vendor) {
 > +		char *buf;
 > +		int len;
 > +
 > +		len = strlen(vendor) + strlen(type) + 2 + 6 + 4 + 1;
 > +		MALLOC(buf, char *, len, M_TEMP, M_NOWAIT);
 > +		if (buf)
 > +			sprintf(buf, "%s model %04x %s", vendor, id >> 16, type);
 > +		return buf;
 > +	}
 > +	return 0;
 > +}
 > +
 > +
 > +
 >  /*---------------------------------------------------------
 >  **
 >  **	Devices to ignore
 > 
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 > 
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-bugs" in the body of the message
 > 
 
 --
 n_hibma@webweaving.org
 n_hibma@freebsd.org                                          USB project
 http://www.etla.net/~n_hibma/
 
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003181620.IAA60111>