summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--convert/Makefile13
-rw-r--r--convert/README.pcitable (renamed from README.pcitable)0
-rwxr-xr-xconvert/merge2pcitable.pl (renamed from merge2pcitable)0
-rw-r--r--convert/xf86PciInfo2pcitable.c22
-rw-r--r--convert/xf86str.h13
5 files changed, 48 insertions, 0 deletions
diff --git a/convert/Makefile b/convert/Makefile
new file mode 100644
index 00000000..1aec5909
--- /dev/null
+++ b/convert/Makefile
@@ -0,0 +1,13 @@
+FILES = xf86PciInfo2pcitable
+
+all: $(FILES)
+
+clean:
+ rm -f $(FILES)
+
+xf86PciInfo2pcitable: %: %.c xf86PciInfo.h
+ gcc -o $@ $<
+
+#do
+# take new xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h in XFree86-4
+# make ; ./xf86PciInfo2pcitable > /tmp/xf_pcitable ; perl rh_pcitable2pcitable /tmp/xf_pcitable ../pcitable
diff --git a/README.pcitable b/convert/README.pcitable
index c792a3e1..c792a3e1 100644
--- a/README.pcitable
+++ b/convert/README.pcitable
diff --git a/merge2pcitable b/convert/merge2pcitable.pl
index a5d85046..a5d85046 100755
--- a/merge2pcitable
+++ b/convert/merge2pcitable.pl
diff --git a/convert/xf86PciInfo2pcitable.c b/convert/xf86PciInfo2pcitable.c
new file mode 100644
index 00000000..30374b79
--- /dev/null
+++ b/convert/xf86PciInfo2pcitable.c
@@ -0,0 +1,22 @@
+/* take xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h in XFree86-4 */
+#include "xf86PciInfo.h"
+
+const char *vendor2text(int id) {
+ SymTabRec *p;
+ for (p = xf86PCIVendorNameInfoData; p->token; p++)
+ if (p->token == id) return p->name;
+ fprintf(stderr, "error, bad vendor id\n");
+ exit(1);
+}
+
+main() {
+ pciVendorDeviceInfo *p;
+
+ for (p = xf86PCIVendorInfoData; p->VendorID; p++) {
+ struct pciDevice *q;
+ const char *vendor = vendor2text(p->VendorID);
+ for (q = p->Device; q->DeviceID; q++) {
+ printf("0x%04x\t0x%04x\t\"unknown\"\t\"%s|%s\"\n", p->VendorID, q->DeviceID, vendor, q->DeviceName);
+ }
+ }
+}
diff --git a/convert/xf86str.h b/convert/xf86str.h
new file mode 100644
index 00000000..9d9f5001
--- /dev/null
+++ b/convert/xf86str.h
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+typedef struct {
+ int token; /* id of the token */
+ const char * name; /* token name */
+} SymTabRec, *SymTabPtr;
+
+#define CARD16 int
+
+#define INIT_PCI_CARD_INFO
+#define INIT_PCI_VENDOR_INFO
+#define INIT_PCI_VENDOR_NAME_INFO
+#define VENDOR_INCLUDE_NONVIDEO