155106Storek /* 2*63318Sbostic * Copyright (c) 1992, 1993 3*63318Sbostic * The Regents of the University of California. All rights reserved. 455106Storek * 555106Storek * This software was developed by the Computer Systems Engineering group 655106Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 755106Storek * contributed to Berkeley. 855106Storek * 955499Sbostic * All advertising materials mentioning features or use of this software 1055499Sbostic * must display the following acknowledgement: 1155499Sbostic * This product includes software developed by the University of 1259190Storek * California, Lawrence Berkeley Laboratory. 1355499Sbostic * 1455106Storek * %sccs.include.redist.c% 1555106Storek * 16*63318Sbostic * @(#)kbio.h 8.1 (Berkeley) 06/11/93 1755106Storek * 1859190Storek * from: $Header: kbio.h,v 1.4 92/11/26 01:16:32 torek Exp $ (LBL) 1955106Storek */ 2055106Storek 2155106Storek /* 2255106Storek * The following is a minimal emulation of Sun's `kio' structures 2355106Storek * and related operations necessary to make X11 happy (i.e., make it 2455106Storek * compile, and make old X11 binaries run). 2555106Storek */ 2655106Storek 2755106Storek /* 2855106Storek * The kiockey structure apparently gets and/or sets keyboard mappings. 2955106Storek * It seems to be kind of useless, but X11 uses it (according to the 3055106Storek * comments) to figure out when a Sun 386i has a type-4 keyboard but 3155106Storek * claims to have a type-3 keyboard. We need just enough to cause the 3255106Storek * appropriate ioctl to return the appropriate magic value. 3355106Storek * 3455106Storek * KIOCGETKEY fills in kio_entry from kio_station. Not sure what tablemask 3555106Storek * is for; X sets it before the call, so it is not an output, but we do not 3655106Storek * care anyway. KIOCSDIRECT is supposed to tell the kernel whether to send 3755106Storek * keys to the console or to X; we just send them to X whenever the keyboard 3855106Storek * is open at all. (XXX may need to change this later) 3955106Storek * 4055106Storek * Keyboard commands and types are defined in kbd.h as they are actually 4155106Storek * real hardware commands and type numbers. 4255106Storek */ 4355106Storek struct kiockey { 4455106Storek int kio_tablemask; /* whatever */ 4555106Storek u_char kio_station; /* key number */ 4655106Storek u_char kio_entry; /* HOLE if not present */ 4755106Storek char kio_text[10]; /* the silly escape sequences (unsupported) */ 4855106Storek }; 4955106Storek 5055106Storek #define HOLE 0x302 /* value for kio_entry to say `really type 3' */ 5155106Storek 5255106Storek #define KIOCTRANS _IOW('k', 0, int) /* set translation mode */ 5355106Storek /* (we only accept TR_UNTRANS_EVENT) */ 5455106Storek #define KIOCGETKEY _IOWR('k', 2, struct kiockey) /* fill in kio_entry */ 5555106Storek #define KIOCGTRANS _IOR('k', 5, int) /* get translation mode */ 5655106Storek #define KIOCCMD _IOW('k', 8, int) /* X uses this to ring bell */ 5755106Storek #define KIOCTYPE _IOR('k', 9, int) /* get keyboard type */ 5855106Storek #define KIOCSDIRECT _IOW('k', 10, int) /* keys to console? */ 5955106Storek 6055106Storek #define TR_UNTRANS_EVENT 3 61