FreeBSD kernel usb device Code
usb_request.c File Reference
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usbhid.h>
#include <dev/usb/usb_core.h>
#include <dev/usb/usb_busdma.h>
#include <dev/usb/usb_request.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_transfer.h>
#include <dev/usb/usb_debug.h>
#include <dev/usb/usb_device.h>
#include <dev/usb/usb_util.h>
#include <dev/usb/usb_dynamic.h>
#include <dev/usb/usb_controller.h>
#include <dev/usb/usb_bus.h>
#include <sys/ctype.h>
Include dependency graph for usb_request.c:

Go to the source code of this file.

Macros

#define USB_DEBUG_VAR   usb_debug
 

Functions

 SYSCTL_INT (_hw_usb, OID_AUTO, no_cs_fail, CTLFLAG_RWTUN, &usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set")
 
 SYSCTL_INT (_hw_usb, OID_AUTO, full_ddesc, CTLFLAG_RWTUN, &usb_full_ddesc, 0, "USB always read complete device descriptor, if set")
 
void usbd_do_request_callback (struct usb_xfer *xfer, usb_error_t error)
 
void usb_do_clear_stall_callback (struct usb_xfer *xfer, usb_error_t error)
 
static usb_handle_req_tusbd_get_hr_func (struct usb_device *udev)
 
usb_error_t usbd_do_request_flags (struct usb_device *udev, struct mtx *mtx, struct usb_device_request *req, void *data, uint16_t flags, uint16_t *actlen, usb_timeout_t timeout)
 
usb_error_t usbd_do_request_proc (struct usb_device *udev, struct usb_process *pproc, struct usb_device_request *req, void *data, uint16_t flags, uint16_t *actlen, usb_timeout_t timeout)
 
usb_error_t usbd_req_reset_port (struct usb_device *udev, struct mtx *mtx, uint8_t port)
 
usb_error_t usbd_req_warm_reset_port (struct usb_device *udev, struct mtx *mtx, uint8_t port)
 
usb_error_t usbd_req_get_desc (struct usb_device *udev, struct mtx *mtx, uint16_t *actlen, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, uint8_t index, uint8_t retries)
 
usb_error_t usbd_req_get_string_any (struct usb_device *udev, struct mtx *mtx, char *buf, uint16_t len, uint8_t string_index)
 
usb_error_t usbd_req_get_string_desc (struct usb_device *udev, struct mtx *mtx, void *sdesc, uint16_t max_len, uint16_t lang_id, uint8_t string_index)
 
usb_error_t usbd_req_get_descriptor_ptr (struct usb_device *udev, struct usb_config_descriptor **ppcd, uint16_t wValue)
 
usb_error_t usbd_req_get_config_desc (struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor *d, uint8_t conf_index)
 
void * usbd_alloc_config_desc (struct usb_device *udev, uint32_t size)
 
void usbd_free_config_desc (struct usb_device *udev, void *ptr)
 
usb_error_t usbd_req_get_config_desc_full (struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor **ppcd, uint8_t index)
 
usb_error_t usbd_req_get_device_desc (struct usb_device *udev, struct mtx *mtx, struct usb_device_descriptor *d)
 
usb_error_t usbd_req_get_alt_interface_no (struct usb_device *udev, struct mtx *mtx, uint8_t *alt_iface_no, uint8_t iface_index)
 
usb_error_t usbd_req_set_alt_interface_no (struct usb_device *udev, struct mtx *mtx, uint8_t iface_index, uint8_t alt_no)
 
usb_error_t usbd_req_get_device_status (struct usb_device *udev, struct mtx *mtx, struct usb_status *st)
 
usb_error_t usbd_req_get_hub_descriptor (struct usb_device *udev, struct mtx *mtx, struct usb_hub_descriptor *hd, uint8_t nports)
 
usb_error_t usbd_req_get_ss_hub_descriptor (struct usb_device *udev, struct mtx *mtx, struct usb_hub_ss_descriptor *hd, uint8_t nports)
 
usb_error_t usbd_req_get_hub_status (struct usb_device *udev, struct mtx *mtx, struct usb_hub_status *st)
 
usb_error_t usbd_req_set_address (struct usb_device *udev, struct mtx *mtx, uint16_t addr)
 
usb_error_t usbd_req_get_port_status (struct usb_device *udev, struct mtx *mtx, struct usb_port_status *ps, uint8_t port)
 
usb_error_t usbd_req_clear_hub_feature (struct usb_device *udev, struct mtx *mtx, uint16_t sel)
 
usb_error_t usbd_req_set_hub_feature (struct usb_device *udev, struct mtx *mtx, uint16_t sel)
 
usb_error_t usbd_req_set_hub_u1_timeout (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t timeout)
 
usb_error_t usbd_req_set_hub_u2_timeout (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t timeout)
 
usb_error_t usbd_req_set_hub_depth (struct usb_device *udev, struct mtx *mtx, uint16_t depth)
 
usb_error_t usbd_req_clear_port_feature (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel)
 
usb_error_t usbd_req_set_port_feature (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint16_t sel)
 
usb_error_t usbd_req_set_protocol (struct usb_device *udev, struct mtx *mtx, uint8_t iface_index, uint16_t report)
 
usb_error_t usbd_req_set_report (struct usb_device *udev, struct mtx *mtx, void *data, uint16_t len, uint8_t iface_index, uint8_t type, uint8_t id)
 
usb_error_t usbd_req_get_report (struct usb_device *udev, struct mtx *mtx, void *data, uint16_t len, uint8_t iface_index, uint8_t type, uint8_t id)
 
usb_error_t usbd_req_set_idle (struct usb_device *udev, struct mtx *mtx, uint8_t iface_index, uint8_t duration, uint8_t id)
 
usb_error_t usbd_req_get_report_descriptor (struct usb_device *udev, struct mtx *mtx, void *d, uint16_t size, uint8_t iface_index)
 
usb_error_t usbd_req_set_config (struct usb_device *udev, struct mtx *mtx, uint8_t conf)
 
usb_error_t usbd_req_get_config (struct usb_device *udev, struct mtx *mtx, uint8_t *pconf)
 
usb_error_t usbd_setup_device_desc (struct usb_device *udev, struct mtx *mtx)
 
usb_error_t usbd_req_re_enumerate (struct usb_device *udev, struct mtx *mtx)
 
usb_error_t usbd_req_clear_device_feature (struct usb_device *udev, struct mtx *mtx, uint16_t sel)
 
usb_error_t usbd_req_set_device_feature (struct usb_device *udev, struct mtx *mtx, uint16_t sel)
 
usb_error_t usbd_req_reset_tt (struct usb_device *udev, struct mtx *mtx, uint8_t port)
 
usb_error_t usbd_req_clear_tt_buffer (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint)
 
usb_error_t usbd_req_set_port_link_state (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t link_state)
 
usb_error_t usbd_req_set_lpm_info (struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t besl, uint8_t addr, uint8_t rwe)
 

Variables

static int usb_no_cs_fail
 
static int usb_full_ddesc
 

Macro Definition Documentation

◆ USB_DEBUG_VAR

#define USB_DEBUG_VAR   usb_debug

Definition at line 58 of file usb_request.c.

Function Documentation

◆ SYSCTL_INT() [1/2]

SYSCTL_INT ( _hw_usb  ,
OID_AUTO  ,
full_ddesc  ,
CTLFLAG_RWTUN  ,
usb_full_ddesc,
,
"USB always read complete device  descriptor,
if set"   
)

◆ SYSCTL_INT() [2/2]

SYSCTL_INT ( _hw_usb  ,
OID_AUTO  ,
no_cs_fail  ,
CTLFLAG_RWTUN  ,
usb_no_cs_fail,
,
"USB clear stall failures are  ignored,
if set"   
)

◆ usb_do_clear_stall_callback()

◆ usbd_alloc_config_desc()

void * usbd_alloc_config_desc ( struct usb_device udev,
uint32_t  size 
)

Definition at line 1303 of file usb_request.c.

References DPRINTF, size, and USB_CONFIG_MAX.

Referenced by usb_temp_setup(), and usbd_req_get_config_desc_full().

Here is the caller graph for this function:

◆ usbd_do_request_callback()

void usbd_do_request_callback ( struct usb_xfer xfer,
usb_error_t  error 
)

Definition at line 204 of file usb_request.c.

References usb_device::ctrlreq_cv, DPRINTF, usb_xfer_root::udev, USB_GET_STATE, USB_ST_SETUP, usbd_transfer_submit(), and usb_xfer::xroot.

Here is the call graph for this function:

◆ usbd_do_request_flags()

usb_error_t usbd_do_request_flags ( struct usb_device udev,
struct mtx *  mtx,
struct usb_device_request req,
void *  data,
uint16_t  flags,
uint16_t *  actlen,
usb_timeout_t  timeout 
)

Definition at line 405 of file usb_request.c.

References usb_xfer::actlen, usb_xfer::aframes, usb_device::bus, usb_device::ctrl_xfer, usb_device::ctrlreq_cv, data, desc, DPRINTF, usb_xfer::error, usb_xfer::flags, usb_xfer::frbuffers, usb_xfer_flags::manual_status, req, usb_xfer_flags::short_xfer_ok, usb_device::state, usb_xfer::timeout, UGETW, USB_ADD_BYTES, USB_BUS_LOCK, USB_BUS_UNLOCK, USB_DELAY_STATUS_STAGE, USB_ERR_CANCELLED, USB_ERR_INVAL, USB_ERR_NOMEM, USB_ERR_NORMAL_COMPLETION, USB_ERR_NOT_CONFIGURED, USB_ERR_SHORT_XFER, USB_ERR_STALLED, USB_ERR_TIMEOUT, USB_MS_TO_TICKS, USB_MTX_ASSERT, USB_MTX_LOCK, USB_MTX_UNLOCK, usb_pause_mtx(), USB_SHORT_XFER_OK, USB_STATE_POWERED, USB_USER_DATA_PTR, USB_XFER_LOCK, USB_XFER_UNLOCK, usbd_copy_in(), usbd_copy_in_user(), usbd_copy_out(), usbd_copy_out_user(), usbd_ctrl_lock(), usbd_ctrl_transfer_setup(), usbd_ctrl_unlock(), usbd_errstr(), usbd_get_hr_func(), usbd_transfer_pending(), usbd_transfer_start(), usbd_transfer_stop(), usbd_xfer_frame_len(), usbd_xfer_max_len(), usbd_xfer_set_frame_len(), usbd_xfer_set_frames(), UT_READ, usb_xfer_root::xfer_mtx, and usb_xfer::xroot.

Referenced by rsu_do_request(), rum_do_request(), run_do_request(), u3g_huawei_init(), u3g_sierra_init(), ubser_attach(), udl_ctrl_msg(), uhid_snes_reset(), uhso_probe_iface_auto(), uipaq_attach(), uled_ctrl_msg(), ulpt_attach(), ulpt_reset(), ural_do_request(), urndis_ctrl_msg(), urtw_do_request(), usbd_do_request_proc(), usbd_req_get_desc(), usbd_req_get_port_status(), usbd_req_set_address(), usie_autoinst(), usie_if_status_cb(), uslcom_get_partnum(), and uvisor_init().

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

◆ usbd_do_request_proc()

usb_error_t usbd_do_request_proc ( struct usb_device udev,
struct usb_process pproc,
struct usb_device_request req,
void *  data,
uint16_t  flags,
uint16_t *  actlen,
usb_timeout_t  timeout 
)

Definition at line 742 of file usb_request.c.

References usb_xfer::actlen, data, usb_xfer::flags, len, req, usb_xfer::timeout, UE_DIR_IN, UGETW, usb_process::up_mtx, USB_ERR_IOERROR, usb_proc_is_gone(), and usbd_do_request_flags().

Referenced by umcs7840_get_reg_sync(), umcs7840_get_UART_reg_sync(), umcs7840_set_reg_sync(), and umcs7840_set_UART_reg_sync().

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

◆ usbd_free_config_desc()

void usbd_free_config_desc ( struct usb_device udev,
void *  ptr 
)

Definition at line 1323 of file usb_request.c.

Referenced by usb_temp_unsetup(), usb_temp_unsetup_w(), usb_unconfigure(), and usbd_req_get_config_desc_full().

Here is the caller graph for this function:

◆ usbd_get_hr_func()

static usb_handle_req_t * usbd_get_hr_func ( struct usb_device udev)
static

◆ usbd_req_clear_device_feature()

usb_error_t usbd_req_clear_device_feature ( struct usb_device udev,
struct mtx *  mtx,
uint16_t  sel 
)

Definition at line 2165 of file usb_request.c.

References req, UR_CLEAR_FEATURE, usbd_do_request, USETW, and UT_WRITE_DEVICE.

Referenced by usbd_clear_dev_wakeup().

Here is the caller graph for this function:

◆ usbd_req_clear_hub_feature()

usb_error_t usbd_req_clear_hub_feature ( struct usb_device udev,
struct mtx *  mtx,
uint16_t  sel 
)

Definition at line 1626 of file usb_request.c.

References req, UR_CLEAR_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_DEVICE.

◆ usbd_req_clear_port_feature()

usb_error_t usbd_req_clear_port_feature ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint16_t  sel 
)

◆ usbd_req_clear_tt_buffer()

usb_error_t usbd_req_clear_tt_buffer ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint8_t  addr,
uint8_t  type,
uint8_t  endpoint 
)

◆ usbd_req_get_alt_interface_no()

usb_error_t usbd_req_get_alt_interface_no ( struct usb_device udev,
struct mtx *  mtx,
uint8_t *  alt_iface_no,
uint8_t  iface_index 
)

◆ usbd_req_get_config()

usb_error_t usbd_req_get_config ( struct usb_device udev,
struct mtx *  mtx,
uint8_t *  pconf 
)

Definition at line 1945 of file usb_request.c.

References req, UR_GET_CONFIG, usbd_do_request, USETW, and UT_READ_DEVICE.

◆ usbd_req_get_config_desc()

usb_error_t usbd_req_get_config_desc ( struct usb_device udev,
struct mtx *  mtx,
struct usb_config_descriptor d,
uint8_t  conf_index 
)

Definition at line 1272 of file usb_request.c.

References UDESC_CONFIG, UGETW, USB_ERR_INVAL, usbd_req_get_desc(), and usb_config_descriptor::wTotalLength.

Referenced by usbd_req_get_config_desc_full().

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

◆ usbd_req_get_config_desc_full()

usb_error_t usbd_req_get_config_desc_full ( struct usb_device udev,
struct mtx *  mtx,
struct usb_config_descriptor **  ppcd,
uint8_t  index 
)

