Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/usbhid.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | struct usb_hid_descriptor { | ||||
struct { | struct { | ||||
uByte bDescriptorType; | uByte bDescriptorType; | ||||
uWord wDescriptorLength; | uWord wDescriptorLength; | ||||
} descrs[1]; | } descrs[1]; | ||||
} __packed; | } __packed; | ||||
#define USB_HID_DESCRIPTOR_SIZE(n) (9+((n)*3)) | #define USB_HID_DESCRIPTOR_SIZE(n) (9+((n)*3)) | ||||
#define UHID_INPUT_REPORT HID_INPUT_REPORT | |||||
#define UHID_OUTPUT_REPORT HID_OUTPUT_REPORT | |||||
#define UHID_FEATURE_REPORT HID_FEATURE_REPORT | |||||
#if defined(_KERNEL) || defined(_STANDALONE) | #if defined(_KERNEL) || defined(_STANDALONE) | ||||
struct usb_config_descriptor; | struct usb_config_descriptor; | ||||
#ifdef COMPAT_USBHID12 | |||||
/* FreeBSD <= 12 compat shims */ | |||||
#define hid_report_size(buf, len, kind, id) \ | |||||
hid_report_size_max(buf, len, kind, id) | |||||
static __inline uint32_t | |||||
hid_get_data_unsigned(const uint8_t *buf, hid_size_t len, | |||||
struct hid_location *loc) | |||||
{ | |||||
return (hid_get_udata(buf, len, loc)); | |||||
} | |||||
static __inline void | |||||
hid_put_data_unsigned(uint8_t *buf, hid_size_t len, struct hid_location *loc, | |||||
unsigned int value) | |||||
{ | |||||
return (hid_put_udata(buf, len, loc, value)); | |||||
} | |||||
#endif | |||||
struct usb_hid_descriptor *hid_get_descriptor_from_usb( | struct usb_hid_descriptor *hid_get_descriptor_from_usb( | ||||
struct usb_config_descriptor *cd, | struct usb_config_descriptor *cd, | ||||
struct usb_interface_descriptor *id); | struct usb_interface_descriptor *id); | ||||
usb_error_t usbd_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx, | usb_error_t usbd_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx, | ||||
void **descp, uint16_t *sizep, struct malloc_type *mem, | void **descp, uint16_t *sizep, struct malloc_type *mem, | ||||
uint8_t iface_index); | uint8_t iface_index); | ||||
#endif /* _KERNEL || _STANDALONE */ | #endif /* _KERNEL || _STANDALONE */ | ||||
#endif /* _USB_HID_H_ */ | #endif /* _USB_HID_H_ */ |