xref: /OK3568_Linux_fs/external/xserver/hw/dmx/input/usb-private.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright 2002 Red Hat Inc., Durham, North Carolina.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * All Rights Reserved.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining
7*4882a593Smuzhiyun  * a copy of this software and associated documentation files (the
8*4882a593Smuzhiyun  * "Software"), to deal in the Software without restriction, including
9*4882a593Smuzhiyun  * without limitation on the rights to use, copy, modify, merge,
10*4882a593Smuzhiyun  * publish, distribute, sublicense, and/or sell copies of the Software,
11*4882a593Smuzhiyun  * and to permit persons to whom the Software is furnished to do so,
12*4882a593Smuzhiyun  * subject to the following conditions:
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * The above copyright notice and this permission notice (including the
15*4882a593Smuzhiyun  * next paragraph) shall be included in all copies or substantial
16*4882a593Smuzhiyun  * portions of the Software.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19*4882a593Smuzhiyun  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20*4882a593Smuzhiyun  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21*4882a593Smuzhiyun  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22*4882a593Smuzhiyun  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23*4882a593Smuzhiyun  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24*4882a593Smuzhiyun  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25*4882a593Smuzhiyun  * SOFTWARE.
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun /*
29*4882a593Smuzhiyun  * Authors:
30*4882a593Smuzhiyun  *   Rickard E. (Rik) Faith <faith@redhat.com>
31*4882a593Smuzhiyun  *
32*4882a593Smuzhiyun  */
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun /** \file
35*4882a593Smuzhiyun  * Private header file for USB support.  This file provides
36*4882a593Smuzhiyun  * Linux-specific include files and the definition of the private
37*4882a593Smuzhiyun  * structure.  \see usb-common.c \see usb-keyboard.c \see usb-mouse.c
38*4882a593Smuzhiyun  * \see usb-other.c */
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun #ifndef _USB_PRIVATE_H_
41*4882a593Smuzhiyun #define _USB_PRIVATE_H_
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun #include "dmxinputinit.h"
44*4882a593Smuzhiyun #include "inputstr.h"
45*4882a593Smuzhiyun #include <X11/Xos.h>
46*4882a593Smuzhiyun #include <errno.h>
47*4882a593Smuzhiyun #include <linux/input.h>
48*4882a593Smuzhiyun #include "usb-common.h"
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun                                 /*  Support for force feedback was
51*4882a593Smuzhiyun                                  *  introduced in Linxu 2.4.10 */
52*4882a593Smuzhiyun #ifndef EV_MSC
53*4882a593Smuzhiyun #define EV_MSC      0x04
54*4882a593Smuzhiyun #endif
55*4882a593Smuzhiyun #ifndef EV_FF
56*4882a593Smuzhiyun #define EV_FF       0x15
57*4882a593Smuzhiyun #endif
58*4882a593Smuzhiyun #ifndef LED_SLEEP
59*4882a593Smuzhiyun #define LED_SLEEP   0x05
60*4882a593Smuzhiyun #endif
61*4882a593Smuzhiyun #ifndef LED_SUSPEND
62*4882a593Smuzhiyun #define LED_SUSPEND 0x06
63*4882a593Smuzhiyun #endif
64*4882a593Smuzhiyun #ifndef LED_MUTE
65*4882a593Smuzhiyun #define LED_MUTE    0x07
66*4882a593Smuzhiyun #endif
67*4882a593Smuzhiyun #ifndef LED_MISC
68*4882a593Smuzhiyun #define LED_MISC    0x08
69*4882a593Smuzhiyun #endif
70*4882a593Smuzhiyun #ifndef BTN_DEAD
71*4882a593Smuzhiyun #define BTN_DEAD    0x12f
72*4882a593Smuzhiyun #endif
73*4882a593Smuzhiyun #ifndef BTN_THUMBL
74*4882a593Smuzhiyun #define BTN_THUMBL  0x13d
75*4882a593Smuzhiyun #endif
76*4882a593Smuzhiyun #ifndef BTN_THUMBR
77*4882a593Smuzhiyun #define BTN_THUMBR  0x13e
78*4882a593Smuzhiyun #endif
79*4882a593Smuzhiyun #ifndef MSC_SERIAL
80*4882a593Smuzhiyun #define MSC_SERIAL  0x00
81*4882a593Smuzhiyun #endif
82*4882a593Smuzhiyun #ifndef MSC_MAX
83*4882a593Smuzhiyun #define MSC_MAX     0x07
84*4882a593Smuzhiyun #endif
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun                                 /* Support for older kernels. */
87*4882a593Smuzhiyun #ifndef ABS_WHEEL
88*4882a593Smuzhiyun #define ABS_WHEEL   0x08
89*4882a593Smuzhiyun #endif
90*4882a593Smuzhiyun #ifndef ABS_GAS
91*4882a593Smuzhiyun #define ABS_GAS     0x09
92*4882a593Smuzhiyun #endif
93*4882a593Smuzhiyun #ifndef ABS_BRAKE
94*4882a593Smuzhiyun #define ABS_BRAKE   0x0a
95*4882a593Smuzhiyun #endif
96*4882a593Smuzhiyun 
97*4882a593Smuzhiyun #define NUM_STATE_ENTRIES (256/32)
98*4882a593Smuzhiyun 
99*4882a593Smuzhiyun /* Private area for USB devices. */
100*4882a593Smuzhiyun typedef struct _myPrivate {
101*4882a593Smuzhiyun     DeviceIntPtr pDevice;                   /**< Device (mouse or other) */
102*4882a593Smuzhiyun     int fd;                                 /**< File descriptor */
103*4882a593Smuzhiyun     unsigned char mask[EV_MAX / 8 + 1];     /**< Mask */
104*4882a593Smuzhiyun     int numRel, numAbs, numLeds;            /**< Counts */
105*4882a593Smuzhiyun     int relmap[REL_CNT];                    /**< Relative axis map */
106*4882a593Smuzhiyun     int absmap[ABS_CNT];                    /**< Absolute axis map */
107*4882a593Smuzhiyun 
108*4882a593Smuzhiyun     CARD32 kbdState[NUM_STATE_ENTRIES];         /**< Keyboard state */
109*4882a593Smuzhiyun     DeviceIntPtr pKeyboard;                     /** Keyboard device */
110*4882a593Smuzhiyun 
111*4882a593Smuzhiyun     int pitch;                  /**< Bell pitch  */
112*4882a593Smuzhiyun     unsigned long duration;     /**< Bell duration */
113*4882a593Smuzhiyun 
114*4882a593Smuzhiyun     /* FIXME: dmxInput is never initialized */
115*4882a593Smuzhiyun     DMXInputInfo *dmxInput;     /**< For pretty-printing */
116*4882a593Smuzhiyun } myPrivate;
117*4882a593Smuzhiyun #endif
118