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