freebsd-dev/sys/dev/usb/serial
Ian Lepore 9ad221a558 Add tsw_busy support to usb_serial (ucom).
The tty layer uses tsw_busy to poll for busy/idle status of the transmitter
hardware during close() and tcdrain(). The ucom layer defines ULSR_TXRDY and
ULSR_TSRE bits for the line status register; when both are set, the
transmitter is idle. Not all chip drivers maintain those bits in the sc_lsr
field, and if the bits never get set the transmitter will always appear
busy, causing hangs in tcdrain().

These changes add a new sc_flag bit, UCOM_FLAG_LSRTXIDLE. When this flag is
set, ucom_busy() uses the lsr bits to return busy vs. idle state, otherwise
it always returns idle (which is effectively what happened before this
change because tsw_busy wasn't implemented).

For the uftdi chip driver, these changes stop masking out the tx idle bits
when processing the status register (because now they're useful), and it
calls ucom_use_lsr_txbits() to indicate the bits are maintained by the
driver and can be used by ucom_busy().

Differential Revision:	https://reviews.freebsd.org/D9183
2017-02-05 15:45:31 +00:00
..
u3g.c Add new USB ID. 2016-09-30 05:28:11 +00:00
uark.c Annotate the usb-serial drivers which always return 0 for line status, 2016-07-27 00:08:01 +00:00
ubsa.c Translate modem status reg bits from ns16550 to SER_* values used by the 2016-07-27 00:03:18 +00:00
ubser.c
uchcom.c Annotate the usb-serial drivers which always return 0 for line status, 2016-07-27 00:08:01 +00:00
ucycom.c
ufoma.c Annotate the usb-serial drivers which always return 0 for line status, 2016-07-27 00:08:01 +00:00
uftdi_reg.h
uftdi.c Add tsw_busy support to usb_serial (ucom). 2017-02-05 15:45:31 +00:00
ugensa.c
uipaq.c
ulpt.c
umcs.c
umcs.h
umct.c Translate modem status reg bits from ns16550 to SER_* values used by the 2016-07-26 23:42:42 +00:00
umodem.c Annotate the usb-serial drivers which always return 0 for line status, 2016-07-27 00:08:01 +00:00
umoscom.c
uplcom.c With clang 3.9.0, compiling uplcom results in the following warnings: 2016-09-04 16:59:35 +00:00
usb_serial.c Add tsw_busy support to usb_serial (ucom). 2017-02-05 15:45:31 +00:00
usb_serial.h Add tsw_busy support to usb_serial (ucom). 2017-02-05 15:45:31 +00:00
uslcom.c Annotate the usb-serial drivers which always return 0 for line status, 2016-07-27 00:08:01 +00:00
uvisor.c
uvscom.c