15 #define USB_CLASS_HID 3 18 #define USB_SUBCLASS_HID_BOOT 1 21 #define USBHID_SET_PROTOCOL \ 22 ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ 23 USB_REQUEST_TYPE ( 0x0b ) ) 26 #define USBHID_PROTOCOL_BOOT 0 29 #define USBHID_PROTOCOL_REPORT 1 32 #define USBHID_SET_IDLE \ 33 ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ 34 USB_REQUEST_TYPE ( 0x0a ) ) 37 #define USBHID_SET_REPORT \ 38 ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \ 39 USB_REQUEST_TYPE ( 0x09 ) ) 42 #define USBHID_REPORT_INPUT 0x01 45 #define USBHID_REPORT_OUTPUT 0x02 48 #define USBHID_REPORT_FEATURE 0x03 107 unsigned int report,
unsigned int duration ) {
127 unsigned int type,
unsigned int report,
void *
data,
uint32_t type
Operating system type.
struct usb_endpoint in
Interrupt IN endpoint.
struct usb_endpoint out
Interrupt OUT endpoint (optional)
int usb_control(struct usb_device *usb, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len)
Issue USB control transaction.
void usbhid_close(struct usb_hid *hid)
Close USB human interface device.
#define USBHID_SET_PROTOCOL
Set protocol.
static int usbhid_set_idle(struct usb_device *usb, unsigned int interface, unsigned int report, unsigned int duration)
Set idle time.
int usbhid_refill(struct usb_hid *hid)
Refill USB human interface device endpoints.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define USBHID_SET_REPORT
Set report.
u16 duration
Microseconds to reserve link.
static int usbhid_set_protocol(struct usb_device *usb, unsigned int interface, unsigned int protocol)
Set protocol.
A USB human interface device.
struct usb_device * usb
USB device.
static void usb_endpoint_init(struct usb_endpoint *ep, struct usb_device *usb, struct usb_endpoint_driver_operations *driver)
Initialise USB endpoint.
A USB configuration descriptor.
Universal Serial Bus (USB)
static int usbhid_set_report(struct usb_device *usb, unsigned int interface, unsigned int type, unsigned int report, void *data, size_t len)
Set report.
int usbhid_describe(struct usb_hid *hid, struct usb_configuration_descriptor *config)
Describe USB human interface device.
uint8_t data[48]
Additional event data.
int usbhid_open(struct usb_hid *hid)
Open USB human interface device.
uint16_t protocol
Protocol ID.
static void usbhid_init(struct usb_hid *hid, struct usb_function *func, struct usb_endpoint_driver_operations *in, struct usb_endpoint_driver_operations *out)
Initialise USB human interface device.
struct usb_function * func
USB function.
USB endpoint driver operations.
#define NULL
NULL pointer (VOID *)
#define USBHID_SET_IDLE
Set idle time.