xref: /illumos-gate/usr/src/uts/common/io/vuidmice/vuidmice.h (revision 57f4a14abf7408570afb91750e10e4b57f721549)
1*57f4a14aSGarrett D'Amore /*
2*57f4a14aSGarrett D'Amore  * CDDL HEADER START
3*57f4a14aSGarrett D'Amore  *
4*57f4a14aSGarrett D'Amore  * The contents of this file are subject to the terms of the
5*57f4a14aSGarrett D'Amore  * Common Development and Distribution License (the "License").
6*57f4a14aSGarrett D'Amore  * You may not use this file except in compliance with the License.
7*57f4a14aSGarrett D'Amore  *
8*57f4a14aSGarrett D'Amore  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*57f4a14aSGarrett D'Amore  * or http://www.opensolaris.org/os/licensing.
10*57f4a14aSGarrett D'Amore  * See the License for the specific language governing permissions
11*57f4a14aSGarrett D'Amore  * and limitations under the License.
12*57f4a14aSGarrett D'Amore  *
13*57f4a14aSGarrett D'Amore  * When distributing Covered Code, include this CDDL HEADER in each
14*57f4a14aSGarrett D'Amore  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*57f4a14aSGarrett D'Amore  * If applicable, add the following below this CDDL HEADER, with the
16*57f4a14aSGarrett D'Amore  * fields enclosed by brackets "[]" replaced with your own identifying
17*57f4a14aSGarrett D'Amore  * information: Portions Copyright [yyyy] [name of copyright owner]
18*57f4a14aSGarrett D'Amore  *
19*57f4a14aSGarrett D'Amore  * CDDL HEADER END
20*57f4a14aSGarrett D'Amore  */
21*57f4a14aSGarrett D'Amore /*
22*57f4a14aSGarrett D'Amore  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*57f4a14aSGarrett D'Amore  * Use is subject to license terms.
24*57f4a14aSGarrett D'Amore  */
25*57f4a14aSGarrett D'Amore 
26*57f4a14aSGarrett D'Amore #ifndef _VUIDMICE_H
27*57f4a14aSGarrett D'Amore #define	_VUIDMICE_H
28*57f4a14aSGarrett D'Amore 
29*57f4a14aSGarrett D'Amore #if _KERNEL
30*57f4a14aSGarrett D'Amore struct MouseStateInfo {
31*57f4a14aSGarrett D'Amore 	unsigned long	last_event_lbolt;
32*57f4a14aSGarrett D'Amore 	uchar_t		wheel_state_bf;
33*57f4a14aSGarrett D'Amore 	uchar_t		format;
34*57f4a14aSGarrett D'Amore 	uchar_t		state;
35*57f4a14aSGarrett D'Amore 	uchar_t		buttons;		/* current button state */
36*57f4a14aSGarrett D'Amore 	int		deltax;			/* delta X value */
37*57f4a14aSGarrett D'Amore 	int		deltay;			/* delta Y value */
38*57f4a14aSGarrett D'Amore 	int		vuid_mouse_mode;
39*57f4a14aSGarrett D'Amore 	uchar_t		oldbuttons;		/* previous button state */
40*57f4a14aSGarrett D'Amore 	uchar_t		sync_byte;
41*57f4a14aSGarrett D'Amore 	uchar_t		inited;
42*57f4a14aSGarrett D'Amore 	uchar_t		nbuttons;
43*57f4a14aSGarrett D'Amore 	timeout_id_t	init_tid;		/* used for initialization */
44*57f4a14aSGarrett D'Amore 	uchar_t		init_count;		/* track down init count */
45*57f4a14aSGarrett D'Amore };
46*57f4a14aSGarrett D'Amore 
47*57f4a14aSGarrett D'Amore typedef struct Mouse_iocstate {
48*57f4a14aSGarrett D'Amore 	int		ioc_state;
49*57f4a14aSGarrett D'Amore 	caddr_t		u_addr;
50*57f4a14aSGarrett D'Amore } Mouse_iocstate_t;
51*57f4a14aSGarrett D'Amore 
52*57f4a14aSGarrett D'Amore #define	STATEP		((struct MouseStateInfo *)qp->q_ptr)
53*57f4a14aSGarrett D'Amore #define	VUIDMICE_NUM_WHEELS		2
54*57f4a14aSGarrett D'Amore #define	VUIDMICE_VERTICAL_WHEEL_ID	0
55*57f4a14aSGarrett D'Amore #define	VUIDMICE_HORIZONTAL_WHEEL_ID	1
56*57f4a14aSGarrett D'Amore 
57*57f4a14aSGarrett D'Amore #ifdef	VUIDM3P
58*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuidm3p"
59*57f4a14aSGarrett D'Amore #define	VUID_PUTNEXT		vuidm3p_putnext
60*57f4a14aSGarrett D'Amore #define	VUID_QUEUE		vuidm3p
61*57f4a14aSGarrett D'Amore #define	VUID_OPEN		vuidm3p_open
62*57f4a14aSGarrett D'Amore #endif
63*57f4a14aSGarrett D'Amore 
64*57f4a14aSGarrett D'Amore #ifdef	VUIDM4P
65*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuidm4p"
66*57f4a14aSGarrett D'Amore #define	VUID_PUTNEXT		vuidm4p_putnext
67*57f4a14aSGarrett D'Amore #define	VUID_QUEUE		vuidm4p
68*57f4a14aSGarrett D'Amore #define	VUID_OPEN		vuidm4p_open
69*57f4a14aSGarrett D'Amore #endif
70*57f4a14aSGarrett D'Amore 
71*57f4a14aSGarrett D'Amore #ifdef	VUIDM5P
72*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuidm5p"
73*57f4a14aSGarrett D'Amore #define	VUID_PUTNEXT		vuidm5p_putnext
74*57f4a14aSGarrett D'Amore #define	VUID_QUEUE		vuidm5p
75*57f4a14aSGarrett D'Amore #define	VUID_OPEN		vuidm5p_open
76*57f4a14aSGarrett D'Amore #endif
77*57f4a14aSGarrett D'Amore 
78*57f4a14aSGarrett D'Amore #ifdef	VUID2PS2
79*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuid2ps2"
80*57f4a14aSGarrett D'Amore #define	VUID_PUTNEXT		vuid2ps2_putnext
81*57f4a14aSGarrett D'Amore #define	VUID_INIT_TIMEOUT	vuid2ps2_init_timeout
82*57f4a14aSGarrett D'Amore #define	VUID_QUEUE		vuid2ps2
83*57f4a14aSGarrett D'Amore #define	VUID_OPEN		vuid2ps2_open
84*57f4a14aSGarrett D'Amore #define	VUID_CLOSE		vuid2ps2_close
85*57f4a14aSGarrett D'Amore #endif
86*57f4a14aSGarrett D'Amore 
87*57f4a14aSGarrett D'Amore #ifdef	VUID3PS2
88*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuid3ps2"
89*57f4a14aSGarrett D'Amore #define	VUID_PUTNEXT		vuid3ps2_putnext
90*57f4a14aSGarrett D'Amore #define	VUID_INIT_TIMEOUT	vuid3ps2_init_timeout
91*57f4a14aSGarrett D'Amore #define	VUID_QUEUE		vuid3ps2
92*57f4a14aSGarrett D'Amore #define	VUID_OPEN		vuid3ps2_open
93*57f4a14aSGarrett D'Amore #define	VUID_CLOSE		vuid3ps2_close
94*57f4a14aSGarrett D'Amore #endif
95*57f4a14aSGarrett D'Amore 
96*57f4a14aSGarrett D'Amore #ifdef	VUIDPS2
97*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuidps2"
98*57f4a14aSGarrett D'Amore #define	VUID_PUTNEXT		vuidps2_putnext
99*57f4a14aSGarrett D'Amore #define	VUID_INIT_TIMEOUT	vuidps2_init_timeout
100*57f4a14aSGarrett D'Amore #define	VUID_QUEUE		vuidps2
101*57f4a14aSGarrett D'Amore #define	VUID_OPEN		vuidps2_open
102*57f4a14aSGarrett D'Amore #define	VUID_CLOSE		vuidps2_close
103*57f4a14aSGarrett D'Amore #endif
104*57f4a14aSGarrett D'Amore 
105*57f4a14aSGarrett D'Amore #ifndef	VUID_NAME
106*57f4a14aSGarrett D'Amore #define	VUID_NAME		"vuidmice"
107*57f4a14aSGarrett D'Amore #endif
108*57f4a14aSGarrett D'Amore 
109*57f4a14aSGarrett D'Amore #endif /* _KERNEL */
110*57f4a14aSGarrett D'Amore 
111*57f4a14aSGarrett D'Amore #endif /* _VUIDMICE_H */
112