Home | History | Annotate | Download | only in usb
History log of /src/sys/dev/usb/usb_subr.c
RevisionDateAuthorComments
 1.279  04-May-2024  mlelstv Make usb address and hub topology available to drvctl.
 1.278  11-Apr-2023  riastradh usb(9): Assert ud_ifaces is null before we clobber it.
 1.277  06-Apr-2022  mlelstv revert accidental last commit (except ukbd.c)
 1.276  06-Apr-2022  mlelstv remove debug printf
 1.275  19-Mar-2022  riastradh usb: Insert assertion to diagnose ud_cdesc/ud_ifaces inconsistency.

Syzbot found a way to see ud_cdesc=NULL but ud_ifaces!=NULL:

https://syzkaller.appspot.com/bug?id=e6d4449a128e73a9a88100a5cc833e5cae9fecae

Maybe it's a race with two threads somehow doing usbd_free_device at
the same time when only one should, but let's rule this case out
early on to make it easier to prove it has to be a race.
 1.274  13-Mar-2022  riastradh usb: Fix debug build.
 1.273  13-Mar-2022  riastradh usbdi(9): Fix mistake in previous change to usbd_fill_iface_data.

The previous change stopped and rejected any descriptors smaller than
an endpoint descriptor. Restore the previous behaviour: just skip
over them (but it will now reject descriptors that are smaller than
_any_ descriptor, which is legitimately a hardware error).
 1.272  13-Mar-2022  riastradh usb: Parse descriptors a little more robustly.

- Avoid reading past the end in the event of bogus bLength.
- Avoid arithmetic overflow by rearranging inequalities.

Reported-by: syzbot+511227c050a2f164e34c@syzkaller.appspotmail.com
 1.271  13-Mar-2022  riastradh usbdi(9): Assert no concurrent aborts on a single pipe.

It is a driver bug to try to abort a pipe at the same time in two
different threads.

HCI drivers may release the bus lock to sleep in upm_abort while
waiting for the hardware to acknowledge an abort, so it won't try to,
e.g., scribble over a DMA buffer in the xfer that we've recycled
after usbd_abort_pipe returns.

If this happens, a concurrent usbd_abort_pipe might try to apply
upm_abort to the same xfer, which HCI drivers are not prepared for
and may wreak havoc.

To avoid this, allow only one usbd_abort_pipe in flight at any given
time.
 1.270  03-Mar-2022  riastradh usbdi(9): Suspend control pipe on detach.

The device is gone so control transfers won't complete anyway. This
obviates the need to wait for usbd_do_request to time out.

Seems like maybe we should make _all_ xfers fail with USBD_CANCELLED
when the device is detached, but there's no list of pipes we can just
walk down to suspend them, so we'd have to find another way to do so.
For now, we'll just keep having drivers suspend/abort pipes other
than the control pipe.
 1.269  06-Nov-2021  skrll USB style. NFC.
 1.268  06-Nov-2021  skrll config_pending_incr doesn't need KERNEL_LOCK protection
 1.267  07-Sep-2021  riastradh usb(4): Fix xfer race between software abort and hardware completion.

This fixes a bug in the API contract of usbd_abort_pipe: with the
change, the caller is guaranteed the xfer completion callbacks have
returned; without the change, completion callbacks could still be
running on the queued xfers while the caller of usbd_abort_pipe
proceeds to concurrently issue usbd_destroy_xfer.

This also fixes the following problem for interrupt pipes, whose
xfers stay on the queue until the pipe is aborted:

Thread 1: Hardware completion interrupt calls usb_transfer_complete.
Thread 1: pipe->up_repeat is 1, so usb_transfer_complete keeps xfer
queued.
Thread 2: Calls usbd_abort_pipe (e.g., in detach).
Thread 2: usbd_abort_pipe waits for bus lock.
Thread 1: usb_transfer_complete releases bus lock to invoke callback.
Thread 2: Sets pipe->up_repeat := 0 (too late for thread 1 to see).
Thread 1: usb_transfer_complete waits to reacquire bus lock before
resetting xfer status to USBD_NOT_STARTED.
Thread 2: Repeatdly calls upm_abort on the same xfer, which does
nothing because upm_abort just does usbd_abort_xfer which does
nothing because the xfer status is (e.g.) USBD_IOERROR and not
USBD_IN_PROGRESS.

Thread 2 is now spinning forever with the bus lock held (and possibly
the kernel lock) waiting for queue or xfer status to change, which
will never happen as long as it holds the bus lock.

The resolution is for thread 2 to notice that thread 1 is busy
invoking a callback, and to wait until thread 1 has finished invoking
the callback and updated the xfer status to reset it to
USBD_NOT_STARTED at which point thread 1 can make progress again.

XXX pullup-9
 1.266  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.265  13-Jun-2021  riastradh branches: 1.265.2;
usb(4): Bus exploration is single-threaded -- assert it so.

New usb_in_event_thread(dev) returns true if dev is a USB device --
that is, a device with a usbN ancestor -- and the current thread is
the USB event thread.

(Kinda kludgey to pass around the device_t instead of, say, struct
usbd_bus, but I don't see a good way to get to the usbN device_t or
struct usb_softc from there.)
 1.264  13-Jun-2021  mlelstv Fix last patch.
 1.263  13-Jun-2021  mlelstv Use correct integer lengths for properties.
Change property names vendor -> vendor-id, product -> product-id to match other users.
 1.262  13-Jun-2021  mlelstv Fix non-DIAGNOSTIC build.
 1.261  13-Jun-2021  riastradh usb(4): Tighten interface locking and pipe references.

- Just use a reference count, not a list of pipes.

- Take the reference in usbd_open_pipe*, before we even look up the
endpoint by address; the endpoint is not stable until we hold the
interface and prevent usbd_set_interface.

- Make opening pipes just fail if usbd_set_interface is in progress.
=> No need to block -- might block for a while, and this is
essentially a driver error rather than a legitimate reason to
block.
=> This should maybe be a kassert, but it's not clear that ugen(4)
doesn't have a user-triggerable path to that kassert, so let's
keep it as a graceful failure for now until someone can audit
ugen(4) and make an informed decision.

- No need for a separate interface pipe lock; just use the bus lock.

This is a little bit longer than before, but makes the bracketed
nature of the references a little clearer and introduces more
kasserts to detect mistakes with internal API usage.
 1.260  12-Jun-2021  riastradh usb(4): Nix unused struct usbd_interface::ui_priv.
 1.259  12-Jun-2021  riastradh usb(4): Make usbd_fill_iface_data atomic.

Now either it replaces and frees the old endpoints array, or it
leaves everything in place; it never leaves a partial update nor
requires the caller to free the old array.
 1.258  12-Jun-2021  riastradh usb(4): Merge logic in usbd_kill_pipe and usbd_close_pipe.

usbd_kill_pipe is now just usbd_abort/close_pipe.

No functional change intended.
 1.257  12-Jun-2021  riastradh usb(4): Fix fix for interface change pipe fix.

If there is an interface:
- Always put the pipe on the list in usbd_setup_pipe (if successful).
- Always have the pipe on the list from _before_ upm_open.
- Always keep the pipe on the list to _after_ upm_close, and after
the async task has completed.

This brings the logic in usbd_close_pipe and usbd_kill_pipe closer.
 1.256  12-Jun-2021  riastradh usb(4): Fix races between usbd_open_pipe* and usbd_set_interface.
 1.255  12-Jun-2021  riastradh usb(4): Fix racy endpoint reference counting.

Rules:

1. After usbd_setup_pipe*, must usbd_kill_pipe.
2. After usbd_open_pipe*, must usbd_close_pipe.

Still haven't merged the logic in usbd_kill_pipe and usbd_close_pipe,
but getting closer.
 1.254  12-Jun-2021  riastradh usb(4), uhub(4): Sprinkle usbhist.
 1.253  12-Jun-2021  riastradh usb(4): Sprinkle kernel lock assertions.
 1.252  12-Jun-2021  riastradh usb(4): Verify dev->ud_subdevs is still there before freeing it.

usbd_attachinterfaces may sleep, and if it does, it releases the
kernel lock, in which case another thread may free dev->ud_subdevs.
 1.251  12-Jun-2021  riastradh usb(4): kmem_zalloc(KM_SLEEP) cannot fail; nix error branch.
 1.250  24-Apr-2021  thorpej branches: 1.250.2;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.249  17-Feb-2021  mlelstv branches: 1.249.2;
Expose more descriptor items as device properties.
 1.248  11-Jun-2020  thorpej branches: 1.248.2;
Update for proplib(3) API changes.
 1.247  31-May-2020  maxv Reset ud_ifaces and ud_cdesc to NULL, to prevent use-after-free in
usb_free_device().

Reported-by: syzbot+c7e74d0ae89e9f08f863@syzkaller.appspotmail.com
 1.246  31-May-2020  jdolecek also set ifc->ui_endpoints to NULL in usbd_free_iface_data() when the value
is freed, to make it impossible to re-enter this by mistake

very likely has no effect for the syzbot problem, but good to do nevetheless

Reported-by: syzbot+c555801d6bc0d768f402@syzkaller.appspotmail.com
 1.245  31-May-2020  maxv If we failed because we didn't encounter an endpoint, do not attempt to
read 'ed', because its value is past the end of the buffer, and we thus
perform out-of-bounds accesses.

Detected thanks to vHCI+KASAN. First bug found by USB fuzzing.

Reported-by: syzbot+59e7f6b3f353584ac810@syzkaller.appspotmail.com
 1.244  14-Mar-2020  christos fix more broken kernhist formats (now I got them all).
 1.243  14-Mar-2020  christos revert the 0x% -> %# change for fixed width formats pointed out by uwe.
 1.242  08-Feb-2020  maxv Move three functions into usbdi_util.c, where they belong. No functional
change.
 1.241  03-Oct-2019  maxv branches: 1.241.2;
Fix memory leaks. Was wondering where memory had gone after several hours
of attach/detach with vHCI.
 1.240  15-Sep-2019  maxv Reset ud_pipe0 to NULL before calling usbd_setup_pipe_flags(). If the call
fails we call usbd_remove_device(), which tries to free ud_pipe0, but it
was already freed.

While here, add two sanity checks, to prevent possible surprises.
 1.239  28-Aug-2019  mrg add new usbd_do_request_len() that can allocate a larger than
request size buffer. reimplement usbd_do_request_flags() in
terms of this. use this for fetching string descriptors.

fixes a very strange problem where an axe(4) attaching (either
has ugen(4) or axe(4)) would ask for 2 bytes, usb_mem.c would
allocate a 2 byte fragment, perform the operation, and sometime
shortly afterwards (usually by the time the next allocation
is made for this fragment), would become corrupted (usually
two bytes were written with 0x0304.)

(initial request of 4 bytes also avoids the problem on this
device. it really seems like a HC problem -- host should not
allow the device to write more than req.wLength! nor should
it allow this write to happen after completion.)

avoid an (almost) always double-log in usbd_transfer().
 1.238  21-Aug-2019  mrg convert pairs of USBHIST_CALLED()+USBHIST_LOG*() into
USBHIST_CALLARGS() calls. this reduces the number of
kernel history lines consumed by these callers, and
for the +LOGN versions, add useful log info to a
message that just says "called!".

reduces the line spam which means the total info in a
full log is significantly increased.
 1.237  07-Aug-2019  maxv Introduce USB_DESCRIPTOR_SIZE (3), and fix two bugs:

1) In usbd_find_idesc(), make sure the tables we're reading fit in the
allocated buffer, otherwise small overflow (seen on KASAN, with
bLength=1).
2) Modify usbd_find_edesc(), to fix the same issues as 1).

