From owner-freebsd-bugs Fri Mar 17 19:30: 8 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 0556337BAE2 for ; Fri, 17 Mar 2000 19:30:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id TAA36497; Fri, 17 Mar 2000 19:30:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from breton.uol.com.br (breton.uol.com.br [200.230.198.74]) by hub.freebsd.org (Postfix) with ESMTP id 7650D37BA06 for ; Fri, 17 Mar 2000 19:28:30 -0800 (PST) (envelope-from lioux-alias-ppp-FreeBSD-gnats-submit=freebsd.org@uol.com.br) Received: from 200-191-159-101-as.acessonet.com.br (200-191-159-101-as.acessonet.com.br [200.191.159.101]) by breton.uol.com.br (8.9.1/8.9.1) with ESMTP id AAA23565 for ; Sat, 18 Mar 2000 00:28:20 -0300 (BRT) Received: (qmail 2321 invoked by uid 1001); 18 Mar 2000 03:27:50 -0000 Message-Id: <20000318032750.2320.qmail@Fedaykin.here> Date: 18 Mar 2000 03:27:50 -0000 From: lioux@uol.com.br Reply-To: lioux@uol.com.br To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/17453: Added sys/pci/ device identification for Aureal Sound Cards Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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