Bug 17453

Summary: Added sys/pci/ device identification for Aureal Sound Cards
Product: Base System Reporter: lioux <lioux>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description lioux 2000-03-18 03:30:01 UTC
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
Comment 1 n_hibma 2000-03-18 16:11:31 UTC
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/
Comment 2 lioux 2000-04-11 04:31:38 UTC
I would like this PR to be close. I had a little chat with the DEV wiz and I
this PR is no longer necessary. :)

--
Thanks mferreira
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-04-11 14:02:42 UTC
State Changed
From-To: open->closed

Closed as per originator's request.