#ifndef _DEV_WSCONS_WSCONSIO_H_
#define _DEV_WSCONS_WSCONSIO_H_
#include <sys/types.h>
#include <sys/ioccom.h>
#include <dev/wscons/wsksymvar.h>
#include <sys/pciio.h>
#define WSSCREEN_NAME_SIZE 16
#define WSEMUL_NAME_SIZE 16
#define WSFONT_NAME_SIZE 32
struct wscons_event {
u_int type;
int value;
struct timespec time;
};
#define WSCONS_EVENT_KEY_UP 1
#define WSCONS_EVENT_KEY_DOWN 2
#define WSCONS_EVENT_ALL_KEYS_UP 3
#define WSCONS_EVENT_MOUSE_UP 4
#define WSCONS_EVENT_MOUSE_DOWN 5
#define WSCONS_EVENT_MOUSE_DELTA_X 6
#define WSCONS_EVENT_MOUSE_DELTA_Y 7
#define WSCONS_EVENT_MOUSE_ABSOLUTE_X 8
#define WSCONS_EVENT_MOUSE_ABSOLUTE_Y 9
#define WSCONS_EVENT_MOUSE_DELTA_Z 10
#define WSCONS_EVENT_MOUSE_ABSOLUTE_Z 11
#define WSCONS_EVENT_MOUSE_DELTA_W 16
#define WSCONS_EVENT_MOUSE_ABSOLUTE_W 17
#define WSCONS_EVENT_SYNC 18
#define WSCONS_EVENT_WSMOUSED_ON 12
#define WSCONS_EVENT_WSMOUSED_OFF 13
#define IS_MOTION_EVENT(type) (((type) == WSCONS_EVENT_MOUSE_DELTA_X) || \
((type) == WSCONS_EVENT_MOUSE_DELTA_Y) || \
((type) == WSCONS_EVENT_MOUSE_DELTA_Z) || \
((type) == WSCONS_EVENT_MOUSE_DELTA_W))
#define IS_BUTTON_EVENT(type) (((type) == WSCONS_EVENT_MOUSE_UP) || \
((type) == WSCONS_EVENT_MOUSE_DOWN))
#define IS_CTRL_EVENT(type) ((type == WSCONS_EVENT_WSMOUSED_ON) || \
(type == WSCONS_EVENT_WSMOUSED_OFF))
#define WSCONS_EVENT_TOUCH_PRESSURE WSCONS_EVENT_MOUSE_ABSOLUTE_Z
#define WSCONS_EVENT_TOUCH_CONTACTS WSCONS_EVENT_MOUSE_ABSOLUTE_W
#define WSCONS_EVENT_TOUCH_WIDTH 24
#define WSCONS_EVENT_TOUCH_RESET 25
#define WSCONS_EVENT_HSCROLL 26
#define WSCONS_EVENT_VSCROLL 27
#define WSKBDIO_GTYPE _IOR('W', 0, u_int)
#define WSKBD_TYPE_LK201 1
#define WSKBD_TYPE_LK401 2
#define WSKBD_TYPE_PC_XT 3
#define WSKBD_TYPE_PC_AT 4
#define WSKBD_TYPE_USB 5
#define WSKBD_TYPE_NEXT 6
#define WSKBD_TYPE_HPC_KBD 7
#define WSKBD_TYPE_HPC_BTN 8
#define WSKBD_TYPE_ARCHIMEDES 9
#define WSKBD_TYPE_ADB 10
#define WSKBD_TYPE_SUN 11
#define WSKBD_TYPE_SUN5 12
#define WSKBD_TYPE_HIL 13
#define WSKBD_TYPE_GSC 14
#define WSKBD_TYPE_LUNA 15
#define WSKBD_TYPE_ZAURUS 16
#define WSKBD_TYPE_DOMAIN 17
#define WSKBD_TYPE_BLUETOOTH 18
#define WSKBD_TYPE_KPC 19
#define WSKBD_TYPE_SGI 20
struct wskbd_bell_data {
u_int which;
u_int pitch;
u_int period;
u_int volume;
};
#define WSKBD_BELL_DOPITCH 0x1
#define WSKBD_BELL_DOPERIOD 0x2
#define WSKBD_BELL_DOVOLUME 0x4
#define WSKBD_BELL_DOALL 0x7
#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)
struct wskbd_keyrepeat_data {
u_int which;
u_int del1;
u_int delN;
};
#define WSKBD_KEYREPEAT_DODEL1 0x1
#define WSKBD_KEYREPEAT_DODELN 0x2
#define WSKBD_KEYREPEAT_DOALL 0x3
#define WSKBDIO_SETKEYREPEAT _IOW('W', 7, struct wskbd_keyrepeat_data)
#define WSKBDIO_GETKEYREPEAT _IOR('W', 8, struct wskbd_keyrepeat_data)
#define WSKBDIO_SETDEFAULTKEYREPEAT \
_IOW('W', 9, struct wskbd_keyrepeat_data)
#define WSKBDIO_GETDEFAULTKEYREPEAT \
_IOR('W', 10, struct wskbd_keyrepeat_data)
#define WSKBD_LED_CAPS 0x01
#define WSKBD_LED_NUM 0x02
#define WSKBD_LED_SCROLL 0x04
#define WSKBD_LED_COMPOSE 0x08
#define WSKBDIO_SETLEDS _IOW('W', 11, int)
#define WSKBDIO_GETLEDS _IOR('W', 12, int)
struct wskbd_map_data {
u_int maplen;
#define WSKBDIO_MAXMAPLEN 65536
struct wscons_keymap *map;
};
#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)
struct wskbd_backlight {
unsigned int min, max, curval;
};
#define WSKBDIO_GETBACKLIGHT _IOR('W', 17, struct wskbd_backlight)
#define WSKBDIO_SETBACKLIGHT _IOW('W', 18, struct wskbd_backlight)
#define WSKBDIO_SETMODE _IOW('W', 19, int)
#define WSKBDIO_GETMODE _IOR('W', 20, int)
#define WSKBD_TRANSLATED 0
#define WSKBD_RAW 1
struct wskbd_encoding_data {
int nencodings;
kbd_t *encodings;
};
#define WSKBDIO_GETENCODINGS _IOWR('W', 21, struct wskbd_encoding_data)
#define WSMOUSEIO_GTYPE _IOR('W', 32, u_int)
#define WSMOUSE_TYPE_VSXXX 1
#define WSMOUSE_TYPE_PS2 2
#define WSMOUSE_TYPE_USB 3
#define WSMOUSE_TYPE_LMS 4
#define WSMOUSE_TYPE_MMS 5
#define WSMOUSE_TYPE_TPANEL 6
#define WSMOUSE_TYPE_NEXT 7
#define WSMOUSE_TYPE_ARCHIMEDES 8
#define WSMOUSE_TYPE_ADB 9
#define WSMOUSE_TYPE_HIL 10
#define WSMOUSE_TYPE_LUNA 11
#define WSMOUSE_TYPE_DOMAIN 12
#define WSMOUSE_TYPE_BLUETOOTH 13
#define WSMOUSE_TYPE_SUN 14
#define WSMOUSE_TYPE_SYNAPTICS 15
#define WSMOUSE_TYPE_ALPS 16
#define WSMOUSE_TYPE_SGI 17
#define WSMOUSE_TYPE_ELANTECH 18
#define WSMOUSE_TYPE_SYNAP_SBTN 19
#define WSMOUSE_TYPE_TOUCHPAD 20
#define WSMOUSEIO_SRES _IOW('W', 33, u_int)
#define WSMOUSE_RES_MIN 0
#define WSMOUSE_RES_DEFAULT 75
#define WSMOUSE_RES_MAX 100
#define WSMOUSE_CALIBCOORDS_MAX 16
#define WSMOUSE_CALIBCOORDS_RESET -1
struct wsmouse_calibcoords {
int minx, miny;
int maxx, maxy;
int swapxy;
int resx, resy;
int samplelen;
struct wsmouse_calibcoord {
int rawx, rawy;
int x, y;
} samples[WSMOUSE_CALIBCOORDS_MAX];
};
#define WSMOUSEIO_SCALIBCOORDS _IOW('W', 36, struct wsmouse_calibcoords)
#define WSMOUSEIO_GCALIBCOORDS _IOR('W', 37, struct wsmouse_calibcoords)
#define WSMOUSEIO_SETMODE _IOW('W', 38, int)
#define WSMOUSE_COMPAT 0
#define WSMOUSE_NATIVE 1
enum wsmousecfg {
WSMOUSECFG_DX_SCALE = 0,
WSMOUSECFG_DY_SCALE,
WSMOUSECFG_PRESSURE_LO,
WSMOUSECFG_PRESSURE_HI,
WSMOUSECFG_TRKMAXDIST,
WSMOUSECFG_SWAPXY,
WSMOUSECFG_X_INV,
WSMOUSECFG_Y_INV,
WSMOUSECFG_REVERSE_SCROLLING,
WSMOUSECFG__FILTERS,
WSMOUSECFG_DX_MAX = 32,
WSMOUSECFG_DY_MAX,
WSMOUSECFG_X_HYSTERESIS,
WSMOUSECFG_Y_HYSTERESIS,
WSMOUSECFG_DECELERATION,
WSMOUSECFG_STRONG_HYSTERESIS,
WSMOUSECFG_SMOOTHING,
WSMOUSECFG__TPFILTERS,
WSMOUSECFG_SOFTBUTTONS = 64,
WSMOUSECFG_SOFTMBTN,
WSMOUSECFG_TOPBUTTONS,
WSMOUSECFG_TWOFINGERSCROLL,
WSMOUSECFG_EDGESCROLL,
WSMOUSECFG_HORIZSCROLL,
WSMOUSECFG_SWAPSIDES,
WSMOUSECFG_DISABLE,
WSMOUSECFG_MTBUTTONS,
WSMOUSECFG__TPFEATURES,
WSMOUSECFG_LEFT_EDGE = 128,
WSMOUSECFG_RIGHT_EDGE,
WSMOUSECFG_TOP_EDGE,
WSMOUSECFG_BOTTOM_EDGE,
WSMOUSECFG_CENTERWIDTH,
WSMOUSECFG_HORIZSCROLLDIST,
WSMOUSECFG_VERTSCROLLDIST,
WSMOUSECFG_F2WIDTH,
WSMOUSECFG_F2PRESSURE,
WSMOUSECFG_TAP_MAXTIME,
WSMOUSECFG_TAP_CLICKTIME,
WSMOUSECFG_TAP_LOCKTIME,
WSMOUSECFG_TAP_ONE_BTNMAP,
WSMOUSECFG_TAP_TWO_BTNMAP,
WSMOUSECFG_TAP_THREE_BTNMAP,
WSMOUSECFG_MTBTN_MAXDIST,
WSMOUSECFG__TPSETUP,
WSMOUSECFG_LOG_INPUT = 256,
WSMOUSECFG_LOG_EVENTS,
WSMOUSECFG__DEBUG,
};
#define WSMOUSECFG_MAX ((WSMOUSECFG__FILTERS - WSMOUSECFG_DX_SCALE) \
+ (WSMOUSECFG__TPFILTERS - WSMOUSECFG_DX_MAX) \
+ (WSMOUSECFG__TPFEATURES - WSMOUSECFG_SOFTBUTTONS) \
+ (WSMOUSECFG__TPSETUP - WSMOUSECFG_LEFT_EDGE) \
+ (WSMOUSECFG__DEBUG - WSMOUSECFG_LOG_INPUT))
struct wsmouse_param {
enum wsmousecfg key;
int value;
};
struct wsmouse_parameters {
struct wsmouse_param *params;
u_int nparams;
};
#define WSMOUSEIO_GETPARAMS _IOW('W', 39, struct wsmouse_parameters)
#define WSMOUSEIO_SETPARAMS _IOW('W', 40, struct wsmouse_parameters)
#define WSDISPLAYIO_GTYPE _IOR('W', 64, u_int)
#define WSDISPLAY_TYPE_UNKNOWN 0
#define WSDISPLAY_TYPE_PM_MONO 1
#define WSDISPLAY_TYPE_PM_COLOR 2
#define WSDISPLAY_TYPE_CFB 3
#define WSDISPLAY_TYPE_XCFB 4
#define WSDISPLAY_TYPE_MFB 5
#define WSDISPLAY_TYPE_SFB 6
#define WSDISPLAY_TYPE_ISAVGA 7
#define WSDISPLAY_TYPE_PCIVGA 8
#define WSDISPLAY_TYPE_TGA 9
#define WSDISPLAY_TYPE_SFBP 10
#define WSDISPLAY_TYPE_PCIMISC 11
#define WSDISPLAY_TYPE_NEXTMONO 12
#define WSDISPLAY_TYPE_PX 13
#define WSDISPLAY_TYPE_PXG 14
#define WSDISPLAY_TYPE_TX 15
#define WSDISPLAY_TYPE_HPCFB 16
#define WSDISPLAY_TYPE_VIDC 17
#define WSDISPLAY_TYPE_SPX 18
#define WSDISPLAY_TYPE_GPX 19
#define WSDISPLAY_TYPE_LCG 20
#define WSDISPLAY_TYPE_VAX_MONO 21
#define WSDISPLAY_TYPE_SB_P9100 22
#define WSDISPLAY_TYPE_EGA 23
#define WSDISPLAY_TYPE_DCPVR 24
#define WSDISPLAY_TYPE_SUN24 25
#define WSDISPLAY_TYPE_SUNBW 26
#define WSDISPLAY_TYPE_STI 27
#define WSDISPLAY_TYPE_SUNCG3 28
#define WSDISPLAY_TYPE_SUNCG6 29
#define WSDISPLAY_TYPE_SUNFFB 30
#define WSDISPLAY_TYPE_SUNCG14 31
#define WSDISPLAY_TYPE_SUNCG2 32
#define WSDISPLAY_TYPE_SUNCG4 33
#define WSDISPLAY_TYPE_SUNCG8 34
#define WSDISPLAY_TYPE_SUNTCX 35
#define WSDISPLAY_TYPE_AGTEN 36
#define WSDISPLAY_TYPE_XVIDEO 37
#define WSDISPLAY_TYPE_SUNCG12 38
#define WSDISPLAY_TYPE_MGX 39
#define WSDISPLAY_TYPE_SB_P9000 40
#define WSDISPLAY_TYPE_RFLEX 41
#define WSDISPLAY_TYPE_LUNA 42
#define WSDISPLAY_TYPE_DVBOX 43
#define WSDISPLAY_TYPE_GBOX 44
#define WSDISPLAY_TYPE_RBOX 45
#define WSDISPLAY_TYPE_HYPERION 46
#define WSDISPLAY_TYPE_TOPCAT 47
#define WSDISPLAY_TYPE_PXALCD 48
#define WSDISPLAY_TYPE_MAC68K 49
#define WSDISPLAY_TYPE_SUNLEO 50
#define WSDISPLAY_TYPE_TVRX 51
#define WSDISPLAY_TYPE_CFXGA 52
#define WSDISPLAY_TYPE_LCSPX 53
#define WSDISPLAY_TYPE_GBE 54
#define WSDISPLAY_TYPE_LEGSS 55
#define WSDISPLAY_TYPE_IFB 56
#define WSDISPLAY_TYPE_RAPTOR 57
#define WSDISPLAY_TYPE_DL 58
#define WSDISPLAY_TYPE_MACHFB 59
#define WSDISPLAY_TYPE_GFXP 60
#define WSDISPLAY_TYPE_RADEONFB 61
#define WSDISPLAY_TYPE_SMFB 62
#define WSDISPLAY_TYPE_SISFB 63
#define WSDISPLAY_TYPE_ODYSSEY 64
#define WSDISPLAY_TYPE_IMPACT 65
#define WSDISPLAY_TYPE_GRTWO 66
#define WSDISPLAY_TYPE_NEWPORT 67
#define WSDISPLAY_TYPE_LIGHT 68
#define WSDISPLAY_TYPE_INTELDRM 69
#define WSDISPLAY_TYPE_RADEONDRM 70
#define WSDISPLAY_TYPE_EFIFB 71
#define WSDISPLAY_TYPE_KMS 72
#define WSDISPLAY_TYPE_ASTFB 73
#define WSDISPLAY_TYPE_VIOGPU 74
struct wsdisplay_fbinfo {
u_int height;
u_int width;
u_int depth;
u_int stride;
u_int offset;
u_int cmsize;
};
#define WSDISPLAYIO_GINFO _IOR('W', 65, struct wsdisplay_fbinfo)
struct wsdisplay_cmap {
u_int index;
u_int count;
u_char *red;
u_char *green;
u_char *blue;
};
#define WSDISPLAYIO_GETCMAP _IOW('W', 66, struct wsdisplay_cmap)
#define WSDISPLAYIO_PUTCMAP _IOW('W', 67, struct wsdisplay_cmap)
#define WSDISPLAYIO_GVIDEO _IOR('W', 68, u_int)
#define WSDISPLAYIO_SVIDEO _IOW('W', 69, u_int)
#define WSDISPLAYIO_VIDEO_OFF 0
#define WSDISPLAYIO_VIDEO_ON 1
struct wsdisplay_curpos {
u_int x, y;
};
struct wsdisplay_cursor {
u_int which;
u_int enable;
struct wsdisplay_curpos pos;
struct wsdisplay_curpos hot;
struct wsdisplay_cmap cmap;
struct wsdisplay_curpos size;
u_char *image;
u_char *mask;
};
#define WSDISPLAY_CURSOR_DOCUR 0x01
#define WSDISPLAY_CURSOR_DOPOS 0x02
#define WSDISPLAY_CURSOR_DOHOT 0x04
#define WSDISPLAY_CURSOR_DOCMAP 0x08
#define WSDISPLAY_CURSOR_DOSHAPE 0x10
#define WSDISPLAY_CURSOR_DOALL 0x1f
#define WSDISPLAYIO_GCURPOS _IOR('W', 70, struct wsdisplay_curpos)
#define WSDISPLAYIO_SCURPOS _IOW('W', 71, struct wsdisplay_curpos)
#define WSDISPLAYIO_GCURMAX _IOR('W', 72, struct wsdisplay_curpos)
#define WSDISPLAYIO_GCURSOR _IOWR('W', 73, struct wsdisplay_cursor)
#define WSDISPLAYIO_SCURSOR _IOW('W', 74, struct wsdisplay_cursor)
#define WSDISPLAYIO_GMODE _IOR('W', 75, u_int)
#define WSDISPLAYIO_SMODE _IOW('W', 76, u_int)
#define WSDISPLAYIO_MODE_EMUL 0
#define WSDISPLAYIO_MODE_MAPPED 1
#define WSDISPLAYIO_MODE_DUMBFB 2
struct wsdisplay_font {
char name[WSFONT_NAME_SIZE];
int index;
#define WSDISPLAY_MAXFONTCOUNT 8
int firstchar, numchars;
int encoding;
#define WSDISPLAY_FONTENC_ISO 0
#define WSDISPLAY_FONTENC_IBM 1
u_int fontwidth, fontheight, stride;
#define WSDISPLAY_MAXFONTSZ (512*1024)
int bitorder, byteorder;
#define WSDISPLAY_FONTORDER_KNOWN 0
#define WSDISPLAY_FONTORDER_L2R 1
#define WSDISPLAY_FONTORDER_R2L 2
void *cookie;
void *data;
};
#define WSDISPLAYIO_LDFONT _IOW ('W', 77, struct wsdisplay_font)
#define WSDISPLAYIO_LSFONT _IOWR('W', 78, struct wsdisplay_font)
#define WSDISPLAYIO_DELFONT _IOW ('W', 79, struct wsdisplay_font)
#define WSDISPLAYIO_USEFONT _IOW ('W', 80, struct wsdisplay_font)
struct wsdisplay_burner {
u_int off;
u_int on;
u_int flags;
#define WSDISPLAY_BURN_VBLANK 0x0001
#define WSDISPLAY_BURN_KBD 0x0002
#define WSDISPLAY_BURN_MOUSE 0x0004
#define WSDISPLAY_BURN_OUTPUT 0x0008
};
#define WSDISPLAYIO_SBURNER _IOW('W', 81, struct wsdisplay_burner)
#define WSDISPLAYIO_GBURNER _IOR('W', 82, struct wsdisplay_burner)
struct wsdisplay_addscreendata {
int idx;
char screentype[WSSCREEN_NAME_SIZE];
char emul[WSEMUL_NAME_SIZE];
};
#define WSDISPLAYIO_ADDSCREEN _IOW('W', 83, struct wsdisplay_addscreendata)
struct wsdisplay_delscreendata {
int idx;
int flags;
#define WSDISPLAY_DELSCR_FORCE 0x01
#define WSDISPLAY_DELSCR_QUIET 0x02
};
#define WSDISPLAYIO_DELSCREEN _IOW('W', 84, struct wsdisplay_delscreendata)
#define WSDISPLAYIO_GETSCREEN _IOWR('W', 85, struct wsdisplay_addscreendata)
#define WSDISPLAYIO_SETSCREEN _IOW('W', 86, u_int)
#define WSDISPLAYIO_LINEBYTES _IOR('W', 95, u_int)
#define WSDISPLAYIO_WSMOUSED _IOW('W', 88, struct wscons_event)
struct wsdisplay_param {
int param;
#define WSDISPLAYIO_PARAM_BACKLIGHT 1
#define WSDISPLAYIO_PARAM_BRIGHTNESS 2
#define WSDISPLAYIO_PARAM_CONTRAST 3
int min, max, curval;
int reserved[4];
};
#define WSDISPLAYIO_GETPARAM _IOWR('W', 89, struct wsdisplay_param)
#define WSDISPLAYIO_SETPARAM _IOWR('W', 90, struct wsdisplay_param)
#define WSDISPLAYIO_GPCIID _IOR('W', 91, struct pcisel)
#define WSDISPLAYIO_DEPTH_1 0x1
#define WSDISPLAYIO_DEPTH_4 0x2
#define WSDISPLAYIO_DEPTH_8 0x4
#define WSDISPLAYIO_DEPTH_15 0x8
#define WSDISPLAYIO_DEPTH_16 0x10
#define WSDISPLAYIO_DEPTH_24_24 0x20
#define WSDISPLAYIO_DEPTH_24_32 0x40
#define WSDISPLAYIO_DEPTH_24 (WSDISPLAYIO_DEPTH_24_24|WSDISPLAYIO_DEPTH_24_32)
#define WSDISPLAYIO_DEPTH_30 0x80
#define WSDISPLAYIO_GETSUPPORTEDDEPTH _IOR('W', 92, unsigned int)
struct wsdisplay_gfx_mode {
int width;
int height;
int depth;
};
#define WSDISPLAYIO_SETGFXMODE _IOW('W', 92, struct wsdisplay_gfx_mode)
struct wsdisplay_screentype {
int idx;
int nidx;
char name[WSSCREEN_NAME_SIZE];
int ncols, nrows;
int fontwidth, fontheight;
};
#define WSDISPLAYIO_GETSCREENTYPE _IOWR('W', 93, struct wsdisplay_screentype)
struct wsdisplay_emultype {
int idx;
char name[WSSCREEN_NAME_SIZE];
};
#define WSDISPLAYIO_GETEMULTYPE _IOWR('W', 94, struct wsdisplay_emultype)
#define WSMUXIO_INJECTEVENT _IOW('W', 96, struct wscons_event)
struct wsmux_device {
int type;
#define WSMUX_MOUSE 1
#define WSMUX_KBD 2
#define WSMUX_MUX 3
int idx;
};
#define WSMUXIO_ADD_DEVICE _IOW('W', 97, struct wsmux_device)
#define WSMUXIO_REMOVE_DEVICE _IOW('W', 98, struct wsmux_device)
#define WSMUX_MAXDEV 32
struct wsmux_device_list {
int ndevices;
struct wsmux_device devices[WSMUX_MAXDEV];
};
#define WSMUXIO_LIST_DEVICES _IOWR('W', 99, struct wsmux_device_list)
#endif