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