Root/
Source at commit 1146 created 12 years 11 months ago. By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing). | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | *␊ |
6 | * The contents of this file constitute Original Code as defined in and␊ |
7 | * are subject to the Apple Public Source License Version 1.1 (the␊ |
8 | * "License"). You may not use this file except in compliance with the␊ |
9 | * License. Please obtain a copy of the License at␊ |
10 | * http://www.apple.com/publicsource and read it before using this file.␊ |
11 | *␊ |
12 | * This Original Code and all software distributed under the License are␊ |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the␊ |
17 | * License for the specific language governing rights and limitations␊ |
18 | * under the License.␊ |
19 | *␊ |
20 | * @APPLE_LICENSE_HEADER_END@␊ |
21 | */␊ |
22 | ␊ |
23 | #ifndef _IOKIT_IOFIREWIRESBP2USERCLIENT_H␊ |
24 | #define _IOKIT_IOFIREWIRESBP2USERCLIENT_H␊ |
25 | ␊ |
26 | #include <IOKit/IOUserClient.h>␊ |
27 | ␊ |
28 | #define FIREWIREPRIVATE␊ |
29 | #include <IOKit/firewire/IOFireWireController.h>␊ |
30 | #undef FIREWIREPRIVATE␊ |
31 | ␊ |
32 | #include <IOKit/firewire/IOFWUserObjectExporter.h>␊ |
33 | ␊ |
34 | #include <IOKit/sbp2/IOFireWireSBP2UserClientCommon.h>␊ |
35 | #include <IOKit/sbp2/IOFireWireSBP2LUN.h>␊ |
36 | ␊ |
37 | class IOFireWireSBP2UserClient : public IOUserClient␊ |
38 | {␊ |
39 | OSDeclareDefaultStructors(IOFireWireSBP2UserClient)␊ |
40 | ␊ |
41 | protected:␊ |
42 | ␊ |
43 | bool␉␉␉␉␉fOpened;␊ |
44 | ␉bool␉␉␉␉␉fStarted;␊ |
45 | IOFireWireSBP2Login * ␉fLogin;␊ |
46 | task_t␉␉␉␉␉fTask;␊ |
47 | ␉␊ |
48 | IOFireWireSBP2LUN *␉␉fProviderLUN;␊ |
49 | OSAsyncReference64␉␉fMessageCallbackAsyncRef;␊ |
50 | OSAsyncReference64␉␉fLoginCallbackAsyncRef;␊ |
51 | OSAsyncReference64␉␉fLogoutCallbackAsyncRef;␊ |
52 | OSAsyncReference64␉␉fUnsolicitedStatusNotifyAsyncRef;␊ |
53 | OSAsyncReference64␉␉fStatusNotifyAsyncRef;␊ |
54 | OSAsyncReference64␉␉fFetchAgentResetAsyncRef;␊ |
55 | ␉OSAsyncReference64␉␉fFetchAgentWriteAsyncRef;␊ |
56 | ␉␊ |
57 | ␉IOFWUserObjectExporter␉*␉fExporter;␊ |
58 | ␉␊ |
59 | ␉IOFireWireLib::UserObjectHandle␉␉fSessionRef;␊ |
60 | ␉␊ |
61 | ␉virtual IOReturn externalMethod(␉uint32_t selector, ␊ |
62 | ␉␉␉␉␉␉␉␉␉␉IOExternalMethodArguments * args,␊ |
63 | ␉␉␉␉␉␉␉␉␉␉IOExternalMethodDispatch * dispatch, ␊ |
64 | ␉␉␉␉␉␉␉␉␉␉OSObject * target, ␊ |
65 | ␉␉␉␉␉␉␉␉␉␉void * reference );␊ |
66 | public:␊ |
67 | ␊ |
68 | ␉virtual bool initWithTask( task_t owningTask, void * securityToken, UInt32 type, OSDictionary * properties );␊ |
69 | ␉virtual void free ();␊ |
70 | ␉␉␉␉␊ |
71 | virtual bool start( IOService * provider );␊ |
72 | ␊ |
73 | virtual IOReturn clientClose( void );␊ |
74 | virtual IOReturn clientDied( void );␊ |
75 | ␊ |
76 | ␉// IOFireWireSBP2ManagementORB friend class wrappers␊ |
77 | ␉virtual void flushAllManagementORBs( void );␊ |
78 | ␊ |
79 | /////////////////////////////////////////////////␊ |
80 | // IOFireWireSBP2LUN␊ |
81 | ␊ |
82 | IOReturn open( IOExternalMethodArguments * arguments );␊ |
83 | ␉IOReturn openWithSessionRef( IOExternalMethodArguments * arguments );␊ |
84 | ␉IOReturn getSessionRef( IOExternalMethodArguments * arguments );␊ |
85 | IOReturn close( IOExternalMethodArguments * arguments );␊ |
86 | ␊ |
87 | // callbacks␊ |
88 | ␉IOReturn setMessageCallback( IOExternalMethodArguments * arguments );␊ |
89 | virtual IOReturn message( UInt32 type, IOService * provider, void * arg );␊ |
90 | ␊ |
91 | /////////////////////////////////////////////////␊ |
92 | // IOFireWireSBP2Login␊ |
93 | ␊ |
94 | IOReturn setLoginCallback( IOExternalMethodArguments * arguments );␊ |
95 | ␉IOReturn setLogoutCallback( IOExternalMethodArguments * arguments );␊ |
96 | IOReturn setUnsolicitedStatusNotify( IOExternalMethodArguments * arguments );␊ |
97 | IOReturn setStatusNotify( IOExternalMethodArguments * arguments );␊ |
98 | ␉IOReturn createLogin( IOExternalMethodArguments * arguments );␊ |
99 | IOReturn releaseLogin( IOExternalMethodArguments * arguments );␊ |
100 | IOReturn submitLogin( IOExternalMethodArguments * arguments );␊ |
101 | IOReturn submitLogout( IOExternalMethodArguments * arguments );␊ |
102 | ␉IOReturn setLoginFlags( IOExternalMethodArguments * arguments );␊ |
103 | IOReturn getMaxCommandBlockSize( IOExternalMethodArguments * arguments );␊ |
104 | IOReturn getLoginID( IOExternalMethodArguments * arguments );␊ |
105 | IOReturn setReconnectTime( IOExternalMethodArguments * arguments );␊ |
106 | ␉IOReturn setMaxPayloadSize( IOExternalMethodArguments * arguments );␊ |
107 | ␊ |
108 | ␉IOReturn submitFetchAgentReset( IOExternalMethodArguments * arguments );␊ |
109 | ␉IOReturn setFetchAgentWriteCompletion( IOExternalMethodArguments * arguments );␊ |
110 | ␉IOReturn ringDoorbell( IOExternalMethodArguments * arguments );␊ |
111 | ␉IOReturn enableUnsolicitedStatus( IOExternalMethodArguments * arguments );␊ |
112 | ␉IOReturn setBusyTimeoutRegisterValue( IOExternalMethodArguments * arguments );␊ |
113 | IOReturn setPassword( IOExternalMethodArguments * arguments );␊ |
114 | ␊ |
115 | ␉// callbacks␊ |
116 | ␉␊ |
117 | ␉static void staticLoginCallback( void * refCon, FWSBP2LoginCompleteParamsPtr params );␊ |
118 | virtual void loginCallback( FWSBP2LoginCompleteParamsPtr params );␊ |
119 | ␊ |
120 | ␉static void staticLogoutCallback( void * refCon, FWSBP2LogoutCompleteParamsPtr params );␊ |
121 | virtual void logoutCallback( FWSBP2LogoutCompleteParamsPtr params );␊ |
122 | ␊ |
123 | ␉static void staticStatusNotify( void * refCon, FWSBP2NotifyParams * params );␊ |
124 | virtual void statusNotify( FWSBP2NotifyParams * params );␊ |
125 | ␊ |
126 | ␉static void staticUnsolicitedNotify( void * refCon, FWSBP2NotifyParams * params );␊ |
127 | virtual void unsolicitedNotify( FWSBP2NotifyParams * params );␊ |
128 | ␊ |
129 | ␉static void staticFetchAgentWriteComplete( void * refCon, IOReturn status, IOFireWireSBP2ORB * orb );␊ |
130 | ␉virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireSBP2ORB * orb );␊ |
131 | ␊ |
132 | static void staticFetchAgentResetComplete( void * refCon, IOReturn status );␊ |
133 | virtual void fetchAgentResetComplete( IOReturn status );␊ |
134 | ␉␊ |
135 | /////////////////////////////////////////////////␊ |
136 | // IOFireWireSBP2ORB␊ |
137 | ␊ |
138 | IOReturn createORB( IOExternalMethodArguments * arguments );␊ |
139 | IOReturn releaseORB( IOExternalMethodArguments * arguments );␊ |
140 | ␉IOReturn submitORB( IOExternalMethodArguments * arguments );␊ |
141 | IOReturn setCommandFlags( IOExternalMethodArguments * arguments );␊ |
142 | IOReturn setORBRefCon( IOExternalMethodArguments * arguments );␊ |
143 | ␉IOReturn setMaxORBPayloadSize( IOExternalMethodArguments * arguments );␊ |
144 | IOReturn setCommandTimeout( IOExternalMethodArguments * arguments );␊ |
145 | ␉IOReturn setCommandGeneration( IOExternalMethodArguments * arguments );␊ |
146 | IOReturn setToDummy( IOExternalMethodArguments * arguments );␊ |
147 | IOReturn setCommandBuffersAsRanges( IOExternalMethodArguments * arguments );␊ |
148 | IOReturn releaseCommandBuffers( IOExternalMethodArguments * arguments );␊ |
149 | IOReturn setCommandBlock( IOExternalMethodArguments * arguments );␊ |
150 | ␉␊ |
151 | ␉// LSI workaround␊ |
152 | IOReturn LSIWorkaroundSetCommandBuffersAsRanges( IOExternalMethodArguments * arguments );␊ |
153 | ␉IOReturn LSIWorkaroundSyncBuffersForOutput( IOExternalMethodArguments * arguments );␊ |
154 | ␉IOReturn LSIWorkaroundSyncBuffersForInput( IOExternalMethodArguments * arguments );␊ |
155 | ␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␊ |
156 | /////////////////////////////////////////////////␊ |
157 | // IOFireWireSBP2MgmtORB␊ |
158 | ␊ |
159 | ␉IOReturn createMgmtORB( IOExternalMethodArguments * arguments );␊ |
160 | IOReturn releaseMgmtORB( IOExternalMethodArguments * arguments );␊ |
161 | IOReturn setMgmtORBCallback( IOExternalMethodArguments * arguments );␊ |
162 | IOReturn submitMgmtORB( IOExternalMethodArguments * arguments );␉␊ |
163 | ␉IOReturn setMgmtORBCommandFunction( IOExternalMethodArguments * arguments );␊ |
164 | ␉IOReturn setMgmtORBManageeORB( IOExternalMethodArguments * arguments );␊ |
165 | ␉IOReturn setMgmtORBManageeLogin( IOExternalMethodArguments * arguments );␊ |
166 | ␉IOReturn setMgmtORBResponseBuffer( IOExternalMethodArguments * arguments );␊ |
167 | ␊ |
168 | ␉// callbacks␊ |
169 | static void staticMgmtORBCallback( void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb );␊ |
170 | virtual void mgmtORBCallback( IOReturn status, IOFireWireSBP2ManagementORB * orb );␊ |
171 | ␉␊ |
172 | ␉// IOFireWireSBP2MgmtORB friend class wrappers␊ |
173 | ␉virtual void setMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); ␊ |
174 | ␉virtual void getMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef );␊ |
175 | ␊ |
176 | ␉ uint32_t␉␉ checkScalarInputCount;␊ |
177 | uint32_t␉␉ checkStructureInputSize;␊ |
178 | uint32_t␉␉ checkScalarOutputCount;␊ |
179 | uint32_t␉␉ checkStructureOutputSize;␊ |
180 | ␊ |
181 | IOReturn checkArguments( IOExternalMethodArguments * args, uint32_t scalarInCount, uint32_t structInCount, ␊ |
182 | ␉␉␉␉␉␉␉␉␉␉␉␉␉uint32_t scalarOutCount, uint32_t structOutCount );␊ |
183 | ␊ |
184 | };␊ |
185 | ␊ |
186 | #endif |