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