FreeBSD kernel usb device Code
usbhid.h File Reference
#include <dev/hid/hid.h>
#include <dev/usb/usb_endian.h>
Include dependency graph for usbhid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usb_hid_descriptor
 

Macros

#define UR_GET_HID_DESCRIPTOR   0x06
 
#define UDESC_HID   0x21
 
#define UDESC_REPORT   0x22
 
#define UDESC_PHYSICAL   0x23
 
#define UR_SET_HID_DESCRIPTOR   0x07
 
#define UR_GET_REPORT   0x01
 
#define UR_SET_REPORT   0x09
 
#define UR_GET_IDLE   0x02
 
#define UR_SET_IDLE   0x0a
 
#define UR_GET_PROTOCOL   0x03
 
#define UR_SET_PROTOCOL   0x0b
 
#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
 

Functions

struct usb_hid_descriptorhid_get_descriptor_from_usb (struct usb_config_descriptor *cd, struct usb_interface_descriptor *id)
 
usb_error_t usbd_req_get_hid_desc (struct usb_device *udev, struct mtx *mtx, void **descp, uint16_t *sizep, struct malloc_type *mem, uint8_t iface_index)
 

Variables

struct usb_hid_descriptor __packed
 

Macro Definition Documentation

◆ UDESC_HID

#define UDESC_HID   0x21

Definition at line 41 of file usbhid.h.

◆ UDESC_PHYSICAL

#define UDESC_PHYSICAL   0x23

Definition at line 43 of file usbhid.h.

◆ UDESC_REPORT

#define UDESC_REPORT   0x22

Definition at line 42 of file usbhid.h.

◆ UHID_FEATURE_REPORT

#define UHID_FEATURE_REPORT   HID_FEATURE_REPORT

Definition at line 68 of file usbhid.h.

◆ UHID_INPUT_REPORT

#define UHID_INPUT_REPORT   HID_INPUT_REPORT

Definition at line 66 of file usbhid.h.

◆ UHID_OUTPUT_REPORT

#define UHID_OUTPUT_REPORT   HID_OUTPUT_REPORT

Definition at line 67 of file usbhid.h.

◆ UR_GET_HID_DESCRIPTOR

#define UR_GET_HID_DESCRIPTOR   0x06

Definition at line 40 of file usbhid.h.

◆ UR_GET_IDLE

#define UR_GET_IDLE   0x02

Definition at line 47 of file usbhid.h.

◆ UR_GET_PROTOCOL

#define UR_GET_PROTOCOL   0x03

Definition at line 49 of file usbhid.h.

◆ UR_GET_REPORT

#define UR_GET_REPORT   0x01

Definition at line 45 of file usbhid.h.

◆ UR_SET_HID_DESCRIPTOR

#define UR_SET_HID_DESCRIPTOR   0x07

Definition at line 44 of file usbhid.h.

◆ UR_SET_IDLE

#define UR_SET_IDLE   0x0a

Definition at line 48 of file usbhid.h.

◆ UR_SET_PROTOCOL

#define UR_SET_PROTOCOL   0x0b

Definition at line 50 of file usbhid.h.

◆ UR_SET_REPORT

#define UR_SET_REPORT   0x09

Definition at line 46 of file usbhid.h.

◆ USB_HID_DESCRIPTOR_SIZE

#define USB_HID_DESCRIPTOR_SIZE (   n)    (9+((n)*3))

Definition at line 64 of file usbhid.h.

Function Documentation

◆ hid_get_descriptor_from_usb()

struct usb_hid_descriptor * hid_get_descriptor_from_usb ( struct usb_config_descriptor cd,
struct usb_interface_descriptor id 
)

Definition at line 82 of file usb_hid.c.

References usb_endpoint_descriptor::bDescriptorType, usb_endpoint_descriptor::bLength, desc, UDESC_HID, UDESC_INTERFACE, usb_desc_foreach(), and USB_HID_DESCRIPTOR_SIZE.

Referenced by usbd_req_get_hid_desc(), and usbhid_fill_device_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usbd_req_get_hid_desc()

usb_error_t usbd_req_get_hid_desc ( struct usb_device udev,
struct mtx *  mtx,
void **  descp,
uint16_t *  sizep,
struct malloc_type *  mem,
uint8_t  iface_index 
)

Variable Documentation

◆ __packed