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.
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.
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]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
36 * Those default values are taken from lower mice drivers.
38 #define CONSMS_SR_DEFAULT_HEIGHT 768
39 #define CONSMS_SR_DEFAULT_WIDTH 1024
41 #define CONSMS_PARMS_DEFAULT_JITTER 0
42 #define CONSMS_PARMS_DEFAULT_SPEED_LAW 0
43 #define CONSMS_PARMS_DEFAULT_SPEED_LIMIT 48
45 #define CONSMS_MAX(x, y) ((x) > (y) ? (x) : (y))
48 * These states are only used when an underlying mouse
49 * is being linked under the virtual mouse (/dev/mouse),
50 * in order to set some cached state variables. And these
51 * states go in a sequential way.
54 LQS_START
= 0, /* begin of initializing */
55 LQS_BUTTON_COUNT_PENDING
= 1, /* wait for button count ACK */
56 LQS_WHEEL_COUNT_PENDING
= 2, /* wait for wheel count ACK */
57 LQS_SET_VUID_FORMAT_PENDING
= 3, /* wait for set format ACK */
58 LQS_SET_WHEEL_STATE_PENDING
= 4, /* wait for wheel state ACK */
59 LQS_SET_PARMS_PENDING
= 5, /* wait for parameters ACK */
60 LQS_SET_RESOLUTION_PENDING
= 6, /* wait for resolution ACK */
61 LQS_DONE
= 7 /* mark end of initialization */
65 typedef void (*ioc_reply_func_t
)(struct consms_lq
*, mblk_t
*);
68 * This structure contains information
69 * for each underlying physical mouse
72 typedef struct consms_lq
{
73 struct consms_lq
*lq_next
; /* next lower queue */
75 consms_lq_state_t lq_state
; /* used during initializing */
76 queue_t
*lq_queue
; /* lower write q */
78 ioc_reply_func_t lq_ioc_reply_func
; /* reply function */
79 mblk_t
*lq_pending_plink
; /* pending msg */
80 queue_t
*lq_pending_queue
; /* upper write q */
82 int lq_num_buttons
; /* number of buttons */
83 int lq_num_wheels
; /* number of wheels */
84 ushort_t lq_wheel_state_bf
; /* enabled/disabled */
88 * This structure is used to remember the
89 * COPYIN and COPYOUT request mp from lower
90 * queue during transparent ioctl.
92 typedef struct consms_response
{
93 struct consms_response
*rsp_next
;
94 mblk_t
*rsp_mp
; /* response mp (M_COPYIN or M_COPYOUT) */
95 queue_t
*rsp_queue
; /* lower read q giving this response */
99 * This structure contains information for
100 * each ioctl message from upper layer
101 * (usually, X server).
103 typedef struct consms_msg
{
104 struct consms_msg
*msg_next
;
106 uint_t msg_id
; /* taken from request message */
107 int msg_num_requests
; /* # of lower queues dispatched */
108 int msg_num_responses
; /* # of responses from lower queues */
109 mblk_t
*msg_request
; /* pending request message from upper */
110 queue_t
*msg_queue
; /* upper write q used for qrely() */
113 * ack_mp is just used for IOCACK
114 * and rsp_list is only used for COPYIN
115 * or COPYOUT responses from lowers
117 mblk_t
*msg_ack_mp
; /* IOCACK from lower */
118 consms_response_t
*msg_rsp_list
; /* responses from lower */
122 * This structure contains information
123 * about virtual mouse (lower queue list,
124 * and virtual mouse state variables).
126 typedef struct consms_state
{
127 consms_lq_t
*consms_lqs
; /* lower queues */
128 int consms_num_lqs
; /* # of lower queues */
130 /* virtual mouse state variables */
131 int consms_vuid_format
; /* NATIVE or VUID_FIRM */
132 int consms_num_buttons
; /* max number of buttons */
133 int consms_num_wheels
; /* max number of wheels */
134 ushort_t consms_wheel_state_bf
; /* wheel enabled or disabled */
135 Ms_parms consms_ms_parms
; /* parameters for usb mouse */
136 Ms_screen_resolution consms_ms_sr
; /* for absolute mouse */
143 #endif /* _SYS_CONSMS_H */