From 90f3b019e42736360b0f1fcfcda486086b07c9a1 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Thu, 14 Nov 2019 15:43:37 +0100 Subject: executor, pkg/host: update usb raw-gadget interface The patches are being upstreamed and the interface has changed. --- tools/syz-usbgen/keyboard.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'tools/syz-usbgen') 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); -- cgit mrf-deployment