pmsvar.h revision 1.12 1 1.12 christos /* $NetBSD: pmsvar.h,v 1.12 2017/08/13 08:49:27 christos Exp $ */
2 1.1 christos
3 1.1 christos /*-
4 1.1 christos * Copyright (c) 2004 Kentaro Kurahone.
5 1.1 christos * Copyright (c) 2004 Ales Krenek.
6 1.1 christos * Copyright (c) 1994 Charles M. Hannum.
7 1.1 christos * Copyright (c) 1992, 1993 Erik Forsberg.
8 1.1 christos * All rights reserved.
9 1.1 christos *
10 1.1 christos * Redistribution and use in source and binary forms, with or without
11 1.1 christos * modification, are permitted provided that the following conditions
12 1.1 christos * are met:
13 1.1 christos * 1. Redistributions of source code must retain the above copyright
14 1.1 christos * notice, this list of conditions and the following disclaimer.
15 1.1 christos *
16 1.1 christos * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 1.1 christos * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 1.1 christos * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19 1.1 christos * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 1.1 christos * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 1.1 christos * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 1.1 christos * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23 1.1 christos * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 1.1 christos * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 1.1 christos * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1 christos */
27 1.1 christos
28 1.1 christos #ifndef _DEV_PCKBCPORT_PMSVAR_H_
29 1.1 christos #define _DEV_PCKBCPORT_PMSVAR_H_
30 1.1 christos
31 1.8 jmcneill #include <dev/pckbport/synapticsvar.h>
32 1.8 jmcneill #include <dev/pckbport/elantechvar.h>
33 1.12 christos #include <dev/pckbport/alpsvar.h>
34 1.8 jmcneill
35 1.1 christos enum pms_type {
36 1.1 christos PMS_UNKNOWN,
37 1.1 christos PMS_STANDARD,
38 1.1 christos PMS_SCROLL3,
39 1.1 christos PMS_SCROLL5,
40 1.8 jmcneill PMS_SYNAPTICS,
41 1.12 christos PMS_ELANTECH,
42 1.12 christos PMS_ALPS
43 1.1 christos };
44 1.1 christos
45 1.1 christos struct pms_protocol {
46 1.1 christos int rates[3];
47 1.1 christos int response;
48 1.1 christos const char *name;
49 1.3 perry };
50 1.1 christos
51 1.1 christos struct pms_softc { /* driver status information */
52 1.6 cube device_t sc_dev;
53 1.1 christos
54 1.1 christos pckbport_tag_t sc_kbctag;
55 1.10 jakllsch pckbport_slot_t sc_kbcslot;
56 1.1 christos
57 1.1 christos int sc_enabled; /* input enabled? */
58 1.1 christos int inputstate; /* number of bytes received for this packet */
59 1.1 christos u_int buttons; /* mouse button status */
60 1.1 christos enum pms_type protocol;
61 1.1 christos unsigned char packet[6];
62 1.1 christos struct timeval last, current;
63 1.1 christos
64 1.7 cube device_t sc_wsmousedev;
65 1.5 ad struct lwp *sc_event_thread;
66 1.1 christos
67 1.12 christos #if defined(PMS_SYNAPTICS_TOUCHPAD) || defined(PMS_ELANTECH_TOUCHPAD) \
68 1.12 christos || defined(PMS_ALPS_TOUCHPAD)
69 1.8 jmcneill union {
70 1.2 scw #ifdef PMS_SYNAPTICS_TOUCHPAD
71 1.1 christos struct synaptics_softc synaptics;
72 1.8 jmcneill #endif
73 1.8 jmcneill #ifdef PMS_ELANTECH_TOUCHPAD
74 1.8 jmcneill struct elantech_softc elantech;
75 1.8 jmcneill #endif
76 1.12 christos #ifdef PMS_ALPS_TOUCHPAD
77 1.12 christos struct alps_softc alps;
78 1.12 christos #endif
79 1.1 christos } u;
80 1.2 scw #endif
81 1.1 christos };
82 1.1 christos
83 1.11 jakllsch int pms_sliced_command(pckbport_tag_t, pckbport_slot_t, u_char);
84 1.11 jakllsch
85 1.10 jakllsch #endif /* _DEV_PCKBCPORT_PMSVAR_H_ */
86