diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/Config.in | 7 | ||||
-rw-r--r-- | drivers/pci/Makefile | 6 | ||||
-rw-r--r-- | drivers/pci/compat.c | 2 | ||||
-rw-r--r-- | drivers/pci/gen-devlist.c | 80 | ||||
-rw-r--r-- | drivers/pci/helper.c | 1 | ||||
-rw-r--r-- | drivers/pci/names.c | 49 | ||||
-rw-r--r-- | drivers/pci/pci.c | 11 | ||||
-rw-r--r-- | drivers/pci/pci.ids | 67 | ||||
-rw-r--r-- | drivers/pci/proc.c | 123 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 2 | ||||
-rw-r--r-- | drivers/pci/setup.c | 29 | ||||
-rw-r--r-- | drivers/pci/syscall.c | 1 |
12 files changed, 205 insertions, 173 deletions
diff --git a/drivers/pci/Config.in b/drivers/pci/Config.in new file mode 100644 index 000000000..de5406404 --- /dev/null +++ b/drivers/pci/Config.in @@ -0,0 +1,7 @@ +# +# PCI configuration +# + +if [ "$CONFIG_PCI" = "y" ]; then + bool 'PCI device name database' CONFIG_PCI_NAMES +fi diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index 291346193..2502f7124 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile @@ -33,10 +33,10 @@ endif include $(TOPDIR)/Rules.make -names.o: names.c devlist.h +names.o: names.c devlist.h classlist.h -devlist.h: pci.ids gen-devlist - ./gen-devlist <pci.ids >devlist.h +devlist.h classlist.h: pci.ids gen-devlist + ./gen-devlist <pci.ids gen-devlist: gen-devlist.c $(HOSTCC) $(HOSTCFLAGS) -o gen-devlist gen-devlist.c diff --git a/drivers/pci/compat.c b/drivers/pci/compat.c index d38876fd4..1b4cdec02 100644 --- a/drivers/pci/compat.c +++ b/drivers/pci/compat.c @@ -3,7 +3,7 @@ * * PCI Bus Services -- Function For Backward Compatibility * - * Copyright 1998, 1999 Martin Mares <mj@ucw.cz> + * Copyright 1998, 1999 Martin Mares <mj@suse.cz> */ #include <linux/types.h> diff --git a/drivers/pci/gen-devlist.c b/drivers/pci/gen-devlist.c index b9809f744..9337d80b0 100644 --- a/drivers/pci/gen-devlist.c +++ b/drivers/pci/gen-devlist.c @@ -1,20 +1,20 @@ /* - * Generate devlist.h from the PCI ID file. + * Generate devlist.h and classlist.h from the PCI ID file. * - * (c) 1999 Martin Mares <mj@ucw.cz> + * (c) 1999 Martin Mares <mj@suse.cz> */ #include <stdio.h> #include <string.h> static void -pq(char *c) +pq(FILE *f, char *c) { while (*c) { if (*c == '"') - printf("\\\""); + fprintf(f, "\\\""); else - putchar(*c); + fputc(*c, f); c++; } } @@ -24,6 +24,15 @@ main(void) { char line[1024], *c, vend[8]; int vendors = 0; + int mode = 0; + FILE *devf, *clsf; + + devf = fopen("devlist.h", "w"); + clsf = fopen("classlist.h", "w"); + if (!devf || !clsf) { + fprintf(stderr, "Cannot create output file!\n"); + return 1; + } while (fgets(line, sizeof(line)-1, stdin)) { if ((c = strchr(line, '\n'))) @@ -31,36 +40,65 @@ main(void) if (!line[0] || line[0] == '#') continue; if (line[1] == ' ') { - vend[0] = 0; - continue; + if (line[0] == 'C' && strlen(line) > 4 && line[4] == ' ') { + vend[0] = line[2]; + vend[1] = line[3]; + vend[2] = 0; + mode = 2; + } else goto err; } - if (line[0] == '\t') { - if (vend[0] && strlen(line) > 5 && line[5] == ' ') { - c = line + 5; - while (*c == ' ') - *c++ = 0; - printf("\tDEVICE(%s,%s,\"", vend, line+1); - pq(c); - puts("\")"); + else if (line[0] == '\t') { + if (line[1] == '\t') + continue; + switch (mode) { + case 1: + if (strlen(line) > 5 && line[5] == ' ') { + c = line + 5; + while (*c == ' ') + *c++ = 0; + fprintf(devf, "\tDEVICE(%s,%s,\"", vend, line+1); + pq(devf, c); + fputs("\")\n", devf); + } else goto err; + break; + case 2: + if (strlen(line) > 3 && line[3] == ' ') { + c = line + 3; + while (*c == ' ') + *c++ = 0; + fprintf(clsf, "CLASS(%s%s, \"%s\")\n", vend, line+1, c); + } else goto err; + break; + default: + goto err; } } else if (strlen(line) > 4 && line[4] == ' ') { c = line + 4; while (*c == ' ') *c++ = 0; if (vendors) - puts("ENDVENDOR()\n"); + fputs("ENDVENDOR()\n\n", devf); vendors++; strcpy(vend, line); - printf("VENDOR(%s,\"", vend); - pq(c); - puts("\")"); + fprintf(devf, "VENDOR(%s,\"", vend); + pq(devf, c); + fputs("\")\n", devf); + mode = 1; + } else { + err: + fprintf(stderr, "Syntax error in mode %d: %s\n", mode, line); + return 1; } } - puts("ENDVENDOR()\n\ + fputs("ENDVENDOR()\n\ \n\ #undef VENDOR\n\ #undef DEVICE\n\ -#undef ENDVENDOR"); +#undef ENDVENDOR\n", devf); + fputs("\n#undef CLASS", clsf); + + fclose(devf); + fclose(clsf); return 0; } diff --git a/drivers/pci/helper.c b/drivers/pci/helper.c index c6815e3b1..c88481042 100644 --- a/drivers/pci/helper.c +++ b/drivers/pci/helper.c @@ -8,7 +8,6 @@ * */ -#include <linux/config.h> #include <linux/kernel.h> #include <linux/pci.h> diff --git a/drivers/pci/names.c b/drivers/pci/names.c index 81dafad61..9018e8976 100644 --- a/drivers/pci/names.c +++ b/drivers/pci/names.c @@ -1,17 +1,18 @@ /* - * $Id: oldproc.c,v 1.24 1998/10/11 15:13:04 mj Exp $ + * PCI Class and Device Name Tables * - * Backward-compatible procfs interface for PCI. - * - * Copyright 1993, 1994, 1995, 1997 Drew Eckhardt, Frederic Potter, + * Copyright 1993--1999 Drew Eckhardt, Frederic Potter, * David Mosberger-Tang, Martin Mares */ +#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/init.h> +#ifdef CONFIG_PCI_NAMES + struct pci_device_info { unsigned short device; unsigned short seen; @@ -92,3 +93,43 @@ void __init pci_name_device(struct pci_dev *dev) } } } + +/* + * Class names. Not in .init section as they are needed in runtime. + */ + +static u16 pci_class_numbers[] = { +#define CLASS(x,y) 0x##x, +#include "classlist.h" +}; + +static char *pci_class_names[] = { +#define CLASS(x,y) y, +#include "classlist.h" +}; + +char * +pci_class_name(u32 class) +{ + int i; + + for(i=0; i<sizeof(pci_class_numbers)/sizeof(pci_class_numbers[0]); i++) + if (pci_class_numbers[i] == class) + return pci_class_names[i]; + return NULL; +} + +#else + +void __init pci_name_device(struct pci_dev *dev) +{ + sprintf(dev->name, "PCI device %04x:%04x", dev->vendor, dev->device); +} + +char * +pci_class_name(u32 class) +{ + return NULL; +} + +#endif diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7d55ba550..05dc22cd1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -6,7 +6,7 @@ * Copyright 1993 -- 1997 Drew Eckhardt, Frederic Potter, * David Mosberger-Tang * - * Copyright 1997 -- 1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz> + * Copyright 1997 -- 1999 Martin Mares <mj@suse.cz> */ #include <linux/types.h> @@ -437,6 +437,7 @@ static unsigned int __init pci_do_scan_bus(struct pci_bus *bus) dev = dev_cache; memset(dev, 0, sizeof(*dev)); dev->bus = bus; + dev->sysdata = bus->sysdata; dev->devfn = devfn; if (pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type)) @@ -490,13 +491,16 @@ static unsigned int __init pci_do_scan_bus(struct pci_bus *bus) pci_read_config_word(dev, PCI_CB_SUBSYSTEM_ID, &dev->subsystem_device); break; default: /* unknown header */ - bad: printk(KERN_ERR "PCI: device %s has unknown header type %02x, ignoring.\n", dev->slot_name, hdr_type); continue; + bad: + printk(KERN_ERR "PCI: %s: class %x doesn't match header type %02x. Ignoring class.\n", + dev->slot_name, class, hdr_type); + dev->class = PCI_CLASS_NOT_DEFINED; } - DBG("PCI: %02x:%02x [%04x/%04x]\n", bus->number, dev->devfn, dev->vendor, dev->device); + DBG("PCI: %02x:%02x [%04x/%04x] %06x %02x\n", bus->number, dev->devfn, dev->vendor, dev->device, class, hdr_type); /* * Put it into the global PCI device chain. It's used to @@ -556,6 +560,7 @@ static unsigned int __init pci_do_scan_bus(struct pci_bus *bus) child->self = dev; child->parent = bus; child->ops = bus->ops; + child->sysdata = bus->sysdata; /* * Set up the primary, secondary and subordinate diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids index ff224959c..a3480ce43 100644 --- a/drivers/pci/pci.ids +++ b/drivers/pci/pci.ids @@ -4,7 +4,7 @@ # Maintained by Martin Mares <pci-ids@ucw.cz> # If you have any new entries, send them to the maintainer. # -# $Id: pci.ids,v 1.41 1999/10/30 09:25:10 mj Exp $ +# $Id: pci.ids,v 1.43 1999/12/04 12:32:55 mj Exp $ # # Vendors, devices and subsystems. Please keep sorted. @@ -221,6 +221,7 @@ 1113 1207 EN-1207-TX Fast Ethernet 1109 2400 ANA-6944A/TX Fast Ethernet 1186 1100 DFE-500TX Fast Ethernet + 1186 1112 DFE-570TX Fast Ethernet 1282 9100 AEF-380TXD Fast Ethernet 2646 0001 KNE100TX Fast Ethernet 000a 21230 Video Codec @@ -543,14 +544,16 @@ 0406 85C501/2 0496 85C496 0530 530 Host + 0540 540 Host 0597 5513C 0601 85C601 0620 620 Host + 0630 630 Host 0900 SiS900 10/100 Ethernet 3602 83C602 5107 5107 5511 5511/5512 - 5513 5513 + 5513 5513 [IDE] 5517 5517 5571 5571 5591 5591/5592 Host @@ -647,9 +650,12 @@ 1092 0157 FIRE GL 1000 PRO 1097 3d01 Jeronimo Pro 3d3d 0100 Reference Permedia 2 3D - 8000 LYNX FireWire Host Controller + 8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller + e4bf 1010 CF1-1-SNARE + e4bf 1020 CF1-2-SNARE 8009 OHCI Compliant FireWire Controller 8019 TSB12LV23 OHCI Compliant IEEE-1394 Controller + e4bf 1010 CF2-1-CYMBAL a001 TDC1570 a100 TDC1561 ac10 PCI1050 @@ -669,6 +675,7 @@ fe00 FireWire Host Controller fe03 12C01A FireWire Host Controller 104d Sony Corporation + 8039 CXD3222 iLINK Controller 104e Oak Technology, Inc 0017 OTI-64017 0107 OTI-107 [Spitfire] @@ -691,16 +698,17 @@ 1056 ICL # Motorola made a mistake and used this value, please duplicate Moto # entries here -- Cort -1507 Motorola Computer Group +1507 Motorola 0001 MPC105 [Eagle] 0002 MPC106 [Grackle] + 0003 MPC8240 [Kahlua] 0100 MC145575 [HFC-PCI] 0431 KTI829c 100VG 4801 Raven 4802 Falcon 4803 Hawk 4806 CPX8216 -1057 Motorola Computer Group +1057 Motorola 0001 MPC105 [Eagle] 0002 MPC106 [Grackle] 0100 MC145575 [HFC-PCI] @@ -1233,6 +1241,8 @@ 1683 IGA-1683 2000 CyberPro 2000 2010 CyberPro 2000A + 5000 CyberPro 5000 + 5050 CyberPro 5050 10eb Artists Graphics 0101 3GA 8111 Twist3 Frame Grabber @@ -1480,7 +1490,7 @@ 112e Infomedia Microelectronics Inc. 112f Imaging Technology Inc 0000 MVC IC-PCI - 0001 Video frame grabber/processor + 0001 MVC IM-PCI Video frame grabber/processor 1130 Computervision 1131 Philips Semiconductors 7145 SAA7145 @@ -1561,7 +1571,13 @@ 1148 5843 FDDI SK-5843 (SK-NET FDDI-LP64) 1148 5844 FDDI SK-5844 (SK-NET FDDI-LP64 DAS) 4200 Token ring adaptor - 4300 GE + 4300 Gigabit Ethernet + 1148 9821 SK-9821 (1000Base-T single link) + 1148 9822 SK-9822 (1000Base-T dual link) + 1148 9841 SK-9841 (1000Base-LX single link) + 1148 9842 SK-9842 (1000Base-LX dual link) + 1148 9843 SK-9843 (1000Base-SX single link) + 1148 9844 SK-9844 (1000Base-SX dual link) 1149 Win System Corporation 114a VMIC 7587 VMIVME-7587 @@ -2193,6 +2209,7 @@ 1280 Photoscript Group Ltd. 1281 Yokogawa Electric Corporation 1282 Davicom Semiconductor, Inc. + 9102 Ethernet 100/10 MBit 1283 Integrated Technology Express, Inc. 673a IT8330G 8330 IT8330G @@ -2262,6 +2279,7 @@ 12b8 Korg 12b9 US Robotics/3Com 1006 WinModem + 1008 56K FaxModem Model 5610 12ba PMC Sierra 12bb Nippon Unisoft Corporation 12bc Array Microsystems @@ -2277,6 +2295,7 @@ 12c4 Connect Tech Inc 12c5 Picture Elements Incorporated 0081 PCIVST [Grayscale Thresholding Engine] + 0086 THR2 Thresholder 12c6 Mitani Corporation 12c7 Dialogic Corp 12c8 G Force Co, Ltd @@ -2427,22 +2446,40 @@ 131d Sysmic, Inc. 131e Xinex Networks Inc 131f Siig Inc + 1000 CyberSerial (1-port) 16550 + 1001 CyberSerial (1-port) 16650 + 1002 CyberSerial (1-port) 16850 1010 Duet 1S(16550)+1P 1011 Duet 1S(16650)+1P 1012 Duet 1S(16850)+1P 1020 CyberParallel (1-port) 1021 CyberParallel (2-port) + 1030 CyberSerial (2-port) 16550 + 1031 CyberSerial (2-port) 16650 + 1032 CyberSerial (2-port) 16850 1034 Trio 2S(16550)+1P 1035 Trio 2S(16650)+1P 1036 Trio 2S(16850)+1P + 1050 CyberSerial (4-port) 16550 + 1051 CyberSerial (4-port) 16650 + 1052 CyberSerial (4-port) 16850 + 2000 CyberSerial (1-port) 16550 + 2001 CyberSerial (1-port) 16650 + 2002 CyberSerial (1-port) 16850 2010 Duet 1S(16550)+1P 2011 Duet 1S(16650)+1P 2012 Duet 1S(16850)+1P 2020 CyberParallel (1-port) 2021 CyberParallel (2-port) + 2030 CyberSerial (2-port) 16550 + 2031 CyberSerial (2-port) 16650 + 2032 CyberSerial (2-port) 16850 2040 Trio 1S(16550)+2P 2041 Trio 1S(16650)+2P 2042 Trio 1S(16850)+2P + 2050 CyberSerial (4-port) 16550 + 2051 CyberSerial (4-port) 16650 + 2052 CyberSerial (4-port) 16850 2060 Trio 2S(16550)+1P 2061 Trio 2S(16650)+1P 2062 Trio 2S(16850)+1P @@ -2563,7 +2600,9 @@ 1395 Ambicom Inc 1396 Cipher Systems Inc 1397 Cologne Chip Designs GmbH - 2bd0 ISDN network controller + 2bd0 ISDN network controller [HFC-PCI] + 1397 2bd0 ISDN Board + e4bf 1000 CI1-1-Harp 1398 Clarion co. Ltd 1399 Rios systems Co Ltd 139a Alacritech Inc @@ -2696,6 +2735,7 @@ 1410 Midas lab Inc 1411 Ikos Systems Inc 1412 IC Ensemble Inc + 1712 ICE1712 [Envy24] 1413 Addonics 1414 Microsoft Corporation 1415 Oxford Semiconductor Ltd @@ -2960,7 +3000,10 @@ 1517 ECHOTEK Corp 1518 PEP MODULAR Computers GmbH 1519 TELEFON AKTIEBOLAGET LM Ericsson -151a GLOBETEK Inc +151a Globetek + 1002 PCI-1002 + 1004 PCI-1004 + 1008 PCI-1008 151b COMBOX Ltd 151c DIGITAL AUDIO LABS Inc 151d Fujitsu Computer Products Of America @@ -3301,6 +3344,11 @@ 103c 10C7 MegaRaid T5 1111 1111 MegaRaid 466 113c 03A2 MegaRaid + 2410 82801 82810 Chipset ISA Bridge (LPC) + 2411 82801 82810 Chipset IDE + 2412 82801 82810 Chipset USB + 2413 82801 82810 Chipset SMBus + 2418 82801 82810 PCI Bridge 5200 EtherExpress PRO/100 5201 EtherExpress PRO/100 7000 82371SB PIIX3 ISA [Natoma/Triton II] @@ -3476,6 +3524,7 @@ e159 Tiger Jet Network Inc. 0001 Model 300 128k 0059 0001 128k ISDN-S/T Adapter 0059 0003 128k ISDN-U Adapter +e4bf EKF Elektronik GmbH eabb Aashima Technology B.V. ecc0 Echo Corporation edd8 ARK Logic Inc diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 4688e82fb..56ca2b46a 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -3,7 +3,7 @@ * * Procfs interface for the PCI bus. * - * Copyright (c) 1997, 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz> + * Copyright (c) 1997--1999 Martin Mares <mj@suse.cz> */ #include <linux/types.h> @@ -207,25 +207,6 @@ static struct file_operations proc_bus_pci_operations = { static struct inode_operations proc_bus_pci_inode_operations = { &proc_bus_pci_operations, /* default base directory file-ops */ - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* mknod */ - NULL, /* rename */ - NULL, /* readlink */ - NULL, /* follow_link */ - NULL, /* get_block */ - NULL, /* readpage */ - NULL, /* writepage */ - NULL, /* flushpage */ - NULL, /* truncate */ - NULL, /* permission */ - NULL, /* smap */ - NULL /* revalidate */ }; #if BITS_PER_LONG == 32 @@ -234,8 +215,8 @@ static struct inode_operations proc_bus_pci_inode_operations = { #define LONG_FORMAT "\t%16lx" #endif -int -get_pci_dev_info(char *buf, char **start, off_t pos, int count, int wr) +static int +get_pci_dev_info(char *buf, char **start, off_t pos, int count) { struct pci_dev *dev = pci_devices; off_t at = 0; @@ -281,7 +262,7 @@ int pci_proc_attach_device(struct pci_dev *dev) if (!(de = bus->procdir)) { sprintf(name, "%02x", bus->number); - de = bus->procdir = create_proc_entry(name, S_IFDIR, proc_bus_pci_dir); + de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir); if (!de) return -ENOMEM; } @@ -325,84 +306,6 @@ void __init proc_bus_pci_add(struct pci_bus *bus) * Backward compatible /proc/pci interface. */ -static const char *pci_strclass (unsigned int class) -{ - switch (class >> 8) { - case PCI_CLASS_NOT_DEFINED: return "Non-VGA device"; - case PCI_CLASS_NOT_DEFINED_VGA: return "VGA compatible device"; - - case PCI_CLASS_STORAGE_SCSI: return "SCSI storage controller"; - case PCI_CLASS_STORAGE_IDE: return "IDE interface"; - case PCI_CLASS_STORAGE_FLOPPY: return "Floppy disk controller"; - case PCI_CLASS_STORAGE_IPI: return "IPI bus controller"; - case PCI_CLASS_STORAGE_RAID: return "RAID bus controller"; - case PCI_CLASS_STORAGE_OTHER: return "Unknown mass storage controller"; - - case PCI_CLASS_NETWORK_ETHERNET: return "Ethernet controller"; - case PCI_CLASS_NETWORK_TOKEN_RING: return "Token ring network controller"; - case PCI_CLASS_NETWORK_FDDI: return "FDDI network controller"; - case PCI_CLASS_NETWORK_ATM: return "ATM network controller"; - case PCI_CLASS_NETWORK_OTHER: return "Network controller"; - - case PCI_CLASS_DISPLAY_VGA: return "VGA compatible controller"; - case PCI_CLASS_DISPLAY_XGA: return "XGA compatible controller"; - case PCI_CLASS_DISPLAY_OTHER: return "Display controller"; - - case PCI_CLASS_MULTIMEDIA_VIDEO: return "Multimedia video controller"; - case PCI_CLASS_MULTIMEDIA_AUDIO: return "Multimedia audio controller"; - case PCI_CLASS_MULTIMEDIA_OTHER: return "Multimedia controller"; - - case PCI_CLASS_MEMORY_RAM: return "RAM memory"; - case PCI_CLASS_MEMORY_FLASH: return "FLASH memory"; - case PCI_CLASS_MEMORY_OTHER: return "Memory"; - - case PCI_CLASS_BRIDGE_HOST: return "Host bridge"; - case PCI_CLASS_BRIDGE_ISA: return "ISA bridge"; - case PCI_CLASS_BRIDGE_EISA: return "EISA bridge"; - case PCI_CLASS_BRIDGE_MC: return "MicroChannel bridge"; - case PCI_CLASS_BRIDGE_PCI: return "PCI bridge"; - case PCI_CLASS_BRIDGE_PCMCIA: return "PCMCIA bridge"; - case PCI_CLASS_BRIDGE_NUBUS: return "NuBus bridge"; - case PCI_CLASS_BRIDGE_CARDBUS: return "CardBus bridge"; - case PCI_CLASS_BRIDGE_OTHER: return "Bridge"; - - case PCI_CLASS_COMMUNICATION_SERIAL: return "Serial controller"; - case PCI_CLASS_COMMUNICATION_PARALLEL: return "Parallel controller"; - case PCI_CLASS_COMMUNICATION_OTHER: return "Communication controller"; - - case PCI_CLASS_SYSTEM_PIC: return "PIC"; - case PCI_CLASS_SYSTEM_DMA: return "DMA controller"; - case PCI_CLASS_SYSTEM_TIMER: return "Timer"; - case PCI_CLASS_SYSTEM_RTC: return "RTC"; - case PCI_CLASS_SYSTEM_OTHER: return "System peripheral"; - - case PCI_CLASS_INPUT_KEYBOARD: return "Keyboard controller"; - case PCI_CLASS_INPUT_PEN: return "Digitizer Pen"; - case PCI_CLASS_INPUT_MOUSE: return "Mouse controller"; - case PCI_CLASS_INPUT_OTHER: return "Input device controller"; - - case PCI_CLASS_DOCKING_GENERIC: return "Generic Docking Station"; - case PCI_CLASS_DOCKING_OTHER: return "Docking Station"; - - case PCI_CLASS_PROCESSOR_386: return "386"; - case PCI_CLASS_PROCESSOR_486: return "486"; - case PCI_CLASS_PROCESSOR_PENTIUM: return "Pentium"; - case PCI_CLASS_PROCESSOR_ALPHA: return "Alpha"; - case PCI_CLASS_PROCESSOR_POWERPC: return "Power PC"; - case PCI_CLASS_PROCESSOR_CO: return "Co-processor"; - - case PCI_CLASS_SERIAL_FIREWIRE: return "FireWire (IEEE 1394)"; - case PCI_CLASS_SERIAL_ACCESS: return "ACCESS Bus"; - case PCI_CLASS_SERIAL_SSA: return "SSA"; - case PCI_CLASS_SERIAL_USB: return "USB Controller"; - case PCI_CLASS_SERIAL_FIBER: return "Fiber Channel"; - - case PCI_CLASS_HOT_SWAP_CONTROLLER: return "Hot Swap Controller"; - - default: return "Unknown class"; - } -} - /* * Convert some of the configuration space registers of the device at * address (bus,devfn) into a string (possibly several lines each). @@ -411,8 +314,8 @@ static const char *pci_strclass (unsigned int class) */ static int sprint_dev_config(struct pci_dev *dev, char *buf, int size) { - unsigned int class_rev; - unsigned char latency, min_gnt, max_lat; + u32 class_rev; + unsigned char latency, min_gnt, max_lat, *class; int reg, len = 0; pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); @@ -423,10 +326,12 @@ static int sprint_dev_config(struct pci_dev *dev, char *buf, int size) return -1; len += sprintf(buf + len, " Bus %2d, device %3d, function %2d:\n", dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn)); - len += sprintf(buf + len, " %s: %s (rev %d).\n", - pci_strclass(class_rev >> 8), - dev->name, - class_rev & 0xff); + class = pci_class_name(class_rev >> 16); + if (class) + len += sprintf(buf+len, " %s", class); + else + len += sprintf(buf+len, " Class %04x", class_rev >> 16); + len += sprintf(buf+len, ": %s (rev %d).\n", dev->name, class_rev & 0xff); if (dev->irq) { if (len + 40 > size) @@ -530,8 +435,8 @@ static int pci_read_proc(char *buf, char **start, off_t off, static int __init pci_proc_init(void) { if (pci_present()) { - proc_bus_pci_dir = create_proc_entry("pci", S_IFDIR, proc_bus); - create_proc_info_entry("devices",0, proc_bus_pci_dir, + proc_bus_pci_dir = proc_mkdir("pci", proc_bus); + create_proc_info_entry("devices", 0, proc_bus_pci_dir, get_pci_dev_info); proc_bus_pci_add(pci_root); create_proc_read_entry("pci", 0, NULL, pci_read_proc, NULL); diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 7c2ff12d5..cda39a5c1 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -5,7 +5,7 @@ * bugs. Devices present only on certain architectures (host * bridges et cetera) should be handled in arch-specific code. * - * Copyright (c) 1999 Martin Mares <mj@ucw.cz> + * Copyright (c) 1999 Martin Mares <mj@suse.cz> * * The bridge optimization stuff has been removed. If you really * have a silly BIOS which is unable to set your host bridge right, diff --git a/drivers/pci/setup.c b/drivers/pci/setup.c index 930484b16..e47380c58 100644 --- a/drivers/pci/setup.c +++ b/drivers/pci/setup.c @@ -9,13 +9,14 @@ * Support routines for initializing a PCI subsystem. */ +/* fixed for multiple pci buses, 1999 Andrea Arcangeli <andrea@suse.de> */ + #include <linux/init.h> #include <linux/kernel.h> #include <linux/pci.h> #include <linux/errno.h> #include <linux/ioport.h> - -#include <asm/cache.h> +#include <linux/cache.h> #define DEBUG_CONFIG 0 @@ -33,15 +34,8 @@ pci_claim_resource(struct pci_dev *dev, int resource) int err; err = -EINVAL; - if (root != NULL) { - /* If `dev' is on a secondary pci bus, `root' may not be - at the origin. In that case, adjust the resource into - range. */ - res->start += root->start; - res->end += root->start; - + if (root != NULL) err = request_resource(root, res); - } if (err) { printk(KERN_ERR "PCI: Address space collision on region %d " "of device %s\n", resource, dev->name); @@ -89,7 +83,7 @@ pdev_assign_unassigned_resources(struct pci_dev *dev, u32 min_io, u32 min_mem) DBGC((" for root[%lx:%lx] min[%lx] size[%lx]\n", root->start, root->end, min, size)); - if (allocate_resource(root, res, size, min, -1, size) < 0) { + if (allocate_resource(root, res, size, min, -1, size, pcibios_align_resource, dev) < 0) { printk(KERN_ERR "PCI: Failed to allocate resource %d for %s\n", i, dev->name); @@ -148,13 +142,6 @@ pci_assign_unassigned_resources(u32 min_io, u32 min_mem) pdev_assign_unassigned_resources(dev, min_io, min_mem); } -struct pbus_set_ranges_data -{ - int found_vga; - unsigned int io_start, io_end; - unsigned int mem_start, mem_end; -}; - #define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define ROUND_DOWN(x, a) ((x) & ~((a) - 1)) @@ -166,7 +153,7 @@ pbus_set_ranges(struct pci_bus *bus, struct pbus_set_ranges_data *outer) struct pci_dev *dev; inner.found_vga = 0; - inner.mem_start = inner.io_start = ~0; + inner.mem_start = inner.io_start = ~0UL; inner.mem_end = inner.io_end = 0; /* Collect information about how our direct children are layed out. */ @@ -201,6 +188,8 @@ pbus_set_ranges(struct pci_bus *bus, struct pbus_set_ranges_data *outer) inner.mem_start = ROUND_DOWN(inner.mem_start, 1*1024*1024); inner.mem_end = ROUND_UP(inner.mem_end, 1*1024*1024); + pcibios_fixup_pbus_ranges(bus, &inner); + /* Configure the bridge, if possible. */ if (bus->self) { struct pci_dev *bridge = bus->self; @@ -281,7 +270,7 @@ pci_set_bus_ranges(void) pbus_set_ranges(bus, NULL); } -static void +static void __init pdev_fixup_irq(struct pci_dev *dev, u8 (*swizzle)(struct pci_dev *, u8 *), int (*map_irq)(struct pci_dev *, u8, u8)) diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c index 4114f8d6c..a58098024 100644 --- a/drivers/pci/syscall.c +++ b/drivers/pci/syscall.c @@ -7,7 +7,6 @@ * magic northbridge registers.. */ -#include <linux/config.h> #include <linux/sched.h> #include <linux/errno.h> #include <linux/pci.h> |