-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.patch
187 lines (157 loc) · 6.11 KB
/
test.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
diff -rwbU5 A/IOATABlockStorage-130.3.1/IOATABlockStorageCommands.cpp B/IOATABlockStorage-130.3.1/IOATABlockStorageCommands.cpp
--- A/IOATABlockStorage-130.3.1/IOATABlockStorageCommands.cpp 2017-04-22 23:20:26.000000000 +0100
+++ B/IOATABlockStorage-130.3.1/IOATABlockStorageCommands.cpp 2017-04-22 23:18:35.000000000 +0100
@@ -1372,11 +1372,11 @@
// Async command processing is complete, re-enqueue command
clientData.self->returnATACommandObject ( cmd );
// Signal the completion routine that the request has been completed.
- IOStorage::complete ( clientData.completion.async,
+ IOStorage::complete ( &clientData.completion.async,
result,
bytesTransferred );
}
diff -rwbU5 A/IOATABlockStorage-130.3.1/IOATABlockStorageDevice.cpp B/IOATABlockStorage-130.3.1/IOATABlockStorageDevice.cpp
--- A/IOATABlockStorage-130.3.1/IOATABlockStorageDevice.cpp 2017-04-22 23:20:26.000000000 +0100
+++ B/IOATABlockStorage-130.3.1/IOATABlockStorageDevice.cpp 2017-04-22 23:20:17.000000000 +0100
@@ -28,11 +28,10 @@
#include <IOKit/storage/IOStorageDeviceCharacteristics.h>
#include <IOKit/IOPlatformExpert.h>
#include "IOATABlockStorageDriver.h"
#include "IOATABlockStorageDevice.h"
-#include "ATASMARTLibPriv.h"
#define super IOBlockStorageDevice
OSDefineMetaClassAndStructors ( IOATABlockStorageDevice, IOBlockStorageDevice );
@@ -134,57 +133,10 @@
dictionary->setObject ( kIOPropertyProductRevisionLevelKey, theString );
theString->release ( );
}
dictionary->setObject ( kIOATASupportedFeaturesKey, fProvider->getProperty ( kIOATASupportedFeaturesKey ) );
- value = OSDynamicCast ( OSNumber, fProvider->getProperty ( kIOATASupportedFeaturesKey ) );
- if ( value != NULL )
- {
-
- features = value->unsigned32BitValue ( );
- if ( features & kIOATAFeatureSMART )
- {
-
- OSDictionary * userClientDict = OSDictionary::withCapacity ( 1 );
- OSString * string1;
- OSString * string2;
-
- string1 = OSString::withCString ( kATASMARTUserClientTypeIDKey );
- string2 = OSString::withCString ( kATASMARTUserClientLibLocationKey );
-
- userClientDict->setObject ( string1, string2 );
-
- setProperty ( kIOUserClientClassKey, kATASMARTUserClientClassKey );
- setProperty ( kIOCFPlugInTypesKey, userClientDict );
-
- if ( userClientDict != NULL )
- {
-
- userClientDict->release ( );
- userClientDict = NULL;
-
- }
-
- if ( string1 != NULL )
- {
-
- string1->release ( );
- string1 = NULL;
-
- }
-
- if ( string2 != NULL )
- {
-
- string2->release ( );
- string2 = NULL;
-
- }
-
- }
-
- }
setProperty ( kIOPropertyDeviceCharacteristicsKey, dictionary );
dictionary->release ( );
@@ -231,18 +183,10 @@
bool
IOATABlockStorageDevice::handleOpen ( IOService * client, IOOptionBits options, void * access )
{
- // If this isn't a user client, pass through to superclass.
- if ( ( options & kIOATASMARTUserClientAccessMask ) == 0 )
- {
-
- return super::handleOpen ( client, options, access );
-
- }
-
// It's the user client, so add it to the set
if ( fClients == NULL )
fClients = OSSet::withCapacity ( 1 );
@@ -270,17 +214,10 @@
void
IOATABlockStorageDevice::handleClose ( IOService * client, IOOptionBits options )
{
- // If this isn't a user client, pass through to superclass.
- if ( ( options & kIOATASMARTUserClientAccessMask ) == 0 )
- super::handleClose ( client, options );
-
- else
- {
-
STATUS_LOG ( ( "Removing user client\n" ) );
fClients->removeObject ( client );
if ( fClients->getCount ( ) != 0 )
{
@@ -289,12 +226,10 @@
}
}
-}
-
//---------------------------------------------------------------------------
// handleIsOpen from client.
bool
diff -rwbU5 A/IOATABlockStorage-130.3.1/IOATABlockStorageDriver.h B/IOATABlockStorage-130.3.1/IOATABlockStorageDriver.h
--- A/IOATABlockStorage-130.3.1/IOATABlockStorageDriver.h 2017-04-22 23:20:26.000000000 +0100
+++ B/IOATABlockStorage-130.3.1/IOATABlockStorageDriver.h 2017-04-22 23:18:35.000000000 +0100
@@ -380,11 +380,11 @@
virtual IOReturn setAggressiveness ( UInt32 type, UInt32 minutes );
// The initialPowerStateForDomainState() method is called by the power manager
// to ask us what state we should be in based on the power flags of our parent
// in the power tree.
- virtual UInt32 initialPowerStateForDomainState ( IOPMPowerFlags flags );
+ virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags flags );
virtual IOReturn setPowerState ( UInt32 powerStateOrdinal,
IOService * whatDevice );
//-----------------------------------------------------------------------
diff -rwbU5 A/IOATABlockStorage-130.3.1/IOATABlockStorageDriverPM.cpp B/IOATABlockStorage-130.3.1/IOATABlockStorageDriverPM.cpp
--- A/IOATABlockStorage-130.3.1/IOATABlockStorageDriverPM.cpp 2017-04-22 23:20:26.000000000 +0100
+++ B/IOATABlockStorage-130.3.1/IOATABlockStorageDriverPM.cpp 2017-04-22 23:18:35.000000000 +0100
@@ -170,11 +170,11 @@
//---------------------------------------------------------------------------
// � initialPowerStateForDomainState - Returns to the power manager what
// initial state the device should be in.
//---------------------------------------------------------------------------
-UInt32
+unsigned long
IOATABlockStorageDriver::initialPowerStateForDomainState (
IOPMPowerFlags flags )
{
// We ignore the flags since we are always active at startup time and we
diff -rwbU5 A/IOATABlockStorage-130.3.1/IOATAStorageDefines.h B/IOATABlockStorage-130.3.1/IOATAStorageDefines.h
--- A/IOATABlockStorage-130.3.1/IOATAStorageDefines.h 2017-04-22 23:20:26.000000000 +0100
+++ B/IOATABlockStorage-130.3.1/IOATAStorageDefines.h 2017-04-22 23:18:35.000000000 +0100
@@ -244,11 +244,11 @@
kIOATADefaultPerformance = 0x80,
kIOATAMaxPowerSavings = 0x01
};
/* ATA power states, from lowest to highest power usage */
-typedef UInt32 IOATAPowerState;
+typedef unsigned long IOATAPowerState;
enum
{
kIOATAPowerStateSystemSleep = 0,
kIOATAPowerStateSleep = 1,
kIOATAPowerStateStandby = 2,