From 45124fbf93f9d58d21148812f782636e728a96da Mon Sep 17 00:00:00 2001 From: Maarten Burie Date: Tue, 7 May 2024 15:52:22 +0200 Subject: [PATCH] added HIDIOCSOUTPUT define for kernels headers < 5.11 --- linux/hid.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/linux/hid.c b/linux/hid.c index 6e32d9506..228fdeeca 100644 --- a/linux/hid.c +++ b/linux/hid.c @@ -61,12 +61,15 @@ #endif -// HIDIOCGINPUT is not defined in Linux kernel headers < 5.11. -// This definition is from hidraw.h in Linux >= 5.11. +// HIDIOCGINPUT and HIDIOCSOUTPUT are not defined in Linux kernel headers < 5.11. +// These definitions are from hidraw.h in Linux >= 5.11. // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f43d3870cafa2a0f3854c1819c8385733db8f9ae #ifndef HIDIOCGINPUT #define HIDIOCGINPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0A, len) #endif +#ifndef HIDIOCSOUTPUT +#define HIDIOCSOUTPUT(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x0B, len) +#endif struct hid_device_ { int device_handle;