Skip to content

Commit

Permalink
added HIDIOCSOUTPUT define for kernels headers < 5.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mbcinergy committed Jun 12, 2024
1 parent aad1ea8 commit 45124fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions linux/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 45124fb

Please sign in to comment.