path: root/sys/sys/bus.h
diff options
authorKonstantin Belousov <kib@FreeBSD.org>2019-04-05 18:09:22 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2019-04-05 18:09:22 +0000
commitc53df6da4e396b3bacdc7870a2815e69497b739e (patch)
tree3ee1e5be52933656427373ab7f00ae944998a4ea /sys/sys/bus.h
parent9cdd5c07ad924249d620437d00458c3b6434dbe5 (diff)
Provide newbus infrastructure for initiating device reset.
The methods BUS_RESET_PREPARE(), BUS_RESET(), and BUS_RESET_POST() should be implemented by bus which can provide reset to a device. The methods are described in inline doxygen comments. Code only provides BUS_RESET_PREPARE() and BUS_RESET_POST() helpers instead of default implementation, because actual bus needs to handle device state around reset, while helpers provide the other half of typical prepare/post code. Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646
Notes: svn path=/head/; revision=345960
Diffstat (limited to 'sys/sys/bus.h')
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 4ad4231a9512..a9fc2387eccf 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -143,6 +143,10 @@ struct devreq {
/* Flags for DEV_DELETE. */
#define DEVF_FORCE_DELETE 0x0000001
+/* Flags for DEV_RESET */
+#define DEVF_RESET_DETACH 0x0000001 /* Detach drivers vs suspend
+ device */
#ifdef _KERNEL
#include <sys/eventhandler.h>
@@ -494,6 +498,8 @@ int bus_generic_unmap_resource(device_t dev, device_t child, int type,
struct resource_map *map);
int bus_generic_write_ivar(device_t dev, device_t child, int which,
uintptr_t value);
+int bus_helper_reset_post(device_t dev, int flags);
+int bus_helper_reset_prepare(device_t dev, int flags);
int bus_null_rescan(device_t dev);