Definition at line 1342 of file usb_request.c.

References DPRINTF, index, len, UDESC_CONFIG, UGETW, USB_CONFIG_MAX, USB_ERR_INVAL, USB_ERR_NOMEM, usbd_alloc_config_desc(), usbd_free_config_desc(), usbd_req_get_config_desc(), usbd_req_get_desc(), USETW, and usb_config_descriptor::wTotalLength.

Referenced by usbd_set_config_index().

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

◆ usbd_req_get_desc()

usb_error_t usbd_req_get_desc ( struct usb_device udev,
struct mtx *  mtx,
uint16_t *  actlen,
void *  desc,
uint16_t  min_len,
uint16_t  max_len,
uint16_t  id,
uint8_t  type,
uint8_t  index,
uint8_t  retries 
)

◆ usbd_req_get_descriptor_ptr()

usb_error_t usbd_req_get_descriptor_ptr ( struct usb_device udev,
struct usb_config_descriptor **  ppcd,
uint16_t  wValue 
)

Definition at line 1226 of file usb_request.c.

References usb_device::bus, len, req, UR_GET_DESCRIPTOR, USB_BUS_LOCK, USB_BUS_UNLOCK, USB_ERR_INVAL, usbd_get_hr_func(), USETW, UT_READ_DEVICE, and usb_device_request::wValue.

