aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-usbgen
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-11-14 15:43:37 +0100
committerAndrey Konovalov <andreyknvl@gmail.com>2019-11-15 14:53:30 +0100
commit90f3b019e42736360b0f1fcfcda486086b07c9a1 (patch)
tree9272a692ef3296242a3671ce9e5c3a9835d3e373 /tools/syz-usbgen
parentbe7a4ab6d8218c838164c65b32b1eae9b6d47517 (diff)
executor, pkg/host: update usb raw-gadget interface
The patches are being upstreamed and the interface has changed.
Diffstat (limited to 'tools/syz-usbgen')
-rw-r--r--tools/syz-usbgen/keyboard.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/tools/syz-usbgen/keyboard.c b/tools/syz-usbgen/keyboard.c
index 819d0eff8..9efa53c2e 100644
--- a/tools/syz-usbgen/keyboard.c
+++ b/tools/syz-usbgen/keyboard.c
@@ -42,6 +42,12 @@ struct hid_descriptor {
/*----------------------------------------------------------------------*/
+struct usb_raw_init {
+ __u64 speed;
+ const __u8 *driver_name;
+ const __u8 *device_name;
+};
+
enum usb_raw_event_type {
USB_RAW_EVENT_INVALID,
USB_RAW_EVENT_CONNECT,
@@ -49,22 +55,16 @@ enum usb_raw_event_type {
};
struct usb_raw_event {
- uint32_t type;
- uint32_t length;
- char data[0];
-};
-
-struct usb_raw_init {
- uint64_t speed;
- const char *driver_name;
- const char *device_name;
+ __u32 type;
+ __u32 length;
+ __u8 data[0];
};
struct usb_raw_ep_io {
- uint16_t ep;
- uint16_t flags;
- uint32_t length;
- char data[0];
+ __u16 ep;
+ __u16 flags;
+ __u32 length;
+ __u8 data[0];
};
#define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
@@ -73,16 +73,16 @@ struct usb_raw_ep_io {
#define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor)
-#define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, int)
+#define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32)
#define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_EP_READ _IOWR('U', 8, struct usb_raw_ep_io)
#define USB_RAW_IOCTL_CONFIGURE _IO('U', 9)
-#define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, uint32_t)
+#define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32)
/*----------------------------------------------------------------------*/
int usb_raw_open() {
- int fd = open("/sys/kernel/debug/usb/raw-gadget", O_RDWR);
+ int fd = open("/dev/raw-gadget", O_RDWR);
if (fd < 0) {
perror("open()");
exit(EXIT_FAILURE);