2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
30 #include <IOKit/assert.h>
31 #include <IOKit/IOLib.h>
32 #include <IOKit/IOBufferMemoryDescriptor.h>
33 #include "IOADBControllerUserClient.h"
35 #define super IOUserClient
37 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
39 OSDefineMetaClassAndStructors(IOADBControllerUserClient
, IOUserClient
)
41 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
43 IOADBControllerUserClient
*IOADBControllerUserClient::withTask(task_t owningTask
)
45 IOADBControllerUserClient
* me
;
47 me
= new IOADBControllerUserClient
;
53 me
->fTask
= owningTask
;
58 bool IOADBControllerUserClient::start( IOService
* provider
)
60 assert(OSDynamicCast(IOADBController
, provider
));
61 if(!super::start(provider
))
63 fOwner
= (IOADBController
*)provider
;
65 // Got the owner, so initialize the call structures
66 fMethods
[kADBReadDevice
].object
= provider
;
67 fMethods
[kADBReadDevice
].func
= (IOMethod
)&IOADBController::readDeviceForUser
;
68 fMethods
[kADBReadDevice
].count0
= 2;
69 fMethods
[kADBReadDevice
].count1
= 8;
70 fMethods
[kADBReadDevice
].flags
= kIOUCScalarIStructO
;
72 fMethods
[kADBWriteDevice
].object
= provider
;
73 fMethods
[kADBWriteDevice
].func
= (IOMethod
)&IOADBController::writeDeviceForUser
;
74 fMethods
[kADBWriteDevice
].count0
= 4;
75 fMethods
[kADBWriteDevice
].count1
= 0;
76 fMethods
[kADBWriteDevice
].flags
= kIOUCScalarIScalarO
;
78 fMethods
[kADBClaimDevice
].object
= provider
;
79 fMethods
[kADBClaimDevice
].func
= (IOMethod
)&IOADBController::claimDevice
;
80 fMethods
[kADBClaimDevice
].count0
= 1;
81 fMethods
[kADBClaimDevice
].count1
= 0;
82 fMethods
[kADBClaimDevice
].flags
= kIOUCScalarIScalarO
;
84 fMethods
[kADBReleaseDevice
].object
= provider
;
85 fMethods
[kADBReleaseDevice
].func
= (IOMethod
)&IOADBController::releaseDevice
;
86 fMethods
[kADBReleaseDevice
].count0
= 1;
87 fMethods
[kADBReleaseDevice
].count1
= 0;
88 fMethods
[kADBReleaseDevice
].flags
= kIOUCScalarIScalarO
;
93 IOReturn
IOADBControllerUserClient::clientMemoryForType( UInt32 type
,
94 UInt32
* flags
, IOLogicalAddress
* address
, IOByteCount
* size
)
96 return kIOReturnUnsupported
;
99 IOReturn
IOADBControllerUserClient::clientClose( void )
103 return kIOReturnSuccess
;
106 IOReturn
IOADBControllerUserClient::clientDied( void )
108 return( clientClose());
111 IOReturn
IOADBControllerUserClient::connectClient( IOUserClient
* client
)
113 return kIOReturnSuccess
;
116 IOExternalMethod
* IOADBControllerUserClient::getExternalMethodForIndex( UInt32 index
)
118 if(index
>= kNumADBMethods
)
121 return &fMethods
[index
];
124 IOReturn
IOADBControllerUserClient::registerNotificationPort ( mach_port_t port
, UInt32 type
)
126 return kIOReturnUnsupported
;