Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux
File: uhid.h
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
[0] Fix | Delete
#ifndef __UHID_H_
[1] Fix | Delete
#define __UHID_H_
[2] Fix | Delete
[3] Fix | Delete
/*
[4] Fix | Delete
* User-space I/O driver support for HID subsystem
[5] Fix | Delete
* Copyright (c) 2012 David Herrmann
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/*
[9] Fix | Delete
* This program is free software; you can redistribute it and/or modify it
[10] Fix | Delete
* under the terms of the GNU General Public License as published by the Free
[11] Fix | Delete
* Software Foundation; either version 2 of the License, or (at your option)
[12] Fix | Delete
* any later version.
[13] Fix | Delete
*/
[14] Fix | Delete
[15] Fix | Delete
/*
[16] Fix | Delete
* Public header for user-space communication. We try to keep every structure
[17] Fix | Delete
* aligned but to be safe we also use __attribute__((__packed__)). Therefore,
[18] Fix | Delete
* the communication should be ABI compatible even between architectures.
[19] Fix | Delete
*/
[20] Fix | Delete
[21] Fix | Delete
#include <linux/input.h>
[22] Fix | Delete
#include <linux/types.h>
[23] Fix | Delete
#include <linux/hid.h>
[24] Fix | Delete
[25] Fix | Delete
enum uhid_event_type {
[26] Fix | Delete
__UHID_LEGACY_CREATE,
[27] Fix | Delete
UHID_DESTROY,
[28] Fix | Delete
UHID_START,
[29] Fix | Delete
UHID_STOP,
[30] Fix | Delete
UHID_OPEN,
[31] Fix | Delete
UHID_CLOSE,
[32] Fix | Delete
UHID_OUTPUT,
[33] Fix | Delete
__UHID_LEGACY_OUTPUT_EV,
[34] Fix | Delete
__UHID_LEGACY_INPUT,
[35] Fix | Delete
UHID_GET_REPORT,
[36] Fix | Delete
UHID_GET_REPORT_REPLY,
[37] Fix | Delete
UHID_CREATE2,
[38] Fix | Delete
UHID_INPUT2,
[39] Fix | Delete
UHID_SET_REPORT,
[40] Fix | Delete
UHID_SET_REPORT_REPLY,
[41] Fix | Delete
};
[42] Fix | Delete
[43] Fix | Delete
struct uhid_create2_req {
[44] Fix | Delete
__u8 name[128];
[45] Fix | Delete
__u8 phys[64];
[46] Fix | Delete
__u8 uniq[64];
[47] Fix | Delete
__u16 rd_size;
[48] Fix | Delete
__u16 bus;
[49] Fix | Delete
__u32 vendor;
[50] Fix | Delete
__u32 product;
[51] Fix | Delete
__u32 version;
[52] Fix | Delete
__u32 country;
[53] Fix | Delete
__u8 rd_data[HID_MAX_DESCRIPTOR_SIZE];
[54] Fix | Delete
} __attribute__((__packed__));
[55] Fix | Delete
[56] Fix | Delete
enum uhid_dev_flag {
[57] Fix | Delete
UHID_DEV_NUMBERED_FEATURE_REPORTS = (1ULL << 0),
[58] Fix | Delete
UHID_DEV_NUMBERED_OUTPUT_REPORTS = (1ULL << 1),
[59] Fix | Delete
UHID_DEV_NUMBERED_INPUT_REPORTS = (1ULL << 2),
[60] Fix | Delete
};
[61] Fix | Delete
[62] Fix | Delete
struct uhid_start_req {
[63] Fix | Delete
__u64 dev_flags;
[64] Fix | Delete
};
[65] Fix | Delete
[66] Fix | Delete
#define UHID_DATA_MAX 4096
[67] Fix | Delete
[68] Fix | Delete
enum uhid_report_type {
[69] Fix | Delete
UHID_FEATURE_REPORT,
[70] Fix | Delete
UHID_OUTPUT_REPORT,
[71] Fix | Delete
UHID_INPUT_REPORT,
[72] Fix | Delete
};
[73] Fix | Delete
[74] Fix | Delete
struct uhid_input2_req {
[75] Fix | Delete
__u16 size;
[76] Fix | Delete
__u8 data[UHID_DATA_MAX];
[77] Fix | Delete
} __attribute__((__packed__));
[78] Fix | Delete
[79] Fix | Delete
struct uhid_output_req {
[80] Fix | Delete
__u8 data[UHID_DATA_MAX];
[81] Fix | Delete
__u16 size;
[82] Fix | Delete
__u8 rtype;
[83] Fix | Delete
} __attribute__((__packed__));
[84] Fix | Delete
[85] Fix | Delete
struct uhid_get_report_req {
[86] Fix | Delete
__u32 id;
[87] Fix | Delete
__u8 rnum;
[88] Fix | Delete
__u8 rtype;
[89] Fix | Delete
} __attribute__((__packed__));
[90] Fix | Delete
[91] Fix | Delete
struct uhid_get_report_reply_req {
[92] Fix | Delete
__u32 id;
[93] Fix | Delete
__u16 err;
[94] Fix | Delete
__u16 size;
[95] Fix | Delete
__u8 data[UHID_DATA_MAX];
[96] Fix | Delete
} __attribute__((__packed__));
[97] Fix | Delete
[98] Fix | Delete
struct uhid_set_report_req {
[99] Fix | Delete
__u32 id;
[100] Fix | Delete
__u8 rnum;
[101] Fix | Delete
__u8 rtype;
[102] Fix | Delete
__u16 size;
[103] Fix | Delete
__u8 data[UHID_DATA_MAX];
[104] Fix | Delete
} __attribute__((__packed__));
[105] Fix | Delete
[106] Fix | Delete
struct uhid_set_report_reply_req {
[107] Fix | Delete
__u32 id;
[108] Fix | Delete
__u16 err;
[109] Fix | Delete
} __attribute__((__packed__));
[110] Fix | Delete
[111] Fix | Delete
/*
[112] Fix | Delete
* Compat Layer
[113] Fix | Delete
* All these commands and requests are obsolete. You should avoid using them in
[114] Fix | Delete
* new code. We support them for backwards-compatibility, but you might not get
[115] Fix | Delete
* access to new feature in case you use them.
[116] Fix | Delete
*/
[117] Fix | Delete
[118] Fix | Delete
enum uhid_legacy_event_type {
[119] Fix | Delete
UHID_CREATE = __UHID_LEGACY_CREATE,
[120] Fix | Delete
UHID_OUTPUT_EV = __UHID_LEGACY_OUTPUT_EV,
[121] Fix | Delete
UHID_INPUT = __UHID_LEGACY_INPUT,
[122] Fix | Delete
UHID_FEATURE = UHID_GET_REPORT,
[123] Fix | Delete
UHID_FEATURE_ANSWER = UHID_GET_REPORT_REPLY,
[124] Fix | Delete
};
[125] Fix | Delete
[126] Fix | Delete
/* Obsolete! Use UHID_CREATE2. */
[127] Fix | Delete
struct uhid_create_req {
[128] Fix | Delete
__u8 name[128];
[129] Fix | Delete
__u8 phys[64];
[130] Fix | Delete
__u8 uniq[64];
[131] Fix | Delete
__u8 *rd_data;
[132] Fix | Delete
__u16 rd_size;
[133] Fix | Delete
[134] Fix | Delete
__u16 bus;
[135] Fix | Delete
__u32 vendor;
[136] Fix | Delete
__u32 product;
[137] Fix | Delete
__u32 version;
[138] Fix | Delete
__u32 country;
[139] Fix | Delete
} __attribute__((__packed__));
[140] Fix | Delete
[141] Fix | Delete
/* Obsolete! Use UHID_INPUT2. */
[142] Fix | Delete
struct uhid_input_req {
[143] Fix | Delete
__u8 data[UHID_DATA_MAX];
[144] Fix | Delete
__u16 size;
[145] Fix | Delete
} __attribute__((__packed__));
[146] Fix | Delete
[147] Fix | Delete
/* Obsolete! Kernel uses UHID_OUTPUT exclusively now. */
[148] Fix | Delete
struct uhid_output_ev_req {
[149] Fix | Delete
__u16 type;
[150] Fix | Delete
__u16 code;
[151] Fix | Delete
__s32 value;
[152] Fix | Delete
} __attribute__((__packed__));
[153] Fix | Delete
[154] Fix | Delete
/* Obsolete! Kernel uses ABI compatible UHID_GET_REPORT. */
[155] Fix | Delete
struct uhid_feature_req {
[156] Fix | Delete
__u32 id;
[157] Fix | Delete
__u8 rnum;
[158] Fix | Delete
__u8 rtype;
[159] Fix | Delete
} __attribute__((__packed__));
[160] Fix | Delete
[161] Fix | Delete
/* Obsolete! Use ABI compatible UHID_GET_REPORT_REPLY. */
[162] Fix | Delete
struct uhid_feature_answer_req {
[163] Fix | Delete
__u32 id;
[164] Fix | Delete
__u16 err;
[165] Fix | Delete
__u16 size;
[166] Fix | Delete
__u8 data[UHID_DATA_MAX];
[167] Fix | Delete
} __attribute__((__packed__));
[168] Fix | Delete
[169] Fix | Delete
/*
[170] Fix | Delete
* UHID Events
[171] Fix | Delete
* All UHID events from and to the kernel are encoded as "struct uhid_event".
[172] Fix | Delete
* The "type" field contains a UHID_* type identifier. All payload depends on
[173] Fix | Delete
* that type and can be accessed via ev->u.XYZ accordingly.
[174] Fix | Delete
* If user-space writes short events, they're extended with 0s by the kernel. If
[175] Fix | Delete
* the kernel writes short events, user-space shall extend them with 0s.
[176] Fix | Delete
*/
[177] Fix | Delete
[178] Fix | Delete
struct uhid_event {
[179] Fix | Delete
__u32 type;
[180] Fix | Delete
[181] Fix | Delete
union {
[182] Fix | Delete
struct uhid_create_req create;
[183] Fix | Delete
struct uhid_input_req input;
[184] Fix | Delete
struct uhid_output_req output;
[185] Fix | Delete
struct uhid_output_ev_req output_ev;
[186] Fix | Delete
struct uhid_feature_req feature;
[187] Fix | Delete
struct uhid_get_report_req get_report;
[188] Fix | Delete
struct uhid_feature_answer_req feature_answer;
[189] Fix | Delete
struct uhid_get_report_reply_req get_report_reply;
[190] Fix | Delete
struct uhid_create2_req create2;
[191] Fix | Delete
struct uhid_input2_req input2;
[192] Fix | Delete
struct uhid_set_report_req set_report;
[193] Fix | Delete
struct uhid_set_report_reply_req set_report_reply;
[194] Fix | Delete
struct uhid_start_req start;
[195] Fix | Delete
} u;
[196] Fix | Delete
} __attribute__((__packed__));
[197] Fix | Delete
[198] Fix | Delete
#endif /* __UHID_H_ */
[199] Fix | Delete
[200] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function