configures an audio device correctly for a device which is already
plugged.
* usb_subr.c
Add locators parameter to usbd_attachinterfaces()
Add usbd_reatach_device()
* usbdivar.h
Export usbd_reatach_device()
the configuration. The match/attach code was assuming whole-device
attach args all the time.
-Use the first (ie index 0) configuration for ubsa -- it makes the
code work in at least one case (PR kern/39211 by Frank Wille), and
there is no indication that an alternative configuration would
be needed. (I've admittedly never seen a usb device with more than
one configuration.)
This fixes mistakes when uhmodem support was added, and the changes were
not tested with a Huawei device yet. So please test if you can.
per-interface attachment into individual functions, to ease
maintainance and allow easier plugin of new attachment functions
-keep a counter of USB interfaces in use on a device, and try to
keep track of interfaces claimed by drivers behind the framework's
back
as proposed on tech-kern@.
While all DMA memory used in the USB framework is mapped BUS_DMAMAP_COHERENT
(including data memory, which is memcpy'd from/to USB-private buffers),
the CPU can reorder loads or stores from/to main memory, causing the
controller to have an incoherent view of the DMA descriptors lists for a
short time. bus_dmamap_sync() should contain memory barriers that prevents
the CPU from reordering load/store. Note that BUS_DMAMAP_COHERENT is
still required for the DMA descriptor lists - these can't work properly
with software cache coherency.
This fixes "host controller process error/host controller halted" errors
I'm occasionally seeing with a umodem device on uhci on x86.
Thanks to Michael Lorenz for testing it on his O2, and Izumi Tsutsui on
his Cobalt Qube 2700.
XXX:
"modload uaudio.kmod" doesn't attach the uaudio driver to
plugged USB devices for now because uhub_rescan() is not
implemented yet. We need to re-plug USB devices after modload.
-avoid unnecessary tree walks and port status requests:
-acknowledge hub status change notifications (but do nothing)
-clear cached port status change bits earlier (but not on ehci, due
to an ehci driver bug)
-do the ehci check on attach rather than a string comparision at runtime
to a crash reported by Christoph Egger in a followup to PR kern/38528.
For consistency, keep track of the device_t pointer to child devices
rather than the softc. We really shouldn't mess with child's softc data.
-unifdef
-since the roothub attach doesn't use locators, don't call
config_stdsubmatch() -- it is a no-op in that case
-ifsubmatch has configuration and interface always set to useful values,
remove unnecessary checks
-remove now unused locator definitions from shared header