linux-old/include/linux/uinput.h
<<
>>
Prefs
   1/*
   2 *  User level driver support for input subsystem
   3 *
   4 * Heavily based on evdev.c by Vojtech Pavlik
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License as published by
   8 * the Free Software Foundation; either version 2 of the License, or
   9 * (at your option) any later version.
  10 *
  11 * This program is distributed in the hope that it will be useful,
  12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14 * GNU General Public License for more details.
  15 *
  16 * You should have received a copy of the GNU General Public License
  17 * along with this program; if not, write to the Free Software
  18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19 *
  20 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
  21 * 
  22 * Changes/Revisions:
  23 *      0.1     20/06/2002
  24 *              - first public version
  25 */
  26
  27#ifndef __UINPUT_H_
  28#define __UINPUT_H_
  29
  30#ifdef __KERNEL__
  31#define UINPUT_MINOR            223
  32#define UINPUT_NAME             "uinput"
  33#define UINPUT_BUFFER_SIZE      16
  34
  35/* state flags => bit index for {set|clear|test}_bit ops */
  36#define UIST_CREATED            0
  37
  38struct uinput_device {
  39        struct input_dev        *dev;
  40        unsigned long           state;
  41        wait_queue_head_t       waitq;
  42        unsigned char           ready,
  43                                head,
  44                                tail;
  45        struct input_event      buff[UINPUT_BUFFER_SIZE];
  46};
  47#endif  /* __KERNEL__ */
  48
  49/* ioctl */
  50#define UINPUT_IOCTL_BASE       'U'
  51#define UI_DEV_CREATE           _IO(UINPUT_IOCTL_BASE, 1)
  52#define UI_DEV_DESTROY          _IO(UINPUT_IOCTL_BASE, 2)
  53#define UI_SET_EVBIT            _IOW(UINPUT_IOCTL_BASE, 100, int)
  54#define UI_SET_KEYBIT           _IOW(UINPUT_IOCTL_BASE, 101, int)
  55#define UI_SET_RELBIT           _IOW(UINPUT_IOCTL_BASE, 102, int)
  56#define UI_SET_ABSBIT           _IOW(UINPUT_IOCTL_BASE, 103, int)
  57#define UI_SET_MSCBIT           _IOW(UINPUT_IOCTL_BASE, 104, int)
  58#define UI_SET_LEDBIT           _IOW(UINPUT_IOCTL_BASE, 105, int)
  59#define UI_SET_SNDBIT           _IOW(UINPUT_IOCTL_BASE, 106, int)
  60#define UI_SET_FFBIT            _IOW(UINPUT_IOCTL_BASE, 107, int)
  61
  62#ifndef NBITS
  63#define NBITS(x) ((((x)-1)/(sizeof(long)*8))+1)
  64#endif  /* NBITS */
  65
  66#define UINPUT_MAX_NAME_SIZE    80
  67struct uinput_user_dev {
  68        char name[UINPUT_MAX_NAME_SIZE];
  69        unsigned short idbus;
  70        unsigned short idvendor;
  71        unsigned short idproduct;
  72        unsigned short idversion;
  73        int ff_effects_max;
  74        int absmax[ABS_MAX + 1];
  75        int absmin[ABS_MAX + 1];
  76        int absfuzz[ABS_MAX + 1];
  77        int absflat[ABS_MAX + 1];
  78};
  79#endif  /* __UINPUT_H_ */
  80
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.