From 139f23635621e9c7bad5c56a6b9be406cb1acf0b Mon Sep 17 00:00:00 2001 From: markj Date: Tue, 4 Jul 2017 01:23:36 +0000 Subject: [PATCH] Add some auxiliary types for device driver support. MFC after: 1 week --- sys/compat/linuxkpi/common/include/linux/device.h | 11 +++++++++++ sys/compat/linuxkpi/common/include/linux/pci.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index f868c32d565..174a067bd25 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -79,6 +79,15 @@ struct dev_pm_ops { int (*runtime_idle)(struct device *dev); }; +struct device_driver { + const char *name; + const struct dev_pm_ops *pm; +}; + +struct device_type { + const char *name; +}; + struct device { struct device *parent; struct list_head irqents; @@ -91,6 +100,8 @@ struct device { * done somewhere else. */ bool bsddev_attached_here; + struct device_driver *driver; + struct device_type *type; dev_t devt; struct class *class; void (*release)(struct device *dev); diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 5615c4053e2..f7581636c71 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -185,7 +185,8 @@ struct pci_driver { void (*shutdown) (struct pci_dev *dev); /* Device shutdown */ driver_t bsddriver; devclass_t bsdclass; - const struct pci_error_handlers *err_handler; + struct device_driver driver; + const struct pci_error_handlers *err_handler; }; extern struct list_head pci_drivers; -- 2.45.2