summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-19 04:00:00 +0000
commit46e045034336a2cc90c1798cd7cc07af744ddfd6 (patch)
tree3b9b51fc482e729f663d25333e77fbed9aaa939a /drivers/pci
parent31dc59d503a02e84c4de98826452acaeb56dc15a (diff)
Merge with Linux 2.3.99-pre4.
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/gen-devlist.c26
-rw-r--r--drivers/pci/pci.ids4
-rw-r--r--drivers/pci/setup-res.c2
3 files changed, 26 insertions, 6 deletions
diff --git a/drivers/pci/gen-devlist.c b/drivers/pci/gen-devlist.c
index ed0bcba16..9b2c652ac 100644
--- a/drivers/pci/gen-devlist.c
+++ b/drivers/pci/gen-devlist.c
@@ -1,12 +1,14 @@
/*
* Generate devlist.h and classlist.h from the PCI ID file.
*
- * (c) 1999 Martin Mares <mj@suse.cz>
+ * (c) 1999--2000 Martin Mares <mj@suse.cz>
*/
#include <stdio.h>
#include <string.h>
+#define MAX_NAME_SIZE 79
+
static void
pq(FILE *f, const char *c)
{
@@ -22,9 +24,11 @@ pq(FILE *f, const char *c)
int
main(void)
{
- char line[1024], *c, vend[8];
+ char line[1024], *c, *bra, vend[8];
int vendors = 0;
int mode = 0;
+ int lino = 0;
+ int vendor_len = 0;
FILE *devf, *clsf;
devf = fopen("devlist.h", "w");
@@ -35,6 +39,7 @@ main(void)
}
while (fgets(line, sizeof(line)-1, stdin)) {
+ lino++;
if ((c = strchr(line, '\n')))
*c = 0;
if (!line[0] || line[0] == '#')
@@ -56,6 +61,16 @@ main(void)
c = line + 5;
while (*c == ' ')
*c++ = 0;
+ if (vendor_len + strlen(c) + 1 > MAX_NAME_SIZE) {
+ /* Too long, try cutting off long description */
+ bra = strchr(c, '[');
+ if (bra && bra > c && bra[-1] == ' ')
+ bra[-1] = 0;
+ if (vendor_len + strlen(c) + 1 > MAX_NAME_SIZE) {
+ fprintf(stderr, "Line %d: Device name too long\n", lino);
+ return 1;
+ }
+ }
fprintf(devf, "\tDEVICE(%s,%s,\"", vend, line+1);
pq(devf, c);
fputs("\")\n", devf);
@@ -80,13 +95,18 @@ main(void)
fputs("ENDVENDOR()\n\n", devf);
vendors++;
strcpy(vend, line);
+ vendor_len = strlen(c);
+ if (vendor_len + 24 > MAX_NAME_SIZE) {
+ fprintf(stderr, "Line %d: Vendor name too long\n", lino);
+ return 1;
+ }
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);
+ fprintf(stderr, "Line %d: Syntax error in mode %d: %s\n", lino, mode, line);
return 1;
}
}
diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids
index 9dae829b5..cdf4092fe 100644
--- a/drivers/pci/pci.ids
+++ b/drivers/pci/pci.ids
@@ -1245,7 +1245,7 @@
10db Rohm LSI Systems, Inc.
10dc CERN/ECP/EDU
0001 STAR/RD24 SCI-PCI (PMC)
- 0002 TAR/RD24 SCI-PCI (PMC) [ATT 2C15-3 (FPGA) SCI bridge on PCI 5 Volt card]
+ 0002 TAR/RD24 SCI-PCI (PMC)
0021 HIPPI destination
0022 HIPPI source
10dc ATT2C15-3 FPGA
@@ -1328,7 +1328,7 @@
8089 Kingsberg Spacetec Serial Output Board
809c S5933_HEPC3
811a PCI-IEEE1355-DS-DE Interface
- 8170 S5933 "Matchmaker" PCI Chipset Development Tool
+ 8170 S5933 "Matchmaker" [PCI Chipset Development Tool]
10e9 Alps Electric Co., Ltd.
10ea Intergraphics Systems
1680 IGA-1680
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 84639a5a2..679b5f49f 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -89,7 +89,7 @@ pci_assign_resource(struct pci_dev *dev, int i)
return 0;
}
-static void
+void
pdev_assign_unassigned_resources(struct pci_dev *dev)
{
u32 reg;