ok mrg@
 1.236  31-Jul-2019  maxv 1) Make sure we have a complete endpoint descriptor header, otherwise
small overflow.
2) Make sure the total length of the bos descriptor did not change in
the meantime, otherwise severe memory corruption.
3) Make sure we have a complete hid descriptor header, otherwise
small overflow.
4) Error out if the report descriptor is zero-sized, otherwise panic.

ok skrll@ mrg@
 1.235  23-Jul-2019  maxv branches: 1.235.2;
1) If the descriptor length is bigger than the USB string descriptor
itself, error out. Otherwise there is a small overflow (seen on KASAN,
with bLength=255).
2) Make sure we have a config descriptor header, otherwise there are small
overflows (seen on KASAN, with wTotalLength=1).
3) Once we have the complete config descriptor, make sure its size didn't
change in the meantime. Otherwise there could be severe overflows.
4) Make sure we have a bos descriptor header, otherwise overflow, same
as 2).

ok mrg@ skrll@
 1.234  19-Jul-2019  mrg revert previous. meant to delete that change...
 1.233  19-Jul-2019  mrg call ure_stop_locked(), not ure_stop(), from ure_init_locked() to
avoid locking botch. fixes assert reported by sc.dying.
 1.232  06-Jul-2019  maxv Revert previous, for now.
 1.231  06-Jul-2019  maxv Fix two length checks, otherwise a malicious USB key plugged in the
system could trigger overflows, seen with KASAN.
 1.230  12-Feb-2019  rin Do not set p->up_serialise twice in usbd_setup_pipe_flags().
No functional changes.
 1.229  27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.228  23-Oct-2018  manu Make USB port iteration code consistent, always startint at port #1

This complements change in revision 1.140
 1.227  18-Sep-2018  mrg add config_pending usage to uhub and general USB device attachment.

- call config_pending_incr() and config_pending_decr() around attaching
devices against "usbdevif" attribute.

uhub:
- convert sc_explorepending and sc_running to bool. add new sc_first_explore.
- call config_pending_incr() at the start of uhub_attach(). dropped in
uhub_explore(), if this is the first explore.
 1.226  02-Aug-2018  riastradh Fix usb_rem_task_wait API.

- Return whether it removed task from queue or not.
. True if it was on the queue and we intercepted it before it ran.
. False if we could not intercept it: either it wasn't queued,
or it already ran. (Up to caller to distinguish these cases.)
- Pass an optional interlock like callout_halt.

While here, simplify.

ok mrg@
 1.225  29-Jul-2018  riastradh Use usb_rem_task_wait in usbd_kill_pipe.
 1.224  30-Apr-2018  mlelstv branches: 1.224.2;
add missing KERNEL_LOCK protection around autoconf calls.

Also replace NULL argument with curlwp for style.
 1.223  26-Dec-2017  khorben branches: 1.223.2;
Fix typo in a comment
 1.222  08-Dec-2017  khorben Be more defensive towards malicious USB devices

This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.

Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).

Based on an initial patch by Nick Hudson <skrll@NetBSD.org>, thanks!

Fixes PR kern/52383.

XXX pull-up to netbsd-7, netbsd-8

LGTM xtos@
 1.221  28-Oct-2017  pgoyette Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3) format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
but it is possible that I've missed some of them. I would be glad to
update any stragglers that anyone identifies.
 1.220  01-Jun-2017  chs branches: 1.220.2;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.219  14-Mar-2017  christos use x alt format and print vendor and product in hex too
 1.218  19-Jan-2017  skrll Pull across xhci(4) improvemnts from nick-nhusb
 1.217  04-Dec-2016  skrll branches: 1.217.2;
Whitespace
 1.216  06-Sep-2016  skrll Reduce scope of a variable. No functional change.
 1.215  03-Sep-2016  skrll Style. No functional change.
 1.214  03-Sep-2016  skrll Reduce scope of a variable. No functional change.
 1.213  03-Sep-2016  skrll Bail out early from usbd_fill_devinfo if we're not a hub to use less
indentation in the code.

No functional change. Same code before and after.
 1.212  03-Sep-2016  skrll Use __arraycount. No functional change.
 1.211  02-May-2016  skrll branches: 1.211.2;
Remove the "usb_disconnect_port: no device" DIAGNOSTIC message
 1.210  23-Apr-2016  skrll Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.209  21-Apr-2016  skrll autoconf(9) requires the kernel_lock so take it while discovering new
devices.

PR/51081: calling ioctl while attaching wifi device causes a jump to NULL
 1.208  07-Jan-2016  skrll Need sys/kmem.h
 1.207  06-Jan-2016  skrll Get the iManufacturer, iProduct, and iSerialNumber strings before probing
for drivers and cache them for later use. This reduces bus transactions
and fixes attachment for at least two of my umass(4)s.
 1.206  10-Dec-2015  skrll Make this actually compile with USB_DEBUG. oops.
 1.205  10-Dec-2015  skrll Pull across the conversion to usbhist from nick-nhusb.
 1.204  08-Nov-2015  joerg Attach serial number as property to all USB devices having one.
 1.203  26-Oct-2015  skrll Correct a comment. From Robert Sprowson.
 1.202  09-Jul-2015  skrll Fix typo in usbd_attachinterfaces - look for interface drivers when there
is no interface (i.e. default) locator
 1.201  11-Apr-2015  skrll Use NULL not 0 for pointers.

Add a '\n' to a DPRINTF (old style)
 1.200  05-Apr-2015  skrll More debug.
 1.199  27-Mar-2015  skrll Remove '\n' in panic message.
 1.198  21-Sep-2014  christos branches: 1.198.2;
Merge the 3 copies of devlist2h.awk that deal with 16 bit key and value
pairs to the compressed one that matt wrote.
 1.197  12-Sep-2014  skrll Improve USB debugging with USBHIST based on KERNHIST.

Convert some DPRINTFs to USBHIST_LOG and allow usbdebug, ehcidebug and
umassdebug to be changed via sysctl.

Remove the #define mess in usb.h.

This was started by mrg@ and updated by reinoud@
 1.196  17-Feb-2014  skrll branches: 1.196.4;
Re-establish the default pipe after the initial reading of the device
descriptor.

This fixes usbd_new_device so that there is no really need to touch
QHs/EDs in [eo]hci_device_request.

KASSERT the address and maximum packet length now.
 1.195  03-Oct-2013  skrll Simply the code now that all (real) HCDs provide a get_lock method.
 1.194  26-Sep-2013  skrll Remove usbd_do_request_async. It's callback was calling usbd_free_xfer
from softint context.

Adjust callers appropriately

- usbd_clear_endpoint_stall_async is already triggered via a
usb_task, so simply call usbd_do_request.

- uhidev_set_report_async had one caller in ukbd_set_leds.
Convert this usage to use usb_task as well.

Discussed with mrg@
 1.193  14-Sep-2013  jakllsch Add work-in-progress xhci(4) driver code. Currently (mostly) supports
interrupt-driven control, interrupt and bulk transfers at the three USB
2.0 speeds on root hub ports.
 1.192  07-Sep-2013  skrll Reload the full device descriptor after re-establishing the default pipe
with the new address.

Some HCDs, e.g. dwc2, need wMaxPacketSize to be the value returned from
the device to complete transfers after the set address. Opening the pipe
again gives the HCD access to the correct value.
 1.191  21-Aug-2013  jakllsch Use NULL instead of 0 as appropriate.
 1.190  20-Mar-2013  skrll branches: 1.190.6;
Only set wMaxPacketSize to 64 for HS/FS and set to 8 for LS to be within
the USB spec.

Should help PR/46696.

Requesting 64 bytes via wLength is indeed common, but fallback to 8
would probably help.
 1.189  22-Jan-2013  jmcneill default pipe is mpsafe, deal with it
 1.188  22-Jan-2013  jmcneill - Add a USBD_MPSAFE flag to usbd_open_pipe. If not set, acquire KERNEL_LOCK
before invoking xfer callbacks on this pipe.
- Add an extra flags parameter to usb_init_task. If USBD_TASKQ_MPSAFE is not
present, acquire KERNEL_LOCK before invoking the task callback.
 1.187  05-Jan-2013  christos fix debug variables.
- include opt_usb.h in usb.h so that USB_DEBUG gets set properly in it.
- normalize and sort debugging variables
 1.186  05-Jan-2013  christos - need opt_usb.h if depending on USB_DEBUG
- remove trailing whitespace
- add missing KERNEL_RCSID
 1.185  02-Jan-2013  skrll Use NULL not 0 for pointer assignment.
 1.184  11-Dec-2012  skrll DPRINTF improvement - print the address of the pipe we return not where
in memory we return the address (which is mostly useless)
 1.183  15-Jul-2012  mrg branches: 1.183.2;
commit my workaround for PR 46648 for now, as the more involved
fix is not ready yet:

move the clear endpoint stall async call into the task thread,
to avoid trying to call kmem_alloc() from a softint thread.

XXX ideally moving callbacks into the task thread (or perhaps
a different high priority task thread) would be better than this
workaround, once that method is working.
 1.182  10-Jun-2012  mrg merge the jmcneill-usbmp branch. many thanks to jared for the
initial work, and every one else who has tested things for me.
this is largely my fault at this point :-)

the main changes are something like:

- usbd_bus_methods{} gains a get_lock() to enable the
host controller to provide a lock for the USB code.
if the lock isn't provided, old-style protection is
(partially) applied.

- ehci/ohci/uhci have been converted to the new
interfaces, including mutex/cv/etc conversion.

- usbdivar.h contains a discussion about locking and
what locks are held for which method calls. more
to come for usbdi(9) here.

- audio drivers (uaudio, umidi, auvitek) have been
properly SMPified now that USB is ready.

- scsi drivers have been modified to take the kernel
lock explicitly before calling into scsi code.

- usb pipes are associated with a lock, that is the
same as the controller lock. (this could be split
up further in the future.)

- several usbfoo_locked() or usbfoo_unlocked()
functions have been added to the usbdi(9) to
enable functionality with or without the USB
lock (per controller) already being held.

the TODO.usbmp file has specific details on what is left to
do, including what device-specific changes should be done now
that the whole framework is ready.
 1.181  22-May-2012  martin Include opt_usb.h for USB_DEBUG.
 1.180  09-Jun-2011  matt branches: 1.180.2; 1.180.6; 1.180.8;
Move EHCI_DEBUG, OHCI_DEBUG, UHCI_DEBUG, USB_DEBUG, UHUB_DEBUG to opt_usb.h
(ya dependencies).
Cleanup usb_mem.c a little more and add block tracking code. Help find
corruption problems.
Comment out the SPEED check for ETTF. XXX why doesn't that work right?
 1.179  27-May-2011  drochner branches: 1.179.2;
remember the data toggle bit per (bulk) endpoint rather than per
pipe, as required by the spec
This helps in cases where pipes are opened/closed without reconfiguring
the device in between, eg with the ugen driver.
only for UHCI/EHCI, don't have an OHCI to test
 1.178  20-Mar-2011  tsutsui Move MALLOC_DEFINE()s from usb_mem.c to usb_subr.c.
usb_mem.c provides functions for DMA memory allocation
that is required by DMA capable host controllers only,
but MALLOC_DEFINE() isn't DMA specific and could be required
by any USB drivers.

Discussed on current-users.
 1.177  03-Nov-2010  dyoung branches: 1.177.2;
Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),
USB_MATCH(), et cetera. These files produce the same assembly
(according to objdump -d) before and after the change
 1.176  21-Aug-2010  pgoyette Update the various xxx_verbose modules to conform to the module subsystem's
