45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright 2002 Red Hat Inc., Durham, North Carolina.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * All Rights Reserved.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission is hereby granted, free of charge, to any person obtaining
45e9809aff7304721fddb95654901b32195c9c7avboxsync * a copy of this software and associated documentation files (the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * "Software"), to deal in the Software without restriction, including
45e9809aff7304721fddb95654901b32195c9c7avboxsync * without limitation on the rights to use, copy, modify, merge,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * and to permit persons to whom the Software is furnished to do so,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * subject to the following conditions:
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The above copyright notice and this permission notice (including the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * next paragraph) shall be included in all copies or substantial
45e9809aff7304721fddb95654901b32195c9c7avboxsync * portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45e9809aff7304721fddb95654901b32195c9c7avboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
45e9809aff7304721fddb95654901b32195c9c7avboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
45e9809aff7304721fddb95654901b32195c9c7avboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
45e9809aff7304721fddb95654901b32195c9c7avboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45e9809aff7304721fddb95654901b32195c9c7avboxsync * SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Authors:
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Rickard E. (Rik) Faith <faith@redhat.com>
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** \file
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Private header file for USB support. This file provides
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Linux-specific include files and the definition of the private
45e9809aff7304721fddb95654901b32195c9c7avboxsync * structure. \see usb-common.c \see usb-keyboard.c \see usb-mouse.c
45e9809aff7304721fddb95654901b32195c9c7avboxsync * \see usb-other.c */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef _USB_PRIVATE_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _USB_PRIVATE_H_
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "dmxinputinit.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "inputstr.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <X11/Xos.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <errno.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include <linux/input.h>
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "usb-common.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Support for force feedback was
45e9809aff7304721fddb95654901b32195c9c7avboxsync * introduced in Linxu 2.4.10 */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef EV_MSC
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define EV_MSC 0x04
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef EV_FF
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define EV_FF 0x15
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef LED_SLEEP
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define LED_SLEEP 0x05
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef LED_SUSPEND
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define LED_SUSPEND 0x06
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef LED_MUTE
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define LED_MUTE 0x07
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef LED_MISC
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define LED_MISC 0x08
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef BTN_DEAD
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BTN_DEAD 0x12f
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef BTN_THUMBL
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BTN_THUMBL 0x13d
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef BTN_THUMBR
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define BTN_THUMBR 0x13e
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef MSC_SERIAL
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MSC_SERIAL 0x00
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef MSC_MAX
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MSC_MAX 0x07
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Support for older kernels. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef ABS_WHEEL
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define ABS_WHEEL 0x08
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef ABS_GAS
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define ABS_GAS 0x09
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef ABS_BRAKE
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define ABS_BRAKE 0x0a
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define NUM_STATE_ENTRIES (256/32)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Private area for USB devices. */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _myPrivate {
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pDevice; /**< Device (mouse or other) */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int fd; /**< File descriptor */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char mask[EV_MAX/8 + 1]; /**< Mask */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int numRel, numAbs, numLeds; /**< Counts */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int relmap[DMX_MAX_AXES]; /**< Relative axis map */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int absmap[DMX_MAX_AXES]; /**< Absolute axis map */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD32 kbdState[NUM_STATE_ENTRIES]; /**< Keyboard state */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DeviceIntPtr pKeyboard; /** Keyboard device */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync int pitch; /**< Bell pitch */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long duration; /**< Bell duration */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* FIXME: dmxInput is never initialized */
45e9809aff7304721fddb95654901b32195c9c7avboxsync DMXInputInfo *dmxInput; /**< For pretty-printing */
45e9809aff7304721fddb95654901b32195c9c7avboxsync} myPrivate;
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif