|
iPXE
|
USB human interface devices (HID) More...
#include <ipxe/usb.h>Go to the source code of this file.
Data Structures | |
| struct | usb_hid |
| A USB human interface device. More... | |
Macros | |
| #define | USB_CLASS_HID 3 |
| Class code for human interface devices. More... | |
| #define | USB_SUBCLASS_HID_BOOT 1 |
| Subclass code for boot devices. More... | |
| #define | USBHID_SET_PROTOCOL |
| Set protocol. More... | |
| #define | USBHID_PROTOCOL_BOOT 0 |
| Boot protocol. More... | |
| #define | USBHID_PROTOCOL_REPORT 1 |
| Report protocol. More... | |
| #define | USBHID_SET_IDLE |
| Set idle time. More... | |
| #define | USBHID_SET_REPORT |
| Set report. More... | |
| #define | USBHID_REPORT_INPUT 0x01 |
| Input report type. More... | |
| #define | USBHID_REPORT_OUTPUT 0x02 |
| Output report type. More... | |
| #define | USBHID_REPORT_FEATURE 0x03 |
| Feature report type. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| 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. More... | |
| static int | usbhid_set_protocol (struct usb_device *usb, unsigned int interface, unsigned int protocol) |
| Set protocol. More... | |
| static int | usbhid_set_idle (struct usb_device *usb, unsigned int interface, unsigned int report, unsigned int duration) |
| Set idle time. More... | |
| 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. More... | |
| int | usbhid_open (struct usb_hid *hid) |
| Open USB human interface device. More... | |
| void | usbhid_close (struct usb_hid *hid) |
| Close USB human interface device. More... | |
| int | usbhid_refill (struct usb_hid *hid) |
| Refill USB human interface device endpoints. More... | |
| int | usbhid_describe (struct usb_hid *hid, struct usb_configuration_descriptor *config) |
| Describe USB human interface device. More... | |
USB human interface devices (HID)
Definition in file usbhid.h.
| #define USB_CLASS_HID 3 |
| #define USB_SUBCLASS_HID_BOOT 1 |
| #define USBHID_SET_PROTOCOL |
Set protocol.
| #define USBHID_SET_IDLE |
Set idle time.
| #define USBHID_SET_REPORT |
Set report.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Initialise USB human interface device.
| hid | USB human interface device |
| func | USB function |
| in | Interrupt IN endpoint operations |
| out | Interrupt OUT endpoint operations (or NULL) |
Definition at line 69 of file usbhid.h.
References usb_hid::func, in, usb_hid::in, out, usb_hid::out, usb_function::usb, and usb_endpoint_init().
Referenced by usbkbd_probe().
|
inlinestatic |
Set protocol.
| usb | USB device |
| interface | Interface number |
| protocol | HID protocol |
| rc | Return status code |
Definition at line 89 of file usbhid.h.
References NULL, protocol, usb_control(), and USBHID_SET_PROTOCOL.
Referenced by usbkbd_probe().
|
inlinestatic |
Set idle time.
| usb | USB device |
| interface | Interface number |
| report | Report ID |
| duration | Duration (in 4ms units) |
| rc | Return status code |
Definition at line 106 of file usbhid.h.
References duration, NULL, usb_control(), and USBHID_SET_IDLE.
Referenced by usbkbd_probe().
|
inlinestatic |
Set report.
| usb | USB device |
| interface | Interface number |
| type | Report type |
| report | Report ID |
| data | Report data |
| len | Length of report data |
| rc | Return status code |
Definition at line 126 of file usbhid.h.
References data, len, type, usb_control(), and USBHID_SET_REPORT.
Referenced by usbkbd_set_leds().
| int usbhid_open | ( | struct usb_hid * | hid | ) |
Open USB human interface device.
| hid | USB human interface device |
| rc | Return status code |
Definition at line 43 of file usbhid.c.
References DBGC, usb_hid::func, usb_hid::in, usb_function::name, usb_hid::out, rc, strerror(), usb_endpoint::usb, usb_endpoint_close(), usb_endpoint_open(), and usb_refill().
Referenced by usbkbd_probe().
| void usbhid_close | ( | struct usb_hid * | hid | ) |
Close USB human interface device.
| hid | USB human interface device |
Definition at line 83 of file usbhid.c.
References usb_hid::in, usb_hid::out, usb_endpoint::usb, and usb_endpoint_close().
Referenced by usbkbd_probe(), and usbkbd_remove().
| int usbhid_refill | ( | struct usb_hid * | hid | ) |
Refill USB human interface device endpoints.
| hid | USB human interface device |
| rc | Return status code |
Definition at line 99 of file usbhid.c.
References usb_hid::in, usb_hid::out, rc, usb_endpoint::usb, and usb_refill().
| int usbhid_describe | ( | struct usb_hid * | hid, |
| struct usb_configuration_descriptor * | config | ||
| ) |
Describe USB human interface device.
| hid | USB human interface device |
| config | Configuration descriptor |
| rc | Return status code |
Definition at line 120 of file usbhid.c.
References DBGC, desc, EINVAL, usb_hid::func, usb_hid::in, usb_function::interface, usb_function::name, usb_hid::out, rc, strerror(), usb_endpoint::usb, usb_endpoint_described(), usb_interface_descriptor(), USB_INTERRUPT_IN, and USB_INTERRUPT_OUT.
Referenced by usbkbd_probe().
1.8.15