consms.h revision d5007c14714a317d8cf986a22ec8ac39f16e168f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CONSMS_H
#define _SYS_CONSMS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Those default values are taken from lower mice drivers.
*/
#define CONSMS_SR_DEFAULT_HEIGHT 768
#define CONSMS_SR_DEFAULT_WIDTH 1024
#define CONSMS_PARMS_DEFAULT_JITTER 0
#define CONSMS_PARMS_DEFAULT_SPEED_LAW 0
#define CONSMS_PARMS_DEFAULT_SPEED_LIMIT 48
#define CONSMS_MAX(x, y) ((x) > (y) ? (x) : (y))
/*
* These states are only used when an underlying mouse
* in order to set some cached state variables. And these
* states go in a sequential way.
*/
typedef enum {
LQS_START = 0, /* begin of initializing */
struct consms_lq;
/*
* This structure contains information
* for each underlying physical mouse
* (lower queue).
*/
typedef struct consms_lq {
int lq_num_buttons; /* number of buttons */
int lq_num_wheels; /* number of wheels */
} consms_lq_t;
/*
* This structure is used to remember the
* COPYIN and COPYOUT request mp from lower
* queue during transparent ioctl.
*/
typedef struct consms_response {
struct consms_response *rsp_next;
/*
* This structure contains information for
* each ioctl message from upper layer
* (usually, X server).
*/
typedef struct consms_msg {
struct consms_msg *msg_next;
int msg_num_requests; /* # of lower queues dispatched */
int msg_num_responses; /* # of responses from lower queues */
/*
* ack_mp is just used for IOCACK
* and rsp_list is only used for COPYIN
* or COPYOUT responses from lowers
*/
} consms_msg_t;
/*
* This structure contains information
* about virtual mouse (lower queue list,
* and virtual mouse state variables).
*/
typedef struct consms_state {
int consms_num_lqs; /* # of lower queues */
/* virtual mouse state variables */
int consms_vuid_format; /* NATIVE or VUID_FIRM */
int consms_num_buttons; /* max number of buttons */
int consms_num_wheels; /* max number of wheels */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CONSMS_H */