mse.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
/* All Rights Reserved */
#ifndef _SYS_MSE_H
#define _SYS_MSE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_MSE_UNIT 15
/* Hardware interface ports */
/* Control port bits */
#define INTR_DISABLE 0x10
#define HIGH_NIBBLE 0x20
#define LOW_NIBBLE 0x00
#define X_COUNTER 0x00
#define Y_COUNTER 0x40
#define HC 0x80
/* Macros to make accessing the BUS mouse ports easier */
/*
* This section describes the original mouse.h definitions
* It is included here for the sake of compatibility.
*/
/* Base I/O addresses for primary and secondary BUS mouse InPort */
#define MOUSE1 0x23c
#define MOUSE2 0x238
/* Offsets of I/O registers from base */
#define ADDRREG 0 /* Address register */
/* Address register definitions */
#define MSTATUS 0 /* Select mouse status register */
/* Identification register definitions */
#define SW3 1
#define SW2 2
#define SW1 4
#define XA 0x10
#define XB 0x20
#define YA 0x40
#define YB 0x80
/* Mode register definitions */
#define RATEMASK 7
#define HZ0NOINTR 0
#define HZ30 1
#define HZ50 2
#define HZ100 3
#define HZ200 4
#define HZ0INTR 6
#define HZEXT 7
#define DATAINT 8
#define TIMERINT 0x10
#define HOLD 0x20
/* #define MODEMASK 0xc0 */
#define QUADMODE 0
#define SYNCHMODE 0x40
#define ASYNMODE 0x80
#define DIRMODE 0xc0
#define SNDERR 0xfe
#define FAILED (-1)
struct msecopy {
int state;
};
/*
* Mouse button number definitions.
*/
#ifdef _KERNEL
/* STREAMS mouse info structure */
struct strmseinfo {
int msetimeid;
char state;
char x;
char y;
char old_buttons;
};
#endif
#define BUS_MAJOR 0
#define MCA_MAJOR 1
#define MBUS 1
#define M320 2
#define MSERIAL 3
/* Mouse configuration */
struct mse_cfg {
unsigned count; /* # of entries in mapping table */
};
/* Mouse monitor daemon */
struct mse_mon {
int cmd; /* Command from driver to monitor */
};
#define MGR_WAITING 8
/* Structure for mouse information pseudo-ioctl (from mse to display driver) */
struct mcastat {
int mode; /* stream or prompt mode */
int present;
int map_unit;
};
struct mouseconfig {
unsigned io_addr; /* Base I/O address */
unsigned ivect; /* Interrupt vector */
int present; /* Set by detection routine */
int map_unit; /* Index into mse_mapping[] */
};
typedef struct mouseconfig MOUSECNF;
/* Display-to-mouse mapping table (sent by mouseadmin) */
struct mousemap {
mse_dev; /* Serial mouse device id; */
/* or makedev(0,unit #) for bus mouse */
int type; /* type of mouse (MBUS, M320, etc) */
};
/*
* AT&T 320 mouse (8042 controller) I/O port addresses
*/
/* Mouse driver internal status structure kept for each virtual mouse */
typedef struct {
int mse_pid;
int rupted;
int isopen;
char old_buttons;
} MOUSE_STRUCT;
/* Mouse driver internal status structure kept for each physical mouse */
typedef struct {
int n_vts;
int old; /* Save old line discipline here */
int state; /* Serial mse input parsing state */
int x_ovr; /* 320 overflow state */
int y_ovr; /* 320 overflow state */
int status; /* Status of manager command */
} MOUSE_UNIT;
/* bits in data port indicating button state */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MSE_H */