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