1/*
2 * Copyright (c) 2012 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24
25#ifndef IOKitUser_IOPLATFORMSUPPORTPRIVATE_h
26#define IOKitUser_IOPLATFORMSUPPORTPRIVATE_h
27
28#if !TARGET_OS_EMBEDDED
29#include <IOKit/IOReturn.h>
30#include <CoreFoundation/CoreFoundation.h>
31
32/*! @define     kIOPlatformTCPKeepAliveDuringSleep
33 *
34 *              Pass this key to <code>IOPlatformCopyFeatureDefault</code>
35 *              to determine whether this platform supports TCPKeepAliveDuringSleep.
36 *
37 *              Pass this key to <code>IOPlatformCopyFeatureActive</code>
38 *              to determine whether the current state of the system (Lid open/closed,
39 *              external displays, Do Not Disturb, Power Nap, TCP KeepAlive expiration, etc.)
40 *              dictates that TCPKeepAlive should be on.
41 */
42#define kIOPlatformTCPKeepAliveDuringSleep     CFSTR("TCPKeepAliveDuringSleep")
43
44
45/*!
46 * @function    IOPlatformCopyFeatureDefault
47 * @abstract    Indicates whether a feature is supported, and what its default
48 *              setting is.
49 * @discussion  This is an SPI front end for IOKit platform drivers.
50 *              This provides a conduit for settings specified by IOPPF (IOPlatformPluginFamily).
51 *
52 *              If the IOPPF driver hasn't matched & started yet, this function will block
53 *              up to 10 seconds for it to do so. You should only anticipate this happening
54 *              at boot time.
55 *
56 * @param       platformSettingKey A CFStringRef describing a platform feature.
57 * @param       outValue Upon success, this function will place a CF object at *outValue.
58 *              IOPPF defines the type and value of *outValue.
59 *              It's the caller's responsibility to confirm the object's CF type before dereferencing it.
60 *              It's the caller's responsibility to CFRelease(outValue)
61 *
62 * @result      kIOReturnSuccess on success.
63 *              kIOReturnNotReady if the IOPPF hasn't matched and started yet (and we waited 10s for it to happen).
64 *              kIOReturnUnsupported if the IOPPF doesn't support this feature.
65 */
66IOReturn IOPlatformCopyFeatureDefault(
67                                      CFStringRef   platformSettingKey,
68                                      CFTypeRef     *outValue);
69
70/*!
71 * @function    IOPlatformCopyFeatureActive
72 * @abstract    Indicates a feature's current value.
73 *
74 * @discussion  Some platform features can dynamically change value. This function encapsulates
75 *              the conditions that affect the feature's value.
76 *
77 * @param       platformSettingKey A CFStringRef describing a platform feature.
78 * @param       outValue Upon success, this function will place a CF object at *outValue.
79 *              IOPPF defines the type and value of *outValue.
80 *              It's the caller's responsibility to confirm the object's CF type before dereferencing it.
81 *              It's the caller's responsibility to CFRelease(outValue)
82 *
83 * @result      kIOReturnSuccess on success.
84 *              kIOReturnNotReady if the IOPPF hasn't matched and started yet (and we waited 10s for it to happen).
85 *              kIOReturnUnsupported if the IOPPF doesn't support this feature.
86 */
87IOReturn IOPlatformCopyFeatureActive(
88                                      CFStringRef   platformSettingKey,
89                                      CFTypeRef     *outValue);
90
91/*!
92 * @function    IOSMCKeyProxyPresent
93 * @abstract    Indicates whether this system has SMC Key Proxy.
94 * @discussion  Assumes that all systems have SMC Key Proxy except for
95                those on a blacklist of older systems.
96 * @result      true if system has SMC Key Proxy, false otherwise.
97 */
98Boolean IOSMCKeyProxyPresent(void);
99
100/*!
101 * @function    IONoteToSelfSupported
102 * @abstract    Indicates whether Note To Self is supported on this system.
103 * @discussion  Assumes that all systems support Note To Self except for
104                those on a blacklist of non-capable systems.
105 * @result      true if Note To Self can be used, false otherwise.
106 */
107Boolean IONoteToSelfSupported(void);
108
109/*!
110 * @function    IOAuthenticatedRestartSupported
111 * @abstract    Indicates whether Authenticated Restart is supported on this system.
112 * @discussion  Call this function before using Authenticated Restart.
113                Assumes that Authenticated Restart can be used only if the system
114                has SMC Key Proxy or supports Note To Self.
115 * @result      true if Authenticated Restart can be used, false otherwise.
116 */
117Boolean IOAuthenticatedRestartSupported(void);
118
119#endif
120#endif
121