1 /* $NetBSD: adbvar.h,v 1.13 2009/03/14 14:46:01 dsl Exp $ */
4 * Copyright (C) 1994 Bradley A. Grantham
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include <machine/adbsys.h>
31 * Arguments used to attach a device to the Apple Desktop Bus
33 struct adb_attach_args
{
39 typedef struct adb_trace_xlate_s
{
44 extern adb_trace_xlate_t adb_trace_xlations
[];
57 typedef void **Handle
;
65 unsigned char devType
;
66 unsigned char origADBAddr
;
76 typedef void (adbComp
)(void *, volatile int *, int);
79 extern int adbHardware
;
81 /* types of adb hardware that we (will eventually) support */
82 #define ADB_HW_UNKNOWN 0x01 /* don't know */
83 #define ADB_HW_II 0x02 /* Mac II series */
84 #define ADB_HW_IISI 0x03 /* Mac IIsi series */
85 #define ADB_HW_PMU 0x04 /* PowerBook series */
86 #define ADB_HW_CUDA 0x05 /* Machines with a Cuda chip */
88 #define ADB_CMDADDR(cmd) ((u_int8_t)((cmd) & 0xf0) >> 4)
89 #define ADBFLUSH(dev) ((((u_int8_t)(dev) & 0x0f) << 4) | 0x01)
90 #define ADBLISTEN(dev, reg) ((((u_int8_t)(dev) & 0x0f) << 4) | 0x08 | (reg))
91 #define ADBTALK(dev, reg) ((((u_int8_t)(dev) & 0x0f) << 4) | 0x0c | (reg))
94 int adb_poweroff(void);
95 void adb_restart(void);
96 void adb_cuda_autopoll(void);
97 int adb_intr_cuda(void *);
100 int GetIndADB(ADBDataBlock
* info
, int index
);
101 int GetADBInfo(ADBDataBlock
* info
, int adbAddr
);
102 int SetADBInfo(ADBSetInfoBlock
* info
, int adbAddr
);
103 int ADBOp(Ptr buffer
, adbComp
*compRout
, Ptr data
, short commandNum
);
104 int adb_read_date_time(unsigned long *t
);
105 int adb_set_date_time(unsigned long t
);
107 int adb_op_sync(Ptr
, adbComp
*, Ptr
, short);
108 void adb_op_comprout(void *, volatile int *, int);