opnsense-src/sys/dev/usb
Kyle Evans 36a80f4264 usb: serial: make more commands execute synchronously
The termios layer wants some level of guarantee that we've actually
submitted param changes to the hardware when our functions return, so we
need to do a little more waiting to avoid violating those guarantees.

This is especially important as some hardware has some minimum timing
specifications around this stuff, and without being less asynchronous
the software dealing with these devices can't reasonably operate the
hardware without more excessive delays than they should need.

More specifically, we make sure that:
 - The command to start transfers is finished before we toggle DTR/RTS
 - The status_change command finishes before we return, which may change
    some fields in the softc that we need for a subsequent call into
    usb_serial
 - cfg_param finishes before we re-enable transfers, and we ensure that
    RTS is appropriately toggled before we return to userland

This has been observed to fix some flakiness in connecting to some
ESP32 devices.

Tested by:	kenrap from Libera
Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D47952
2024-12-10 19:23:41 -06:00
..
controller Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
gadget sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
input Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
misc Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
net if_usie: fix typo 2024-09-22 00:56:37 +02:00
quirk usb: correct the rtw8821cu quirk and add another wireless rtw88 device 2024-08-27 17:48:43 +00:00
serial usb: serial: make more commands execute synchronously 2024-12-10 19:23:41 -06:00
storage sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
template sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
video newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY 2024-07-24 22:22:58 -06:00
wlan uath: flush data/commands to the firmware before changing channel / state 2024-11-18 20:50:41 -08:00
ufm_ioctl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
uftdiio.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
uled_ioctl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usb.h usb: increase USB_PORT_RESET_RECOVERY 2024-09-06 12:34:30 -06:00
usb_bus.h usb: change LIST to SLIST to avoid LinuxKPI conflicts 2024-09-24 22:53:28 +00:00
usb_busdma.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_busdma.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_cdc.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_controller.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_core.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_core.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_debug.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_debug.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_dev.c kern: Make fileops and filterops tables const where possible 2024-11-26 21:04:21 +00:00
usb_dev.h usb: change LIST to SLIST to avoid LinuxKPI conflicts 2024-09-24 22:53:28 +00:00
usb_device.c usb: fix loop in usb_config_parse 2024-11-10 21:53:18 -05:00
usb_device.h usb: change LIST to SLIST to avoid LinuxKPI conflicts 2024-09-24 22:53:28 +00:00
usb_dynamic.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_dynamic.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_endian.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_error.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_fdt_support.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
usb_fdt_support.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usb_freebsd.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_freebsd_loader.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_generic.c ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver 2024-02-19 12:44:00 +02:00
usb_generic.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_handle_request.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hid.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub_acpi.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_hub_private.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
usb_ioctl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_lookup.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_mbuf.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_mbuf.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_msctest.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_msctest.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_parse.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_pci.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_pf.c net: Remove unneeded NULL check for the allocated ifnet 2024-06-28 18:16:29 +08:00
usb_pf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usb_process.c usb: serial: allow the open/close sleep to be interruptible 2024-12-10 19:23:10 -06:00
usb_process.h usb: serial: allow the open/close sleep to be interruptible 2024-12-10 19:23:10 -06:00
usb_request.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_request.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_transfer.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_transfer.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_util.c usb: use only usb_devinfo() in device_set_usb_desc() 2024-01-16 18:49:08 +02:00
usb_util.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usbdevs rtwn: Add device ID for TPLink RTL8192CU 2024-11-21 10:40:11 -05:00
usbdi.h usb: serial: allow the open/close sleep to be interruptible 2024-12-10 19:23:10 -06:00
usbdi_util.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
usbhid.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00