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 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
29 * Permission to use, copy, modify, and distribute this software and
30 * its documentation for any purpose and without fee is hereby granted,
31 * provided that the above copyright notice appears in all copies and
32 * that both the copyright notice and this permission notice appear in
33 * supporting documentation.
35 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
36 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37 * FOR A PARTICULAR PURPOSE.
39 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
40 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
42 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
43 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
47 * Copyright 1996 1995 by Apple Computer, Inc. 1997 1996 1995 1994 1993 1992 1991
50 * Permission to use, copy, modify, and distribute this software and
51 * its documentation for any purpose and without fee is hereby granted,
52 * provided that the above copyright notice appears in all copies and
53 * that both the copyright notice and this permission notice appear in
54 * supporting documentation.
56 * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
57 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
58 * FOR A PARTICULAR PURPOSE.
60 * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
61 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
62 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
63 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
64 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
70 * 18 June 1998 sdouglas
71 * Start IOKit version.
74 #define ADB_DEVICE_COUNT 16
76 #define ADB_FLAGS_PRESENT 0x00000001 /* Device is present */
77 #define ADB_FLAGS_REGISTERED 0x00000002 /* Device has a handler */
78 #define ADB_FLAGS_UNRESOLVED 0x00000004 /* Device has not been fully probed */
84 #define ADB_DEVCMD_SELF_TEST 0xff
85 #define ADB_DEVCMD_CHANGE_ID 0xfe
86 #define ADB_DEVCMD_CHANGE_ID_AND_ACT 0xfd
87 #define ADB_DEVCMD_CHANGE_ID_AND_ENABLE 0x00
91 struct ADBDeviceControl
{
93 IOADBAddress defaultAddress
;
95 UInt8 defaultHandlerID
;
97 id owner
; // here for speed
100 typedef struct ADBDeviceControl ADBDeviceControl
;
105 @interface IOADBBus
: IODevice
<IOADBAutoPollHandler
>
107 IODevice
<IOADBController
> * controller
;
109 ADBDeviceControl
* adbDevices
[ ADB_DEVICE_COUNT
];
112 - (IOReturn
) probeBus
;
113 - setUpName
:(IOADBDevice
*)device
;
117 - (IOReturn
) setOwner
:owner forDevice
:(void *)busRef
;
119 - (IOReturn
) flush
:(void *)busRef
;
121 - (IOReturn
) readRegister
:(void *)busRef
122 adbRegister
:(IOADBRegister
)adbRegister
123 contents
:(UInt8
*)data
124 length
:(IOByteCount
*)length
;
126 - (IOReturn
) writeRegister
:(void *)busRef
127 adbRegister
:(IOADBRegister
)adbRegister
128 contents
:(UInt8
*)data
129 length
:(IOByteCount
*)length
;
131 - (IOADBAddress
) address
:(void *)busRef
;
133 - (IOADBAddress
) defaultAddress
:(void *)busRef
;
135 - (UInt8
) handlerID
:(void *)busRef
;
137 - (UInt8
) defaultHandlerID
:(void *)busRef
;
139 - (IOReturn
) setHandlerID
:(void *)busRef
140 handlerID
:(UInt8
)handlerID
;
144 @interface IOADBDevice
: IODevice
<IOADBDevice
>
150 - initForBus
:(IOADBBus
*)bus andBusRef
:(void *)busRef
;