You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.1 KiB
90 lines
3.1 KiB
/****************************************************************************
|
|
****************************************************************************
|
|
***
|
|
*** This header was automatically generated from a Linux kernel header
|
|
*** of the same name, to make information necessary for userspace to
|
|
*** call into the kernel available to libc. It contains only constants,
|
|
*** structures, and macros generated from the original header, and thus,
|
|
*** contains no copyrightable information.
|
|
***
|
|
*** To edit the content of this header, modify the corresponding
|
|
*** source file (e.g. under external/kernel-headers/original/) then
|
|
*** run bionic/libc/kernel/tools/update_all.py
|
|
***
|
|
*** Any manual change here will be lost the next time this script will
|
|
*** be run. You've been warned!
|
|
***
|
|
****************************************************************************
|
|
****************************************************************************/
|
|
#ifndef _UAPI__LINUX_USB_RAW_GADGET_H
|
|
#define _UAPI__LINUX_USB_RAW_GADGET_H
|
|
#include <asm/ioctl.h>
|
|
#include <linux/types.h>
|
|
#include <linux/usb/ch9.h>
|
|
#define UDC_NAME_LENGTH_MAX 128
|
|
struct usb_raw_init {
|
|
__u8 driver_name[UDC_NAME_LENGTH_MAX];
|
|
__u8 device_name[UDC_NAME_LENGTH_MAX];
|
|
__u8 speed;
|
|
};
|
|
enum usb_raw_event_type {
|
|
USB_RAW_EVENT_INVALID = 0,
|
|
USB_RAW_EVENT_CONNECT = 1,
|
|
USB_RAW_EVENT_CONTROL = 2,
|
|
};
|
|
struct usb_raw_event {
|
|
__u32 type;
|
|
__u32 length;
|
|
__u8 data[0];
|
|
};
|
|
#define USB_RAW_IO_FLAGS_ZERO 0x0001
|
|
#define USB_RAW_IO_FLAGS_MASK 0x0001
|
|
struct usb_raw_ep_io {
|
|
__u16 ep;
|
|
__u16 flags;
|
|
__u32 length;
|
|
__u8 data[0];
|
|
};
|
|
#define USB_RAW_EPS_NUM_MAX 30
|
|
#define USB_RAW_EP_NAME_MAX 16
|
|
#define USB_RAW_EP_ADDR_ANY 0xff
|
|
struct usb_raw_ep_caps {
|
|
__u32 type_control : 1;
|
|
__u32 type_iso : 1;
|
|
__u32 type_bulk : 1;
|
|
__u32 type_int : 1;
|
|
__u32 dir_in : 1;
|
|
__u32 dir_out : 1;
|
|
};
|
|
struct usb_raw_ep_limits {
|
|
__u16 maxpacket_limit;
|
|
__u16 max_streams;
|
|
__u32 reserved;
|
|
};
|
|
struct usb_raw_ep_info {
|
|
__u8 name[USB_RAW_EP_NAME_MAX];
|
|
__u32 addr;
|
|
struct usb_raw_ep_caps caps;
|
|
struct usb_raw_ep_limits limits;
|
|
};
|
|
struct usb_raw_eps_info {
|
|
struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX];
|
|
};
|
|
#define USB_RAW_IOCTL_INIT _IOW('U', 0, struct usb_raw_init)
|
|
#define USB_RAW_IOCTL_RUN _IO('U', 1)
|
|
#define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event)
|
|
#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, __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, __u32)
|
|
#define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info)
|
|
#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12)
|
|
#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32)
|
|
#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32)
|
|
#define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32)
|
|
#endif
|