1706f2543Smrg/*
2706f2543Smrg * Copyright 2002 Red Hat Inc., Durham, North Carolina.
3706f2543Smrg *
4706f2543Smrg * All Rights Reserved.
5706f2543Smrg *
6706f2543Smrg * Permission is hereby granted, free of charge, to any person obtaining
7706f2543Smrg * a copy of this software and associated documentation files (the
8706f2543Smrg * "Software"), to deal in the Software without restriction, including
9706f2543Smrg * without limitation on the rights to use, copy, modify, merge,
10706f2543Smrg * publish, distribute, sublicense, and/or sell copies of the Software,
11706f2543Smrg * and to permit persons to whom the Software is furnished to do so,
12706f2543Smrg * subject to the following conditions:
13706f2543Smrg *
14706f2543Smrg * The above copyright notice and this permission notice (including the
15706f2543Smrg * next paragraph) shall be included in all copies or substantial
16706f2543Smrg * portions of the Software.
17706f2543Smrg *
18706f2543Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19706f2543Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20706f2543Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21706f2543Smrg * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22706f2543Smrg * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23706f2543Smrg * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24706f2543Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25706f2543Smrg * SOFTWARE.
26706f2543Smrg */
27706f2543Smrg
28706f2543Smrg/*
29706f2543Smrg * Authors:
30706f2543Smrg *   Rickard E. (Rik) Faith <faith@redhat.com>
31706f2543Smrg *
32706f2543Smrg */
33706f2543Smrg
34706f2543Smrg/** \file
35706f2543Smrg * Private header file for USB support.  This file provides
36706f2543Smrg * Linux-specific include files and the definition of the private
37706f2543Smrg * structure.  \see usb-common.c \see usb-keyboard.c \see usb-mouse.c
38706f2543Smrg * \see usb-other.c */
39706f2543Smrg
40706f2543Smrg#ifndef _USB_PRIVATE_H_
41706f2543Smrg#define _USB_PRIVATE_H_
42706f2543Smrg
43706f2543Smrg#include "dmxinputinit.h"
44706f2543Smrg#include "inputstr.h"
45706f2543Smrg#include <X11/Xos.h>
46706f2543Smrg#include <errno.h>
47706f2543Smrg#include <linux/input.h>
48706f2543Smrg#include "usb-common.h"
49706f2543Smrg
50706f2543Smrg                                /*  Support for force feedback was
51706f2543Smrg                                 *  introduced in Linxu 2.4.10 */
52706f2543Smrg#ifndef EV_MSC
53706f2543Smrg#define EV_MSC      0x04
54706f2543Smrg#endif
55706f2543Smrg#ifndef EV_FF
56706f2543Smrg#define EV_FF       0x15
57706f2543Smrg#endif
58706f2543Smrg#ifndef LED_SLEEP
59706f2543Smrg#define LED_SLEEP   0x05
60706f2543Smrg#endif
61706f2543Smrg#ifndef LED_SUSPEND
62706f2543Smrg#define LED_SUSPEND 0x06
63706f2543Smrg#endif
64706f2543Smrg#ifndef LED_MUTE
65706f2543Smrg#define LED_MUTE    0x07
66706f2543Smrg#endif
67706f2543Smrg#ifndef LED_MISC
68706f2543Smrg#define LED_MISC    0x08
69706f2543Smrg#endif
70706f2543Smrg#ifndef BTN_DEAD
71706f2543Smrg#define BTN_DEAD    0x12f
72706f2543Smrg#endif
73706f2543Smrg#ifndef BTN_THUMBL
74706f2543Smrg#define BTN_THUMBL  0x13d
75706f2543Smrg#endif
76706f2543Smrg#ifndef BTN_THUMBR
77706f2543Smrg#define BTN_THUMBR  0x13e
78706f2543Smrg#endif
79706f2543Smrg#ifndef MSC_SERIAL
80706f2543Smrg#define MSC_SERIAL  0x00
81706f2543Smrg#endif
82706f2543Smrg#ifndef MSC_MAX
83706f2543Smrg#define MSC_MAX     0x07
84706f2543Smrg#endif
85706f2543Smrg
86706f2543Smrg                                /* Support for older kernels. */
87706f2543Smrg#ifndef ABS_WHEEL
88706f2543Smrg#define ABS_WHEEL   0x08
89706f2543Smrg#endif
90706f2543Smrg#ifndef ABS_GAS
91706f2543Smrg#define ABS_GAS     0x09
92706f2543Smrg#endif
93706f2543Smrg#ifndef ABS_BRAKE
94706f2543Smrg#define ABS_BRAKE   0x0a
95706f2543Smrg#endif
96706f2543Smrg
97706f2543Smrg#define NUM_STATE_ENTRIES (256/32)
98706f2543Smrg
99706f2543Smrg/* Private area for USB devices. */
100706f2543Smrgtypedef struct _myPrivate {
101706f2543Smrg    DeviceIntPtr   pDevice;                 /**< Device (mouse or other) */
102706f2543Smrg    int            fd;                      /**< File descriptor */
103706f2543Smrg    unsigned char  mask[EV_MAX/8 + 1];      /**< Mask */
104706f2543Smrg    int            numRel, numAbs, numLeds; /**< Counts */
105706f2543Smrg    int            relmap[DMX_MAX_AXES];    /**< Relative axis map */
106706f2543Smrg    int            absmap[DMX_MAX_AXES];    /**< Absolute axis map */
107706f2543Smrg
108706f2543Smrg    CARD32         kbdState[NUM_STATE_ENTRIES]; /**< Keyboard state */
109706f2543Smrg    DeviceIntPtr   pKeyboard;                   /** Keyboard device */
110706f2543Smrg
111706f2543Smrg    int            pitch;       /**< Bell pitch  */
112706f2543Smrg    unsigned long  duration;    /**< Bell duration */
113706f2543Smrg
114706f2543Smrg    /* FIXME: dmxInput is never initialized */
115706f2543Smrg    DMXInputInfo   *dmxInput;   /**< For pretty-printing */
116706f2543Smrg} myPrivate;
117706f2543Smrg#endif
118