1 // Copyright 2016 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <stdbool.h>
8 #include <stddef.h>
9 #include <stdint.h>
10 #include <zircon/device/ioctl.h>
11 #include <zircon/device/ioctl-wrapper.h>
12 #include <zircon/types.h>
13 
14 // Returns a socket that can be used to send input reports and receive output reports.
15 #define IOCTL_HIDCTL_CONFIG \
16     IOCTL(IOCTL_KIND_GET_HANDLE, IOCTL_FAMILY_HID, 0)
17 
18 typedef struct hid_ioctl_config {
19     uint8_t dev_num;
20     bool boot_device;
21     uint8_t dev_class;
22     size_t rpt_desc_len;
23     uint8_t rpt_desc[];
24 } hid_ioctl_config_t;
25 
26 // ssize_t ioctl_hidctl_config(int fd, const hid_ioctl_config_t* in, size_t in_len, zx_handle_t* out);
27 IOCTL_WRAPPER_VARIN_OUT(ioctl_hidctl_config, IOCTL_HIDCTL_CONFIG, hid_ioctl_config_t, zx_handle_t);
28