usb4bsd - Fix poll/select/kqfilter issues with ums and usb_fifo*() API
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 10 Mar 2014 00:01:41 +0000 (17:01 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 10 Mar 2014 00:06:02 +0000 (17:06 -0700)
commit4bcecc80cde102c21a6cc5a8e562b60da0be724c
treebb6e8277203df191dfe8b4e4099baf2310e3d878
parent0aaa62c429b1a3db72c4e985478b01abe8de9d51
usb4bsd - Fix poll/select/kqfilter issues with ums and usb_fifo*() API

* Fix handling of f->flag_isselect.  It was being improperly cleared on
  event notification.  It can only be cleared when the knote is removed.

* Call f->methods->f_start_read() unconditionally in usb_filter_read().
  Conditionalizing on f->queue_data will fail with devices (aka ums) which
  allocate the buffer independantly of starting the interrupt xfer.

* Call usb_fifo_wakeup() in mbuf re-queue cases to handle races when
  the read() code pulls an mbuf off the queue and then puts it back on.

* Fix bugs in UMS - Keep track of whether the interrupt transfer is running
  or not and do not re-submit or re-stop the transfer unconditionally.
sys/bus/u4b/input/ums.c
sys/bus/u4b/usb_dev.c