new locking protocol.
 1.175  07-Aug-2010  christos Pass the lengths of the buffers and use bound string functions where easy
to do so.
 1.174  27-Jul-2010  drochner do a port reset between initial device descriptor fetch and
address assignment - not required by the spec but Windows does so,
fixes a problem with a Sun Keyboard reported by Jonathan Perkin,
verified by Jonathan Kollasch
 1.173  25-Jul-2010  pgoyette Move setting of the usb_verbose_loaded flag into the module's init routine.
This ensures that the flag is set even if the module was manually loaded
by the user rather than just auto-loaded.
 1.172  20-Jul-2010  drochner another iteration in the eternal device enumeration struggle:
use a request of 64 bytes for the initial device descriptor fetch.
This is what windows does, and I've seen USB device firmware which
really depends on this. (sends 8 bytes if 64 are requested and
the full descriptor which is more than NetBSD's USB_MAX_IPACKET
otherwise) This is the world...
 1.171  06-Jun-2010  pgoyette Update usbverbose module to use module_autoload() rather than module_load().
Load the module right before each attempt to use its features, and let the
module subsystem handle unloading.
 1.170  29-May-2010  cegger unload usbverbose, not pciverbose
 1.169  29-May-2010  pgoyette Extract USBVERBOSE into a kernel module. The module can be builtin
by defining 'options USBVERBOSE' in the kernel config file (no change
from current behavior), or it can be loaded at boot time on those
architectures that support the boot loader's "load" command.

The module is built for all architectures, whether or not USB support
exists.
 1.168  25-Apr-2010  matthias Fix for PR#42572. I was running with this patch for several month without
any problems.
 1.167  12-Nov-2009  dyoung branches: 1.167.2; 1.167.4;
Re-order operations in usb_detach() so that if a usb(4) instance's
children will not detach, the instance is not left in an inconsistent
state.

If uhub(4) port is disconnected, forcefully detach the children on
that port.

Simplify detachment hooks. (sc_dying must die!)

Pass along and respect detachment flags, esp. DETACH_FORCE,
throughout.
 1.166  12-Nov-2009  uebayasi Style.
 1.165  11-Nov-2009  pooka be a little more verbose in DIAGNOSTIC printf
 1.164  03-Sep-2009  dyoung Expand some of the portability macros from sys/dev/usb/usb_port.h.
There is no change in the generated assembly.
 1.163  16-Aug-2009  martin If we are attaching a high speed device, request a full size descriptor
block - we know the device will be able to handle it already.
This fixes a strange failure mode when attaching a (apparently non standard
conformant) USB ATA device I have, and *should* not cause any harm.
Apparently the device in question answered with the full descriptor despite
our short request - a failure mode not handled gracefully, leading to a
port reset. From Jeremy Morse.
 1.162  18-Aug-2008  kent branches: 1.162.12;
Implement uhub_rescan(). After this change, "modload uaudio.kmod"
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()
 1.161  12-Aug-2008  drochner fix an inconsistency in a check for invalid configuration index vs. value;
noticed by Frank Wille in PR kern/39211, but unrelated to the problem
described (The check can practically never be hit.)
 1.160  28-Jul-2008  drochner -in usbd_probe_and_attach(), split out the code for per-device and
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
 1.159  22-Jun-2008  jmcneill branches: 1.159.2;
PR 39023: usbd_new_device: do not set address early, from FreeBSD.
 1.158  06-Jun-2008  drochner branches: 1.158.2;
oops, forgot to pass locators when I simplified the autoconf code
 1.157  27-May-2008  drochner kill USB_DO_ATTACH
 1.156  26-May-2008  drochner some cleanup:
-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
 1.155  25-May-2008  drochner -make the list of USB child devices a (possibly sparse) array rather
