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