Referenced by usbd_set_config_index().

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

◆ usbd_req_get_device_desc()

usb_error_t usbd_req_get_device_desc ( struct usb_device udev,
struct mtx *  mtx,
struct usb_device_descriptor d 
)

Definition at line 1392 of file usb_request.c.

References UDESC_DEVICE, and usbd_req_get_desc().

Referenced by usbd_setup_device_desc().

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

◆ usbd_req_get_device_status()

usb_error_t usbd_req_get_device_status ( struct usb_device udev,
struct mtx *  mtx,
struct usb_status st 
)

Definition at line 1472 of file usb_request.c.

References req, UR_GET_STATUS, usbd_do_request, USETW, and UT_READ_DEVICE.

Referenced by usbd_set_config_index().

Here is the caller graph for this function:

◆ usbd_req_get_hub_descriptor()

usb_error_t usbd_req_get_hub_descriptor ( struct usb_device udev,
struct mtx *  mtx,
struct usb_hub_descriptor hd,
uint8_t  nports 
)

Definition at line 1493 of file usb_request.c.

References len, req, UDESC_HUB, UR_GET_DESCRIPTOR, usbd_do_request, USETW, USETW2, and UT_READ_CLASS_DEVICE.

Referenced by uhub_attach(), and uhub_query_info().

