Page MenuHomeFreeBSD

D26651.id77819.diff
No OneTemporary

D26651.id77819.diff

Index: sys/compat/linuxkpi/common/include/linux/pci.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/pci.h
+++ sys/compat/linuxkpi/common/include/linux/pci.h
@@ -37,6 +37,7 @@
#include <sys/param.h>
#include <sys/bus.h>
+#include <sys/module.h>
#include <sys/nv.h>
#include <sys/pciio.h>
#include <sys/rman.h>
@@ -65,7 +66,26 @@
uintptr_t driver_data;
};
-#define MODULE_DEVICE_TABLE(bus, table)
+/* Linux has an empty element at the end of the ID table -> nitems() - 1. */
+#define MODULE_DEVICE_TABLE(_bus, _table) \
+ \
+static device_method_t _ ## _bus ## _ ## _table ## _methods[] = { \
+ { 0, 0 } \
+}; \
+ \
+static driver_t _ ## _bus ## _ ## _table ## _driver = { \
+ "lkpi_" #_table, \
+ _ ## _bus ## _ ## _table ## _methods, \
+ 0 \
+}; \
+ \
+static devclass_t _ ## _bus ## _ ## _table ## _devclass; \
+ \
+DRIVER_MODULE(lkpi_ ## _table, pci, _ ## _bus ## _ ## _table ## _driver,\
+ _ ## _bus ## _ ## _table ## _devclass, 0, 0); \
+ \
+MODULE_PNP_INFO("U32:vendor;U32:device", \
+ _bus, lkpi_ ## _table, _table, nitems(_table) - 1)
#define PCI_BASE_CLASS_DISPLAY 0x03
#define PCI_CLASS_DISPLAY_VGA 0x0300

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 24, 1:14 AM (9 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32053946
Default Alt Text
D26651.id77819.diff (1 KB)

Event Timeline