Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  *  Copyright (c) 2007 Jiri Kosina
0004  */
0005 /*
0006  * This program is free software; you can redistribute it and/or modify it
0007  * under the terms and conditions of the GNU General Public License,
0008  * version 2, as published by the Free Software Foundation.
0009  *
0010  * You should have received a copy of the GNU General Public License along with
0011  * this program; if not, write to the Free Software Foundation, Inc.,
0012  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
0013  */
0014 #ifndef _UAPI_HIDRAW_H
0015 #define _UAPI_HIDRAW_H
0016 
0017 
0018 
0019 #include <linux/hid.h>
0020 #include <linux/types.h>
0021 
0022 struct hidraw_report_descriptor {
0023     __u32 size;
0024     __u8 value[HID_MAX_DESCRIPTOR_SIZE];
0025 };
0026 
0027 struct hidraw_devinfo {
0028     __u32 bustype;
0029     __s16 vendor;
0030     __s16 product;
0031 };
0032 
0033 /* ioctl interface */
0034 #define HIDIOCGRDESCSIZE    _IOR('H', 0x01, int)
0035 #define HIDIOCGRDESC        _IOR('H', 0x02, struct hidraw_report_descriptor)
0036 #define HIDIOCGRAWINFO      _IOR('H', 0x03, struct hidraw_devinfo)
0037 #define HIDIOCGRAWNAME(len)     _IOC(_IOC_READ, 'H', 0x04, len)
0038 #define HIDIOCGRAWPHYS(len)     _IOC(_IOC_READ, 'H', 0x05, len)
0039 /* The first byte of SFEATURE and GFEATURE is the report number */
0040 #define HIDIOCSFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
0041 #define HIDIOCGFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
0042 #define HIDIOCGRAWUNIQ(len)     _IOC(_IOC_READ, 'H', 0x08, len)
0043 /* The first byte of SINPUT and GINPUT is the report number */
0044 #define HIDIOCSINPUT(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x09, len)
0045 #define HIDIOCGINPUT(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0A, len)
0046 /* The first byte of SOUTPUT and GOUTPUT is the report number */
0047 #define HIDIOCSOUTPUT(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0B, len)
0048 #define HIDIOCGOUTPUT(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0C, len)
0049 
0050 #define HIDRAW_FIRST_MINOR 0
0051 #define HIDRAW_MAX_DEVICES 64
0052 /* number of reports to buffer */
0053 #define HIDRAW_BUFFER_SIZE 64
0054 
0055 
0056 /* kernel-only API declarations */
0057 
0058 #endif /* _UAPI_HIDRAW_H */