2 * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch.
4 * Copyright (c) 1992, 1993 Brian Dunford-Shore and Holger Veit.
6 * Copyright (C) 1992, 1993 Soeren Schmidt.
10 * For the sake of compatibility, portions of this code regarding the
11 * X server interface are taken from Soeren Schmidt's syscons driver.
13 * This code is derived from software contributed to 386BSD by
16 * This code is derived from software contributed to Berkeley by
17 * William Jolitz and Don Ahn.
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution.
27 * 3. All advertising materials mentioning features or use of this software
28 * must display the following acknowledgement:
29 * This product includes software developed by
30 * Hellmuth Michaelis, Brian Dunford-Shore, Joerg Wunsch, Holger Veit
32 * 4. The name authors may not be used to endorse or promote products
33 * derived from this software without specific prior written permission.
35 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
36 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
38 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
39 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
40 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
41 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
42 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
44 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 * @(#)ioctl_pcvt.h, 3.20, Last Edit-Date: [Fri Apr 7 10:17:13 1995]
48 * $FreeBSD: src/sys/i386/include/pcvt_ioctl.h,v 1.13 1999/12/29 04:33:04 peter Exp $
49 * $DragonFly: src/sys/platform/pc32/include/Attic/pcvt_ioctl.h,v 1.2 2003/06/17 04:28:36 dillon Exp $
52 /*---------------------------------------------------------------------------
54 * pcvt_ioctl.h ioctl's for the VT220 video driver 'pcvt'
55 * ---------------------------------------------------------
56 * -hm ------------ Release 3.00 --------------
57 * -hm some new PCVT_xxx (and CONF_xxx) values
58 * -hm version definitions moved to begin of file
59 * -hm removed PCVT_FAKE_SYSCONS10
60 * -hm accept KERNEL or _KERNEL
61 * -hm changed _IOCTL_PCVT_H_ to _MACHINE_PCVT_IOCTL_H_ (bde)
63 *---------------------------------------------------------------------------*/
65 #ifndef _MACHINE_PCVT_IOCTL_H_
66 #define _MACHINE_PCVT_IOCTL_H_
68 /* pcvt version information for VGAPCVTID ioctl */
70 #define PCVTIDNAME "pcvt-b24" /* driver id - string */
71 #define PCVTIDMAJOR 3 /* driver id - major release */
72 #define PCVTIDMINOR 20 /* driver id - minor release */
75 #include <sys/types.h>
77 #include <sys/ioccom.h>
79 /*---------------------------------------------------------------------------*
80 * IOCTLs for MF II and AT Keyboards
81 *---------------------------------------------------------------------------*/
83 #define KBDRESET _IO('K', 1) /* reset keyboard / set defaults */
84 #define KBDGTPMAT _IOR('K', 2, int) /* get current typematic value */
85 #define KBDSTPMAT _IOW('K', 3, int) /* set current typematic value */
87 /* Typematic Delay Values */
89 #define KBD_TPD250 0x00 /* 250 ms */
90 #define KBD_TPD500 0x20 /* 500 ms */
91 #define KBD_TPD750 0x40 /* 750 ms */
92 #define KBD_TPD1000 0x60 /* 1000 ms */
94 /* Typematic Repeat Rate */
96 #define KBD_TPM300 0x00 /* 30.0 char/second */
97 #define KBD_TPM267 0x01 /* 26.7 char/second */
98 #define KBD_TPM240 0x02 /* 24.0 char/second */
99 #define KBD_TPM218 0x03 /* 21.8 char/second */
100 #define KBD_TPM200 0x04 /* 20.0 char/second */
101 #define KBD_TPM185 0x05 /* 18.5 char/second */
102 #define KBD_TPM171 0x06 /* 17.1 char/second */
103 #define KBD_TPM160 0x07 /* 16.0 char/second */
104 #define KBD_TPM150 0x08 /* 15.0 char/second */
105 #define KBD_TPM133 0x09 /* 13.3 char/second */
106 #define KBD_TPM120 0x0A /* 12.0 char/second */
107 #define KBD_TPM109 0x0B /* 10.9 char/second */
108 #define KBD_TPM100 0x0C /* 10.0 char/second */
109 #define KBD_TPM92 0x0D /* 9.2 char/second */
110 #define KBD_TPM86 0x0E /* 8.6 char/second */
111 #define KBD_TPM80 0x0F /* 8.0 char/second */
112 #define KBD_TPM75 0x10 /* 7.5 char/second */
113 #define KBD_TPM67 0x11 /* 6.7 char/second */
114 #define KBD_TPM60 0x12 /* 6.0 char/second */
115 #define KBD_TPM55 0x13 /* 5.5 char/second */
116 #define KBD_TPM50 0x14 /* 5.0 char/second */
117 #define KBD_TPM46 0x15 /* 4.6 char/second */
118 #define KBD_TPM43 0x16 /* 4.3 char/second */
119 #define KBD_TPM40 0x17 /* 4.0 char/second */
120 #define KBD_TPM37 0x18 /* 3.7 char/second */
121 #define KBD_TPM33 0x19 /* 3.3 char/second */
122 #define KBD_TPM30 0x1A /* 3.0 char/second */
123 #define KBD_TPM27 0x1B /* 2.7 char/second */
124 #define KBD_TPM25 0x1C /* 2.5 char/second */
125 #define KBD_TPM23 0x1D /* 2.3 char/second */
126 #define KBD_TPM21 0x1E /* 2.1 char/second */
127 #define KBD_TPM20 0x1F /* 2.0 char/second */
129 #define KBDGREPSW _IOR('K', 4, int) /* get key repetition switch */
130 #define KBDSREPSW _IOW('K', 5, int) /* set key repetition switch */
131 #define KBD_REPEATOFF 0
132 #define KBD_REPEATON 1
134 #define KBDGLEDS _IOR('K', 6, int) /* get LED state */
135 #define KBDSLEDS _IOW('K', 7, int) /* set LED state, does not influence */
136 #define KBD_SCROLLLOCK 0x0001 /* the driver's idea of lock key state */
137 #define KBD_NUMLOCK 0x0002
138 #define KBD_CAPSLOCK 0x0004
139 #define KBDGLOCK _IOR('K', 8, int) /* gets state of SCROLL,NUM,CAPS */
140 #define KBDSLOCK _IOW('K', 9, int) /* sets state of SCROLL,NUM,CAPS + LEDs */
142 #define KBDMAXOVLKEYSIZE 15 /* + zero byte */
144 struct kbd_ovlkey /* complete definition of a key */
146 u_short keynum; /* the key itself */
147 u_short type; /* type of key, see below */
148 u_char subu; /* subtype, ignored on write */
149 char unshift[KBDMAXOVLKEYSIZE+1]; /* emitted string, unshifted */
150 u_char subs; /* subtype, ignored on write */
151 char shift[KBDMAXOVLKEYSIZE+1]; /* emitted string, shifted */
152 u_char subc; /* subtype, ignored on write */
153 char ctrl[KBDMAXOVLKEYSIZE+1]; /* emitted string, control */
154 u_char suba; /* subtype, ignored on write */
155 char altgr[KBDMAXOVLKEYSIZE+1]; /* emitted string, altgr */
158 /* Max value for keynum field */
160 #define KBDMAXKEYS 128 /* Max No. of Keys */
162 /* Values for type field */
164 #define KBD_NONE 0 /* no function, key is disabled */
165 #define KBD_SHIFT 1 /* keyboard shift */
166 #define KBD_META 2 /* alternate shift, sets bit8 to ASCII code */
167 #define KBD_NUM 3 /* numeric shift, keypad num / appl */
168 #define KBD_CTL 4 /* control code generation */
169 #define KBD_CAPS 5 /* caps shift - swaps case of letter */
170 #define KBD_ASCII 6 /* ascii code generating key */
171 #define KBD_SCROLL 7 /* stop output */
172 #define KBD_FUNC 8 /* function key */
173 #define KBD_KP 9 /* keypad keys */
174 #define KBD_BREAK 10 /* ignored */
175 #define KBD_ALTGR 11 /* AltGr Translation feature */
176 #define KBD_SHFTLOCK 12 /* shiftlock */
177 #define KBD_CURSOR 13 /* cursor keys */
178 #define KBD_RETURN 14 /* RETURN/ENTER keys */
180 /* Values for subtype field */
182 #define KBD_SUBT_STR 0 /* key is bound to a string */
183 #define KBD_SUBT_FNC 1 /* key is bound to a function */
186 #define KBD_OVERLOAD 0x8000 /* Key is overloaded, ignored in ioctl */
187 #define KBD_MASK (~KBD_OVERLOAD) /* mask for type */
189 #define KBDGCKEY _IOWR('K',16, struct kbd_ovlkey) /* get current key values */
190 #define KBDSCKEY _IOW('K',17, struct kbd_ovlkey) /* set new key assignment values*/
191 #define KBDGOKEY _IOWR('K',18, struct kbd_ovlkey) /* get original key assignment values*/
193 #define KBDRMKEY _IOW('K',19, int) /* remove a key assignment */
194 #define KBDDEFAULT _IO('K',20) /* remove all key assignments */
196 /* mouse emulator definitions */
199 int leftbutton; /* (PC) scan code for "left button" key */
200 int middlebutton; /* (PC) scan code for "mid button" key */
201 int rightbutton; /* (PC) scan code for "right button" key */
202 int stickybuttons; /* if true, the buttons are "sticky" */
203 int acceltime; /* timeout in microseconds to start pointer */
204 /* movement acceleration */
205 /* defaults to: scan(F1), scan(F2), scan(F3), false, 500000 */
208 #define KBDMOUSEGET _IOR('K', 25, struct mousedefs) /* read defs */
209 #define KBDMOUSESET _IOW('K', 26, struct mousedefs) /* set defs */
211 /*---------------------------------------------------------------------------*
212 * IOCTLs for Video Adapter
213 *---------------------------------------------------------------------------*/
215 /* Definition of PC Video Adaptor Types */
217 #define UNKNOWN_ADAPTOR 0 /* Unidentified adaptor ... */
218 #define MDA_ADAPTOR 1 /* Monochrome Display Adaptor/Hercules Graphics Card */
219 #define CGA_ADAPTOR 2 /* Color Graphics Adaptor */
220 #define EGA_ADAPTOR 3 /* Enhanced Graphics Adaptor */
221 #define VGA_ADAPTOR 4 /* Video Graphics Adaptor/Array */
223 /* Definitions of Monitor types */
225 #define MONITOR_MONO 0 /* Monochrome Monitor */
226 #define MONITOR_COLOR 1 /* Color Monitor */
228 /* Types of VGA chips detectable by current driver version */
230 #define VGA_F_NONE 0 /* FAMILY NOT KNOWN */
231 #define VGA_UNKNOWN 0 /* default, no 132 columns */
233 #define VGA_F_TSENG 1 /* FAMILY TSENG */
234 #define VGA_ET4000 1 /* Tseng Labs ET4000 */
235 #define VGA_ET3000 2 /* Tseng Labs ET3000 */
237 #define VGA_F_WD 2 /* FAMILY WD */
238 #define VGA_PVGA 3 /* Western Digital Paradise VGA */
239 #define VGA_WD90C00 4 /* Western Digital WD90C00 */
240 #define VGA_WD90C10 5 /* Western Digital WD90C10 */
241 #define VGA_WD90C11 6 /* Western Digital WD90C11 */
243 #define VGA_F_V7 3 /* FAMILY VIDEO 7 */
244 #define VGA_V7VEGA 7 /* Video 7 VEGA VGA */
245 #define VGA_V7FWVR 8 /* Video 7 FASTWRITE/VRAM */
246 #define VGA_V7V5 9 /* Video 7 Version 5 */
247 #define VGA_V71024I 10 /* Video 7 1024i */
248 #define VGA_V7UNKNOWN 11 /* Video 7 unknown board .. */
250 #define VGA_F_TRI 4 /* FAMILY TRIDENT */
251 #define VGA_TR8800BR 12 /* Trident TVGA 8800BR */
252 #define VGA_TR8800CS 13 /* Trident TVGA 8800CS */
253 #define VGA_TR8900B 14 /* Trident TVGA 8900B */
254 #define VGA_TR8900C 15 /* Trident TVGA 8900C */
255 #define VGA_TR8900CL 16 /* Trident TVGA 8900CL */
256 #define VGA_TR9000 17 /* Trident TVGA 9000 */
257 #define VGA_TR9100 18 /* Trident TVGA 9100 */
258 #define VGA_TR9200 19 /* Trident TVGA 9200 */
259 #define VGA_TRUNKNOWN 20 /* Trident unknown */
261 #define VGA_F_S3 5 /* FAMILY S3 */
262 #define VGA_S3_911 21 /* S3 911 */
263 #define VGA_S3_924 22 /* S3 924 */
264 #define VGA_S3_80x 23 /* S3 801/805 */
265 #define VGA_S3_928 24 /* S3 928 */
266 #define VGA_S3_UNKNOWN 25 /* unknown S3 chipset */
268 #define VGA_F_CIR 6 /* FAMILY CIRRUS */
269 #define VGA_CL_GD5402 26 /* Cirrus CL-GD5402 */
270 #define VGA_CL_GD5402r1 27 /* Cirrus CL-GD5402r1 */
271 #define VGA_CL_GD5420 28 /* Cirrus CL-GD5420 */
272 #define VGA_CL_GD5420r1 29 /* Cirrus CL-GD5420r1 */
273 #define VGA_CL_GD5422 30 /* Cirrus CL-GD5422 */
274 #define VGA_CL_GD5424 31 /* Cirrus CL-GD5424 */
275 #define VGA_CL_GD5426 32 /* Cirrus CL-GD5426 */
276 #define VGA_CL_GD5428 33 /* Cirrus CL-GD5428 */
278 /*****************************************************************************/
279 /* NOTE: update the 'scon' utility when adding support for more chipsets !!! */
280 /*****************************************************************************/
282 /* Definitions of Vertical Screen Sizes for EGA/VGA Adaptors */
284 #define SIZ_25ROWS 0 /* VGA: 25 lines, 8x16 font */
285 /* EGA: 25 lines, 8x14 font */
286 #define SIZ_28ROWS 1 /* VGA: 28 lines, 8x14 font */
287 #define SIZ_35ROWS 2 /* EGA: 35 lines, 8x10 font */
288 #define SIZ_40ROWS 3 /* VGA: 40 lines, 8x10 font */
289 #define SIZ_43ROWS 4 /* EGA: 43 lines, 8x8 font */
290 #define SIZ_50ROWS 5 /* VGA: 50 lines, 8x8 font */
292 /* Definitions of Font Sizes for EGA/VGA Adaptors */
294 #define FNT_8x16 0 /* 8x16 Pixel Font, only VGA */
295 #define FNT_8x14 1 /* 8x14 Pixel Font, EGA/VGA */
296 #define FNT_8x10 2 /* 8x10 Pixel Font, EGA/VGA */
297 #define FNT_8x8 3 /* 8x8 Pixel Font, EGA/VGA */
299 /* Definitions of Character Set (Font) Numbers */
301 #define CH_SET0 0 /* Character Set (Font) 0, EGA/VGA */
302 #define CH_SET1 1 /* Character Set (Font) 1, EGA/VGA */
303 #define CH_SET2 2 /* Character Set (Font) 2, EGA/VGA */
304 #define CH_SET3 3 /* Character Set (Font) 3, EGA/VGA */
305 #define CH_SETMAX_EGA 3 /* EGA has 4 Character Sets / Fonts */
306 #define CH_SET4 4 /* Character Set (Font) 4, VGA */
307 #define CH_SET5 5 /* Character Set (Font) 5, VGA */
308 #define CH_SET6 6 /* Character Set (Font) 6, VGA */
309 #define CH_SET7 7 /* Character Set (Font) 7, VGA */
310 #define CH_SETMAX_VGA 7 /* VGA has 8 Character Sets / Fonts */
312 /* Definitions of Terminal Emulation Modes */
314 #define M_HPVT 0 /* VTxxx and HP Mode, Labels & Status Line on */
315 #define M_PUREVT 1 /* only VTxxx Sequences recognized, no Labels */
319 #define VGACURSOR _IOW('V',100, struct cursorshape) /* set cursor shape */
322 int screen_no; /* screen number for which to set, */
323 /* or -1 to set on current active screen */
324 int start; /* top scanline, range 0... Character Height - 1 */
325 int end; /* end scanline, range 0... Character Height - 1 */
328 #define VGALOADCHAR _IOW('V',101, struct vgaloadchar) /* load vga char */
331 int character_set; /* VGA character set to load into */
332 int character; /* Character to load */
333 int character_scanlines; /* Scanlines per character */
334 u_char char_table[32]; /* VGA character shape table */
337 #define VGASETFONTATTR _IOW('V',102, struct vgafontattr) /* set font attr */
338 #define VGAGETFONTATTR _IOWR('V',103, struct vgafontattr) /* get font attr */
341 int character_set; /* VGA character set */
342 int font_loaded; /* Mark font loaded or unloaded */
343 int screen_size; /* Character rows per screen */
344 int character_scanlines; /* Scanlines per character - 1 */
345 int screen_scanlines; /* Scanlines per screen - 1 byte */
348 #define VGASETSCREEN _IOW('V',104, struct screeninfo) /* set screen info */
349 #define VGAGETSCREEN _IOWR('V',105, struct screeninfo) /* get screen info */
352 int adaptor_type; /* type of video adaptor installed */
353 /* read only, ignored on write */
354 int monitor_type; /* type of monitor (mono/color)installed*/
355 /* read only, ignored on write */
356 int totalfonts; /* no of downloadable fonts */
357 /* read only, ignored on write */
358 int totalscreens; /* no of virtual screens */
359 /* read only, ignored on write */
360 int screen_no; /* screen number, this was got from */
361 /* on write, if -1, apply pure_vt_mode */
362 /* and/or screen_size to current screen */
363 /* else to screen_no supplied */
364 int current_screen; /* screen number, which is displayed. */
365 /* on write, if -1, make this screen */
366 /* the current screen, else set current */
367 /* displayed screen to parameter */
368 int pure_vt_mode; /* flag, pure VT mode or HP/VT mode */
369 /* on write, if -1, no change */
370 int screen_size; /* screen size */
371 /* on write, if -1, no change */
372 int force_24lines; /* force 24 lines if 25 lines VT mode */
373 /* or 28 lines HP mode to get pure */
374 /* VT220 screen size */
375 /* on write, if -1, no change */
376 int vga_family; /* if adaptor_type = VGA, this reflects */
377 /* the chipset family after a read */
378 /* nothing happens on write ... */
379 int vga_type; /* if adaptor_type = VGA, this reflects */
380 /* the chipset after a read */
381 /* nothing happens on write ... */
382 int vga_132; /* set to 1 if driver has support for */
383 /* 132 column operation for chipset */
384 /* currently ignored on write */
387 #define VGAREADPEL _IOWR('V', 110, struct vgapel) /*r VGA palette entry */
388 #define VGAWRITEPEL _IOW('V', 111, struct vgapel) /*w VGA palette entry */
391 unsigned idx; /* index into palette, 0 .. 255 valid */
392 unsigned r, g, b; /* RGB values, masked by VGA_PMASK (63) */
395 /* NOTE: The next ioctl is only valid if option PCVT_SCREENSAVER is configured*/
396 /* this is *not* restricted to VGA's, but won't introduce new garbage... */
398 #define VGASCREENSAVER _IOW('V', 112, int) /* set timeout for screen */
399 /* saver in seconds; 0 turns */
402 #define VGAPCVTID _IOWR('V',113, struct pcvtid) /* get driver id */
404 struct pcvtid { /* THIS STRUCTURE IS NOW FROZEN !!! */
405 #define PCVTIDNAMELN 16 /* driver id - string length */
406 char name[PCVTIDNAMELN]; /* driver name, == PCVTIDSTR */
407 int rmajor; /* revision number, major */
408 int rminor; /* revision number, minor */
409 }; /* END OF COLD PART ... */
411 #define VGAPCVTINFO _IOWR('V',114, struct pcvtinfo) /* get driver info */
413 struct pcvtinfo { /* compile time option values */
414 u_int opsys; /* PCVT_xxx(x)BSD */
415 #define CONF_UNKNOWNOPSYS 0
416 #define CONF_386BSD 1 /* unsupported */
417 #define CONF_NETBSD 2
418 #define CONF_FREEBSD 3
419 u_int opsysrel; /* Release */
420 u_int nscreens; /* PCVT_NSCREENS */
421 u_int scanset; /* PCVT_SCANSET */
422 u_int updatefast; /* PCVT_UPDATEFAST */
423 u_int updateslow; /* PCVT_UPDATESLOW */
424 u_int sysbeepf; /* PCVT_SYSBEEPF */
425 u_int pcburst; /* PCVT_PCBURST */
426 u_int kbd_fifo_sz; /* PCVT_KBD_FIFO_SZ */
428 /* config booleans */
430 u_long compile_opts; /* PCVT_xxxxxxxxxxxxxxx */
432 #define CONF_VT220KEYB 0x00000001
433 #define CONF_SCREENSAVER 0x00000002
434 #define CONF_PRETTYSCRNS 0x00000004
435 #define CONF_CTRL_ALT_DEL 0x00000008
436 #define CONF_USEKBDSEC 0x00000010
437 #define CONF_24LINESDEF 0x00000020
438 #define CONF_EMU_MOUSE 0x00000040
439 #define CONF_SHOWKEYS 0x00000080
440 #define CONF_KEYBDID 0x00000100
441 #define CONF_SIGWINCH 0x00000200
442 #define CONF_NULLCHARS 0x00000400
443 #define CONF_BACKUP_FONTS 0x00000800
444 #define CONF_SW0CNOUTP 0x00001000 /* was FORCE8BIT */
445 /* 0x00002000 was NEEDPG */
446 #define CONF_SETCOLOR 0x00004000
447 #define CONF_132GENERIC 0x00008000
448 #define CONF_PALFLICKER 0x00010000
449 #define CONF_WAITRETRACE 0x00020000
450 #define CONF_XSERVER 0x00040000
451 #define CONF_USL_VT_COMPAT 0x00080000
452 #define CONF_PORTIO_DELAY 0x00100000 /* was FAKE_SYSCONS10 */
453 #define CONF_INHIBIT_NUMLOCK 0x00200000
454 #define CONF_META_ESC 0x00400000
455 #define CONF_NOFASTSCROLL 0x00800000
456 #define CONF_SLOW_INTERRUPT 0x01000000
457 #define CONF_KBD_FIFO 0x02000000
458 #define CONF_NO_LED_UPDATE 0x04000000
461 #define VGASETCOLMS _IOW('V', 115, int) /* set number of columns (80/132)*/
464 * only useful if compiled with ``XSERVER'' defined, but always here:
465 * WARNING: DO NOT CHANGE THESE DEFINITIONS, the X server relies on
466 * it since it's defining its own values and doesn't know nothing about
470 #define CONSOLE_X_MODE_ON _IO('t', 121) /* turn off pcvt, grant IOPL for X */
472 #define CONSOLE_X_MODE_OFF _IO('t', 122) /* back to pcvt */
474 #define CONSOLE_X_BELL _IOW('t', 123, int[2]) /* set bell behaviour */
477 * start of USL VT compatibility stuff
478 * these definitions must match those ones used by syscons
480 * Note that some of the ioctl command definitions below break the Berkeley
481 * style. They accept a parameter of type "int" (instead of Berkeley style
482 * "int *") in order to pass a single integer to the ioctl. These macros
483 * below are marked with a dummy "int" comment. Dont blame anyone else
484 * than USL for that braindeadness. It is done here to be a bit source-
485 * level compatible to SysV. (N.B., within the ioctl, the argument is
486 * dereferenced by "int *" anyway. The translation is done by the upper-
487 * level ioctl stuff.)
491 * NB: Some of the definitions below apparently override the definitions
492 * in the KBD section above. But, due to BSDs encoding of the IO direction
493 * and transfer size, the resulting ioctl cmds differ, so we can take them
494 * here. The only real conflict would appear if we implemented KDGKBMODE,
495 * which would be identical to KBDGLEDS above. Since this command is not
496 * necessary for XFree86 2.0, we omit it.
499 /* #define KDGKBMODE _IOR('K', 6, int) */ /* not yet implemented */
501 #define KDSKBMODE _IO('K', 7 /*, int */)
502 #define K_RAW 0 /* keyboard returns scancodes */
503 #define K_XLATE 1 /* keyboard returns ascii */
505 #define KDMKTONE _IO('K', 8 /*, int */)
507 /* #define KDGETMODE _IOR('K', 9, int) */ /* not yet implemented */
509 #define KDSETMODE _IO('K', 10 /*, int */)
510 #define KD_TEXT 0 /* set text mode restore fonts */
511 #define KD_GRAPHICS 1 /* set graphics mode */
513 /* we cannot see any sense to support KD_TEXT0 or KD_TEXT1 */
515 #define KDENABIO _IO('K', 60) /* only allowed if euid == 0 */
516 #define KDDISABIO _IO('K', 61)
518 #define KDGETLED _IOR('K', 65, int)
519 #define KDSETLED _IO('K', 66 /*, int */)
524 #define KDSETRAD _IO('K', 67 /*, int */)
527 * Note that since our idea of key mapping is much different from the
528 * SysV style, we _only_ support mapping layers base (0), shifted (1),
529 * alt (4), and alt-shift (5), and only for the basic keys (without
530 * any function keys). This is what XFree86 2.0+ needs to establish
531 * the default X keysym mapping.
533 #define GIO_KEYMAP _IOR('k', 6, keymap_t)
535 #define VT_OPENQRY _IOR('v', 1, int)
536 #define VT_SETMODE _IOW('v', 2, vtmode_t)
537 #define VT_GETMODE _IOR('v', 3, vtmode_t)
539 #define VT_RELDISP _IO('v', 4 /*, int */)
541 /* acceptable values for the VT_RELDISP command */
543 #define VT_FALSE 0 /* release of VT refused */
544 #define VT_TRUE 1 /* VT released */
545 #define VT_ACKACQ 2 /* acknowledging VT acquisition */
548 #define VT_ACTIVATE _IO('v', 5 /*, int */)
549 #define VT_WAITACTIVE _IO('v', 6 /*, int */)
550 #define VT_GETACTIVE _IOR('v', 7, int)
552 #ifndef _VT_MODE_DECLARED
553 #define _VT_MODE_DECLARED
557 #define VT_AUTO 0 /* switching controlled by drvr */
558 #define VT_PROCESS 1 /* switching controlled by prog */
560 char waitv; /* not implemented yet SOS */
563 short frsig; /* not implemented yet SOS */
566 typedef struct vt_mode vtmode_t;
567 #endif /* !_VT_MODE_DECLARED */
572 #ifndef _KEYMAP_DECLARED
573 #define _KEYMAP_DECLARED
575 u_char map[NUM_STATES];
582 struct keyent_t key[NUM_KEYS];
585 typedef struct keymap keymap_t;
586 #endif /* !_KEYMAP_DECLARED */
588 /* end of USL VT compatibility stuff */
590 #endif /* !_MACHINE_PCVT_IOCTL_H_ */