xref: /netbsd-src/sys/arch/arc/dev/opmsvar.h (revision 7b161854865b8e4c9a7c7a1373162c1d784447e2)
1*7b161854Stsutsui /*	$NetBSD: opmsvar.h,v 1.5 2008/09/13 16:02:17 tsutsui Exp $	*/
2b7abba77Ssoda /*	$OpenBSD: pccons.c,v 1.22 1999/01/30 22:39:37 imp Exp $	*/
3b7abba77Ssoda /*	NetBSD: pms.c,v 1.21 1995/04/18 02:25:18 mycroft Exp	*/
4b7abba77Ssoda 
5b7abba77Ssoda /*-
6b7abba77Ssoda  * Copyright (c) 1990 The Regents of the University of California.
7b7abba77Ssoda  * All rights reserved.
8b7abba77Ssoda  *
9b7abba77Ssoda  * This code is derived from software contributed to Berkeley by
10b7abba77Ssoda  * William Jolitz and Don Ahn.
11b7abba77Ssoda  *
12aad01611Sagc  * Redistribution and use in source and binary forms, with or without
13aad01611Sagc  * modification, are permitted provided that the following conditions
14aad01611Sagc  * are met:
15aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
16aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
17aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
18aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
19aad01611Sagc  *    documentation and/or other materials provided with the distribution.
20aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
21aad01611Sagc  *    may be used to endorse or promote products derived from this software
22aad01611Sagc  *    without specific prior written permission.
23aad01611Sagc  *
24aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34aad01611Sagc  * SUCH DAMAGE.
35aad01611Sagc  *
36aad01611Sagc  *	@(#)pccons.c	5.11 (Berkeley) 5/21/91
37aad01611Sagc  */
38aad01611Sagc 
39aad01611Sagc /*-
40aad01611Sagc  * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.  All rights reserved.
41aad01611Sagc  *
42aad01611Sagc  * This code is derived from software contributed to Berkeley by
43aad01611Sagc  * William Jolitz and Don Ahn.
44aad01611Sagc  *
45b7abba77Ssoda  * Copyright (c) 1994 Charles M. Hannum.
46b7abba77Ssoda  * Copyright (c) 1992, 1993 Erik Forsberg.
47b7abba77Ssoda  *
48b7abba77Ssoda  * Redistribution and use in source and binary forms, with or without
49b7abba77Ssoda  * modification, are permitted provided that the following conditions
50b7abba77Ssoda  * are met:
51b7abba77Ssoda  * 1. Redistributions of source code must retain the above copyright
52b7abba77Ssoda  *    notice, this list of conditions and the following disclaimer.
53b7abba77Ssoda  * 2. Redistributions in binary form must reproduce the above copyright
54b7abba77Ssoda  *    notice, this list of conditions and the following disclaimer in the
55b7abba77Ssoda  *    documentation and/or other materials provided with the distribution.
56b7abba77Ssoda  * 3. All advertising materials mentioning features or use of this software
57b7abba77Ssoda  *    must display the following acknowledgement:
58b7abba77Ssoda  *	This product includes software developed by the University of
59b7abba77Ssoda  *	California, Berkeley and its contributors.
60b7abba77Ssoda  * 4. Neither the name of the University nor the names of its contributors
61b7abba77Ssoda  *    may be used to endorse or promote products derived from this software
62b7abba77Ssoda  *    without specific prior written permission.
63b7abba77Ssoda  *
64b7abba77Ssoda  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
65b7abba77Ssoda  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
66b7abba77Ssoda  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
67b7abba77Ssoda  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
68b7abba77Ssoda  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
69b7abba77Ssoda  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
70b7abba77Ssoda  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
71b7abba77Ssoda  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
72b7abba77Ssoda  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
73b7abba77Ssoda  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
74b7abba77Ssoda  * SUCH DAMAGE.
75b7abba77Ssoda  *
76b7abba77Ssoda  *	@(#)pccons.c	5.11 (Berkeley) 5/21/91
77b7abba77Ssoda  */
78b7abba77Ssoda 
79b7abba77Ssoda struct opms_softc {		/* driver status information */
80*7b161854Stsutsui 	device_t sc_dev;
81b7abba77Ssoda 
82b7abba77Ssoda 	struct clist sc_q;
83b7abba77Ssoda 	struct selinfo sc_rsel;
84b7abba77Ssoda 	u_char sc_state;	/* mouse driver state */
85b7abba77Ssoda #define	PMS_OPEN	0x01	/* device is open */
86b7abba77Ssoda #define	PMS_ASLP	0x02	/* waiting for mouse data */
87b7abba77Ssoda 	u_char sc_status;	/* mouse button status */
88b7abba77Ssoda 	int sc_x, sc_y;		/* accumulated motion in the X,Y axis */
89b7abba77Ssoda 
90b7abba77Ssoda #if 0
91b7abba77Ssoda 	struct pccons_kbd_context *sc_pkc; /* pckbd device software context */
92b7abba77Ssoda #endif
93b7abba77Ssoda };
94b7abba77Ssoda 
957fe2a5a0Stsutsui int opms_common_match(bus_space_tag_t, struct pccons_config *);
967fe2a5a0Stsutsui void opms_common_attach(struct opms_softc *, bus_space_tag_t,
977fe2a5a0Stsutsui     struct pccons_config *);
987fe2a5a0Stsutsui int opmsintr(void *);
99