Here is the caller graph for this function:

◆ usbd_req_get_hub_status()

usb_error_t usbd_req_get_hub_status ( struct usb_device udev,
struct mtx *  mtx,
struct usb_hub_status st 
)

Definition at line 1537 of file usb_request.c.

References req, UR_GET_STATUS, usbd_do_request, USETW, and UT_READ_CLASS_DEVICE.

◆ usbd_req_get_port_status()

usb_error_t usbd_req_get_port_status ( struct usb_device udev,
struct mtx *  mtx,
struct usb_port_status ps,
uint8_t  port 
)

Definition at line 1603 of file usb_request.c.

References req, UR_GET_STATUS, usbd_do_request_flags(), USETW, and UT_READ_CLASS_OTHER.

Referenced by uhub_read_port_status(), usb_trigger_reprobe_on_off(), usbd_req_reset_port(), and usbd_req_warm_reset_port().

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

◆ usbd_req_get_report()

usb_error_t usbd_req_get_report ( struct usb_device udev,
struct mtx *  mtx,
void *  data,
uint16_t  len,
uint8_t  iface_index,
uint8_t  type,
uint8_t  id 
)

◆ usbd_req_get_report_descriptor()

usb_error_t usbd_req_get_report_descriptor ( struct usb_device udev,
struct mtx *  mtx,
void *  d,
uint16_t  size,
uint8_t  iface_index 
)

Definition at line 1890 of file usb_request.c.

References usb_interface_descriptor::bInterfaceNumber, usb_interface::idesc, req, size, UDESC_REPORT, UR_GET_DESCRIPTOR, USB_ERR_INVAL, usbd_do_request, usbd_get_iface(), USETW, USETW2, and UT_READ_INTERFACE.

Referenced by usbd_req_get_hid_desc(), and usbhid_get_rdesc().

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

◆ usbd_req_get_ss_hub_descriptor()

usb_error_t usbd_req_get_ss_hub_descriptor ( struct usb_device udev,
struct mtx *  mtx,
struct usb_hub_ss_descriptor hd,
uint8_t  nports 
)

