2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
26 * Permission to use, copy, modify, and distribute this software and
27 * its documentation for any purpose and without fee is hereby granted,
28 * provided that the above copyright notice appears in all copies and
29 * that both the copyright notice and this permission notice appear in
30 * supporting documentation.
32 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
33 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
34 * FOR A PARTICULAR PURPOSE.
36 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
37 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
39 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
40 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 * Copyright 1996 1995 by Apple Computer, Inc. 1997 1996 1995 1994 1993 1992 1991
47 * Permission to use, copy, modify, and distribute this software and
48 * its documentation for any purpose and without fee is hereby granted,
49 * provided that the above copyright notice appears in all copies and
50 * that both the copyright notice and this permission notice appear in
51 * supporting documentation.
53 * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
54 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
55 * FOR A PARTICULAR PURPOSE.
57 * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
58 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
59 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
60 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
61 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
67 * 18 June 1998 sdouglas
68 * Start IOKit version.
71 #define ADB_DEVICE_COUNT 16
73 #define ADB_FLAGS_PRESENT 0x00000001 /* Device is present */
74 #define ADB_FLAGS_REGISTERED 0x00000002 /* Device has a handler */
75 #define ADB_FLAGS_UNRESOLVED 0x00000004 /* Device has not been fully probed */
81 #define ADB_DEVCMD_SELF_TEST 0xff
82 #define ADB_DEVCMD_CHANGE_ID 0xfe
83 #define ADB_DEVCMD_CHANGE_ID_AND_ACT 0xfd
84 #define ADB_DEVCMD_CHANGE_ID_AND_ENABLE 0x00
88 struct ADBDeviceControl
{
90 IOADBAddress defaultAddress
;
92 UInt8 defaultHandlerID
;
94 id owner
; // here for speed
97 typedef struct ADBDeviceControl ADBDeviceControl
;
102 @interface IOADBBus
: IODevice
<IOADBAutoPollHandler
>
104 IODevice
<IOADBController
> * controller
;
106 ADBDeviceControl
* adbDevices
[ ADB_DEVICE_COUNT
];
109 - (IOReturn
) probeBus
;
110 - setUpName
:(IOADBDevice
*)device
;
114 - (IOReturn
) setOwner
:owner forDevice
:(void *)busRef
;
116 - (IOReturn
) flush
:(void *)busRef
;
118 - (IOReturn
) readRegister
:(void *)busRef
119 adbRegister
:(IOADBRegister
)adbRegister
120 contents
:(UInt8
*)data
121 length
:(IOByteCount
*)length
;
123 - (IOReturn
) writeRegister
:(void *)busRef
124 adbRegister
:(IOADBRegister
)adbRegister
125 contents
:(UInt8
*)data
126 length
:(IOByteCount
*)length
;
128 - (IOADBAddress
) address
:(void *)busRef
;
130 - (IOADBAddress
) defaultAddress
:(void *)busRef
;
132 - (UInt8
) handlerID
:(void *)busRef
;
134 - (UInt8
) defaultHandlerID
:(void *)busRef
;
136 - (IOReturn
) setHandlerID
:(void *)busRef
137 handlerID
:(UInt8
)handlerID
;
141 @interface IOADBDevice
: IODevice
<IOADBDevice
>
147 - initForBus
:(IOADBBus
*)bus andBusRef
:(void *)busRef
;