18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright (c) 2007 Jiri Kosina
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify it
78c2ecf20Sopenharmony_ci * under the terms and conditions of the GNU General Public License,
88c2ecf20Sopenharmony_ci * version 2, as published by the Free Software Foundation.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License along with
118c2ecf20Sopenharmony_ci * this program; if not, write to the Free Software Foundation, Inc.,
128c2ecf20Sopenharmony_ci * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci#ifndef _UAPI_HIDRAW_H
158c2ecf20Sopenharmony_ci#define _UAPI_HIDRAW_H
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#include <linux/hid.h>
208c2ecf20Sopenharmony_ci#include <linux/types.h>
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_cistruct hidraw_report_descriptor {
238c2ecf20Sopenharmony_ci	__u32 size;
248c2ecf20Sopenharmony_ci	__u8 value[HID_MAX_DESCRIPTOR_SIZE];
258c2ecf20Sopenharmony_ci};
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cistruct hidraw_devinfo {
288c2ecf20Sopenharmony_ci	__u32 bustype;
298c2ecf20Sopenharmony_ci	__s16 vendor;
308c2ecf20Sopenharmony_ci	__s16 product;
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* ioctl interface */
348c2ecf20Sopenharmony_ci#define HIDIOCGRDESCSIZE	_IOR('H', 0x01, int)
358c2ecf20Sopenharmony_ci#define HIDIOCGRDESC		_IOR('H', 0x02, struct hidraw_report_descriptor)
368c2ecf20Sopenharmony_ci#define HIDIOCGRAWINFO		_IOR('H', 0x03, struct hidraw_devinfo)
378c2ecf20Sopenharmony_ci#define HIDIOCGRAWNAME(len)     _IOC(_IOC_READ, 'H', 0x04, len)
388c2ecf20Sopenharmony_ci#define HIDIOCGRAWPHYS(len)     _IOC(_IOC_READ, 'H', 0x05, len)
398c2ecf20Sopenharmony_ci/* The first byte of SFEATURE and GFEATURE is the report number */
408c2ecf20Sopenharmony_ci#define HIDIOCSFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
418c2ecf20Sopenharmony_ci#define HIDIOCGFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
428c2ecf20Sopenharmony_ci#define HIDIOCGRAWUNIQ(len)     _IOC(_IOC_READ, 'H', 0x08, len)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define HIDRAW_FIRST_MINOR 0
458c2ecf20Sopenharmony_ci#define HIDRAW_MAX_DEVICES 64
468c2ecf20Sopenharmony_ci/* number of reports to buffer */
478c2ecf20Sopenharmony_ci#define HIDRAW_BUFFER_SIZE 64
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci/* kernel-only API declarations */
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#endif /* _UAPI_HIDRAW_H */
53