opnsense-src/sys/dev/usb
Kyle Evans 4c20884b37 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

(cherry picked from commit 36a80f4264350a2f4f0686eb91ae7f5943d40327)
2024-12-31 23:45:26 -06:00
..
controller Add some AMD device IDs. 2024-09-25 09:17:26 -04:00
gadget sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
input uhid(4): update ugd_actlen in USB_GET_REPORT ioctl 2024-12-22 06:33:16 +03:00
misc usb: Fix two typos in source code comments 2024-01-23 07:42:03 +01:00
net Move support of Realtek 8156/8156B from cdce(4) to ure(4) 2024-10-21 10:58:35 +08:00
quirk Move support of Realtek 8156/8156B from cdce(4) to ure(4) 2024-10-21 10:58:35 +08:00
serial usb: serial: make more commands execute synchronously 2024-12-31 23:45:26 -06:00
storage sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
template sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
video sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
wlan uath(4): Fix a typo in a source code comment 2024-02-25 08:42:24 +01: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 sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_bus.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06: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-12-03 01:03:42 +00:00
usb_dev.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
usb_device.c usb: fix loop in usb_config_parse 2024-11-13 09:26:44 -05:00
usb_device.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06: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: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06: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-03-16 17:11:37 +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 bpf: Add IfAPI analogue for bpf_peers_present() 2024-09-24 12:30:48 +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-31 23:45:24 -06:00
usb_process.h usb: serial: allow the open/close sleep to be interruptible 2024-12-31 23:45:24 -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-30 13:07:29 +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-12-04 13:35:12 -05:00
usbdi.h usb: serial: allow the open/close sleep to be interruptible 2024-12-31 23:45:24 -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