2007-08-27 06:01:23 +04:00
|
|
|
/* $NetBSD: wsconsio.h,v 1.88 2007/08/27 02:01:23 macallan Exp $ */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Christopher G. Demetriou
|
|
|
|
* for the NetBSD Project.
|
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1998-04-07 17:43:16 +04:00
|
|
|
#ifndef _DEV_WSCONS_WSCONSIO_H_
|
|
|
|
#define _DEV_WSCONS_WSCONSIO_H_
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* WSCONS (wsdisplay, wskbd, wsmouse) exported interfaces.
|
|
|
|
*
|
|
|
|
* Ioctls are all in group 'W'. Ioctl number space is partitioned like:
|
|
|
|
* 0-31 keyboard ioctls (WSKBDIO)
|
|
|
|
* 32-63 mouse ioctls (WSMOUSEIO)
|
|
|
|
* 64-95 display ioctls (WSDISPLAYIO)
|
2001-11-05 11:22:24 +03:00
|
|
|
* 96-127 mux ioctls (WSMUXIO)
|
2001-10-24 18:07:31 +04:00
|
|
|
* 128-255 reserved for future use
|
1998-03-22 17:24:02 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/ioccom.h>
|
1998-04-07 17:43:16 +04:00
|
|
|
#include <dev/wscons/wsksymvar.h>
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Common event structure (used by keyboard and mouse)
|
|
|
|
*/
|
|
|
|
struct wscons_event {
|
|
|
|
u_int type;
|
|
|
|
int value;
|
|
|
|
struct timespec time;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Event type definitions. Comment for each is information in value. */
|
|
|
|
#define WSCONS_EVENT_KEY_UP 1 /* key code */
|
|
|
|
#define WSCONS_EVENT_KEY_DOWN 2 /* key code */
|
1998-09-17 22:05:43 +04:00
|
|
|
#define WSCONS_EVENT_ALL_KEYS_UP 3 /* void */
|
1998-03-22 17:24:02 +03:00
|
|
|
#define WSCONS_EVENT_MOUSE_UP 4 /* button # (leftmost = 0) */
|
|
|
|
#define WSCONS_EVENT_MOUSE_DOWN 5 /* button # (leftmost = 0) */
|
|
|
|
#define WSCONS_EVENT_MOUSE_DELTA_X 6 /* X delta amount */
|
|
|
|
#define WSCONS_EVENT_MOUSE_DELTA_Y 7 /* Y delta amount */
|
|
|
|
#define WSCONS_EVENT_MOUSE_ABSOLUTE_X 8 /* X location */
|
|
|
|
#define WSCONS_EVENT_MOUSE_ABSOLUTE_Y 9 /* Y location */
|
1998-07-27 20:59:22 +04:00
|
|
|
#define WSCONS_EVENT_MOUSE_DELTA_Z 10 /* Z delta amount */
|
1998-07-27 22:17:08 +04:00
|
|
|
#define WSCONS_EVENT_MOUSE_ABSOLUTE_Z 11 /* Z location */
|
2002-06-27 03:05:33 +04:00
|
|
|
#define WSCONS_EVENT_SCREEN_SWITCH 12 /* New screen number */
|
2005-04-28 11:15:44 +04:00
|
|
|
#define WSCONS_EVENT_ASCII 13 /* key code is already ascii */
|
2005-11-23 12:38:02 +03:00
|
|
|
#define WSCONS_EVENT_MOUSE_DELTA_W 14 /* W delta amount */
|
|
|
|
#define WSCONS_EVENT_MOUSE_ABSOLUTE_W 15 /* W location */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
2007-01-19 23:59:45 +03:00
|
|
|
#define WSCONS_EVENT_ASCII 13 /* data is an ASCII code */
|
1998-03-22 17:24:02 +03:00
|
|
|
/*
|
|
|
|
* Keyboard ioctls (0 - 31)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Get keyboard type. */
|
|
|
|
#define WSKBDIO_GTYPE _IOR('W', 0, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBD_TYPE_LK201 1 /* lk-201 */
|
|
|
|
#define WSKBD_TYPE_LK401 2 /* lk-401 */
|
|
|
|
#define WSKBD_TYPE_PC_XT 3 /* PC-ish, XT scancode */
|
|
|
|
#define WSKBD_TYPE_PC_AT 4 /* PC-ish, AT scancode */
|
|
|
|
#define WSKBD_TYPE_USB 5 /* USB, XT scancode */
|
|
|
|
#define WSKBD_TYPE_NEXT 6 /* NeXT keyboard */
|
|
|
|
#define WSKBD_TYPE_HPC_KBD 7 /* HPC bultin keyboard */
|
|
|
|
#define WSKBD_TYPE_HPC_BTN 8 /* HPC/PsPC buttons */
|
|
|
|
#define WSKBD_TYPE_ARCHIMEDES 9 /* Archimedes keyboard */
|
|
|
|
#define WSKBD_TYPE_RISCPC 10 /* RiscPC keyboard, resembling AT codes */
|
|
|
|
#define WSKBD_TYPE_ADB 11 /* ADB */
|
|
|
|
#define WSKBD_TYPE_HIL 12 /* HIL keyboard */
|
|
|
|
#define WSKBD_TYPE_AMIGA 13 /* Amiga keyboard */
|
|
|
|
#define WSKBD_TYPE_MAPLE 14 /* Dreamcast Maple keyboard */
|
|
|
|
#define WSKBD_TYPE_ATARI 15 /* Atari keyboard */
|
|
|
|
#define WSKBD_TYPE_SUN 16 /* Sun Type3/4 */
|
|
|
|
#define WSKBD_TYPE_SUN5 17 /* Sun Type5 */
|
2005-08-28 17:08:16 +04:00
|
|
|
#define WSKBD_TYPE_SGI 18 /* SGI keyboard */
|
|
|
|
#define WSKBD_TYPE_MATRIXKP 19 /* Matrix keypads/buttons */
|
2005-12-29 18:24:51 +03:00
|
|
|
#define WSKBD_TYPE_EWS4800 20 /* NEC EWS4800 */
|
2006-06-19 19:44:33 +04:00
|
|
|
#define WSKBD_TYPE_BLUETOOTH 21 /* Bluetooth keyboard */
|
2006-12-17 19:08:44 +03:00
|
|
|
#define WSKBD_TYPE_ZAURUS 22 /* Sharp Zaurus keyboard */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/* Manipulate the keyboard bell. */
|
|
|
|
struct wskbd_bell_data {
|
|
|
|
u_int which; /* values to get/set */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBD_BELL_DOPITCH 0x1 /* get/set pitch */
|
|
|
|
#define WSKBD_BELL_DOPERIOD 0x2 /* get/set period */
|
|
|
|
#define WSKBD_BELL_DOVOLUME 0x4 /* get/set volume */
|
|
|
|
#define WSKBD_BELL_DOALL 0x7 /* all of the above */
|
1998-03-22 17:24:02 +03:00
|
|
|
u_int pitch; /* pitch, in Hz */
|
|
|
|
u_int period; /* period, in milliseconds */
|
|
|
|
u_int volume; /* percentage of max volume */
|
|
|
|
};
|
2004-05-29 01:42:29 +04:00
|
|
|
|
1998-03-22 17:24:02 +03:00
|
|
|
#define WSKBDIO_BELL _IO('W', 1)
|
|
|
|
#define WSKBDIO_COMPLEXBELL _IOW('W', 2, struct wskbd_bell_data)
|
|
|
|
#define WSKBDIO_SETBELL _IOW('W', 3, struct wskbd_bell_data)
|
|
|
|
#define WSKBDIO_GETBELL _IOR('W', 4, struct wskbd_bell_data)
|
|
|
|
#define WSKBDIO_SETDEFAULTBELL _IOW('W', 5, struct wskbd_bell_data)
|
|
|
|
#define WSKBDIO_GETDEFAULTBELL _IOR('W', 6, struct wskbd_bell_data)
|
|
|
|
|
|
|
|
/* Manipulate the emulation key repeat settings. */
|
|
|
|
struct wskbd_keyrepeat_data {
|
|
|
|
u_int which; /* values to get/set */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBD_KEYREPEAT_DODEL1 0x1 /* get/set del1 */
|
|
|
|
#define WSKBD_KEYREPEAT_DODELN 0x2 /* get/set delN */
|
|
|
|
#define WSKBD_KEYREPEAT_DOALL 0x3 /* all of the above */
|
1998-03-22 17:24:02 +03:00
|
|
|
u_int del1; /* delay before first, ms */
|
|
|
|
u_int delN; /* delay before rest, ms */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define WSKBDIO_SETKEYREPEAT _IOW('W', 7, struct wskbd_keyrepeat_data)
|
|
|
|
#define WSKBDIO_GETKEYREPEAT _IOR('W', 8, struct wskbd_keyrepeat_data)
|
2002-09-25 18:21:07 +04:00
|
|
|
#define WSKBDIO_SETDEFAULTKEYREPEAT _IOW('W', 9, struct wskbd_keyrepeat_data)
|
|
|
|
#define WSKBDIO_GETDEFAULTKEYREPEAT _IOR('W', 10, struct wskbd_keyrepeat_data)
|
1998-03-22 17:24:02 +03:00
|
|
|
|
1998-04-07 17:43:16 +04:00
|
|
|
/* Get/set keyboard leds */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBD_LED_CAPS 0x01
|
|
|
|
#define WSKBD_LED_NUM 0x02
|
|
|
|
#define WSKBD_LED_SCROLL 0x04
|
|
|
|
#define WSKBD_LED_COMPOSE 0x08
|
1998-04-07 17:43:16 +04:00
|
|
|
|
1998-07-21 13:17:33 +04:00
|
|
|
#define WSKBDIO_SETLEDS _IOW('W', 11, int)
|
|
|
|
#define WSKBDIO_GETLEDS _IOR('W', 12, int)
|
1998-04-07 17:43:16 +04:00
|
|
|
|
|
|
|
/* Manipulate keysym groups. */
|
|
|
|
struct wskbd_map_data {
|
|
|
|
u_int maplen; /* number of entries in map */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBDIO_MAXMAPLEN 65536
|
1998-04-07 17:43:16 +04:00
|
|
|
struct wscons_keymap *map; /* map to get or set */
|
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBDIO_GETMAP _IOWR('W', 13, struct wskbd_map_data)
|
|
|
|
#define WSKBDIO_SETMAP _IOW('W', 14, struct wskbd_map_data)
|
|
|
|
#define WSKBDIO_GETENCODING _IOR('W', 15, kbd_t)
|
|
|
|
#define WSKBDIO_SETENCODING _IOW('W', 16, kbd_t)
|
1998-04-07 17:43:16 +04:00
|
|
|
|
1998-06-12 02:15:14 +04:00
|
|
|
/* internal use only */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBDIO_SETMODE _IOW('W', 19, int)
|
|
|
|
#define WSKBDIO_GETMODE _IOR('W', 20, int)
|
|
|
|
#define WSKBD_TRANSLATED 0
|
|
|
|
#define WSKBD_RAW 1
|
1998-06-12 02:15:14 +04:00
|
|
|
|
2001-09-19 03:25:25 +04:00
|
|
|
#define WSKBDIO_SETKEYCLICK _IOW('W', 21, int)
|
|
|
|
#define WSKBDIO_GETKEYCLICK _IOR('W', 22, int)
|
|
|
|
|
2004-06-01 22:49:46 +04:00
|
|
|
/* Manipulate the scrolling modifiers and mode */
|
|
|
|
struct wskbd_scroll_data {
|
|
|
|
u_int which;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBD_SCROLL_DOMODIFIER 0x01
|
|
|
|
#define WSKBD_SCROLL_DOMODE 0x02
|
|
|
|
#define WSKBD_SCROLL_DOALL 0x03
|
2004-06-01 22:49:46 +04:00
|
|
|
u_int mode;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSKBD_SCROLL_MODE_NORMAL 0x00
|
|
|
|
#define WSKBD_SCROLL_MODE_HOLD 0x01
|
2004-06-01 22:49:46 +04:00
|
|
|
u_int modifier;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define WSKBDIO_GETSCROLL _IOR('W', 23, struct wskbd_scroll_data)
|
|
|
|
#define WSKBDIO_SETSCROLL _IOW('W', 24, struct wskbd_scroll_data)
|
2004-05-29 01:42:29 +04:00
|
|
|
|
1998-03-22 17:24:02 +03:00
|
|
|
/*
|
|
|
|
* Mouse ioctls (32 - 63)
|
|
|
|
*/
|
|
|
|
|
1998-12-30 16:14:21 +03:00
|
|
|
/* Get mouse type */
|
1998-03-22 17:24:02 +03:00
|
|
|
#define WSMOUSEIO_GTYPE _IOR('W', 32, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_TYPE_VSXXX 1 /* DEC serial */
|
|
|
|
#define WSMOUSE_TYPE_PS2 2 /* PS/2-compatible */
|
|
|
|
#define WSMOUSE_TYPE_USB 3 /* USB mouse */
|
|
|
|
#define WSMOUSE_TYPE_LMS 4 /* Logitech busmouse */
|
|
|
|
#define WSMOUSE_TYPE_MMS 5 /* Microsoft InPort mouse */
|
|
|
|
#define WSMOUSE_TYPE_TPANEL 6 /* Generic Touch Panel */
|
|
|
|
#define WSMOUSE_TYPE_NEXT 7 /* NeXT mouse */
|
|
|
|
#define WSMOUSE_TYPE_ARCHIMEDES 8 /* Archimedes mouse */
|
|
|
|
#define WSMOUSE_TYPE_HIL 9 /* HIL mouse */
|
2005-02-27 03:26:58 +03:00
|
|
|
#define WSMOUSE_TYPE_AMIGA 10 /* Amiga mouse */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_TYPE_MAXINE 11 /* DEC maxine mouse */
|
|
|
|
#define WSMOUSE_TYPE_MAPLE 12 /* Dreamcast Maple mouse */
|
2005-08-28 17:08:16 +04:00
|
|
|
#define WSMOUSE_TYPE_SGI 13 /* SGI mouse */
|
2006-06-19 19:44:33 +04:00
|
|
|
#define WSMOUSE_TYPE_BLUETOOTH 14 /* Bluetooth mouse */
|
2007-01-19 23:59:45 +03:00
|
|
|
#define WSMOUSE_TYPE_ADB 15 /* ADB mouse or touchpad */
|
|
|
|
#define WSMOUSE_TYPE_PSEUDO 16 /* not actually a mouse */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
1999-05-03 19:43:25 +04:00
|
|
|
/* Set resolution. Not applicable to all mouse types. */
|
2001-01-08 14:20:24 +03:00
|
|
|
#define WSMOUSEIO_SRES _IOW('W', 33, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_RES_MIN 0
|
|
|
|
#define WSMOUSE_RES_DEFAULT 75
|
|
|
|
#define WSMOUSE_RES_MAX 100
|
1999-05-03 19:43:25 +04:00
|
|
|
|
|
|
|
/* Set scale factor (num / den). Not applicable to all mouse types. */
|
2001-01-08 14:20:24 +03:00
|
|
|
#define WSMOUSEIO_SSCALE _IOW('W', 34, u_int[2])
|
1999-05-03 19:43:25 +04:00
|
|
|
|
|
|
|
/* Set sample rate. Not applicable to all mouse types. */
|
2001-01-08 14:20:24 +03:00
|
|
|
#define WSMOUSEIO_SRATE _IOW('W', 35, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_RATE_MIN 0
|
|
|
|
#define WSMOUSE_RATE_DEFAULT 50
|
|
|
|
#define WSMOUSE_RATE_MAX 100
|
1999-05-03 19:43:25 +04:00
|
|
|
|
2000-01-08 05:57:22 +03:00
|
|
|
/* Set/get sample coordinates for calibration */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_CALIBCOORDS_MAX 16
|
|
|
|
#define WSMOUSE_CALIBCOORDS_RESET -1
|
2000-01-08 05:57:22 +03:00
|
|
|
struct wsmouse_calibcoords {
|
|
|
|
int minx, miny; /* minimum value of X/Y */
|
|
|
|
int maxx, maxy; /* maximum value of X/Y */
|
|
|
|
int samplelen; /* number of samples available or
|
|
|
|
WSMOUSE_CALIBCOORDS_RESET for raw mode */
|
|
|
|
struct wsmouse_calibcoord {
|
|
|
|
int rawx, rawy; /* raw coordinate */
|
|
|
|
int x, y; /* translated coordinate */
|
|
|
|
} samples[WSMOUSE_CALIBCOORDS_MAX]; /* sample coordinates */
|
|
|
|
};
|
2000-02-28 15:34:31 +03:00
|
|
|
#define WSMOUSEIO_SCALIBCOORDS _IOW('W', 36, struct wsmouse_calibcoords)
|
|
|
|
#define WSMOUSEIO_GCALIBCOORDS _IOR('W', 37, struct wsmouse_calibcoords)
|
2000-01-08 05:57:22 +03:00
|
|
|
|
2003-01-03 07:36:26 +03:00
|
|
|
/* get device id for calibration */
|
|
|
|
struct wsmouse_id {
|
|
|
|
u_int type;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_ID_TYPE_UIDSTR 0 /* ID string (null terminated) */
|
2003-01-03 07:36:26 +03:00
|
|
|
u_int length;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMOUSE_ID_MAXLEN 256
|
2003-01-03 07:36:26 +03:00
|
|
|
u_char data[WSMOUSE_ID_MAXLEN];
|
|
|
|
};
|
|
|
|
#define WSMOUSEIO_GETID _IOWR('W', 38, struct wsmouse_id)
|
|
|
|
|
2006-02-05 20:38:33 +03:00
|
|
|
/* Get/set button repeating. */
|
|
|
|
struct wsmouse_repeat {
|
|
|
|
unsigned long wr_buttons;
|
|
|
|
unsigned int wr_delay_first;
|
|
|
|
unsigned int wr_delay_decrement;
|
|
|
|
unsigned int wr_delay_minimum;
|
|
|
|
};
|
|
|
|
#define WSMOUSEIO_GETREPEAT _IOR('W', 39, struct wsmouse_repeat)
|
|
|
|
#define WSMOUSEIO_SETREPEAT _IOW('W', 40, struct wsmouse_repeat)
|
|
|
|
|
1998-03-22 17:24:02 +03:00
|
|
|
/*
|
|
|
|
* Display ioctls (64 - 95)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Get display type */
|
|
|
|
#define WSDISPLAYIO_GTYPE _IOR('W', 64, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_TYPE_UNKNOWN 0 /* unknown */
|
|
|
|
#define WSDISPLAY_TYPE_PM_MONO 1 /* DEC [23]100 mono */
|
|
|
|
#define WSDISPLAY_TYPE_PM_COLOR 2 /* DEC [23]100 color */
|
|
|
|
#define WSDISPLAY_TYPE_CFB 3 /* DEC TC CFB (CX) */
|
|
|
|
#define WSDISPLAY_TYPE_XCFB 4 /* DEC `maxine' onboard fb */
|
|
|
|
#define WSDISPLAY_TYPE_MFB 5 /* DEC TC MFB (MX) */
|
|
|
|
#define WSDISPLAY_TYPE_SFB 6 /* DEC TC SFB (HX) */
|
|
|
|
#define WSDISPLAY_TYPE_ISAVGA 7 /* (generic) ISA VGA */
|
|
|
|
#define WSDISPLAY_TYPE_PCIVGA 8 /* (generic) PCI VGA */
|
|
|
|
#define WSDISPLAY_TYPE_TGA 9 /* DEC PCI TGA */
|
|
|
|
#define WSDISPLAY_TYPE_SFBP 10 /* DEC TC SFB+ (HX+) */
|
|
|
|
#define WSDISPLAY_TYPE_PCIMISC 11 /* (generic) PCI misc. disp. */
|
|
|
|
#define WSDISPLAY_TYPE_NEXTMONO 12 /* NeXT mono display */
|
|
|
|
#define WSDISPLAY_TYPE_PX 13 /* DEC TC PX */
|
|
|
|
#define WSDISPLAY_TYPE_PXG 14 /* DEC TC PXG */
|
|
|
|
#define WSDISPLAY_TYPE_TX 15 /* DEC TC TX */
|
|
|
|
#define WSDISPLAY_TYPE_HPCFB 16 /* Handheld/PalmSize PC */
|
|
|
|
#define WSDISPLAY_TYPE_VIDC 17 /* Acorn/ARM VIDC */
|
|
|
|
#define WSDISPLAY_TYPE_SPX 18 /* DEC SPX (VS3100/VS4000) */
|
|
|
|
#define WSDISPLAY_TYPE_GPX 19 /* DEC GPX (uVAX/VS2K/VS3100 */
|
|
|
|
#define WSDISPLAY_TYPE_LCG 20 /* DEC LCG (VS4000) */
|
|
|
|
#define WSDISPLAY_TYPE_VAX_MONO 21 /* DEC VS2K/VS3100 mono */
|
|
|
|
#define WSDISPLAY_TYPE_SB_P9100 22 /* Tadpole SPARCbook P9100 */
|
|
|
|
#define WSDISPLAY_TYPE_EGA 23 /* (generic) EGA */
|
|
|
|
#define WSDISPLAY_TYPE_DCPVR 24 /* Dreamcast PowerVR */
|
|
|
|
#define WSDISPLAY_TYPE_GATOR 25 /* HP Gator */
|
|
|
|
#define WSDISPLAY_TYPE_TOPCAT 26 /* HP TopCat */
|
|
|
|
#define WSDISPLAY_TYPE_RENAISSANCE 27 /* HP Renaissance */
|
|
|
|
#define WSDISPLAY_TYPE_CATSEYE 28 /* HP CatsEye */
|
|
|
|
#define WSDISPLAY_TYPE_DAVINCI 29 /* HP DaVinci */
|
|
|
|
#define WSDISPLAY_TYPE_TIGER 30 /* HP Tiger */
|
|
|
|
#define WSDISPLAY_TYPE_HYPERION 31 /* HP Hyperion */
|
|
|
|
#define WSDISPLAY_TYPE_AMIGACC 32 /* Amiga custom chips */
|
|
|
|
#define WSDISPLAY_TYPE_SUN24 33 /* Sun 24 bit framebuffers */
|
|
|
|
#define WSDISPLAY_TYPE_NEWPORT 34 /* SGI Newport */
|
|
|
|
#define WSDISPLAY_TYPE_GR2 35 /* SGI GR2 */
|
|
|
|
#define WSDISPLAY_TYPE_SUNCG12 36 /* Sun cgtwelve */
|
|
|
|
#define WSDISPLAY_TYPE_SUNCG14 37 /* Sun cgfourteen */
|
|
|
|
#define WSDISPLAY_TYPE_SUNTCX 38 /* Sun TCX */
|
|
|
|
#define WSDISPLAY_TYPE_SUNFFB 39 /* Sun creator FFB */
|
2006-02-18 21:56:05 +03:00
|
|
|
#define WSDISPLAY_TYPE_STI 40 /* HP STI framebuffers */
|
2005-02-04 08:58:44 +03:00
|
|
|
#define WSDISPLAY_TYPE_HDLCD 41 /* Hitachi HD44780 based LCDs */
|
2006-02-18 21:56:05 +03:00
|
|
|
#define WSDISPLAY_TYPE_VESA 42 /* VESA BIOS framebuffer */
|
2006-12-03 01:18:47 +03:00
|
|
|
#define WSDISPLAY_TYPE_XILFB 43 /* Xilinx TFT cores */
|
2006-12-26 08:54:00 +03:00
|
|
|
#define WSDISPLAY_TYPE_LIGHT 44 /* SGI Light (a.k.a. Entry/Starter) */
|
2007-04-11 08:09:10 +04:00
|
|
|
#define WSDISPLAY_TYPE_GENFB 45 /* generic nondescript framebuffer */
|
2007-07-26 05:59:07 +04:00
|
|
|
#define WSDISPLAY_TYPE_CRIME 46 /* SGI O2 */
|
2007-07-26 16:17:14 +04:00
|
|
|
#define WSDISPLAY_TYPE_PXALCD 47 /* PXA2x0 LCD controller */
|
2007-08-27 06:01:23 +04:00
|
|
|
#define WSDISPLAY_TYPE_AG10 48 /* Fujitsu AG-10e */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/* Basic display information. Not applicable to all display types. */
|
|
|
|
struct wsdisplay_fbinfo {
|
|
|
|
u_int height; /* height in pixels */
|
|
|
|
u_int width; /* width in pixels */
|
|
|
|
u_int depth; /* bits per pixel */
|
|
|
|
u_int cmsize; /* color map size (entries) */
|
|
|
|
};
|
|
|
|
#define WSDISPLAYIO_GINFO _IOR('W', 65, struct wsdisplay_fbinfo)
|
|
|
|
|
|
|
|
/* Colormap operations. Not applicable to all display types. */
|
|
|
|
struct wsdisplay_cmap {
|
|
|
|
u_int index; /* first element (0 origin) */
|
|
|
|
u_int count; /* number of elements */
|
|
|
|
u_char *red; /* red color map elements */
|
|
|
|
u_char *green; /* green color map elements */
|
|
|
|
u_char *blue; /* blue color map elements */
|
2005-02-27 03:26:58 +03:00
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_GETCMAP _IOW('W', 66, struct wsdisplay_cmap)
|
|
|
|
#define WSDISPLAYIO_PUTCMAP _IOW('W', 67, struct wsdisplay_cmap)
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/* Video control. Not applicable to all display types. */
|
|
|
|
#define WSDISPLAYIO_GVIDEO _IOR('W', 68, u_int)
|
|
|
|
#define WSDISPLAYIO_SVIDEO _IOW('W', 69, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_VIDEO_OFF 0 /* video off */
|
|
|
|
#define WSDISPLAYIO_VIDEO_ON 1 /* video on */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/* Cursor control. Not applicable to all display types. */
|
|
|
|
struct wsdisplay_curpos { /* cursor "position" */
|
|
|
|
u_int x, y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wsdisplay_cursor {
|
|
|
|
u_int which; /* values to get/set */
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_CURSOR_DOCUR 0x01 /* get/set enable */
|
|
|
|
#define WSDISPLAY_CURSOR_DOPOS 0x02 /* get/set pos */
|
|
|
|
#define WSDISPLAY_CURSOR_DOHOT 0x04 /* get/set hot spot */
|
|
|
|
#define WSDISPLAY_CURSOR_DOCMAP 0x08 /* get/set cmap */
|
|
|
|
#define WSDISPLAY_CURSOR_DOSHAPE 0x10 /* get/set img/mask */
|
|
|
|
#define WSDISPLAY_CURSOR_DOALL 0x1f /* all of the above */
|
1998-03-22 17:24:02 +03:00
|
|
|
u_int enable; /* enable/disable */
|
|
|
|
struct wsdisplay_curpos pos; /* position */
|
|
|
|
struct wsdisplay_curpos hot; /* hot spot */
|
|
|
|
struct wsdisplay_cmap cmap; /* color map info */
|
|
|
|
struct wsdisplay_curpos size; /* bit map size */
|
|
|
|
u_char *image; /* image data */
|
|
|
|
u_char *mask; /* mask data */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Cursor control: get and set position */
|
|
|
|
#define WSDISPLAYIO_GCURPOS _IOR('W', 70, struct wsdisplay_curpos)
|
|
|
|
#define WSDISPLAYIO_SCURPOS _IOW('W', 71, struct wsdisplay_curpos)
|
|
|
|
|
|
|
|
/* Cursor control: get maximum size */
|
|
|
|
#define WSDISPLAYIO_GCURMAX _IOR('W', 72, struct wsdisplay_curpos)
|
|
|
|
|
|
|
|
/* Cursor control: get/set cursor attributes/shape */
|
|
|
|
#define WSDISPLAYIO_GCURSOR _IOWR('W', 73, struct wsdisplay_cursor)
|
|
|
|
#define WSDISPLAYIO_SCURSOR _IOW('W', 74, struct wsdisplay_cursor)
|
|
|
|
|
|
|
|
/* Display mode: Emulation (text) vs. Mapped (graphics) mode */
|
|
|
|
#define WSDISPLAYIO_GMODE _IOR('W', 75, u_int)
|
|
|
|
#define WSDISPLAYIO_SMODE _IOW('W', 76, u_int)
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_MODE_EMUL 0 /* emulation (text) mode */
|
|
|
|
#define WSDISPLAYIO_MODE_MAPPED 1 /* mapped (graphics) mode */
|
2004-07-21 00:28:20 +04:00
|
|
|
#define WSDISPLAYIO_MODE_DUMBFB 2 /* mapped (graphics) fb mode */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
2002-09-25 18:21:07 +04:00
|
|
|
|
1999-01-09 18:44:45 +03:00
|
|
|
/*
|
|
|
|
* XXX WARNING
|
2002-09-25 18:21:07 +04:00
|
|
|
* XXX The following wsdisplay definitions are very preliminary and are likely
|
1999-01-09 18:44:45 +03:00
|
|
|
* XXX to be changed without care about backwards compatibility!
|
|
|
|
*/
|
1998-03-22 17:24:02 +03:00
|
|
|
struct wsdisplay_font {
|
2003-02-09 13:29:35 +03:00
|
|
|
const char *name;
|
1998-03-22 17:24:02 +03:00
|
|
|
int firstchar, numchars;
|
1999-01-13 19:21:02 +03:00
|
|
|
int encoding;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_FONTENC_ISO 0
|
|
|
|
#define WSDISPLAY_FONTENC_IBM 1
|
|
|
|
#define WSDISPLAY_FONTENC_PCVT 2
|
|
|
|
#define WSDISPLAY_FONTENC_ISO7 3 /* greek */
|
|
|
|
#define WSDISPLAY_FONTENC_ISO2 4 /* east european */
|
2001-08-05 15:26:52 +04:00
|
|
|
u_int fontwidth, fontheight, stride;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_MAXFONTSZ (512*1024)
|
2000-01-05 21:44:21 +03:00
|
|
|
int bitorder, byteorder;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_FONTORDER_KNOWN 0 /* i.e, no need to convert */
|
2000-01-07 06:13:23 +03:00
|
|
|
#define WSDISPLAY_FONTORDER_L2R 1
|
|
|
|
#define WSDISPLAY_FONTORDER_R2L 2
|
2003-02-10 17:28:19 +03:00
|
|
|
void *data;
|
1998-03-22 17:24:02 +03:00
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_LDFONT _IOW('W', 77, struct wsdisplay_font)
|
1998-03-22 17:24:02 +03:00
|
|
|
|
1999-01-09 18:44:45 +03:00
|
|
|
struct wsdisplay_addscreendata {
|
|
|
|
int idx; /* screen index */
|
|
|
|
char *screentype;
|
|
|
|
char *emul;
|
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_ADDSCREEN _IOW('W', 78, struct wsdisplay_addscreendata)
|
1999-01-09 18:44:45 +03:00
|
|
|
|
|
|
|
struct wsdisplay_delscreendata {
|
|
|
|
int idx; /* screen index */
|
|
|
|
int flags;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_DELSCR_FORCE 1
|
1999-01-09 18:44:45 +03:00
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_DELSCREEN _IOW('W', 79, struct wsdisplay_delscreendata)
|
1999-01-09 18:44:45 +03:00
|
|
|
|
1999-01-13 19:21:02 +03:00
|
|
|
struct wsdisplay_usefontdata {
|
|
|
|
char *name;
|
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_SFONT _IOW('W', 80, struct wsdisplay_usefontdata)
|
1999-01-13 19:21:02 +03:00
|
|
|
|
2001-10-24 18:07:31 +04:00
|
|
|
/* Obsolete, replaced by WSMUXIO_{ADD,REMOVE}_DEVICE */
|
1999-05-15 18:22:46 +04:00
|
|
|
struct wsdisplay_kbddata {
|
|
|
|
int op;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define _O_WSDISPLAY_KBD_ADD 0
|
|
|
|
#define _O_WSDISPLAY_KBD_DEL 1
|
1999-05-15 18:22:46 +04:00
|
|
|
int idx;
|
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define _O_WSDISPLAYIO_SETKEYBOARD _IOWR('W', 81, struct wsdisplay_kbddata)
|
1999-05-15 18:22:46 +04:00
|
|
|
|
2000-10-01 07:29:12 +04:00
|
|
|
/* Misc control. Not applicable to all display types. */
|
|
|
|
struct wsdisplay_param {
|
2005-08-28 17:08:16 +04:00
|
|
|
int param;
|
2000-10-01 07:29:12 +04:00
|
|
|
#define WSDISPLAYIO_PARAM_BACKLIGHT 1
|
|
|
|
#define WSDISPLAYIO_PARAM_BRIGHTNESS 2
|
|
|
|
#define WSDISPLAYIO_PARAM_CONTRAST 3
|
2005-08-28 17:08:16 +04:00
|
|
|
int min, max, curval;
|
|
|
|
int reserved[4];
|
2000-10-01 07:29:12 +04:00
|
|
|
};
|
|
|
|
#define WSDISPLAYIO_GETPARAM _IOWR('W', 82, struct wsdisplay_param)
|
|
|
|
#define WSDISPLAYIO_SETPARAM _IOWR('W', 83, struct wsdisplay_param)
|
|
|
|
|
2002-06-27 03:05:33 +04:00
|
|
|
#define WSDISPLAYIO_GETACTIVESCREEN _IOR('W', 84, int)
|
|
|
|
|
|
|
|
/* Character functions */
|
|
|
|
struct wsdisplay_char {
|
|
|
|
int row, col;
|
|
|
|
uint16_t letter;
|
|
|
|
uint8_t background, foreground;
|
|
|
|
char flags;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAY_CHAR_BRIGHT 1
|
|
|
|
#define WSDISPLAY_CHAR_BLINK 2
|
2002-06-27 03:05:33 +04:00
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSDISPLAYIO_GETWSCHAR _IOWR('W', 85, struct wsdisplay_char)
|
|
|
|
#define WSDISPLAYIO_PUTWSCHAR _IOWR('W', 86, struct wsdisplay_char)
|
2002-06-27 03:05:33 +04:00
|
|
|
|
2004-06-01 22:49:46 +04:00
|
|
|
/* Manipulate the scrolling values (how many lines to scroll) */
|
|
|
|
|
|
|
|
struct wsdisplay_scroll_data {
|
2004-06-01 22:58:51 +04:00
|
|
|
u_int which;
|
|
|
|
#define WSDISPLAY_SCROLL_DOFASTLINES 0x01
|
|
|
|
#define WSDISPLAY_SCROLL_DOSLOWLINES 0x02
|
|
|
|
#define WSDISPLAY_SCROLL_DOALL 0x03
|
2004-06-07 05:13:40 +04:00
|
|
|
u_int fastlines;
|
|
|
|
u_int slowlines;
|
2004-06-01 22:49:46 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define WSDISPLAYIO_DGSCROLL _IOR('W', 87, struct wsdisplay_scroll_data)
|
|
|
|
#define WSDISPLAYIO_DSSCROLL _IOW('W', 88, struct wsdisplay_scroll_data)
|
|
|
|
|
Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").
A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it. This is optional, which means that this also works with other drivers
that don't have this new operation.
Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
change the colors dynamically from userland. This is enabled by default
in the GENERIC kernel (as well as others) but disabled on all INSTALL*
kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
which specify the default colors for the console at boot time. These have
the same meaning as the (already existing) WS_KERNEL_* variables.
wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.
Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 16:34:02 +04:00
|
|
|
struct wsdisplay_msgattrs {
|
|
|
|
int default_attrs, default_bg, default_fg;
|
|
|
|
int kernel_attrs, kernel_bg, kernel_fg;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define WSDISPLAYIO_GMSGATTRS _IOR('W', 89, struct wsdisplay_msgattrs)
|
|
|
|
#define WSDISPLAYIO_SMSGATTRS _IOW('W', 90, struct wsdisplay_msgattrs)
|
|
|
|
|
Implement border color customization in wscons(4), only available for vga(4)
at the moment.
This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively. Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).
It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.
Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others). The later is always commented out, leaving the usual black
border as a default.
wsconsctl is modified to allow accessing this value easily. For example,
'wsconsctl -d -w border=blue'.
2004-07-30 02:29:35 +04:00
|
|
|
#define WSDISPLAYIO_GBORDER _IOR('W', 91, int)
|
|
|
|
#define WSDISPLAYIO_SBORDER _IOW('W', 92, int)
|
|
|
|
|
2006-02-18 21:56:05 +03:00
|
|
|
/* Splash screen control */
|
|
|
|
#define WSDISPLAYIO_SSPLASH _IOW('W', 93, int)
|
|
|
|
#define WSDISPLAYIO_SPROGRESS _IOW('W', 94, int)
|
|
|
|
|
1998-03-22 17:24:02 +03:00
|
|
|
/* XXX NOT YET DEFINED */
|
|
|
|
/* Mapping information retrieval. */
|
|
|
|
|
2004-07-21 00:28:20 +04:00
|
|
|
/* Display information: number of bytes per row, may be same as pixels */
|
|
|
|
#define WSDISPLAYIO_LINEBYTES _IOR('W', 95, u_int)
|
2002-09-25 18:21:07 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Mux ioctls (96 - 127)
|
|
|
|
*/
|
|
|
|
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMUXIO_INJECTEVENT _IOW('W', 96, struct wscons_event)
|
|
|
|
#define WSMUX_INJECTEVENT WSMUXIO_INJECTEVENT /* XXX compat */
|
1999-07-29 22:20:02 +04:00
|
|
|
|
|
|
|
struct wsmux_device {
|
|
|
|
int type;
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMUX_MOUSE 1
|
|
|
|
#define WSMUX_KBD 2
|
|
|
|
#define WSMUX_MUX 3
|
1999-07-29 22:20:02 +04:00
|
|
|
int idx;
|
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMUXIO_ADD_DEVICE _IOW('W', 97, struct wsmux_device)
|
|
|
|
#define WSMUX_ADD_DEVICE WSMUXIO_ADD_DEVICE /* XXX compat */
|
|
|
|
#define WSMUXIO_REMOVE_DEVICE _IOW('W', 98, struct wsmux_device)
|
|
|
|
#define WSMUX_REMOVE_DEVICE WSMUXIO_REMOVE_DEVICE /* XXX compat */
|
1999-07-29 22:20:02 +04:00
|
|
|
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMUX_MAXDEV 32
|
1999-07-29 22:20:02 +04:00
|
|
|
struct wsmux_device_list {
|
|
|
|
int ndevices;
|
|
|
|
struct wsmux_device devices[WSMUX_MAXDEV];
|
|
|
|
};
|
2004-06-01 22:58:51 +04:00
|
|
|
#define WSMUXIO_LIST_DEVICES _IOWR('W', 99, struct wsmux_device_list)
|
|
|
|
#define WSMUX_LIST_DEVICES WSMUXIO_LIST_DEVICES /* XXX compat */
|
1999-07-29 22:20:02 +04:00
|
|
|
|
1998-04-07 17:43:16 +04:00
|
|
|
#endif /* _DEV_WSCONS_WSCONSIO_H_ */
|