aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bhnd/bhnd_types.h
diff options
context:
space:
mode:
authorLandon J. Fuller <landonf@FreeBSD.org>2017-09-27 19:44:23 +0000
committerLandon J. Fuller <landonf@FreeBSD.org>2017-09-27 19:44:23 +0000
commit8e35bf8319f3f087abd63079aa5b8820e5f837b4 (patch)
treecb8771af560ee2cbfbb930523a129dd67da98261 /sys/dev/bhnd/bhnd_types.h
parent922f5528bdf2f8d2210098ea83605b7e84267945 (diff)
downloadsrc-8e35bf8319f3f087abd63079aa5b8820e5f837b4.tar.gz
src-8e35bf8319f3f087abd63079aa5b8820e5f837b4.zip
bhnd: Implement bhnd(4) platform device registration.
Add bhnd(4) API for explicitly registering BHND platform devices (ChipCommon, PMU, NVRAM, etc) with the bus, rather than walking the newbus hierarchy to discover platform devices. These devices are now also refcounted; attempting to deregister an actively used platform device will return EBUSY. This resolves a lock ordering incompatibility with bwn(4)'s firmware loading threads; previously it was necessary to acquire Giant to protect newbus access when locating and querying the NVRAM device. Approved by: adrian (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12392
Notes
Notes: svn path=/head/; revision=324070
Diffstat (limited to 'sys/dev/bhnd/bhnd_types.h')
-rw-r--r--sys/dev/bhnd/bhnd_types.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/bhnd/bhnd_types.h b/sys/dev/bhnd/bhnd_types.h
index ffdbf1a47489..d819afedbecb 100644
--- a/sys/dev/bhnd/bhnd_types.h
+++ b/sys/dev/bhnd/bhnd_types.h
@@ -1,7 +1,11 @@
/*-
- * Copyright (c) 2015 Landon Fuller <landon@landonf.org>
+ * Copyright (c) 2015-2016 Landon Fuller <landon@landonf.org>
+ * Copyright (c) 2017 The FreeBSD Foundation
* All rights reserved.
*
+ * Portions of this software were developed by Landon Fuller
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -65,6 +69,14 @@ typedef enum {
BHND_DEVCLASS_INVALID /**< no/invalid class */
} bhnd_devclass_t;
+/** bhnd(4) platform services. */
+typedef enum {
+ BHND_SERVICE_CHIPC, /**< chipcommon service; implements the bhnd_chipc interface */
+ BHND_SERVICE_PMU, /**< pmu service; implements the bhnd_pmu interface */
+ BHND_SERVICE_NVRAM, /**< nvram service; implements the bhnd_nvram interface */
+
+ BHND_SERVICE_ANY = 1000, /**< match on any service type */
+} bhnd_service_t;
/**
* bhnd(4) port types.