Definition at line 1515 of file usb_request.c.

References len, req, UDESC_SS_HUB, UR_GET_DESCRIPTOR, usbd_do_request, USETW, USETW2, and UT_READ_CLASS_DEVICE.

Referenced by uhub_attach(), and uhub_query_info().

Here is the caller graph for this function:

◆ usbd_req_get_string_any()

usb_error_t usbd_req_get_string_any ( struct usb_device udev,
struct mtx *  mtx,
char *  buf,
uint16_t  len,
uint8_t  string_index 
)

Definition at line 1100 of file usb_request.c.

References usb_device::flags, usb_device::langid, len, n, usb_device_flags::no_strings, UGETW, USB_ERR_INVAL, USB_ERR_NORMAL_COMPLETION, USB_ERR_STALLED, and usbd_req_get_string_desc().

Referenced by cdce_attach(), device_set_usb_desc(), and usb_set_device_strings().

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

◆ usbd_req_get_string_desc()

usb_error_t usbd_req_get_string_desc ( struct usb_device udev,
struct mtx *  mtx,
void *  sdesc,
uint16_t  max_len,
uint16_t  lang_id,
uint8_t  string_index 
)

Definition at line 1206 of file usb_request.c.

References UDESC_STRING, and usbd_req_get_desc().

Referenced by usb_get_langid(), and usbd_req_get_string_any().

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

◆ usbd_req_re_enumerate()

◆ usbd_req_reset_port()

◆ usbd_req_reset_tt()

usb_error_t usbd_req_reset_tt ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port 
)

◆ usbd_req_set_address()

usb_error_t usbd_req_set_address ( struct usb_device udev,
struct mtx *  mtx,
uint16_t  addr 
)

Definition at line 1561 of file usb_request.c.

References addr, usb_device::bus, usb_bus::methods, req, usb_bus_methods::set_address, UR_SET_ADDRESS, USB_DELAY_STATUS_STAGE, USB_ERR_INVAL, USB_MS_TO_TICKS, usb_pause_mtx(), usb_set_address_settle, usbd_do_request_flags(), USETW, and UT_WRITE_DEVICE.

Referenced by usb_alloc_device(), and usbd_req_re_enumerate().

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

◆ usbd_req_set_alt_interface_no()

usb_error_t usbd_req_set_alt_interface_no ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  iface_index,
uint8_t  alt_no 
)

Definition at line 1434 of file usb_request.c.

References usb_interface_descriptor::bInterfaceNumber, DPRINTF, usb_interface::idesc, usb_interface::num_altsetting, req, UR_SET_INTERFACE, USB_ERR_INVAL, USB_ERR_STALLED, usbd_do_request, usbd_get_iface(), USETW, and UT_WRITE_INTERFACE.

Referenced by u3g_sael_m460_init(), and usbd_set_alt_interface_index().

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

◆ usbd_req_set_config()

usb_error_t usbd_req_set_config ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  conf 
)

Definition at line 1920 of file usb_request.c.

References DPRINTF, req, UR_SET_CONFIG, usbd_do_request, USETW, and UT_WRITE_DEVICE.

Referenced by axe_reset(), axge_reset(), kue_reset(), muge_reset(), smsc_reset(), usbd_set_config_index(), and zyd_init_locked().

Here is the caller graph for this function:

◆ usbd_req_set_device_feature()

usb_error_t usbd_req_set_device_feature ( struct usb_device udev,
struct mtx *  mtx,
uint16_t  sel 
)

Definition at line 2186 of file usb_request.c.

References req, UR_SET_FEATURE, usbd_do_request, USETW, and UT_WRITE_DEVICE.

Referenced by usbd_set_dev_wakeup().

Here is the caller graph for this function:

◆ usbd_req_set_hub_depth()

usb_error_t usbd_req_set_hub_depth ( struct usb_device udev,
struct mtx *  mtx,
uint16_t  depth 
)

Definition at line 1712 of file usb_request.c.

