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