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