Annotation of sys/dev/adb/adb.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: adb.h,v 1.3 2007/03/13 20:56:56 miod Exp $ */
2: /* $NetBSD: adbsys.h,v 1.4 2000/12/19 02:59:24 tsubai Exp $ */
3:
4: /*-
5: * Copyright (C) 1993, 1994 Allen K. Briggs, Chris P. Caputo,
6: * Michael L. Finch, Bradley A. Grantham, and
7: * Lawrence A. Kesteloot
8: * All rights reserved.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
20: * This product includes software developed by the Alice Group.
21: * 4. The names of the Alice Group or any of its members may not be used
22: * to endorse or promote products derived from this software without
23: * specific prior written permission.
24: *
25: * THIS SOFTWARE IS PROVIDED BY THE ALICE GROUP ``AS IS'' AND ANY EXPRESS OR
26: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28: * IN NO EVENT SHALL THE ALICE GROUP BE LIABLE FOR ANY DIRECT, INDIRECT,
29: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35: */
36:
37: #ifndef _ADB_H_
38: #define _ADB_H_
39:
40: #ifdef _KERNEL
41:
42: /*
43: * Arguments used to attach a device to the Apple Desktop Bus
44: */
45: struct adb_attach_args {
46: int origaddr;
47: int adbaddr;
48: int handler_id;
49: };
50:
51: #define ADB_CMDADDR(cmd) ((u_int8_t)(cmd & 0xf0) >> 4)
52: #define ADBFLUSH(dev) ((((u_int8_t)dev & 0x0f) << 4) | 0x01)
53: #define ADBLISTEN(dev, reg) ((((u_int8_t)dev & 0x0f) << 4) | 0x08 | reg)
54: #define ADBTALK(dev, reg) ((((u_int8_t)dev & 0x0f) << 4) | 0x0c | reg)
55:
56: /* an ADB event */
57: typedef struct adb_event_s {
58: int byte_count; /* number of bytes */
59: unsigned char bytes[8]; /* bytes from register 0 */
60: } adb_event_t;
61:
62: /* Interesting default addresses */
63: #define ADBADDR_SECURE 1 /* Security dongles */
64: #define ADBADDR_MAP 2 /* Mapped devices (keyboards/pads) */
65: #define ADBADDR_REL 3 /* Relative positioning devices
66: (mice, trackballs/pads) */
67: #define ADBADDR_ABS 4 /* Absolute positioning devices
68: (graphics tablets) */
69: #define ADBADDR_DATATX 5
70: #define ADBADDR_RSRVD 6 /* Reserved by Apple */
71: #define ADBADDR_MISC 7 /* Miscellaneous appliances */
72: #define ADBADDR_DONGLE ADBADDR_SECURE
73: #define ADBADDR_KBD ADBADDR_MAP
74: #define ADBADDR_MS ADBADDR_REL
75: #define ADBADDR_TABLET ADBADDR_ABS
76: #define ADBADDR_MODEM ADBADDR_DATATX
77:
78: #define ADBADDR_APM 0xac0ff /* A faux-addr for the APM driver to
79: latch onto */
80:
81: /* Interesting keyboard handler IDs */
82: #define ADB_STDKBD 1
83: #define ADB_EXTKBD 2
84: #define ADB_ISOKBD 4
85: #define ADB_EXTISOKBD 5
86: #define ADB_KBDII 8
87: #define ADB_ISOKBDII 9
88: #define ADB_PBKBD 12
89: #define ADB_PBISOKBD 13
90: #define ADB_ADJKPD 14
91: #define ADB_ADJKBD 16
92: #define ADB_ADJISOKBD 17
93: #define ADB_ADJJAPKBD 18
94: #define ADB_PBEXTISOKBD 20
95: #define ADB_PBEXTJAPKBD 21
96: #define ADB_JPKBDII 22
97: #define ADB_PBEXTKBD 24
98: #define ADB_DESIGNKBD 27 /* XXX Needs to be verified XXX */
99: #define ADB_PBJPKBD 30
100: #define ADB_PBG4KBD 195
101: #define ADB_IBITISOKBD 196
102: #define ADB_PBG3JPKBD 201
103:
104: /* Interesting mouse handler IDs */
105: #define ADBMS_100DPI 1
106: #define ADBMS_200DPI 2
107: #define ADBMS_MSA3 3 /* Mouse Systems A3 Mouse */
108: #define ADBMS_EXTENDED 4 /* Extended mouse protocol */
109: #define ADBMS_USPEED 0x2f /* MicroSpeed mouse */
110: #define ADBMS_UCONTOUR 0x66 /* Contour mouse */
111: #define ADBMS_TURBO 50 /* Kensington Turbo Mouse */
112:
113: /* Interesting tablet handler ID */
114: #define ADB_ARTPAD 58 /* WACOM ArtPad II tablet */
115:
116: /* Interesting miscellaneous handler ID */
117: #define ADB_POWERKEY 34 /* Sophisticated Circuits PowerKey */
118: /* (intelligent power tap) */
119:
120: extern int adb_polling;
121: #ifdef ADB_DEBUG
122: extern int adb_debug;
123: #endif
124:
125: /* ADB Manager */
126:
127: typedef caddr_t Ptr;
128:
129: typedef struct {
130: Ptr siServiceRtPtr;
131: Ptr siDataAreaAddr;
132: } ADBSetInfoBlock;
133:
134: typedef struct {
135: unsigned char devType;
136: unsigned char origADBAddr;
137: Ptr dbServiceRtPtr;
138: Ptr dbDataAreaAddr;
139: } ADBDataBlock;
140:
141: int adbprint(void *, const char *);
142: int adb_op_sync(Ptr, short);
143: int set_adb_info(ADBSetInfoBlock *, int);
144:
145: #endif /* _KERNEL */
146:
147: #endif /* _ADB_H_ */
CVSweb