References req, UR_SET_HUB_DEPTH, usbd_do_request, USETW, and UT_WRITE_CLASS_DEVICE.

Referenced by uhub_attach().

Here is the caller graph for this function:

◆ usbd_req_set_hub_feature()

usb_error_t usbd_req_set_hub_feature ( struct usb_device udev,
struct mtx *  mtx,
uint16_t  sel 
)

Definition at line 1647 of file usb_request.c.

References req, UR_SET_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_DEVICE.

◆ usbd_req_set_hub_u1_timeout()

usb_error_t usbd_req_set_hub_u1_timeout ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint8_t  timeout 
)

Definition at line 1668 of file usb_request.c.

References req, UHF_PORT_U1_TIMEOUT, UR_SET_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.

Referenced by uhub_reattach_port().

Here is the caller graph for this function:

◆ usbd_req_set_hub_u2_timeout()

usb_error_t usbd_req_set_hub_u2_timeout ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint8_t  timeout 
)

Definition at line 1690 of file usb_request.c.

References req, UHF_PORT_U2_TIMEOUT, UR_SET_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.

Referenced by uhub_reattach_port().

Here is the caller graph for this function:

◆ usbd_req_set_idle()

usb_error_t usbd_req_set_idle ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  iface_index,
uint8_t  duration,
uint8_t  id 
)

Definition at line 1862 of file usb_request.c.

References usb_interface_descriptor::bInterfaceNumber, usb_interface::idesc, req, UR_SET_IDLE, USB_ERR_INVAL, usbd_do_request, usbd_get_iface(), USETW, USETW2, and UT_WRITE_CLASS_INTERFACE.

Referenced by uhid_attach(), ukbd_attach(), and usbhid_attach().

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

◆ usbd_req_set_lpm_info()

usb_error_t usbd_req_set_lpm_info ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint8_t  besl,
uint8_t  addr,
uint8_t  rwe 
)

◆ usbd_req_set_port_feature()

usb_error_t usbd_req_set_port_feature ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint16_t  sel 
)

Definition at line 1755 of file usb_request.c.

References req, UR_SET_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.

Referenced by uhub_attach(), usb_dev_suspend_peer(), usb_trigger_reprobe_on_off(), usbd_req_reset_port(), and usbd_req_warm_reset_port().

Here is the caller graph for this function:

◆ usbd_req_set_port_link_state()

usb_error_t usbd_req_set_port_link_state ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  port,
uint8_t  link_state 
)

Definition at line 2271 of file usb_request.c.

References req, UHF_PORT_LINK_STATE, UR_SET_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.

Referenced by usb_dev_resume_peer(), and usb_dev_suspend_peer().

Here is the caller graph for this function:

◆ usbd_req_set_protocol()

usb_error_t usbd_req_set_protocol ( struct usb_device udev,
struct mtx *  mtx,
uint8_t  iface_index,
uint16_t  report 
)

Definition at line 1777 of file usb_request.c.

References usb_interface_descriptor::bInterfaceNumber, usb_interface::idesc, report, req, UR_SET_PROTOCOL, USB_ERR_INVAL, usbd_do_request, usbd_get_iface(), USETW, and UT_WRITE_CLASS_INTERFACE.

Referenced by ukbd_attach(), and ums_attach().

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

◆ usbd_req_set_report()

usb_error_t usbd_req_set_report ( struct usb_device udev,
struct mtx *  mtx,
void *  data,
uint16_t  len,
uint8_t  iface_index,
uint8_t  type,
uint8_t  id 
)

◆ usbd_req_warm_reset_port()

◆ usbd_setup_device_desc()

Variable Documentation

◆ usb_full_ddesc

int usb_full_ddesc
static

Definition at line 80 of file usb_request.c.

Referenced by usbd_setup_device_desc().

◆ usb_no_cs_fail

int usb_no_cs_fail
static

Definition at line 75 of file usb_request.c.

Referenced by usb_do_clear_stall_callback().