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