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