opnsense-src/sys/dev/usb/serial
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
..
u3g.c u3g: add SIERRA AC340U 2024-09-01 21:46:02 -07:00
uark.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ubsa.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ubser.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
uchcom.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ucycom.c Remove my middle name. 2023-08-17 15:08:30 +02:00
ufoma.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
uftdi.c usb: Add support for Brainboxes USB-to-Serial adapters 2024-11-17 14:17:55 +09:00
uftdi_reg.h usb: Fix two typos in source code comments 2024-01-23 07:42:03 +01:00
ugensa.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
uipaq.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ulpt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
umcs.c umcs(4): Fix two typos in source code comments 2024-02-25 08:43:54 +01:00
umcs.h usb: Fix a typo in a source code comment 2024-01-25 07:45:09 +01:00
umct.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
umodem.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
umoscom.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
uplcom.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
usb_serial.c usb: serial: make more commands execute synchronously 2024-12-31 23:45:26 -06:00
usb_serial.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
uslcom.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
uvisor.c sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
uvscom.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00