FreeBSD kernel usb device Code
|
Go to the source code of this file.
Functions | |
usb_error_t | usbd_req_clear_hub_feature (struct usb_device *udev, struct mtx *mtx, uint16_t sel) |
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_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_get_config (struct usb_device *udev, struct mtx *mtx, uint8_t *pconf) |
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) |
usb_error_t | usbd_req_get_config_desc_full (struct usb_device *udev, struct mtx *mtx, struct usb_config_descriptor **ppcd, uint8_t conf_index) |
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_device_desc (struct usb_device *udev, struct mtx *mtx, struct usb_device_descriptor *d) |
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_get_port_status (struct usb_device *udev, struct mtx *mtx, struct usb_port_status *ps, uint8_t port) |
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_set_address (struct usb_device *udev, struct mtx *mtx, uint16_t addr) |
usb_error_t | usbd_req_set_hub_feature (struct usb_device *udev, struct mtx *mtx, 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_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_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_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) |
void * | usbd_alloc_config_desc (struct usb_device *, uint32_t) |
void | usbd_free_config_desc (struct usb_device *, void *) |
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().
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().
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().
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.
usb_error_t usbd_req_clear_port_feature | ( | struct usb_device * | udev, |
struct mtx * | mtx, | ||
uint8_t | port, | ||
uint16_t | sel | ||
) |
Definition at line 1733 of file usb_request.c.
References req, UR_CLEAR_FEATURE, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.
Referenced by uhub_attach(), uhub_explore(), uhub_explore_handle_re_enumerate(), uhub_reattach_port(), uhub_suspend_resume_port(), usb_dev_resume_peer(), usb_dev_suspend_peer(), usb_trigger_reprobe_on_off(), usbd_req_reset_port(), and usbd_req_warm_reset_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 | ||
) |
Definition at line 2237 of file usb_request.c.
References addr, usb_device_descriptor::bDeviceClass, usb_device_descriptor::bDeviceProtocol, usb_device::ddesc, endpoint, req, type, UDCLASS_HUB, UDPROTO_HSHUBSTT, UR_CLEAR_TT_BUFFER, usbd_do_request, USETW, UT_WRITE_CLASS_OTHER, and usb_device_request::wValue.
Referenced by usbd_req_re_enumerate().
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 | ||
) |
Definition at line 1408 of file usb_request.c.
References usb_interface_descriptor::bInterfaceNumber, usb_interface::idesc, req, UR_GET_INTERFACE, USB_ERR_INVAL, usbd_do_request, usbd_get_iface(), USETW, and UT_READ_INTERFACE.
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.
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().
usb_error_t usbd_req_get_config_desc_full | ( | struct usb_device * | udev, |
struct mtx * | mtx, | ||
struct usb_config_descriptor ** | ppcd, | ||
uint8_t | conf_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().
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 | ||
) |
Definition at line 986 of file usb_request.c.
References desc, index, req, type, UR_GET_DESCRIPTOR, USB_ERR_INVAL, USB_ERR_TIMEOUT, usb_pause_mtx(), USB_SHORT_XFER_OK, usbd_do_request_flags(), USETW, USETW2, and UT_READ_DEVICE.
Referenced by usbd_req_get_config_desc(), usbd_req_get_config_desc_full(), usbd_req_get_device_desc(), usbd_req_get_string_desc(), and usbd_setup_device_desc().
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().
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().
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().
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().
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.
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().
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().
usb_error_t usbd_req_re_enumerate | ( | struct usb_device * | udev, |
struct mtx * | mtx | ||
) |
Definition at line 2054 of file usb_request.c.
References usb_device::address, usb_device_descriptor::bMaxPacketSize, usb_device::ddesc, DPRINTF, usb_device::flags, usb_device::hs_port_no, usb_device::parent_hs_hub, usb_device::parent_hub, usb_device::port_no, retry, usb_device::speed, UE_CONTROL, uhub_count_active_host_ports(), USB_ERR_INVAL, USB_MAX_IPACKET, usb_device_flags::usb_mode, USB_MODE_HOST, usb_pause_mtx(), usb_set_device_state(), USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_SUPER, USB_START_ADDR, USB_STATE_ADDRESSED, USB_STATE_POWERED, usbd_errstr(), usbd_req_clear_tt_buffer(), usbd_req_reset_port(), usbd_req_reset_tt(), usbd_req_set_address(), usbd_req_warm_reset_port(), and usbd_setup_device_desc().
Referenced by uhub_explore_handle_re_enumerate(), usb_alloc_device(), and usb_msc_auto_quirk().
usb_error_t usbd_req_reset_port | ( | struct usb_device * | udev, |
struct mtx * | mtx, | ||
uint8_t | port | ||
) |
Definition at line 786 of file usb_request.c.
References DPRINTF, n, status, UGETW, UHF_C_PORT_RESET, UHF_PORT_RESET, UPS_C_PORT_RESET, UPS_CURRENT_CONNECT_STATUS, UPS_RESET, USB_ERR_TIMEOUT, USB_MS_TO_TICKS, usb_pause_mtx(), usb_port_reset_delay, usb_port_reset_recovery, usbd_errstr(), usbd_req_clear_port_feature(), usbd_req_get_port_status(), usbd_req_set_port_feature(), usb_port_status::wPortChange, and usb_port_status::wPortStatus.
Referenced by uhub_reattach_port(), and usbd_req_re_enumerate().
usb_error_t usbd_req_reset_tt | ( | struct usb_device * | udev, |
struct mtx * | mtx, | ||
uint8_t | port | ||
) |
Definition at line 2207 of file usb_request.c.
References usb_device_descriptor::bDeviceClass, usb_device_descriptor::bDeviceProtocol, usb_device::ddesc, req, UDCLASS_HUB, UDPROTO_HSHUBSTT, UR_RESET_TT, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.
Referenced by usbd_req_re_enumerate().
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().
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().
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().
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.
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().
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().
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 | ||
) |
Definition at line 2298 of file usb_request.c.
References addr, req, UHF_PORT_L1, UR_SET_AND_TEST, USB_ERR_IOERROR, USB_ERR_PENDING_REQUESTS, USB_ERR_STALLED, USB_ERR_TIMEOUT, usbd_do_request, USETW, and UT_WRITE_CLASS_OTHER.
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().
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().
usb_error_t usbd_req_warm_reset_port | ( | struct usb_device * | udev, |
struct mtx * | mtx, | ||
uint8_t | port | ||
) |
Definition at line 876 of file usb_request.c.
References DPRINTF, n, status, UGETW, UHF_BH_PORT_RESET, UHF_C_BH_PORT_RESET, UPS_C_BH_PORT_RESET, UPS_CURRENT_CONNECT_STATUS, UPS_PORT_LINK_STATE_GET, UPS_PORT_LS_COMP_MODE, UPS_PORT_LS_LOOPBACK, UPS_PORT_LS_SS_INA, UPS_PORT_LS_U3, USB_ERR_TIMEOUT, USB_MS_TO_TICKS, usb_pause_mtx(), usb_port_reset_delay, usb_port_reset_recovery, usbd_errstr(), usbd_req_clear_port_feature(), usbd_req_get_port_status(), usbd_req_set_port_feature(), usb_port_status::wPortChange, and usb_port_status::wPortStatus.
Referenced by uhub_suspend_resume_port(), and usbd_req_re_enumerate().
usb_error_t usbd_setup_device_desc | ( | struct usb_device * | udev, |
struct mtx * | mtx | ||
) |
Definition at line 1961 of file usb_request.c.
References usb_device::address, usb_device_descriptor::bcdUSB, usb_device_descriptor::bDeviceClass, usb_device_descriptor::bDeviceProtocol, usb_device_descriptor::bDeviceSubClass, usb_device_descriptor::bLength, usb_device_descriptor::bMaxPacketSize, usb_device::ddesc, DPRINTF, usb_device::speed, UDESC_DEVICE, UGETW, usb_full_ddesc, USB_MAX_IPACKET, USB_SPEED_FULL, usbd_errstr(), usbd_req_get_desc(), and usbd_req_get_device_desc().
Referenced by usb_alloc_device(), and usbd_req_re_enumerate().