Use NetBSD PCI ID DB

Change-Id: I3fcbce5983b4e0b45e6cc8fac076947c6a84928d
This commit is contained in:
Lionel Sambuc 2014-10-16 14:23:30 +02:00
parent 7eb99bda90
commit 3641562f44
5 changed files with 79 additions and 419 deletions

View file

@ -1,7 +1,14 @@
.include <bsd.own.mk>
# Makefile for PCI support # Makefile for PCI support
PROG= pci PROG= pci
SRCS= main.c pci.c pci_table.c SRCS= main.c pci.c pci_table.c
# Directly taken from sys/dev/pci
.PATH.c: ${NETBSDSRCDIR}/sys/dev/pci
SRCS+= pci_verbose.c pci_subr.c
CPPFLAGS.pci_subr.c+= -D_PCI_SERVER
DPADD+= ${LIBSYS} ${LIBTIMERS} DPADD+= ${LIBSYS} ${LIBTIMERS}
LDADD+= -lsys -ltimers LDADD+= -lsys -ltimers

View file

@ -20,6 +20,7 @@ Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl>
#include <machine/pci_via.h> #include <machine/pci_via.h>
#include <machine/vmparam.h> #include <machine/vmparam.h>
#include <pci.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -452,51 +453,14 @@ get_freebus(void)
static const char * static const char *
pci_vid_name(u16_t vid) pci_vid_name(u16_t vid)
{ {
int i; const char *name = pci_findvendor_real(vid);
if (NULL == name)
for (i= 0; pci_vendor_table[i].name; i++) return "unknown";
{ else
if (pci_vendor_table[i].vid == vid) return name;
return pci_vendor_table[i].name;
}
return "unknown";
} }
static const char *
pci_baseclass_name(u8_t baseclass)
{
int i;
for (i= 0; pci_baseclass_table[i].name; i++)
{
if (pci_baseclass_table[i].baseclass == baseclass)
return pci_baseclass_table[i].name;
}
return NULL;
}
static const char *
pci_subclass_name(u8_t baseclass, u8_t subclass, u8_t infclass)
{
int i;
for (i= 0; pci_subclass_table[i].name; i++)
{
if (pci_subclass_table[i].baseclass != baseclass)
continue;
if (pci_subclass_table[i].subclass != subclass)
continue;
if (pci_subclass_table[i].infclass != infclass &&
pci_subclass_table[i].infclass != (u16_t)-1)
{
continue;
}
return pci_subclass_table[i].name;
}
return NULL;
}
static void static void
print_hyper_cap(int devind, u8_t capptr) print_hyper_cap(int devind, u8_t capptr)
{ {
@ -1660,9 +1624,9 @@ probe_bus(int busind)
baseclass= __pci_attr_r8(devind, PCI_BCR); baseclass= __pci_attr_r8(devind, PCI_BCR);
subclass= __pci_attr_r8(devind, PCI_SCR); subclass= __pci_attr_r8(devind, PCI_SCR);
infclass= __pci_attr_r8(devind, PCI_PIFR); infclass= __pci_attr_r8(devind, PCI_PIFR);
s= pci_subclass_name(baseclass, subclass, infclass); s= pci_subclass_name(baseclass << 24 | subclass << 16);
if (!s) if (!s)
s= pci_baseclass_name(baseclass); s= pci_baseclass_name(baseclass << 24);
{ {
if (!s) if (!s)
s= "(unknown class)"; s= "(unknown class)";
@ -1858,7 +1822,7 @@ acpi_map_bridge(unsigned int pbnr, unsigned int dev, unsigned int sbnr)
static void static void
do_pcibridge(int busind) do_pcibridge(int busind)
{ {
int i, devind, busnr; int devind, busnr;
int ind, type; int ind, type;
u16_t vid, did; u16_t vid, did;
u8_t sbusn, baseclass, subclass, infclass, headt; u8_t sbusn, baseclass, subclass, infclass, headt;
@ -1868,12 +1832,6 @@ do_pcibridge(int busind)
busnr= pcibus[busind].pb_busnr; busnr= pcibus[busind].pb_busnr;
for (devind= 0; devind< nr_pcidev; devind++) for (devind= 0; devind< nr_pcidev; devind++)
{ {
#if 0
printf("do_pcibridge: trying %u.%u.%u\n",
pcidev[devind].pd_busnr, pcidev[devind].pd_dev,
pcidev[devind].pd_func);
#endif
if (pcidev[devind].pd_busnr != busnr) if (pcidev[devind].pd_busnr != busnr)
{ {
#if 0 #if 0
@ -1884,16 +1842,8 @@ do_pcibridge(int busind)
vid= pcidev[devind].pd_vid; vid= pcidev[devind].pd_vid;
did= pcidev[devind].pd_did; did= pcidev[devind].pd_did;
for (i= 0; pci_pcibridge[i].vid != 0; i++) /* LSC: The table is empty, so always true...
{ if (pci_pcibridge[i].vid == 0) */
if (pci_pcibridge[i].vid != vid)
continue;
if (pci_pcibridge[i].did != did)
continue;
break;
}
type= pci_pcibridge[i].type;
if (pci_pcibridge[i].vid == 0)
{ {
headt= __pci_attr_r8(devind, PCI_HEADT); headt= __pci_attr_r8(devind, PCI_HEADT);
type= 0; type= 0;
@ -2031,26 +1981,8 @@ pci_intel_init()
if (OK != (s=sys_outl(PCII_CONFADD, PCII_UNSEL))) if (OK != (s=sys_outl(PCII_CONFADD, PCII_UNSEL)))
printf("PCI: warning, sys_outl failed: %d\n", s); printf("PCI: warning, sys_outl failed: %d\n", s);
#if 0
if (vid == 0xffff && did == 0xffff) if (vid == 0xffff && did == 0xffff)
return; /* Nothing here */ return; /* Nothing here */
for (i= 0; pci_intel_ctrl[i].vid; i++)
{
if (pci_intel_ctrl[i].vid == vid &&
pci_intel_ctrl[i].did == did)
{
break;
}
}
if (!pci_intel_ctrl[i].vid)
{
printf("pci_intel_init (warning): unknown PCI-controller:\n"
"\tvendor %04X (%s), device %04X\n",
vid, pci_vid_name(vid), did);
}
#endif
if (nr_pcibus >= NR_PCIBUS) if (nr_pcibus >= NR_PCIBUS)
panic("too many PCI busses: %d", nr_pcibus); panic("too many PCI busses: %d", nr_pcibus);
@ -2521,17 +2453,8 @@ _pci_slot_name(int devind, char **cpp)
const char * const char *
_pci_dev_name(u16_t vid, u16_t did) _pci_dev_name(u16_t vid, u16_t did)
{ {
int i;
for (i= 0; pci_device_table[i].name; i++) return pci_findproduct_real(did << 16 | vid);
{
if (pci_device_table[i].vid == vid &&
pci_device_table[i].did == did)
{
return pci_device_table[i].name;
}
}
return NULL;
} }
/*===========================================================================* /*===========================================================================*

View file

@ -4,33 +4,6 @@ pci.h
Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl> Created: Jan 2000 by Philip Homburg <philip@cs.vu.nl>
*/ */
struct pci_vendor
{
u16_t vid;
const char *name;
};
struct pci_device
{
u16_t vid;
u16_t did;
const char *name;
};
struct pci_baseclass
{
u8_t baseclass;
const char *name;
};
struct pci_subclass
{
u8_t baseclass;
u8_t subclass;
u16_t infclass;
const char *name;
};
struct pci_intel_ctrl struct pci_intel_ctrl
{ {
u16_t vid; u16_t vid;
@ -72,15 +45,7 @@ struct pci_acl
extern int debug; extern int debug;
extern struct pci_vendor pci_vendor_table[];
extern struct pci_device pci_device_table[];
extern struct pci_baseclass pci_baseclass_table[];
extern struct pci_subclass pci_subclass_table[];
#if 0
extern struct pci_intel_ctrl pci_intel_ctrl[];
#endif
extern struct pci_isabridge pci_isabridge[]; extern struct pci_isabridge pci_isabridge[];
extern struct pci_pcibridge pci_pcibridge[];
extern struct pci_acl pci_acl[NR_DRIVERS]; extern struct pci_acl pci_acl[NR_DRIVERS];
/* Function prototypes. */ /* Function prototypes. */
@ -114,3 +79,8 @@ int _pci_attr_r32(int devind, int port, u32_t *vp);
int _pci_attr_w8(int devind, int port, u8_t value); int _pci_attr_w8(int devind, int port, u8_t value);
int _pci_attr_w16(int devind, int port, u16_t value); int _pci_attr_w16(int devind, int port, u16_t value);
int _pci_attr_w32(int devind, int port, u32_t value); int _pci_attr_w32(int devind, int port, u32_t value);
/* minix hooks into NetBSD PCI IDS DB */
typedef uint32_t pcireg_t;
const char *pci_baseclass_name(pcireg_t reg);
const char *pci_subclass_name(pcireg_t reg);

View file

@ -18,280 +18,6 @@ See the Linux PCI ID Repository <http://pciids.sourceforge.net/>.
#include "pci.h" #include "pci.h"
struct pci_vendor pci_vendor_table[]=
{
{ 0x1000, "NCR" },
{ 0x1002, "ATI Technologies" },
{ 0x100B, "National Semiconductor Corporation" },
{ 0x1013, "Cirrus Logic" },
{ 0x1022, "Advanced Micro Devices" },
{ 0x102B, "Matrox Graphics, Inc." },
{ 0x1039, "Silicon Integrated Systems (SiS)" },
{ 0x104C, "Texas Instruments" },
{ 0x105A, "Promise Technology" },
{ 0x10B7, "3Com Corporation" },
{ 0x10B9, "AcerLabs (ALI)" },
{ 0x10C8, "Neomagic Corporation" },
{ 0x10DE, "nVidia Corporation" },
{ 0x10EC, "Realtek" },
{ 0x1106, "VIA" },
{ 0x110A, "Siemens Nixdorf AG" },
{ 0x1186, "D-Link" },
{ 0x125D, "ESS Technology" },
{ 0x1259, "Allied Telesyn International" },
{ 0x1274, "Ensoniq" },
{ 0x1385, "Netgear" },
{ 0x16ec, "US Robotics" },
{ 0x1737, "Linksys" },
{ 0x1969, "Atheros Communications" },
{ 0x1af4, "Red Hat" },
{ 0x5333, "S3" },
{ 0x8086, "Intel" },
{ 0x80ee, "Oracle" },
{ 0x9004, "Adaptec" },
{ 0x9005, "Adaptec" },
{ 0x0000, NULL }
};
struct pci_device pci_device_table[]=
{
{ 0x1000, 0x0001, "NCR 53C810" },
{ 0x1000, 0x000F, "NCR 53C875" },
{ 0x1002, 0x4752, "ATI Rage XL PCI" },
{ 0x100B, 0xD001, "Nat. Semi. 87410" },
{ 0x1013, 0x00B8, "Cirrus Logic GD 5446" },
{ 0x1013, 0x6003, "Cirrus Logic CS4614/22/24 CrystalClear" },
{ 0x1022, 0x1100, "K8 HyperTransport Tech. Conf." },
{ 0x1022, 0x1101, "K8 [Athlon64/Opteron] Address Map" },
{ 0x1022, 0x1102, "K8 [Athlon64/Opteron] DRAM Controller" },
{ 0x1022, 0x1103, "K8 [Athlon64/Opteron] Misc. Control" },
{ 0x1022, 0x2000, "AMD Lance/PCI" },
{ 0x1022, 0x700C, "AMD-762 CPU to PCI Bridge (SMP chipset)" },
{ 0x1022, 0x700D, "AMD-762 CPU to PCI Bridge (AGP 4x)" },
{ 0x1022, 0x7410, "AMD-766 PCI to ISA/LPC Bridge" },
{ 0x1022, 0x7411, "AMD-766 EIDE Controller" },
{ 0x102B, 0x051B, "Matrox MGA 2164W [Millennium II]" },
{ 0x102B, 0x0525, "Matrox MGA G400 AGP" },
{ 0x1039, 0x0008, "SiS 85C503/5513" },
{ 0x1039, 0x0200, "SiS 5597/5598 VGA" },
{ 0x1039, 0x0406, "SiS 85C501/2" },
{ 0x1039, 0x5597, "SiS 5582" },
{ 0x104C, 0xAC1C, "TI PCI1225" },
{ 0x105A, 0x0D30, "Promise Technology 20265" },
{ 0x10B7, 0x9058, "3Com 3c905B-Combo" },
{ 0x10B7, 0x9805, "3Com 3c980-TX Python-T" },
{ 0x10B9, 0x1533, "ALI M1533 ISA-bridge [Aladdin IV]" },
{ 0x10B9, 0x1541, "ALI M1541" },
{ 0x10B9, 0x5229, "ALI M5229 (IDE)" },
{ 0x10B9, 0x5243, "ALI M5243" },
{ 0x10B9, 0x7101, "ALI M7101 PMU" },
{ 0x10C8, 0x0005, "Neomagic NM2200 Magic Graph 256AV" },
{ 0x10C8, 0x8005, "Neomagic NM2200 Magic Graph 256AV Audio" },
{ 0x10DE, 0x0020, "nVidia Riva TnT [NV04]" },
{ 0x10DE, 0x0110, "nVidia GeForce2 MX [NV11]" },
{ 0x10EC, 0x8029, "Realtek RTL8029" },
{ 0x10EC, 0x8129, "Realtek RTL8129" },
{ 0x10EC, 0x8136, "Realtek RTL8101E Family" },
{ 0x10EC, 0x8139, "Realtek RTL8139" },
{ 0x10EC, 0x8167, "Realtek RTL8169/8110 Family Gigabit NIC" },
{ 0x10EC, 0x8169, "Realtek RTL8169" },
{ 0x1106, 0x0305, "VIA VT8363/8365 [KT133/KM133]" },
{ 0x1106, 0x0571, "VIA IDE controller" },
{ 0x1106, 0x0686, "VIA VT82C686 (Apollo South Bridge)" },
{ 0x1106, 0x1204, "K8M800 Host Bridge" },
{ 0x1106, 0x2204, "K8M800 Host Bridge" },
{ 0x1106, 0x3038, "VT83C572 PCI USB Controller" },
{ 0x1106, 0x3057, "VT82C686A ACPI Power Management Controller" },
{ 0x1106, 0x3058, "VIA AC97 Audio Controller" },
{ 0x1106, 0x3059, "VIA AC97 Audio Controller" },
{ 0x1106, 0x3065, "VT6102 [Rhine-II]" },
{ 0x1106, 0x3074, "VIA VT8233" },
{ 0x1106, 0x3099, "VIA VT8367 [KT266]" },
{ 0x1106, 0x3104, "VIA USB 2.0" },
{ 0x1106, 0x3108, "VIA S3 Unichrome Pro VGA Adapter" },
{ 0x1106, 0x3149, "VIA VT6420 SATA RAID Controller" },
{ 0x1106, 0x3204, "K8M800 Host Bridge" },
{ 0x1106, 0x3227, "VT8237 ISA bridge" },
{ 0x1106, 0x4204, "K8M800 Host Bridge" },
{ 0x1106, 0x8305, "VIA VT8365 [KM133 AGP]" },
{ 0x1106, 0xB099, "VIA VT8367 [KT266 AGP]" },
{ 0x1106, 0xB188, "VT8237 PCI bridge" },
{ 0x110A, 0x0005, "Siemens Nixdorf Tulip Cntlr., Power Management" },
{ 0x1186, 0x1300, "D-Link RTL8139" },
{ 0x1186, 0x4300, "D-Link Gigabit adapter" },
{ 0x1259, 0xc107, "Allied Telesyn International Gigabit Ethernet Adapter" },
{ 0x125D, 0x1969, "ESS ES1969 Solo-1 Audiodrive" },
{ 0x1274, 0x1371, "Ensoniq ES1371 [AudioPCI-97]" },
{ 0x1274, 0x5000, "Ensoniq ES1370" },
{ 0x1274, 0x5880, "Ensoniq CT5880 [AudioPCI]" },
{ 0x1385, 0x8169, "Netgear Gigabit Ethernet Adapter" },
{ 0x16ec, 0x0116, "US Robotics Realtek 8169S chip" },
{ 0x1737, 0x1032, "Linksys Instant Gigabit Desktop Network Interface" },
{ 0x1969, 0x2048, "Atheros L2 Fast Ethernet Controller" },
{ 0x1af4, 0x1000, "Virtio network device" },
{ 0x1af4, 0x1001, "Virtio block device" },
{ 0x1af4, 0x1002, "Virtio memory balloon" },
{ 0x1af4, 0x1003, "Virtio console" },
{ 0x5333, 0x8811, "S3 86c764/765 [Trio32/64/64V+]" },
{ 0x5333, 0x883d, "S3 Virge/VX" },
{ 0x5333, 0x88d0, "S3 Vision 964 vers 0" },
{ 0x5333, 0x8a01, "S3 Virge/DX or /GX" },
{ 0x8086, 0x1004, "Intel 82543GC Gigabit Ethernet Controller" },
{ 0x8086, 0x100E, "Intel PRO/1000 MT Desktop Adapter" },
{ 0x8086, 0x100F, "Intel PRO/1000 MT 82545EM" },
{ 0x8086, 0x1029, "Intel EtherExpressPro100 ID1029" },
{ 0x8086, 0x1030, "Intel Corporation 82559 InBusiness 10/100" },
{ 0x8086, 0x1031, "Intel Corporation 82801CAM PRO/100 VE" },
{ 0x8086, 0x1032, "Intel Corporation 82801CAM PRO/100 VE" },
{ 0x8086, 0x103d, "Intel Corporation 82801DB PRO/100 VE (MOB)" },
{ 0x8086, 0x1064, "Intel Corporation 82562 PRO/100 VE" },
{ 0x8086, 0x107C, "Intel PRO/1000 GT Desktop Adapter" },
{ 0x8086, 0x10CD, "Intel PRO/1000 Gigabit Network Connection" },
{ 0x8086, 0x10D3, "Intel 82574L Gigabit Network Connection" },
{ 0x8086, 0x105E, "Intel 82571EB Gigabit Ethernet Controller" },
{ 0x8086, 0x1209, "Intel EtherExpressPro100 82559ER" },
{ 0x8086, 0x1229, "Intel EtherExpressPro100 82557/8/9" },
{ 0x8086, 0x122D, "Intel 82437FX" },
{ 0x8086, 0x122E, "Intel 82371FB (PIIX)" },
{ 0x8086, 0x1230, "Intel 82371FB (IDE)" },
{ 0x8086, 0x1237, "Intel 82441FX (440FX)" },
{ 0x8086, 0x1250, "Intel 82439HX" },
{ 0x8086, 0x1A30, "Intel 82845B/A MCH" },
{ 0x8086, 0x1A31, "Intel 82845B/A PCI Bridge to AGP port" },
{ 0x8086, 0x2440, "Intel 82801B PCI to ISA bridge" },
{ 0x8086, 0x2449, "Intel EtherExpressPro100 82562EM" },
{ 0x8086, 0x244e, "Intel 82801 PCI Bridge" },
{ 0x8086, 0x2560, "Intel 82845G/GL[Brookdale-G]/GE/PE" },
{ 0x8086, 0x2561, "Intel 82845G/GL/GE/PE Host-to-AGP Bridge" },
{ 0x8086, 0x7000, "Intel 82371SB" },
{ 0x8086, 0x7010, "Intel 82371SB (IDE)" },
{ 0x8086, 0x7020, "Intel 82371SB (USB)" },
{ 0x8086, 0x7030, "Intel 82437VX" }, /* asw 2005-03-02 */
{ 0x8086, 0x7100, "Intel 82371AB" }, /* asw 2004-07-31 */
{ 0x8086, 0x7100, "Intel 82371AB" },
{ 0x8086, 0x7110, "Intel 82371AB (PIIX4)" },
{ 0x8086, 0x7111, "Intel 82371AB (IDE)" },
{ 0x8086, 0x7112, "Intel 82371AB (USB)" },
{ 0x8086, 0x7113, "Intel 82371AB (Power)" },
{ 0x8086, 0x7124, "Intel 82801AA" }, /* asw 2004-11-09 */
{ 0x8086, 0x7190, "Intel 82443BX" },
{ 0x8086, 0x7191, "Intel 82443BX (AGP bridge)" },
{ 0x8086, 0x7192, "Intel 82443BX (Host-to-PCI bridge)" },
{ 0x80ee, 0xcafe, "Oracle VirtualBox backdoor device" },
{ 0x9004, 0x8178, "Adaptec AHA-2940U/2940UW Ultra/Ultra-Wide SCSI Ctrlr" },
{ 0x9005, 0x0080, "Adaptec AIC-7892A Ultra160/m PCI SCSI Controller" },
{ 0x0000, 0x0000, NULL }
};
struct pci_baseclass pci_baseclass_table[]=
{
{ 0x00, "No device class" },
{ 0x01, "Mass storage controller" },
{ 0x02, "Network controller" },
{ 0x03, "Display controller" },
{ 0x04, "Multimedia device" },
{ 0x05, "Memory controller" },
{ 0x06, "Bridge device" },
{ 0x07, "Simple comm. controller" },
{ 0x08, "Base system peripheral" },
{ 0x09, "Input device" },
{ 0x0A, "Docking station" },
{ 0x0B, "Processor" },
{ 0x0C, "Serial bus controller" },
{ 0x0d, "Wireless controller" },
{ 0x0e, "Intelligent I/O controller" },
{ 0x0f, "Satellite comm. controller" },
{ 0x10, "Encryption/decryption controller" },
{ 0x11, "Data acquisition controller" },
{ 0xff, "Misc. device" },
{ 0x00, NULL }
};
/* -1 in the infclass field is a wildcard for infclass */
struct pci_subclass pci_subclass_table[]=
{
{ 0x00, 0x01, 0x00, "VGA-compatible device" },
{ 0x01, 0x00, 0x00, "SCSI bus controller" },
{ 0x01, 0x01, -1, "IDE controller" },
{ 0x01, 0x02, 0x00, "Floppy disk controller" },
{ 0x01, 0x03, 0x00, "IPI controller" },
{ 0x01, 0x04, 0x00, "RAID controller" },
{ 0x01, 0x06, 0x01, "AHCI controller" },
{ 0x01, 0x80, 0x00, "Other mass storage controller" },
{ 0x02, 0x00, 0x00, "Ethernet controller" },
{ 0x02, 0x01, 0x00, "Token Ring controller" },
{ 0x02, 0x02, 0x00, "FDDI controller" },
{ 0x02, 0x03, 0x00, "ATM controller" },
{ 0x02, 0x04, 0x00, "ISDN controller" },
{ 0x02, 0x80, 0x00, "Other network controller" },
{ 0x03, 0x00, 0x00, "VGA-compatible controller" },
{ 0x03, 0x00, 0x01, "8514-compatible controller" },
{ 0x03, 0x01, 0x00, "XGA controller" },
{ 0x03, 0x02, 0x00, "3D controller" },
{ 0x03, 0x80, 0x00, "Other display controller" },
{ 0x04, 0x00, 0x00, "Video device" },
{ 0x04, 0x01, 0x00, "Audio device" },
{ 0x04, 0x02, 0x00, "Computer telephony device" },
{ 0x04, 0x80, 0x00, "Other multimedia device" },
{ 0x06, 0x00, 0x00, "Host bridge" },
{ 0x06, 0x01, 0x00, "ISA bridge" },
{ 0x06, 0x02, 0x00, "EISA bridge" },
{ 0x06, 0x03, 0x00, "MCA bridge" },
{ 0x06, 0x04, 0x00, "PCI-to-PCI bridge" },
{ 0x06, 0x04, 0x01, "Subtractive decode PCI-to-PCI bridge" },
{ 0x06, 0x05, 0x00, "PCMCIA bridge" },
{ 0x06, 0x06, 0x00, "NuBus bridge" },
{ 0x06, 0x07, 0x00, "CardBus bridge" },
{ 0x06, 0x08, -1, "RACEway bridge" },
{ 0x06, 0x09, -1, "Semi-transparent PCI-to-PCI bridge" },
{ 0x06, 0x80, 0x00, "Other bridge device" },
{ 0x0C, 0x00, 0x00, "IEEE 1394 (FireWire)" },
{ 0x0C, 0x00, 0x10, "IEEE 1394 (OpenHCI)" },
{ 0x0C, 0x01, 0x00, "ACCESS bus" },
{ 0x0C, 0x02, 0x00, "SSA" },
{ 0x0C, 0x03, 0x00, "USB (with UHC)" },
{ 0x0C, 0x03, 0x10, "USB (with OHC)" },
{ 0x0C, 0x03, 0x80, "USB (other host inf.)" },
{ 0x0C, 0x03, 0xFE, "USB device" },
{ 0x0C, 0x04, 0x00, "Fibre Channel" },
{ 0x0C, 0x05, 0x00, "SMBus" },
{ 0x00, 0x00, 0x00, NULL }
};
#if 0
struct pci_intel_ctrl pci_intel_ctrl[]=
{
{ 0x1022, 0x700C, }, /* AMD-762 */
{ 0x1039, 0x0406, }, /* SiS 85C501/2 */
{ 0x1039, 0x5597, }, /* SiS 5582 */
{ 0x10B9, 0x1541, }, /* ALI M1541 */
{ 0x1106, 0x0305, }, /* VIA VT8363/8365 */
{ 0x1106, 0x3099, }, /* VIA VT8367 [KT266] */
{ 0x1106, 0x3188, }, /* VIA */
{ 0x1106, 0x0282, }, /* VIA */
{ 0x1106, 0x0204, }, /* VIA VT8367 [KT266] */
{ 0x8086, 0x122D, }, /* Intel 82437FX */
{ 0x8086, 0x1237, }, /* Intel 82441FX */
{ 0x8086, 0x1250, }, /* Intel 82439HX */
{ 0x8086, 0x1A30, }, /* Intel 82845 MCH */
{ 0x8086, 0x2560, }, /* Intel 82845G/GL[Brookdale-G]/GE/PE */
{ 0x8086, 0x7030, }, /* Intel 82437VX (asw 2005-03-02) */
{ 0x8086, 0x7100, }, /* Intel 82371AB (asw 2004-07-31) */
{ 0x8086, 0x7124, }, /* Intel 82801AA (asw 2004-11-09) */
{ 0x8086, 0x7190, }, /* Intel 82443BX - AGP enabled */
{ 0x8086, 0x7192, }, /* Intel 82443BX - AGP disabled */
{ 0x0000, 0x0000, },
};
#endif
struct pci_isabridge pci_isabridge[]= struct pci_isabridge pci_isabridge[]=
{ {
{ 0x1022, 0x7410, 1, PCI_IB_AMD, }, /* AMD-766 */ { 0x1022, 0x7410, 1, PCI_IB_AMD, }, /* AMD-766 */
@ -309,23 +35,3 @@ struct pci_isabridge pci_isabridge[]=
{ 0x8086, 0x7124, 1, PCI_IB_PIIX, }, /* Intel 82801AA (asw 2004-11-09) */ { 0x8086, 0x7124, 1, PCI_IB_PIIX, }, /* Intel 82801AA (asw 2004-11-09) */
{ 0x0000, 0x0000, 0, 0, }, { 0x0000, 0x0000, 0, 0, },
}; };
struct pci_pcibridge pci_pcibridge[]=
{
#if 0
{ 0x8086, 0x1A31, PCI_PCIB_INTEL, }, /* Intel 82845B/A AGP Bridge */
{ 0x8086, 0x2448, PCI_PCIB_INTEL, }, /* Intel 82801 Mobile */
{ 0x8086, 0x244e, PCI_PCIB_INTEL, }, /* Intel 82801 PCI Bridge */
{ 0x8086, 0x2561, PCI_PCIB_INTEL, }, /* Intel 82845 AGP Bridge */
{ 0x8086, 0x7191, PCI_PCIB_INTEL, }, /* Intel 82443BX (AGP bridge) */
{ 0x1022, 0x700D, PCI_PCIB_INTEL, }, /* AMD-762 (AGP 4x) */
{ 0x10B9, 0x5243, PCI_PCIB_INTEL, }, /* ALI M5243 */
{ 0x1106, 0x8305, PCI_AGPB_VIA, }, /* VIA VT8365 [KM133 AGP] */
{ 0x1106, 0xB188, PCI_AGPB_VIA, }, /* VT8237 PCI bridge */
#endif
{ 0x0000, 0x0000, 0, },
};
/*
* $PchId: pci_table.c,v 1.7 2003/09/05 10:53:22 philip Exp $
*/

View file

@ -32,6 +32,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined(__minix) && defined(_PCI_SERVER)
/* This is a quick hack, simple copy of the file, until we can use it as is. */
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <pci.h>
#include <dev/pci/pcireg.h>
const char *pci_baseclass_name(pcireg_t reg);
const char *pci_subclass_name(pcireg_t reg);
#else
/* /*
* PCI autoconfiguration support functions. * PCI autoconfiguration support functions.
* *
@ -62,6 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.106 2013/08/05 07:53:31 msaitoh Exp $
#ifdef _KERNEL #ifdef _KERNEL
#include <dev/pci/pcivar.h> #include <dev/pci/pcivar.h>
#endif #endif
#endif /* defined(__minix) && defined(_PCI_SERVER) */
/* /*
* Descriptions of known PCI classes and subclasses. * Descriptions of known PCI classes and subclasses.
@ -295,6 +310,44 @@ static const struct pci_class pci_class[] = {
NULL, }, NULL, },
}; };
#if defined(__minix) && defined(_PCI_SERVER)
const char *
pci_baseclass_name(pcireg_t reg)
{
const struct pci_class *classp = pci_class;
while (classp->name != NULL) {
if (PCI_CLASS(reg) == classp->val)
break;
classp++;
}
return classp->name;
}
const char *
pci_subclass_name(pcireg_t reg)
{
const struct pci_class *classp = pci_class;
const struct pci_class *subclassp;
while (classp->name != NULL) {
if (PCI_CLASS(reg) == classp->val)
break;
classp++;
}
subclassp = (classp->name != NULL) ? classp->subclasses : NULL;
while (subclassp && subclassp->name != NULL) {
if (PCI_SUBCLASS(reg) == subclassp->val)
break;
subclassp++;
}
return subclassp->name;
}
#else
void pci_load_verbose(void); void pci_load_verbose(void);
#if defined(_KERNEL) #if defined(_KERNEL)
@ -1980,3 +2033,4 @@ pci_conf_print(
printf("\n"); printf("\n");
#endif /* _KERNEL */ #endif /* _KERNEL */
} }
#endif /* defined(__minix) && defined(_PCI_SERVER) */