xref: /openbsd-src/sys/dev/adb/akbdvar.h (revision 9b08915371287c5b935847fb55b21b634472fb47)
1*9b089153Smpi /*	$OpenBSD: akbdvar.h,v 1.4 2012/01/29 10:54:21 mpi Exp $	*/
2305d9e87Smiod /*	$NetBSD: akbdvar.h,v 1.4 1999/02/17 14:56:56 tsubai Exp $	*/
3305d9e87Smiod 
4305d9e87Smiod /*
5305d9e87Smiod  * Copyright (C) 1998	Colin Wood
6305d9e87Smiod  * All rights reserved.
7305d9e87Smiod  *
8305d9e87Smiod  * Redistribution and use in source and binary forms, with or without
9305d9e87Smiod  * modification, are permitted provided that the following conditions
10305d9e87Smiod  * are met:
11305d9e87Smiod  * 1. Redistributions of source code must retain the above copyright
12305d9e87Smiod  *    notice, this list of conditions and the following disclaimer.
13305d9e87Smiod  * 2. Redistributions in binary form must reproduce the above copyright
14305d9e87Smiod  *    notice, this list of conditions and the following disclaimer in the
15305d9e87Smiod  *    documentation and/or other materials provided with the distribution.
16305d9e87Smiod  * 3. All advertising materials mentioning features or use of this software
17305d9e87Smiod  *    must display the following acknowledgement:
18305d9e87Smiod  *	This product includes software developed by Colin Wood.
19305d9e87Smiod  * 4. The name of the author may not be used to endorse or promote products
20305d9e87Smiod  *    derived from this software without specific prior written permission.
21305d9e87Smiod  *
22305d9e87Smiod  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23305d9e87Smiod  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24305d9e87Smiod  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25305d9e87Smiod  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26305d9e87Smiod  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27305d9e87Smiod  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28305d9e87Smiod  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29305d9e87Smiod  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30305d9e87Smiod  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31305d9e87Smiod  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32305d9e87Smiod  */
33305d9e87Smiod 
34305d9e87Smiod #ifndef _ADB_AKBDVAR_H_
35305d9e87Smiod #define _ADB_AKBDVAR_H_
36305d9e87Smiod 
37305d9e87Smiod /*
38305d9e87Smiod  * State info, per keyboard instance.
39305d9e87Smiod  */
40305d9e87Smiod struct akbd_softc {
41305d9e87Smiod 	struct	device	sc_dev;
42305d9e87Smiod 
43305d9e87Smiod 	/* ADB info */
44305d9e87Smiod 	int		origaddr;	/* ADB device type (ADBADDR_KBD) */
45305d9e87Smiod 	int		adbaddr;	/* current ADB address */
46305d9e87Smiod 	int		handler_id;	/* type of keyboard */
47305d9e87Smiod 
48305d9e87Smiod 	u_int8_t	sc_leds;	/* current LED state */
49*9b089153Smpi 	u_int8_t	sc_iso;
5071b69b65Smiod 
5171b69b65Smiod 	int		sc_caps;	/* capslock key state */
52305d9e87Smiod 	struct device	*sc_wskbddev;
5371b69b65Smiod 
54305d9e87Smiod #ifdef WSDISPLAY_COMPAT_RAWKBD
55305d9e87Smiod 	int sc_rawkbd;
56305d9e87Smiod #endif /* defined(WSDISPLAY_COMPAT_RAWKBD) */
57305d9e87Smiod };
58305d9e87Smiod 
59305d9e87Smiod /* LED register bits, inverse of actual register value */
60305d9e87Smiod #define LED_NUMLOCK	0x1
61305d9e87Smiod #define LED_CAPSLOCK	0x2
62305d9e87Smiod #define LED_SCROLL_LOCK	0x4
63305d9e87Smiod 
64305d9e87Smiod int	akbd_cnattach(void);
65305d9e87Smiod int	akbd_is_console(void);
66305d9e87Smiod 
67305d9e87Smiod extern struct wskbd_mapdata akbd_keymapdata;
68305d9e87Smiod extern int adb_polledkey;
69305d9e87Smiod 
70305d9e87Smiod #endif /* _ADB_AKBDVAR_H_ */
71