xref: /csrg-svn/sys/sparc/dev/kbio.h (revision 55106)
1*55106Storek /*
2*55106Storek  * Copyright (c) 1992 The Regents of the University of California.
3*55106Storek  * All rights reserved.
4*55106Storek  *
5*55106Storek  * This software was developed by the Computer Systems Engineering group
6*55106Storek  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
7*55106Storek  * contributed to Berkeley.
8*55106Storek  *
9*55106Storek  * %sccs.include.redist.c%
10*55106Storek  *
11*55106Storek  *	@(#)kbio.h	7.1 (Berkeley) 07/13/92
12*55106Storek  *
13*55106Storek  * from: $Header: kbio.h,v 1.3 92/06/17 05:35:49 torek Exp $ (LBL)
14*55106Storek  */
15*55106Storek 
16*55106Storek /*
17*55106Storek  * The following is a minimal emulation of Sun's `kio' structures
18*55106Storek  * and related operations necessary to make X11 happy (i.e., make it
19*55106Storek  * compile, and make old X11 binaries run).
20*55106Storek  */
21*55106Storek 
22*55106Storek /*
23*55106Storek  * The kiockey structure apparently gets and/or sets keyboard mappings.
24*55106Storek  * It seems to be kind of useless, but X11 uses it (according to the
25*55106Storek  * comments) to figure out when a Sun 386i has a type-4 keyboard but
26*55106Storek  * claims to have a type-3 keyboard.  We need just enough to cause the
27*55106Storek  * appropriate ioctl to return the appropriate magic value.
28*55106Storek  *
29*55106Storek  * KIOCGETKEY fills in kio_entry from kio_station.  Not sure what tablemask
30*55106Storek  * is for; X sets it before the call, so it is not an output, but we do not
31*55106Storek  * care anyway.  KIOCSDIRECT is supposed to tell the kernel whether to send
32*55106Storek  * keys to the console or to X; we just send them to X whenever the keyboard
33*55106Storek  * is open at all.  (XXX may need to change this later)
34*55106Storek  *
35*55106Storek  * Keyboard commands and types are defined in kbd.h as they are actually
36*55106Storek  * real hardware commands and type numbers.
37*55106Storek  */
38*55106Storek struct kiockey {
39*55106Storek 	int	kio_tablemask;	/* whatever */
40*55106Storek 	u_char	kio_station;	/* key number */
41*55106Storek 	u_char	kio_entry;	/* HOLE if not present */
42*55106Storek 	char	kio_text[10];	/* the silly escape sequences (unsupported) */
43*55106Storek };
44*55106Storek 
45*55106Storek #define	HOLE	0x302		/* value for kio_entry to say `really type 3' */
46*55106Storek 
47*55106Storek #define	KIOCTRANS	_IOW('k', 0, int)	/* set translation mode */
48*55106Storek 			/* (we only accept TR_UNTRANS_EVENT) */
49*55106Storek #define	KIOCGETKEY	_IOWR('k', 2, struct kiockey) /* fill in kio_entry */
50*55106Storek #define	KIOCGTRANS	_IOR('k', 5, int)	/* get translation mode */
51*55106Storek #define	KIOCCMD		_IOW('k', 8, int)	/* X uses this to ring bell */
52*55106Storek #define	KIOCTYPE	_IOR('k', 9, int)	/* get keyboard type */
53*55106Storek #define	KIOCSDIRECT	_IOW('k', 10, int)	/* keys to console? */
54*55106Storek 
55*55106Storek #define	TR_UNTRANS_EVENT	3
56