than a zero-terminated list; this makes the code simpler and also
hopefully fixes the recent "childdet" botch, see PR kern/38528
-handle the root hub specially a bit earlier, this allows to kick out
the "submatch" functions completely which needed to second-guess
from the port number (where "0" meant root hub")
(we could handle the root hub specially even earlier, but as done
now big parts of the hub emulation code are exercised regularely,
this would bitrot otherwise)
 1.154  24-May-2008  cube Split device_t and softc for all USB device drivers, and related cosmetic
changes.

Matthias Drochner kindly reviewed this patch, and tested ums, ubt, uaudio
and ral. I tested umass myself.
 1.153  28-Apr-2008  martin branches: 1.153.2;
Remove clause 3 and 4 from TNF licenses
 1.152  05-Apr-2008  cegger branches: 1.152.2; 1.152.4;
use aprint_*_dev and device_xname
 1.151  28-Mar-2008  drochner split device/softc for USB host controllers and the usb (control)
device,
this is hairy stuff, and I've only tested with uhci/ehci at pci,
please test the rest and report problems
 1.150  18-Feb-2008  dyoung branches: 1.150.6;
Use device_t and its accessor functions.

Register _childdetached methods with drivers that attach children.
Wait to set child references to NULL there, instead of doing that
in the detach method.

Replace many uses of USB_DECLARE_DRIVER() with CFATTACH_DECL2().
 1.149  19-Oct-2007  ad branches: 1.149.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.148  30-Jun-2007  mlelstv branches: 1.148.6; 1.148.8; 1.148.12;
Fix typo that prevents port reset after several retries.
 1.147  20-May-2007  mlelstv Retry set_address function for very slow (out of spec) devices, just
like FreeBSD.
 1.146  30-Mar-2007  christos PR/36102: Yojiro UO: Restore revision 1.142's way of reading the descriptor
because uplcom hangs otherwise. Also reported by Anon Ymous.
 1.145  15-Mar-2007  drochner in usbd_set_config_index, range-check the index
 1.144  13-Mar-2007  drochner branches: 1.144.2;
Introduce different autoconf interface attributes for USB drivers
matching (and handling) a whole device and those which match an
interface only. This will allow to enforce some rules, eg that
the former don't use interface information for matching or that the
latter don't modify global device state.
The previous way left too much freedom do the drivers which led to
inconsistencies and abuse.
For now, I've not changed locators and submatch rules, this will
happen later.
There should not be any change in behaviour, except in the case of
some drivers which did behave inconsistently:
if_atu, if_axe, uep: matched the configured device in the interface
stage, but did configuration again. I've converted them to match
in the device stage.
ustir, utoppy: matched in the interface stage, but only against
vendor/device information, and used any configuration/interface
without checking. Changed to match in device stage, and added
some simple code to configure and use the first interface.
If you have one of those devices, please test!
 1.143  26-Feb-2007  drochner branches: 1.143.4; 1.143.6; 1.143.8;
Another attempt to read string descriptors at once, this time with
the largest size which makes sense (254). See rev. 1.114-116 for
possible problems, but that was with len=255 which is an impossible
size for a string descriptor.
Someone with a "kue" please test this.
 1.142  24-Jan-2007  drochner branches: 1.142.2;
There are devices which don't report the "self powered" state correctly
in the device status word (at least Palmpilot; comments in Linux
indicate that there are more).
So don't use this information, just use the bit in the configuration
descriptor we are attempting to set. (It is of little use anyway,
perhaps the code can be simplified further.)
Thanks to Steven M. Bellovin for running some tests with a Palmpilot.
 1.141  19-Jan-2007  drochner In usbd_set_config_index(), remove the code which tries to draw conclusions
from the attempted power state instead of the real one. The configuration
descriptor is a constant thing and doesn't reflect the actual state, so
this doesn't make any sense. The actual state can be read by a device
status read, so use this as the first and only instance and remove
the device specific quirks which were based on wrong assumptions.
(It is possible that one of the 3 devices with quirk entries still
needs some special treatment, but this would need better research. For
now I'd prefer to avoid a quirk database which isn't maintained anyway.)
Btw, don't be confused by messages about self powered hubs which don't
have external power connected. This is legal, see the specs.
 1.140  05-Dec-2006  pavel Add forgotten #include "opt_compat_netbsd.h" because COMPAT_30 is used.
Should fix a build problem reported by Blair Sadewitz.
 1.139  03-Dec-2006  pavel Restore compatibility of USB_DEVICEINFO ioctl and reads from /dev/usb with
NetBSD 3.x. Patch from Stephan Thesing provided in
http://mail-index.netbsd.org/current-users/2006/03/21/0002.html, with some
modifications by me.
See also
http://mail-index.netbsd.org/current-users/2006/08/29/0017.html

The code is conditionally compiled depending on COMPAT_30.

Also fix a leak of struct usb_event in usbread() introduced while converting
on-stack variables to dynamic allocation.

Reviewed by martin@.
 1.138  16-Nov-2006  christos branches: 1.138.2;
__unused removal on arguments; approved by core.
 1.137  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.136  04-Oct-2006  christos fix empty if
 1.135  11-Jun-2006  christos branches: 1.135.6; 1.135.8;
Don't free subdevs on normal completion. The detach code needs it.
 1.134  09-Jun-2006  christos stack police: Don't allocate 1k on the stack, only use malloc when we need to.
 1.133  04-Jun-2006  christos save another 1K on the stack.
 1.132  04-Jun-2006  christos Don't allocate 1K on the stack.
 1.131  23-Nov-2005  augustss branches: 1.131.4; 1.131.6; 1.131.8; 1.131.14;
Normally a ugen device only attaches if no other driver wants the device.
Add the ability to force ugen to attach with very high priority if "flags 1"
is specified. This can be used with the vendor and product locators to
force ugen to be used for certain devices.
Similarly, uhid only attaches if no other HID driver (ums or ukbd) wants it.
Again, "flags 1" will force uhid to attach anyway.
 1.130  21-Sep-2005  nathanw branches: 1.130.6;
usbd_setup_pipe(): Don't call usbd_clear_endpoint_stall(). It's not
necessary for normal devices, and it prevents some common (but
apparantly buggy) devices from working, including the Apple iPod (mini
and photo) and certain M-Systems DiskOnKey flash devices.

If (also buggy) devices resurface that need this when they are
attached, they can be addressed, ideally in each device's driver.
 1.129  26-Aug-2005  drochner s/locdesc_t/int/g
 1.128  19-Jun-2005  enami branches: 1.128.2;
Actually, usbd_trim_spaces was not writing to const memory, so revert
unnecessary changes. Instead, make the caller code easier to read.
After all, it is enough to suppress warning due to constfy.
 1.127  16-Jun-2005  christos Return the beginning of the string, not the end.
 1.126  30-May-2005  christos - const poisoning
- avoid shadowing
- usbd_trim_spaces was writing to const memory; give it a buffer.
 1.125  23-May-2005  soren Sync 1284 id printing with the devinfo change, but leave it disabled for now.
 1.124  11-May-2005  augustss Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows.
 1.123  02-May-2005  augustss Use UTF8 to encode strings read from the device (instead of using '?' for
characters >=0x100).

Also add serial number string to the device information struct.
 1.122  04-Mar-2005  mycroft branches: 1.122.2;
Separate out vendors from the product table, to reduce string duplication.
Saves ~10K.
 1.121  02-Mar-2005  mycroft Copyright maintenance.
 1.120  23-Oct-2004  augustss branches: 1.120.4; 1.120.6;
Keep track of what high speed port (if any) a device belongs to so we can
set the transaction translator fields for the transfer.
Add a gross hack for split transaction completion in the ehci driver that
allows control transfers to be translated. Interrupt transfers do not work.
Warn when any low/full speed device is opened.
 1.119  23-Oct-2004  augustss Make an iterator abstraction for looping through all descriptors.

Move usb_get_string() and make it public.
 1.118  13-Sep-2004  drochner a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
 1.117  08-Sep-2004  drochner remove a redundant check
 1.116  23-Jun-2004  mycroft In the "seemed like a good idea until I found the fatal flaw" department...
Attempting to read a maximum-size string descriptor causes my kue device to go
completely apeshit. So, go back to the original method, but allow the device
to return a shorter string than it claimed.
 1.115  23-Jun-2004  mycroft Whoops, use the correct value for the maximum string descriptor length.
 1.114  23-Jun-2004  mycroft Yes, some devices return incorrect lengths in their string descriptors. Rather
than losing, do what Windows does: just request the maximum size, and allow a
shorter response. Obsoletes the need for UQ_NO_STRINGS, and therefore these
"quirks" are removed.
 1.113  23-Apr-2004  itojun use bounded string ops (snprintf, strl*)
 1.112  22-Apr-2004  itojun sprintf -> snprintf
 1.111  15-Mar-2004  augustss branches: 1.111.2;
Set the device address before reading the device descriptor.
This makes certain non-conforming devices work.
Suggested by Peter Burnett in kern/24716.
 1.110  25-Feb-2004  drochner On disconnect, set the "subdev" pointer to NULL, otherwise
free()d memory will be referenced through
usbd_add_dev_event(USB_EVENT_DEVICE_DETACH)->
usbd_fill_deviceinfo()
later.
might need more review, but at least it doesn't crash on
amd64 anymore
 1.109  28-Jan-2004  augustss Fix pasto.
 1.108  28-Jan-2004  augustss If vendor or product is the empty string, ignore it.
From FreeBSD.
 1.107  05-Jan-2004  augustss Try harder to get initial descriptor. Do a port reset now and then
in the retry loop.
 1.106  23-Sep-2003  mycroft Allow a device to reject CLEAR_FEATURE ENDPOINT_STALL (with a STALL) -- the
assumption being that the device will never use a STALL of a non-control pipe,
I guess.
 1.105  12-Sep-2003  mycroft In usbd_setup_pipe(), check the return value from usbd_clear_endpoint_stall().
 1.104  23-Jun-2003  martin branches: 1.104.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.103  10-Jan-2003  augustss Try to get full device descriptor a few times. This makes some slow
devices work. From FreeBSD.
 1.102  01-Jan-2003  augustss Try getting string descriptors in a slightly different way to works around
some problematic devices. From Alexander Kabaev <kan@FreeBSD.ORG>.
 1.101  01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.100  27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.99  11-Jul-2002  augustss Get rid of trailing white space.
 1.98  20-Feb-2002  christos branches: 1.98.8;
Prefix structure members to protect them against clashes with eg. c++ keywords.
Suggested by Alfred Perlstein, from FreeBSD, ok'd by augustss
 1.97  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.96  22-Nov-2001  augustss Correct a comment.
 1.95  20-Nov-2001  augustss Sanity check max packet lengths.
 1.94  20-Nov-2001  augustss Update for new speed handling.
 1.93  17-Nov-2001  augustss Make it possible to report device speeds with ioctl(USB_DEVICEINFO).
 1.92  16-Nov-2001  augustss Handle devices that disappear during reset gracefully.
 1.91  13-Nov-2001  lukem add RCSIDs
 1.90  10-Nov-2001  augustss Get rid of unused abort_handle.
 1.89  10-Nov-2001  augustss Abort any xfers on the control pipe before closing it on detach.
 1.88  10-Nov-2001  augustss Small portability improvement.
 1.87  15-Aug-2001  augustss branches: 1.87.4;
Add a little infrastructure so that individual drivers can easily check
if thee was a vendor+product locator match.
 1.86  16-May-2001  lukem branches: 1.86.2;
delint: remove unnecessary assignment to same objection (hidden in #define)
 1.85  21-Jan-2001  augustss branches: 1.85.2;
Trim space off both ends of device product and vendor strings.
 1.84  18-Jan-2001  jdolecek constify
 1.83  08-Jan-2001  augustss Cosmetic changes.
 1.82  13-Dec-2000  augustss Don't try to access a device that is being disconnected when generating
the detach event. Fixes (I hope) PR 11713 from itohy@netbsd.org (ITOH Yasufumi).
 1.81  24-Oct-2000  augustss Add a hack to try and figure out if the TI UTUSB41 hub is bus powered
despite claiming to be self powered (it's important to know so that the
power budget can be met).
 1.80  12-Oct-2000  augustss Avoid empty strings for vendor&product.
 1.79  01-Jun-2000  augustss Improve some portability items.
 1.78  01-Jun-2000  augustss Bring the coding style into the 80s, i.e., get rid of __P and use
ANSI prototypes and declarations.
 1.77  31-May-2000  augustss Be more careful when setting the alternate interface.
 1.76  27-Apr-2000  augustss branches: 1.76.2;
Change my email address.
 1.75  23-Apr-2000  augustss Make it possible to move a device to its unconfigured state by
using config #0.
 1.74  21-Apr-2000  augustss Add some comments.
 1.73  21-Apr-2000  augustss Change error reporting in port reset function.
 1.72  14-Apr-2000  augustss Make attach of ugen work as it should so product&vendor locators can be used.
 1.71  29-Mar-2000  augustss Some OpenBSD portability fixes.
 1.70  29-Mar-2000  augustss Do not accept new xfers for queuing while a pipe is aborting.
 1.69  27-Mar-2000  augustss Change (almost) all static to Static. The symbol `Static' can then be defined
to `' or `static' depending on if you want to debug or not.
 1.68  25-Mar-2000  augustss Rename and move around callout handles to make it more sane.
Add some DIAGNOSTIC.
Fix buglet in isoc abort on UHCI.
 1.67  13-Mar-2000  soren Fix doubled 'the's in comments.
 1.66  20-Feb-2000  jdolecek usbd_devinfo_vp(): search the know devs array also if the device
doesn't return product description (e.g. Kye's Genius NetScroll
mouse returns vendor, but not product); the strings
returned by device are still preferred to those in the array, though
 1.65  02-Feb-2000  augustss Change the USB event mechanism to include more information about devices
and drivers. Partly from FreeBSD.
 1.64  01-Feb-2000  augustss Make sure to use delay() in usb_delay_ms() while cold booting.
 1.63  19-Jan-2000  augustss Add an argument to usbd_open_pipe_intr() to specify the polling interval
for an interrupt pipe in case we don't what what the descriptor suggests.
 1.62  16-Jan-2000  augustss Add usbd_reload_device_desc() to get the device descriptor again from a device.
Useful if e.g. downloading firmware updates the revision number.
 1.61  18-Dec-1999  augustss Add another debug printf.
 1.60  15-Dec-1999  augustss Add even more debug output.
 1.59  15-Dec-1999  augustss More debug printfs.
 1.58  06-Dec-1999  augustss Cosmetics and a couple of diagnostic messages.
 1.57  24-Nov-1999  augustss Avoid the special when disconnecting devices with no config descriptor.
It was wrong.
 1.56  18-Nov-1999  augustss Cosmetic changes and some small improvements. From FreeBSD and Nick Hibma.
 1.55  16-Nov-1999  augustss Fix a pointer test that I got wrong in the big code cleanup.
 1.54  16-Nov-1999  augustss Some minor changes from OpenBSD.
 1.53  12-Nov-1999  augustss A number of stylistic changes to increase readability (many suggested
by Nick Hibma):
use NULL not 0
declare all local definitions static
rename s/usbd_request/usbd_xfer/ s/reqh/xfer/
rename s/r/err/
use implicit test for no err
KNF
 1.52  13-Oct-1999  augustss branches: 1.52.2; 1.52.4;
Merge in a large batch of changes from Nick Hibma <hibma@skylink.it> so
the USB stack compiles on FreeBSD again.
 1.51  12-Oct-1999  augustss Fix some bugs in USB controller detach code.
 1.50  12-Oct-1999  augustss Add an event mechanism so that a userland process can watch devices come
and go.
 1.49  11-Oct-1999  augustss Add a quirk for devices that lie about how they are powered.
 1.48  16-Sep-1999  augustss branches: 1.48.2;
More DIAGNOSTIC paranoia.
 1.47  15-Sep-1999  augustss Add preliminary (untested) code for detaching the USB host controller
(needed for CardBus based controllers).
 1.46  13-Sep-1999  augustss Rearrange the code a little so we can decide if we are in process
or interrupt context in a reliable way. Mainly used for DIAGNOSTIC.
 1.45  09-Sep-1999  augustss Change the internal API to allow DMA buffers to be pre-allocated by
the device driver instead of happening automagically in the HC driver.
This affects both the HC-USBD interface as well as the USBD-device
interface.
This change will allow DMA buffers to be reused e.g. in isochronous
traffic.

Add isochronous support to the UHCI driver (not for OHCI yet).
 1.44  05-Sep-1999  augustss Change some printf to DPRINTF for consistency. From Nick Hibma, FreeBSD.
 1.43  05-Sep-1999  augustss Change the way the `struct device' base part of all driver softc are
declared and accessed to make it more portable. Idea from Nick Hibma, FreeBSD.
No functional changes.
 1.42  29-Aug-1999  thorpej Make usbd_errstr() always return a useful error message; it's not like
the strings are that big.
 1.41  28-Aug-1999  augustss Change some 'struct device' to 'bdevice'. From FreeBSD.
 1.40  22-Aug-1999  augustss Move more of the transfer completion processing to HC independent code.
Fix some problems with transfer abort & timeout.
 1.39  19-Aug-1999  augustss Add a utility function, usbd_errstr(), to print error strings. From FreeBSD.
 1.38  17-Aug-1999  augustss Redo the UHCI data toggle handling.
Make sure data toggles get synchronized on open and
when clearing an endpoint stall.
 1.37  17-Aug-1999  augustss Make some small changes to make it compile on OpenBSD.
 1.36  16-Aug-1999  augustss Change the way transfers are dequeued so thet we know that they
are removed from the queue before being deallocated.
 1.35  14-Aug-1999  augustss Some changes from FreeBSD (no functional differences).
 1.34  30-Jun-1999  augustss Totally redo the way device detach is done. It now uses a kernel event
thread and the config detach method.
Squish a number of space leaks on detach.
 1.33  14-Jun-1999  augustss Get rid of a bunch of code that was part of an old USBDI proposal, but that
is unused in our USB stack.

Once upon a time, when I started writing the USB stack for NetBSD, there
was an effort to make a standard for how USB device drivers should interact
with the rest of the USB stack. This effort had contributors from just
about all Un*x camps (but not Micro$oft :). I based my design on one of their
early proposals since I thought it would be a good idea if we could all
share device drivers with a minimum effort. Shortly after I started my work
all the free Un*x people were thrown out of the USBDI work since we did not
pay the USB membership fee. Well, some time has passed now and the work of
the standardization group is almost public again. But alas, the new standard
has grown to be a monster! I do not want to have this as the basis for the
*BSD USB stack; it is far too complicated.
So, since we are not even close to being compilant with the standard, I've
thrown out some old baggage.
 1.32  16-May-1999  augustss Add vendor/product/release locators. Added in frustration as my HID
devices appeared as different devices after some plugging and unplugging. :-)
 1.31  13-May-1999  augustss More DIAGNOSTIC tests.
 1.30  09-May-1999  augustss More debug.
 1.29  18-Mar-1999  augustss branches: 1.29.4;
Initialize pipe structure properly. From Joel Chen <jchen@nc.com>
 1.28  10-Jan-1999  augustss Some minor updates from FreeBSD.
 1.27  08-Jan-1999  augustss Various little fixes from the FreeBSD version.
 1.26  07-Jan-1999  augustss Fix typo in FreeBSD part of the code.
 1.25  07-Jan-1999  augustss Fix some FreeBSD compiler warnings.
 1.24  01-Jan-1999  augustss Fix bug setting up endpoint descriptors for an interface.
 1.23  30-Dec-1998  augustss Split usbd_delay_ms() into two functions, one can be used in
device drivers.
 1.22  29-Dec-1998  augustss Do not blindly assume that a device supports language id 0, instead
ask it what languages it supports.
 1.21  29-Dec-1998  augustss Return more info in ioctl(USB_DEVICEINFO).
 1.20  28-Dec-1998  augustss Send more information to USB attach routines so that they can claim
multiple interfaces.
 1.19  28-Dec-1998  augustss Change the host controller internal API a little and add some incomplete
support for isochronous transfers.
 1.18  26-Dec-1998  augustss Merge changes to make the USB stack work with FreeBSD. The original
diffs from Nick Hibma <n_hibma@freebsd.org>, but with substantial
changes from me.
XXX Not tested on FreeBSD yet.
 1.17  12-Dec-1998  augustss Oops, I commited the wrong version before.
 1.16  12-Dec-1998  augustss Initialize variable to make gcc happy.
 1.15  10-Dec-1998  augustss Change a printf a little.
 1.14  09-Dec-1998  drochner make compile without USB_DEBUG, wrap lines to 80 cols
 1.13  09-Dec-1998  augustss Improvement to the ugen driver.
Better error checking.
Some code rearrengment.
 1.12  08-Dec-1998  augustss Some minor API changes and additions.
 1.11  02-Dec-1998  augustss Add configuration and interface locators.
 1.10  02-Dec-1998  augustss Avoid wrapping lines in attach printfs.
 1.9  25-Nov-1998  augustss Make the copyright header conform to the NetBSD template.
 1.8  21-Nov-1998  augustss Fix some typos.
 1.7  02-Aug-1998  augustss Improve some error messages.
Make some preparations for isochronous transfers.
 1.6  01-Aug-1998  augustss Make sure to abort the interrupt pipe on disconnect of a mouse or keyboard.
Improve some error messages.
 1.5  01-Aug-1998  augustss Switch from a global flag to tell if the host controller should use
polling to a local one for each controller.
 1.4  23-Jul-1998  augustss Use the pipe maximum packet length rather than the device max length when
setting up a transfer.
Update the UHCI data toggle correctly.
 1.3  22-Jul-1998  augustss Loop over all configurations when trying to probe for interface drivers.
 1.2  16-Jul-1998  is Make this compile without USBVERBOSE.
 1.1  12-Jul-1998  augustss Add USB support. Supported so far:
* UHCI and OHCI host controllers on PCI
* Hubs
* HID devices withe special drivers for mouse and keyboard
* Printers
 1.29.4.2  01-Jul-1999  thorpej Sync w/ -current.
 1.29.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.48.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.52.4.1  15-Nov-1999  fvdl Sync with -current
 1.52.2.4  11-Feb-2001  bouyer Sync with HEAD.
 1.52.2.3  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.52.2.2  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.52.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.76.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.85.2.9  15-Jan-2003  thorpej Sync with HEAD.
 1.85.2.8  03-Jan-2003  thorpej Sync with HEAD.
 1.85.2.7  18-Oct-2002  nathanw Catch up to -current.
 1.85.2.6  01-Aug-2002  nathanw Catch up to -current.
 1.85.2.5  28-Feb-2002  nathanw Catch up to -current.
 1.85.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.85.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.85.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.85.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.86.2.6  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.86.2.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.86.2.4  16-Mar-2002  jdolecek Catch up with -current.
 1.86.2.3  11-Feb-2002  jdolecek Sync w/ -current.
 1.86.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.86.2.1  25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.87.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.98.8.1  15-Jul-2002  gehenna catch up with -current.
 1.104.2.7  11-Dec-2005  christos Sync with head.
 1.104.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.104.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.104.2.4  02-Nov-2004  skrll Sync with HEAD.
 1.104.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.104.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.104.2.1  03-Aug-2004  skrll Sync with HEAD
 1.111.2.1  02-Jul-2004  he branches: 1.111.2.1.2;
Pull up revisions 1.114-1.116 (requested by mycroft in ticket #572):
Several fixes mostly related to USB:
o Add a general workaround for devices returning incorrect
lengths in string descriptors, so that we don't need
separate quirk entries for these.
 1.111.2.1.2.1  06-Dec-2005  tron Pull up following revision(s) (requested by riz in ticket #10181):
sys/dev/usb/usb_subr.c: revision 1.130
usbd_setup_pipe(): Don't call usbd_clear_endpoint_stall(). It's not
necessary for normal devices, and it prevents some common (but
apparantly buggy) devices from working, including the Apple iPod (mini
and photo) and certain M-Systems DiskOnKey flash devices.
If (also buggy) devices resurface that need this when they are
attached, they can be addressed, ideally in each device's driver.
 1.120.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.120.4.1  29-Apr-2005  kent sync with -current
 1.122.2.1  06-Oct-2005  tron Pull up following revision(s) (requested by nathanw in ticket #861):
sys/dev/usb/usb_subr.c: revision 1.130
usbd_setup_pipe(): Don't call usbd_clear_endpoint_stall(). It's not
necessary for normal devices, and it prevents some common (but
apparantly buggy) devices from working, including the Apple iPod (mini
and photo) and certain M-Systems DiskOnKey flash devices.
If (also buggy) devices resurface that need this when they are
attached, they can be addressed, ideally in each device's driver.
 1.128.2.6  27-Feb-2008  yamt sync with head.
 1.128.2.5  27-Oct-2007  yamt sync with head.
 1.128.2.4  03-Sep-2007  yamt sync with head.
 1.128.2.3  26-Feb-2007  yamt sync with head.
 1.128.2.2  30-Dec-2006  yamt sync with head.
 1.128.2.1  21-Jun-2006  yamt sync with head.
 1.130.6.1  29-Nov-2005  yamt sync with head.
 1.131.14.1  19-Jun-2006  chap Sync with head.
 1.131.8.1  26-Jun-2006  yamt sync with head.
 1.131.6.1  07-Jun-2006  kardel Sync with head.
 1.131.4.1  09-Sep-2006  rpaulo sync with head
 1.135.8.2  10-Dec-2006  yamt sync with head.
 1.135.8.1  22-Oct-2006  yamt sync with head
 1.135.6.3  01-Feb-2007  ad Sync with head.
 1.135.6.2  12-Jan-2007  ad Sync with head.
 1.135.6.1  18-Nov-2006  ad Sync with head.
 1.138.2.3  24-Jul-2007  liamjfoy Pull up following revision(s) (requested by mlelstv in ticket #780):
sys/dev/usb/usb_subr.c: revision 1.148
Fix typo that prevents port reset after several retries.
 1.138.2.2  25-Jun-2007  liamjfoy Pull up following revision(s) (requested by mlelstv in ticket #745):
sys/dev/usb/usb_subr.c: revision 1.147
Retry set_address function for very slow (out of spec) devices, just
like FreeBSD.
 1.138.2.1  06-Apr-2007  bouyer branches: 1.138.2.1.2;
Pull up following revision(s) (requested by pavel in ticket #556):
sys/dev/usb/ugen.c: revision 1.89
sys/dev/usb/usb.c: revisions 1.92, 1.93
sys/dev/usb/usb_subr.c: revision 1.139, 1.140
sys/dev/usb/usb.h: revision 1.75
sys/dev/usb/usbdi.h: revisions 1.71, 1.72
sys/dev/usb/usbdi.c: revision 1.115, 1.116
sys/dev/usb/uhid.c: revision 1.73
Restore compatibility of USB_DEVICEINFO ioctl and reads from /dev/usb with
NetBSD 3.x. The code is conditionally compiled depending on COMPAT_30.
 1.138.2.1.2.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.142.2.3  15-Apr-2007  yamt sync with head.
 1.142.2.2  24-Mar-2007  yamt sync with head.
 1.142.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.143.8.3  21-Jun-2007  itohy Pullup 1.145-1.147
Most of the changes are already included since I started this work
based on the FreeBSD version.
 1.143.8.2  18-Jun-2007  itohy Pullup 1.144 (attach driver per interface) with #ifdef USB_USE_IFATTACH.
 1.143.8.1  22-May-2007  itohy Overhaul of USB stack, mostly DMA related

This applies to NetBSD 4.99.13 (March 1, 2007)

usbdi(9) interface is based on FreeBSD version, excluding
- removal of portability code

Patch most NetBSD changes, excluding
- DMA memory "reserve", since we don't need contiguous buffers any longer
- volatiles in DMA structure, since it should not be needed
with proper bus_dmamap_sync(9)s

DMA/non-DMA memory management overhaul
- Move all DMA related code to usb_mem.[ch]
(add usb_alloc_buffer_dma(), usb_free_buffer_dma(), etc.).
XXX Should usb_mem.[ch] be renamed as usb_mem_dma.[ch] ?
- Add corresponding non-DMA code to usb_mem_nodma.[ch] .
Currently just use malloc(9).
- Above files are conditionally used by config framework (added
attributes to conf/files and dev/usb/files.usb).
- Add diagnostic panics when resource allocation is requested
on interrupt context.
- Change memory allocations (that require context) from NOWAIT to WAITOK.

Allocate DMA/non-DMA buffer per host interface, not globally.
advantage: Buffers can be freed on detaching host interface.
Activity of a host interface does not affect others.
disadvantages: It possibly consumes more memory.

API changes
- usbd_alloc_xfer() is changed:
old: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev);
new: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev,
usbd_pipe_handle pipe);
- pipe argument of usbd_setup_*xfer() are now unused
XXX the pipe argument should be removed?
- add mapping APIs
- async request will be processed as a task (kernel thread context),
and delayed to some extent
- usbdivar.h: struct usbd_xfer: renamed a member "allocbuf" to "hcbuffer"
(mapped/allocated/refered buffer for HCI driver)
- usb_port.h: change usb_proc_ptr from struct ptoc * to struct lwp *
- usb_port.h: add usb_sigproc_ptr for psignal(9) (struct proc *)
- usb.h: add UE_MAXPKTSZ(ep) and UE_MAXPKTSZ_MASK macros for USB 2.0

changes to USB device drivers
- atu, aue, axe, cdce, cue, kue, rum, udav, upl, ural, url,
uaudio, ubt, ucom, ugen, uhidev, uirda, ulpt, umidi, urio,
uscanner, ustir, utoppy:
* catch up API change of usbd_alloc_xfer()
- umass, usscanner:
* catch up API change of usbd_alloc_xfer()
* eliminate memory copy for large transfer

ohci
- free resources on detach
- add lots of bus_dmamap_sync() operations
- simplify the code of loading std chain
- rewrite code of looking up TD/ITD from DMA addr by using allocation chunk
- add workaround for CMD Tech 670 and 673 chipsets
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

slhci
- allocate xfer and slhci_xfer at once, and simplify relevant code
- add slhci_detach()
- remove second arg of slhci_attach() since it is the same as the first arg.
- add support for "mapping" (no, it doesn't map since it doesn't do DMA)
buffer and mbuf
- add pcmcia frontend
- NOT TESTED, missing hardware

ehci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf
- done only simple test

uhci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

To do
- review, test, debug
- rewrite network drivers to utilize usbd_map_buffer_mbuf()
- rewrite uaudio(4) to eliminate memcpy
- "pipe" argument of usbd_setup_*xfer() should eventually be removed
 1.143.6.1  11-Jul-2007  mjf Sync with head.
 1.143.4.5  23-Oct-2007  ad Sync with head.
 1.143.4.4  15-Jul-2007  ad Sync with head.
 1.143.4.3  27-May-2007  ad Sync with head.
 1.143.4.2  10-Apr-2007  ad Sync with head.
 1.143.4.1  13-Mar-2007  ad Sync with head.
 1.144.2.1  18-Mar-2007  reinoud First attempt to bring branch in sync with HEAD
 1.148.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.148.8.2  23-Mar-2008  matt sync with HEAD
 1.148.8.1  06-Nov-2007  matt sync with HEAD
 1.148.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.149.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.150.6.4  28-Sep-2008  mjf Sync with HEAD.
 1.150.6.3  29-Jun-2008  mjf Sync with HEAD.
 1.150.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.150.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.152.4.7  09-Oct-2010  yamt sync with head
 1.152.4.6  11-Aug-2010  yamt sync with head.
 1.152.4.5  11-Mar-2010  yamt sync with head
 1.152.4.4  16-Sep-2009  yamt sync with head
 1.152.4.3  19-Aug-2009  yamt sync with head.
 1.152.4.2  04-May-2009  yamt sync with head.
 1.152.4.1  16-May-2008  yamt sync with head.
 1.152.2.3  17-Jun-2008  yamt sync with head.
 1.152.2.2  04-Jun-2008  yamt sync with head
 1.152.2.1  18-May-2008  yamt sync with head.
 1.153.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.153.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.158.2.2  31-Jul-2008  simonb Sync with head.
 1.158.2.1  27-Jun-2008  simonb Sync with head.
 1.159.2.1  19-Oct-2008  haad Sync with HEAD.
 1.162.12.1  05-Nov-2013  matt Pull down xhci support from HEAD
 1.167.4.6  12-Jun-2011  rmind sync with head
 1.167.4.5  31-May-2011  rmind sync with head
 1.167.4.4  21-Apr-2011  rmind sync with head
 1.167.4.3  05-Mar-2011  rmind sync with head
 1.167.4.2  03-Jul-2010  rmind sync with head
 1.167.4.1  30-May-2010  rmind sync with head
 1.167.2.4  06-Nov-2010  uebayasi Sync with HEAD.
 1.167.2.3  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.167.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.167.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.177.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.179.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.180.8.1  07-Feb-2014  sborrill Pull up the following revisions(s) (requested by skrll in ticket #1015):
sys/dev/usb/usb_subr.c: revision 1.190, 1.192

Fix PR/48496. Only set wMaxPacketSize to 64 for HS/FS and set to 8 for LS to be within
the USB spec.
Reload the full device descriptor after re-establishing the default pipe
with the new address.
 1.180.6.5  02-Jun-2012  mrg sync to latest -current.
 1.180.6.4  26-Feb-2012  mrg use kpause() in usb{d,}_delay_ms(), and add a version that takes a mutex
 1.180.6.3  09-Dec-2011  mrg - make pipe->close method take the thread lock

- convert usb_taskq to use mutex/cv

- convert needs_explore usage into a cv on the thread lock

- remove KERNEL_*LOCK from uaudio and umidi, since we're supposedly
MPSAFE here now

- use IPL_SCHED instead of IPL_USB (aka biglocked) interrupts

- drop the audio thread lock when calling into usb when it may sleep,
avoiding a deadlock between audiowrite and audioioctl. this fixes
mixerctl -a vs. playing hanging the system
XXX probably need to check this in a bunch more places.
 1.180.6.2  08-Dec-2011  mrg - convert usbd_bus_methods{} and usbd_pipe_methods{} to use
c99 struct initialisers

- move the locks from the pipe to the bus, since we'll need
access to them from bus-level ops

- remove dead-for-years SPLUSBCHECK and replaced it with
asserts that the thread lock is held

- begin to document the locking scheme

- convert usbd_*lock_pipe() into real function-like macros
 1.180.6.1  04-Dec-2011  jmcneill branches: 1.180.6.1.2;
Make ehci mpsafe.
 1.180.6.1.2.4  08-Dec-2011  mrg sync usb_subr.c and usbdivar.h with the branch entirely, and most of
usbdi.c as well.
 1.180.6.1.2.3  08-Dec-2011  mrg merge a few more changes from the main branch.
 1.180.6.1.2.2  08-Dec-2011  mrg merge a few more things from the main branch. uaudio@ohci still works.
 1.180.6.1.2.1  08-Dec-2011  mrg at little closer to the main branch.
 1.180.2.4  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.180.2.3  23-Jan-2013  yamt sync with head
 1.180.2.2  16-Jan-2013  yamt sync with (a bit old) head
 1.180.2.1  30-Oct-2012  yamt sync with head
 1.183.2.4  03-Dec-2017  jdolecek update from HEAD
 1.183.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.183.2.2  23-Jun-2013  tls resync from head
 1.183.2.1  25-Feb-2013  tls resync with head
 1.190.6.2  18-May-2014  rmind sync with head
 1.190.6.1  28-Aug-2013  rmind sync with head
 1.196.4.6  16-Nov-2019  martin Pull up following revision(s) (requested by mrg in ticket #1713):

sys/dev/usb/usbdi.h: revision 1.97 (via patch)
sys/dev/usb/usbdi.c: revision 1.186 (via patch)
sys/dev/usb/usb_subr.c: revision 1.239 (via patch)

add new usbd_do_request_len() that can allocate a larger than
request size buffer. reimplement usbd_do_request_flags() in
terms of this. use this for fetching string descriptors.

fixes a very strange problem where an axe(4) attaching (either
has ugen(4) or axe(4)) would ask for 2 bytes, usb_mem.c would
allocate a 2 byte fragment, perform the operation, and sometime
shortly afterwards (usually by the time the next allocation
is made for this fragment), would become corrupted (usually
two bytes were written with 0x0304.)
(initial request of 4 bytes also avoids the problem on this
device. it really seems like a HC problem -- host should not
allow the device to write more than req.wLength! nor should
it allow this write to happen after completion.)

avoid an (almost) always double-log in usbd_transfer().
 1.196.4.5  08-Aug-2018  martin Pull up following revision(s) (requested by riastradh in ticket #1626):

sys/dev/usb/if_cue.c: revision 1.80
sys/dev/usb/umcs.c: revision 1.11
sys/dev/usb/umcs.c: revision 1.12
sys/dev/usb/if_ural.c: revision 1.56
sys/dev/usb/if_run.c: revision 1.28
sys/dev/usb/if_ural.c: revision 1.57
sys/dev/usb/if_run.c: revision 1.29
sys/dev/usb/uatp.c: revision 1.16
sys/dev/usb/uatp.c: revision 1.17
sys/dev/usb/if_axe.c: revision 1.91
sys/dev/usb/if_axe.c: revision 1.92
sys/dev/usb/if_zyd.c: revision 1.49
sys/dev/usb/if_axen.c: revision 1.15
sys/dev/usb/if_url.c: revision 1.60
sys/dev/usb/if_udav.c: revision 1.54
sys/dev/usb/if_axen.c: revision 1.16
sys/dev/usb/if_udav.c: revision 1.55
sys/dev/usb/if_athn_usb.c: revision 1.28
sys/dev/usb/if_athn_usb.c: revision 1.29
sys/dev/usb/if_urtw.c: revision 1.16
sys/dev/usb/if_urtw.c: revision 1.17
sys/dev/usb/if_cue.c: revision 1.79
sys/dev/usb/if_rum.c: revision 1.62
sys/dev/usb/if_urtwn.c: revision 1.61
sys/dev/usb/if_rum.c: revision 1.63
sys/dev/usb/if_urtwn.c: revision 1.63
sys/dev/usb/usb.c: revision 1.170
sys/dev/usb/usb.c: revision 1.171
sys/dev/usb/if_smsc.c: revision 1.35
sys/dev/usb/if_smsc.c: revision 1.36
sys/dev/usb/if_zyd.c: revision 1.50
sys/dev/usb/if_aue.c: revision 1.144
sys/dev/usb/if_aue.c: revision 1.145
sys/dev/usb/usb_subr.c: revision 1.225
sys/dev/usb/usb_subr.c: revision 1.226
sys/dev/usb/if_upgt.c: revision 1.21
sys/dev/usb/usbdi.h: revision 1.93
sys/dev/usb/if_upgt.c: revision 1.22
sys/dev/usb/if_url.c: revision 1.59
sys/dev/usb/usbdi.h: revision 1.95
sys/dev/usb/if_otus.c: revision 1.34
sys/dev/usb/if_atu.c: revision 1.62
sys/dev/usb/if_otus.c: revision 1.35
sys/dev/usb/if_atu.c: revision 1.63

New function usb_rem_task_wait(dev, task, queue).

If task is scheduled to run, removes it from the queue. If it may
have already begun to run, waits for it to complete. Caller must
guarantee it will not switch to another queue. If caller guarantees
it will not be scheduled again, then usb_rem_task_wait guarantees it
is not running on return.

This will enable us to fix a litany of bugs in detach where we
currently fail to wait for a pending task.

Use usb_rem_task_wait in various drivers.
 1.196.4.4  03-Jan-2018  snj Pull up following revision(s) (requested by khorben in ticket #1541):
sys/dev/usb/usb_subr.c: revision 1.222
Be more defensive towards malicious USB devices
This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.
Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).
Based on an initial patch by Nick Hudson <skrll@NetBSD.org>, thanks!
Fixes PR kern/52383.
 1.196.4.3  05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.196.4.2  06-Feb-2016  snj branches: 1.196.4.2.2;
Pull up following revision(s) (requested by skrll in ticket #1097):
sys/dev/usb/usb.c: revision 1.161
sys/dev/usb/usb_subr.c: revisions 1.207, 1.208
sys/dev/usb/usbdivar.h: revision 1.111
sys/dev/usb/xhci.c: revision 1.33
Get the iManufacturer, iProduct, and iSerialNumber strings before probing
for drivers and cache them for later use. This reduces bus transactions
and fixes attachment for at least two of my umass(4)s.
--
Need sys/kmem.h
 1.196.4.1  16-Nov-2015  msaitoh Pull up following revision(s) (requested by joerg in ticket #1032):
sys/dev/usb/usb_subr.c: revision 1.204
Attach serial number as property to all USB devices having one.
 1.196.4.2.2.3  26-Jan-2017  skrll Sync with HEAD/nhusb
 1.196.4.2.2.2  07-Sep-2016  skrll Sync with HEAD
 1.196.4.2.2.1  06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.198.2.40  28-Aug-2017  skrll Sync with HEAD
 1.198.2.39  03-Jan-2017  skrll Improve handling of roothub device and free up a bus address for LS/FS/HS
controllers.
 1.198.2.38  29-Dec-2016  skrll Take bus lock while removing a device from the bus list and announce
detach once complete (not before)
 1.198.2.37  29-Dec-2016  skrll Whitespace
 1.198.2.36  05-Dec-2016  skrll Sync with HEAD
 1.198.2.35  26-Oct-2016  skrll PR kern/48243 (inconsistant usage of 'up->parent' in usb_subr.c)

Add a KASSERT and comment to explain what's going on.
 1.198.2.34  07-Oct-2016  skrll Sprinkle const
 1.198.2.33  07-Oct-2016  skrll Actually add sshub_p for previous
 1.198.2.32  07-Oct-2016  skrll Make the code match the comment wrt port powered status
 1.198.2.31  05-Oct-2016  skrll Sync with HEAD
 1.198.2.30  02-May-2016  skrll s/kmem_intr_free/kmem_free/ in usbd_setup_pipe_flags
 1.198.2.29  02-May-2016  skrll Remove the DIAGNOSTIC message "usb_disconnect_port: no device". These
can happen normally now.
 1.198.2.28  22-Apr-2016  skrll Sync with HEAD
 1.198.2.27  16-Apr-2016  skrll Explicitly initialise up_serialise to true
 1.198.2.26  19-Mar-2016  skrll Initialise up_serialise to true and add a KASSERT.
 1.198.2.25  08-Mar-2016  skrll Remove "\n" from DPRINTF - it is not required.
 1.198.2.24  06-Feb-2016  skrll More debug
 1.198.2.23  10-Jan-2016  skrll Bring the following change from HEAD

Get the iManufacturer, iProduct, and iSerialNumber strings before probing
for drivers and cache them for later use. This reduces bus transactions
and fixes attachment for at least two of my umass(4)s.
 1.198.2.22  28-Dec-2015  skrll Strictly follow the sequence abort pipe, destroy xfers, and close pipe as
API now requires. Plug some memory leaks in some drivers while doing
this.

Also, remove up_refcnt as it was broken and helped leak more memory.
 1.198.2.21  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.198.2.20  19-Dec-2015  skrll Whitespace.
 1.198.2.19  19-Dec-2015  skrll Improve debug a little.
 1.198.2.18  29-Sep-2015  skrll sizeof KNF
 1.198.2.17  22-Sep-2015  skrll Sync with HEAD
 1.198.2.16  26-Jun-2015  skrll Don't give doing SET_CONFIG if usbd_set_config_index fails to get the
full BOS descriptor. Mark ud_bdesc as NULL instead
 1.198.2.15  06-Jun-2015  skrll Read Binary Object Store descriptor and store to ud_bdesc.

From t-hash
 1.198.2.14  06-Jun-2015  skrll Use USB_IS_SS macro and update a comment.

From t-hash.
 1.198.2.13  06-Jun-2015  skrll Sync with HEAD
 1.198.2.12  07-Apr-2015  skrll Oops. Fix previous.
 1.198.2.11  07-Apr-2015  skrll Deal with super speed port powered reporting. From Takahiro HAYASHI.
 1.198.2.10  06-Apr-2015  skrll Sync with HEAD
 1.198.2.9  21-Mar-2015  skrll Add prefixes to attach_arg structure member names. No functional change.
 1.198.2.8  19-Mar-2015  skrll Do the same as OpenBSD and get rid of the *_handle typedefs and use
plain structures insteads
 1.198.2.7  10-Mar-2015  skrll Remove '\n' from DPRINTF
 1.198.2.6  01-Mar-2015  skrll Convert to USBHIST
 1.198.2.5  05-Dec-2014  skrll KNF. Remove ( ) from return statements.
 1.198.2.4  03-Dec-2014  skrll Replace malloc(9) with kmem(9)
 1.198.2.3  03-Dec-2014  skrll G/C M_USBHC
 1.198.2.2  03-Dec-2014  skrll The grand renaming of structure members.

No functional change.
 1.198.2.1  01-Dec-2014  skrll Add prefixes to method structures member names. No functional change.
 1.211.2.2  20-Mar-2017  pgoyette Sync with HEAD
 1.211.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.217.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.220.2.6  04-Nov-2018  martin Pull up following revision(s) (requested by manu in ticket #1078):

sys/dev/usb/uhub.c: revision 1.140
sys/dev/usb/uhub.c: revision 1.141
sys/dev/usb/usb_subr.c: revision 1.228

Make USB port numbers display consistent

Make sure USB ports numbers are displayed with the first one as number one
and not number zero when rescanning bus. The change makes the display
consistent with the display at boot time USB discovery.

While we are there, make port iteration consistent everywhere in the code,
always starting at one instead of zero.

-

Make USB port iteration code consistent, always startint at port #1
This complements change in revision 1.140
 1.220.2.5  27-Sep-2018  martin Pull up following revision(s) (requested by mrg in ticket #1037):

sys/dev/usb/uhub.c: revision 1.139
sys/external/bsd/dwc2/dwc2.c: revision 1.55
sys/ddb/db_output.c: revision 1.34
sys/ddb/db_command.c: revision 1.160
sys/dev/usb/ehci.c: revision 1.264
sys/dev/usb/xhci.c: revision 1.99
sys/dev/usb/ehci.c: revision 1.265
sys/kern/subr_userconf.c: revision 1.27
sys/dev/usb/ehcivar.h: revision 1.46
sys/dev/usb/ohci.c: revision 1.287
sys/dev/usb/uhci.c: revision 1.284
sys/dev/usb/usbdi.c: revision 1.178
sys/dev/usb/usb.c: revision 1.172
sys/dev/pci/xhci_pci.c: revision 1.14
sys/dev/usb/usb.c: revision 1.173
sys/dev/usb/usb.c: revision 1.174
share/man/man4/usb.4: revision 1.110
sys/ddb/db_command.c: revision 1.159
sys/dev/usb/usb_subr.c: revision 1.227
sys/dev/usb/uhcivar.h: revision 1.56
(all via patch)

consolidate the handling of polling across HC drivers, and generic USB:
- don't take mutexes if polling
- normalise the code across all drivers
- add some not yet code to block discovery to/from polling
- minor CSE
- adjust comment for usbd_set_polling() to reality now i properly
understand what it is used for and why.

this, with a hack to make RB_ASKNAME to wait 5 seconds allows boot -a
work with USB keyboards. there are still multiple issues remaining:
- discovery and polling need to be mutually exclusive
- attachment of ukbd and wskbd is not handled by config_pending, and
the 5 second delay isn't going to always be enough.

call cnpollc(1) and cnpollc(0) around cngetc().
(christos has a good idea to add a function that does all 3,
and we should switch all the callers in this sequence to use
it (and fix the MD ones missing it still). not all can, as
eg, line-grabbing functions can use cngetsn(), which only
calls cnpollc() twice.)


When this file is used when not building the kernel (eg: /usr/sbin/crash)
make cnpollc() go away.


reorder some struct members to remove holes.


add config_pending usage to uhub and general USB device attachment.
- call config_pending_incr() and config_pending_decr() around attaching
devices against "usbdevif" attribute.

uhub:
- convert sc_explorepending and sc_running to bool. add new sc_first_explore.
- call config_pending_incr() at the start of uhub_attach(). dropped in
uhub_explore(), if this is the first explore.


implement a gross hack to fix "boot -a" on systems with usb keyboards on
systems with ehci handover to uhci (and maybe ohci), and fix a similar
problem for "boot -s".

there is effort to ensure that all devices attached via USB are probed
before RB_ASKNAME or RB_SINGLE attempts to ask any questions on the console,
and largely this works, often by chance, today, for USB disks and root.
i've recently pushed this more into uhub and general USB device attachment
as well, and kept a config_pending reference across the first explore of
a bus. these fix many issues with directly attached hubs.

however, on systems where devices connected to ehci ports are handed over
to a companion uhci or ohci port, it may not be the first, or even second,
bus explore that finds the device finally before attachment, and at this
point all config_pending references are dropped.

there is no direct communication between drivers, the potentials are
looked up but their device_t is only used for generic things like the name,
so informing the correct companion to expect a device and deal with the
config_pending references is not possible without some fairly ugly layer
violations or multi-level callbacks (eg, we have "ehci0", and usually an
the relevant companion, eg, "uhci2", but it is the uhub that uhci2 has
attached that will deal with the device attachment.)

with the above fixes to generic USB code, the disown happens during the
first explore. the hack works by, at this point, checking if (a) root
is not mounted, (b) single user or ask name are set, and (c) if the hack
as not been triggered already. if all 3 conditions are true, then a
config_pending_incr() is called and a callback is triggered for (default)
5 seconds to call config_pending_decr(). ehci detach pauses waiting for
this callback if scheduled.

this allows enough time for the uhub and the ukbd/wskbd to attach before
the RK_ASKROOT prompts appear. testing shows it takes between 1.5 and
2 seconds for the keyboard to appear after the disown occurs.

Index: dev/usb/ehcivar.c
- new sc_compcallout, sc_compcallout, sc_complock, and a state for th
handover hack.

Index: dev/usb/ehci.c
ehci_init():
- use aprint_normal_dev() instead of manual device_xname().
- initialise sc_compcallout, sc_compcallout, sc_complock, and sc_comp_state.
ehci_detach():
- if there are companion controllers, tear own the above, including waiting
if there is a callback scheduled.
ehci_disown_callback():
- new callout to call config_pending_decr() in the the future.
schedule this ca
ehci_disown_sched_callback():
- if booting to single user or asking names, call config_pending_incr() and
schedule the callout above, default 5 second delay.
ehci_disown():
- if disowning a port call ehci_disown_sched_callback().
deal with partial attach failures in usb_attach vs usb_detach aka PR 53598.
- make sure xhci's sc->sc_ios is NULL if failure happens.
- rearrange usb_attach() / usb_doattach() to make it simpler to clean up.
- move usb_async_intr softint into usb_once_init(). previously, each USB
controller would start a new one, and leave the old one leaked.
- handle controller interrupts without a bus attached


remove usb(4)'s "flags 1" code. it has been dead for a while,
as it runs during the interrupts part of configuration now,
and all the devices try attach as early as possible, including
any root or boot required disk or keyboard device, which is
what this flag was for.
 1.220.2.4  26-Aug-2018  martin Pull up following revision(s) (requested by mlelstv in ticket #990):

sys/dev/usb/usb_subr.c: revision 1.224

add missing KERNEL_LOCK protection around autoconf calls.

Also replace NULL argument with curlwp for style.
 1.220.2.3  08-Aug-2018  martin Pull up following revision(s) (requested by riastradh in ticket #963):

sys/dev/usb/if_cue.c: revision 1.80
sys/dev/usb/umcs.c: revision 1.11
sys/dev/usb/umcs.c: revision 1.12
sys/dev/usb/if_ural.c: revision 1.56
sys/dev/usb/if_run.c: revision 1.28
sys/dev/usb/if_ural.c: revision 1.57
sys/dev/usb/if_run.c: revision 1.29
sys/dev/usb/uatp.c: revision 1.16
sys/dev/usb/uatp.c: revision 1.17
sys/dev/usb/if_axe.c: revision 1.91
sys/dev/usb/if_axe.c: revision 1.92
sys/dev/usb/if_zyd.c: revision 1.49
sys/dev/usb/if_axen.c: revision 1.15
sys/dev/usb/if_url.c: revision 1.60
sys/dev/usb/if_udav.c: revision 1.54
sys/dev/usb/if_axen.c: revision 1.16
sys/dev/usb/if_udav.c: revision 1.55
sys/dev/usb/if_athn_usb.c: revision 1.28
sys/dev/usb/if_athn_usb.c: revision 1.29
sys/dev/usb/if_urtw.c: revision 1.16
sys/dev/usb/if_urtw.c: revision 1.17
sys/dev/usb/if_cue.c: revision 1.79
sys/dev/usb/if_rum.c: revision 1.62
sys/dev/usb/if_urtwn.c: revision 1.61
sys/dev/usb/if_rum.c: revision 1.63
sys/dev/usb/if_urtwn.c: revision 1.63
sys/dev/usb/usb.c: revision 1.170
sys/dev/usb/usb.c: revision 1.171
sys/dev/usb/if_smsc.c: revision 1.35
sys/dev/usb/if_smsc.c: revision 1.36
sys/dev/usb/if_zyd.c: revision 1.50
sys/dev/usb/if_aue.c: revision 1.144
sys/dev/usb/if_aue.c: revision 1.145
sys/dev/usb/usb_subr.c: revision 1.225
sys/dev/usb/usb_subr.c: revision 1.226
sys/dev/usb/if_upgt.c: revision 1.21
sys/dev/usb/usbdi.h: revision 1.93
sys/dev/usb/if_upgt.c: revision 1.22
sys/dev/usb/if_url.c: revision 1.59
sys/dev/usb/usbdi.h: revision 1.95
sys/dev/usb/if_otus.c: revision 1.34
sys/dev/usb/if_atu.c: revision 1.62
sys/dev/usb/if_otus.c: revision 1.35
sys/dev/usb/if_atu.c: revision 1.63

New function usb_rem_task_wait(dev, task, queue).

If task is scheduled to run, removes it from the queue. If it may
have already begun to run, waits for it to complete. Caller must
guarantee it will not switch to another queue. If caller guarantees
it will not be scheduled again, then usb_rem_task_wait guarantees it
is not running on return.

This will enable us to fix a litany of bugs in detach where we
currently fail to wait for a pending task.

Use usb_rem_task_wait in various drivers.
 1.220.2.2  21-Dec-2017  snj Pull up following revision(s) (requested by khorben in ticket #447):
sys/dev/usb/usb_subr.c: revision 1.222
Be more defensive towards malicious USB devices
This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.
Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).
Based on an initial patch by Nick Hudson <skrll@NetBSD.org>, thanks!
Fixes PR kern/52383.
 1.220.2.1  02-Nov-2017  snj Pull up following revision(s) (requested by pgoyette in ticket #335):
share/man/man9/kernhist.9: 1.5-1.8
sys/arch/acorn26/acorn26/pmap.c: 1.39
sys/arch/arm/arm32/fault.c: 1.105 via patch
sys/arch/arm/arm32/pmap.c: 1.350, 1.359
sys/arch/arm/broadcom/bcm2835_bsc.c: 1.7
sys/arch/arm/omap/if_cpsw.c: 1.20
sys/arch/arm/omap/tiotg.c: 1.7
sys/arch/evbarm/conf/RPI2_INSTALL: 1.3
sys/dev/ic/sl811hs.c: 1.98
sys/dev/usb/ehci.c: 1.256
sys/dev/usb/if_axe.c: 1.83
sys/dev/usb/motg.c: 1.18
sys/dev/usb/ohci.c: 1.274
sys/dev/usb/ucom.c: 1.119
sys/dev/usb/uhci.c: 1.277
sys/dev/usb/uhub.c: 1.137
sys/dev/usb/umass.c: 1.160-1.162
sys/dev/usb/umass_quirks.c: 1.100
sys/dev/usb/umass_scsipi.c: 1.55
sys/dev/usb/usb.c: 1.168
sys/dev/usb/usb_mem.c: 1.70
sys/dev/usb/usb_subr.c: 1.221
sys/dev/usb/usbdi.c: 1.175
sys/dev/usb/usbdi_util.c: 1.67-1.70
sys/dev/usb/usbroothub.c: 1.3
sys/dev/usb/xhci.c: 1.75
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: 1.34
sys/kern/kern_history.c: 1.15
sys/kern/kern_xxx.c: 1.74
sys/kern/vfs_bio.c: 1.275-1.276
sys/miscfs/genfs/genfs_io.c: 1.71
sys/sys/kernhist.h: 1.21
sys/ufs/ffs/ffs_balloc.c: 1.63
sys/ufs/lfs/lfs_vfsops.c: 1.361
sys/ufs/lfs/ulfs_inode.c: 1.21
sys/ufs/lfs/ulfs_vnops.c: 1.52
sys/ufs/ufs/ufs_inode.c: 1.102
sys/ufs/ufs/ufs_vnops.c: 1.239
sys/uvm/pmap/pmap.c: 1.37-1.39
sys/uvm/pmap/pmap_tlb.c: 1.22
sys/uvm/uvm_amap.c: 1.108
sys/uvm/uvm_anon.c: 1.64
sys/uvm/uvm_aobj.c: 1.126
sys/uvm/uvm_bio.c: 1.91
sys/uvm/uvm_device.c: 1.66
sys/uvm/uvm_fault.c: 1.201
sys/uvm/uvm_km.c: 1.144
sys/uvm/uvm_loan.c: 1.85
sys/uvm/uvm_map.c: 1.353
sys/uvm/uvm_page.c: 1.194
sys/uvm/uvm_pager.c: 1.111
sys/uvm/uvm_pdaemon.c: 1.109
sys/uvm/uvm_swap.c: 1.175
sys/uvm/uvm_vnode.c: 1.103
usr.bin/vmstat/vmstat.c: 1.219
Reorder to test for null before null deref in debug code
--
Reorder to test for null before null deref in debug code
--
KNF
--
No need for '\n' in UVMHIST_LOG
--
normalise a BIOHIST log message
--
Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...
(As proposed on tech-kern@ with additional changes and enhancements.)
Details of changes:
* All history arguments are now stored as uintmax_t values[1], both in
the kernel and in the structures used for exporting the history data
to userland via sysctl(9). This avoids problems on some architectures
where passing a 64-bit (or larger) value to printf(3) can cause it to
process the value as multiple arguments. (This can be particularly
problematic when printf()'s format string is not a literal, since in
that case the compiler cannot know how large each argument should be.)
* Update the data structures used for exporting kernel history data to
include a version number as well as the length of history arguments.
* All [2] existing users of kernhist(9) have had their format strings
updated. Each format specifier now includes an explicit length
modifier 'j' to refer to numeric values of the size of uintmax_t.
* All [2] existing users of kernhist(9) have had their format strings
updated to replace uses of "%p" with "%#jx", and the pointer
arguments are now cast to (uintptr_t) before being subsequently cast
to (uintmax_t). This is needed to avoid compiler warnings about
casting "pointer to integer of a different size."
* All [2] existing users of kernhist(9) have had instances of "%s" or
"%c" format strings replaced with numeric formats; several instances
of mis-match between format string and argument list have been fixed.
* vmstat(1) has been modified to handle the new size of arguments in the
history data as exported by sysctl(9).
* vmstat(1) now provides a warning message if the history requested with
the -u option does not exist (previously, this condition was silently
ignored, with only a single blank line being printed).
* vmstat(1) now checks the version and argument length included in the
data exported via sysctl(9) and exits if they do not match the values
with which vmstat was built.
* The kernhist(9) man-page has been updated to note the additional
requirements imposed on the format strings, along with several other
minor changes and enhancements.
[1] It would have been possible to use an explicit length (for example,
uint64_t) for the history arguments. But that would require another
"rototill" of all the users in the future when we add support for an
architecture that supports a larger size. Also, the printf(3)
format
specifiers for explicitly-sized values, such as "%"PRIu64, are much
more verbose (and less aesthetically appealing, IMHO) than simply
using "%ju".
[2] I've tried very hard to find "all [the] existing users of
kernhist(9)"
but it is possible that I've missed some of them. I would be glad
to
update any stragglers that anyone identifies.
--
For some reason this single kernel seems to have outgrown its declared
size as a result of the kernhist(9) changes. Bump the size.
XXX The amount of increase may be excessive - anyone with more detailed
XXX knowledge please feel free to further adjust the value
appropriately.
--
Misssed one cast of pointer --> uintptr_t in previous kernhist(9) commit
--
And yet another one. :(
--
Use correct mark-up for NetBSD version.
--
More improvements in grammar and readability.
--
Remove a stray '"' (obvious typo) and add a couple of casts that are
probably needed.
--
And replace an instance of "%p" conversion with "%#jx"
--
Whitespace fix. Give Bl tag table a width. Fix Xr.
 1.223.2.5  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.223.2.4  30-Sep-2018  pgoyette Ssync with HEAD
 1.223.2.3  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.223.2.2  02-May-2018  pgoyette Synch with HEAD
 1.223.2.1  29-Mar-2018  pgoyette Split out the usb compat_30 code and add it to the module
 1.224.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.224.2.1  10-Jun-2019  christos Sync with HEAD
 1.235.2.1  01-Sep-2019  martin Pull up following revision(s) (requested by mrg in ticket #135):

distrib/sets/lists/comp/mi 1.2279
distrib/sets/lists/modules/mi 1.123
share/man/man9/Makefile 1.438
share/man/man9/usbnet.9 1.1-1.9
sys/dev/ic/rndisreg.h 1.3
sys/dev/usb/TODO 1.47-1.52
sys/dev/usb/TODO.usbmp 1.15,1.16
sys/dev/usb/files.usb 1.157-1.167
sys/dev/usb/if_aue.c 1.155-1.161
sys/dev/usb/if_auereg.h 1.30-1.32
sys/dev/usb/if_axe.c 1.103-1.119
sys/dev/usb/if_axen.c 1.51-1.53,1.55-1.67
sys/dev/usb/if_axenreg.h 1.15
sys/dev/usb/if_cdce.c 1.54-1.67
sys/dev/usb/if_cue.c 1.85,1.86
sys/dev/usb/if_cuereg.h 1.23
sys/dev/usb/if_kue.c 1.97-1.100
sys/dev/usb/if_kuereg.h 1.23,1.24
sys/dev/usb/if_mue.c 1.51-1.55
sys/dev/usb/if_muereg.h 1.6
sys/dev/usb/if_muevar.h 1.9
sys/dev/usb/if_smsc.c 1.46-1.61
sys/dev/usb/if_smscreg.h 1.6
sys/dev/usb/if_smscvar.h delete
sys/dev/usb/if_udav.c 1.60-1.71
sys/dev/usb/if_udavreg.h 1.14,1.15
sys/dev/usb/if_upl.c 1.65,1.66
sys/dev/usb/if_ure.c 1.15-1.31
sys/dev/usb/if_urevar.h 1.4,1.5
sys/dev/usb/if_url.c 1.67-1.70
sys/dev/usb/if_urlreg.h 1.14
sys/dev/usb/if_urndis.c 1.22-1.33
sys/dev/usb/if_urtwn.c 1.72
sys/dev/usb/ohci.c 1.290
sys/dev/usb/uhub.c 1.143
sys/dev/usb/usb.c 1.180
sys/dev/usb/usb.h 1.118
sys/dev/usb/usb_mem.c 1.71
sys/dev/usb/usb_subr.c 1.238,1.239
sys/dev/usb/usbdevs 1.772
sys/dev/usb/usbdi.c 1.183,1.186
sys/dev/usb/usbdi.h 1.97
sys/dev/usb/usbdi_util.c 1.75
sys/dev/usb/usbhist.h 1.5,1.6
sys/dev/usb/usbnet.c 1.1-1.24
sys/dev/usb/usbnet.h 1.1-1.14
sys/dev/usb/usbroothub.c 1.9
sys/dev/usb/xhci.c 1.109,1.110
sys/modules/Makefile 1.223
sys/modules/usbnet/Makefile 1.1

usbnet(9): Add common framework for USB network devices.
This bring various safety fixes to all updated drivers,
and includes locking clean up, detach safety when being
used or not, separate rx/tx locks to improve performance,
porting to NET_MPSAFE, many edge/error case bugs in
drivers fixed, as well as resovling PRs 54303 and 54308.
These drivers are converted: axe(4), axen(4), aue(4),
cdce(4), cue(4), kue(4), mue(4), smsc(4), udav(4),
upl(4), ure(4), url(4), and urndis(4).
 1.241.2.1  29-Feb-2020  ad Sync with head.
 1.248.2.1  03-Apr-2021  thorpej Sync with HEAD.
 1.249.2.2  02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.249.2.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.250.2.1  17-Jun-2021  thorpej Sync w/ HEAD.
 1.265.2.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed