]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r313287:
authorian <ian@FreeBSD.org>
Thu, 2 Mar 2017 04:42:33 +0000 (04:42 +0000)
committerian <ian@FreeBSD.org>
Thu, 2 Mar 2017 04:42:33 +0000 (04:42 +0000)
commit6c815d79b139a562617910f5e9757c9e134fe4eb
treef1fa6f6e52b5af458853db35c1c3ebcd572e1d0b
parent441c0c0ed529fc9fb17e0feb520d123e21acb7f5
MFC r313287:

  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().
sys/dev/usb/serial/uftdi.c
sys/dev/usb/serial/usb_serial.c
sys/dev/usb/serial/usb_serial.h