summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-04-21 12:13:31 +0000
committerDave Airlie <airlied@linux.ie>2004-04-21 12:13:31 +0000
commit93bd67ef62e95a32f8b7e2fd7d9dadee52664160 (patch)
tree529b54bcdcfd364d6bc25cabf38999b465dadd80 /linux-core
parent0f32a8852712e405f64c5917bcebefc441aa1ba3 (diff)
centralise pci ids into one place and use scripts to generate files for
kernel
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/Makefile5
-rw-r--r--linux-core/drmP.h12
-rw-r--r--linux-core/drm_drv.c17
-rw-r--r--linux-core/savage.h24
4 files changed, 18 insertions, 40 deletions
diff --git a/linux-core/Makefile b/linux-core/Makefile
index b1758884..dc21459a 100644
--- a/linux-core/Makefile
+++ b/linux-core/Makefile
@@ -208,7 +208,10 @@ SHAREDDIR := ../shared
HASSHARED := $(shell if [ -d $(SHAREDDIR) ]; then echo y; fi)
ifeq ($(HASSHARED),y)
-includes:: $(SHAREDSRC)
+includes:: $(SHAREDSRC) drm_pciids.h
+
+drm_pciids.h: $(SHAREDDIR)/drm_pciids.txt
+ sh ../scripts/create_linux_pci_lists.sh < $(SHAREDDIR)/drm_pciids.txt
$(SHAREDSRC):
@if [ -r $(SHAREDDIR)/$@ ]; then \
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 09556b89..e30dd6d9 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -255,6 +255,10 @@ static inline void class_simple_destroy(struct class_simple *cs){};
static inline struct class_simple *class_simple_create(struct module *owner, char *name) { return NULL; }
+#ifndef pci_pretty_name
+#define pci_pretty_name(x) x->name
+#endif
+
#endif
#ifndef REMAP_PAGE_RANGE_5_ARGS
@@ -423,14 +427,6 @@ do { \
typedef int drm_ioctl_t( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
-typedef struct drm_pci_id_list
-{
- int vendor;
- int device;
- long driver_private;
- char *name;
-} drm_pci_id_list_t;
-
typedef struct drm_ioctl_desc {
drm_ioctl_t *func;
int auth_needed;
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 35876dc6..cdeb9b68 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -540,8 +540,10 @@ static int DRM(takedown)( drm_device_t *dev )
return 0;
}
-static drm_pci_id_list_t DRM(pciidlist)[] = {
- DRIVER_PCI_IDS
+#include "drm_pciids.h"
+
+static struct pci_device_id DRM(pciidlist)[] = {
+ DRM(PCI_IDS)
};
static int DRM(probe)(struct pci_dev *pdev)
@@ -551,17 +553,17 @@ static int DRM(probe)(struct pci_dev *pdev)
int retcode;
#endif
int i;
- char *desc = NULL;
+ int is_compat = 0;
DRM_DEBUG( "\n" );
for (i = 0; DRM(pciidlist)[i].vendor != 0; i++) {
if ((DRM(pciidlist)[i].vendor == pdev->vendor) &&
(DRM(pciidlist)[i].device == pdev->device)) {
- desc = DRM(pciidlist)[i].name;
+ is_compat = 1;
}
}
- if (desc == NULL)
+ if (is_compat == 0)
return -ENODEV;
if (DRM(numdevs) >= MAX_DEVICES)
@@ -623,7 +625,7 @@ static int DRM(probe)(struct pci_dev *pdev)
}
#endif
DRM(numdevs)++; /* no errors, mark it reserved */
-
+
DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n",
DRIVER_NAME,
DRIVER_MAJOR,
@@ -631,7 +633,8 @@ static int DRM(probe)(struct pci_dev *pdev)
DRIVER_PATCHLEVEL,
DRIVER_DATE,
dev->minor,
- desc );
+ pci_pretty_name(pdev)
+ );
DRIVER_POSTINIT();
diff --git a/linux-core/savage.h b/linux-core/savage.h
index 5ccd22d8..fb828ce6 100644
--- a/linux-core/savage.h
+++ b/linux-core/savage.h
@@ -36,28 +36,4 @@
#define __HAVE_MTRR 1
#define __HAVE_CTX_BITMAP 1
-#define DRIVER_PCI_IDS \
- {0x5333, 0x8a22, 0, "Savage4"}, \
- {0x5333, 0x8a23, 0, "Savage4"}, \
- {0x5333, 0x8c10, 0, "Savage/MX-MV"}, \
- {0x5333, 0x8c11, 0, "Savage/MX"}, \
- {0x5333, 0x8c12, 0, "Savage/IX-MV"}, \
- {0x5333, 0x8c13, 0, "Savage/IX"}, \
- {0x5333, 0x8c20, 0, "Savage 3D"}, \
- {0x5333, 0x8c21, 0, "Savage 3D/MV"}, \
- {0x5333, 0x8c22, 0, "SuperSavage MX/128"}, \
- {0x5333, 0x8c24, 0, "SuperSavage MX/64"}, \
- {0x5333, 0x8c26, 0, "SuperSavage MX/64C"}, \
- {0x5333, 0x8c2a, 0, "SuperSavage IX/128 SDR"}, \
- {0x5333, 0x8c2b, 0, "SuperSavage IX/128 DDR"}, \
- {0x5333, 0x8c2c, 0, "SuperSavage IX/64 SDR"}, \
- {0x5333, 0x8c2d, 0, "SuperSavage IX/64 DDR"}, \
- {0x5333, 0x8c2e, 0, "SuperSavage IX/C SDR"}, \
- {0x5333, 0x8c2f, 0, "SuperSavage IX/C DDR"}, \
- {0x5333, 0x8a25, 0, "ProSavage PM133"}, \
- {0x5333, 0x8a26, 0, "ProSavage KM133"}, \
- {0x5333, 0x8d01, 0, "ProSavage PN133"}, \
- {0x5333, 0x8d02, 0, "ProSavage KN133"}, \
- {0x5333, 0x8d04, 0, "ProSavage DDR"}
-
#endif