Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/pci.h
Show All 31 Lines | |||||
#define _LINUX_PCI_H_ | #define _LINUX_PCI_H_ | ||||
#define CONFIG_PCI_MSI | #define CONFIG_PCI_MSI | ||||
#include <linux/types.h> | #include <linux/types.h> | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/module.h> | |||||
#include <sys/nv.h> | #include <sys/nv.h> | ||||
#include <sys/pciio.h> | #include <sys/pciio.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <dev/pci/pcivar.h> | #include <dev/pci/pcivar.h> | ||||
#include <dev/pci/pcireg.h> | #include <dev/pci/pcireg.h> | ||||
#include <dev/pci/pci_private.h> | #include <dev/pci/pci_private.h> | ||||
Show All 12 Lines | struct pci_device_id { | ||||
uint32_t device; | uint32_t device; | ||||
uint32_t subvendor; | uint32_t subvendor; | ||||
uint32_t subdevice; | uint32_t subdevice; | ||||
uint32_t class; | uint32_t class; | ||||
uint32_t class_mask; | uint32_t class_mask; | ||||
uintptr_t driver_data; | 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[] = { \ | |||||
DEVMETHOD_END \ | |||||
hselasky: DEVMETHOD_END is the right for { 0, 0 }
Change looks good in total. | |||||
}; \ | |||||
\ | |||||
static driver_t _ ## _bus ## _ ## _table ## _driver = { \ | |||||
"lkpi_" #_bus #_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;V32:subvendor;V32:subdevice", \ | |||||
Done Inline ActionsWhy not include the subvender and subdevice? There's no reason to omit them. imp: Why not include the subvender and subdevice? There's no reason to omit them. | |||||
_bus, lkpi_ ## _table, _table, nitems(_table) - 1) | |||||
#define PCI_BASE_CLASS_DISPLAY 0x03 | #define PCI_BASE_CLASS_DISPLAY 0x03 | ||||
#define PCI_CLASS_DISPLAY_VGA 0x0300 | #define PCI_CLASS_DISPLAY_VGA 0x0300 | ||||
#define PCI_CLASS_DISPLAY_OTHER 0x0380 | #define PCI_CLASS_DISPLAY_OTHER 0x0380 | ||||
#define PCI_BASE_CLASS_BRIDGE 0x06 | #define PCI_BASE_CLASS_BRIDGE 0x06 | ||||
#define PCI_CLASS_BRIDGE_ISA 0x0601 | #define PCI_CLASS_BRIDGE_ISA 0x0601 | ||||
#define PCI_ANY_ID -1U | #define PCI_ANY_ID -1U | ||||
▲ Show 20 Lines • Show All 985 Lines • Show Last 20 Lines |
DEVMETHOD_END is the right for { 0, 0 }
Change looks good in total.