History log of /freebsd-current/sys/dev/usb/controller/usb_controller.c
Revision Date Author Comments
# 80828c6f 25-May-2024 Joshua Kinard <freebsd@kumba.dev>

kern: Remove leftover saf1761otg bits

Almost all code related to the saf1761 driver was removed in commit
44796b7e822e, except for two small bits related to saf1761otg support.
This patch completes the removal.

PR: 279302
Signed-off-by: Joshua Kinard <freebsd@kumba.dev>
Reviewed by: mhorne
MFC after: 3 days
Fixes: 44796b7e822e ("mips: remove saf1761")


# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 8758aabb 07-Oct-2022 Hans Petter Selasky <hselasky@FreeBSD.org>

usb(4): Make the enumeration thread nice time a variable.

Depends on "options USB_DEBUG".

Suggested by: koobs@
MFC after: 1 week
Sponsored by: NVIDIA Networking


# 55a3bd00 09-Jun-2022 Hans Petter Selasky <hselasky@FreeBSD.org>

usb(4): Make sure the enumeration thread doesn't loop too fast.

MFC after: 1 week
Sponsored by: NVIDIA Networking


# bc9372d7 06-May-2022 John Baldwin <jhb@FreeBSD.org>

usb: Remove unused devclass arguments to DRIVER_MODULE.


# c6df6f53 09-Dec-2021 Warner Losh <imp@FreeBSD.org>

Create wrapper for Giant taken for newbus

Create a wrapper for newbus to take giant and for busses to take it too.
bus_topo_lock() should be called before interacting with newbus routines
and unlocked with bus_topo_unlock(). If you need the topology lock for
some reason, bus_topo_mtx() will provide that.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D31831


# 9dd3156e 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

usb: clean up empty lines in .c and .h files


# f8d2b1f3 15-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked). Use it in
preparation for a general review of all nodes.
This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Reviewed by: hselasky, kib
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D23632


# 58d5c511 27-Jul-2018 Warner Losh <imp@FreeBSD.org>

Remove Atmel AT91RM9200 and AT91SAM9 support.

The last known robust version of this code base was FreeBSD 8.2. There
are no users of this on current, and all users of it have abandoned
this platform or are in legacy mode with a prior version of FreeBSD.

All known users on arm@ approved this removal, and there were no
objections.

Differential Revision: https://reviews.freebsd.org/D16312


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# 43ea03d7 13-Aug-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve the realtime properties of USB transfers for embedded systems
like RPI-B and RPI-2.

Description of problem:
USB transfers can process data in their callbacks sometimes causing
unacceptable latency for other USB transfers. Separate BULK completion
callbacks from CONTROL, INTERRUPT and ISOCHRONOUS callbacks, and give
BULK completion callbacks lesser execution priority than the
others. This way USB audio won't be interfered by heavy USB ethernet
usage for example.

Further serve USB transfer completion in a round robin fashion,
instead of only serving the most CPU hungry. This has been done by
adding a third flag to USB transfer queue structure which keeps track
of looping callbacks. The "command" callback function then decides
what to do when looping.

MFC after: 2 weeks


# b78e84d1 13-Jan-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Resolve a special case deadlock: When two or more threads are
simultaneously detaching kernel drivers on the same USB device we can
get stuck in the "usb_wait_pending_ref_locked()" function because the
conditions needed for allowing detach are not met. The "destroy_dev()"
function waits for all system calls involving the given character
device to return. Character device system calls may lock the USB
enumeration lock, which is also held when "destroy_dev()" is
called. This can sometimes lead to a deadlock not noticed by
WITNESS. The current solution is to ensure the calling thread is the
only one holding the USB enumeration lock and prevent other threads
from getting refs while a USB device detach is ongoing. This turned
out not to be sufficient. To solve this deadlock we could use
"destroy_dev_sched()" to schedule the device destruction in the
background, but then we don't know when it is safe to free() the
private data of the character device. Instead a callback function is
executed by the USB explore process to kill off any leftover USB
character devices synchronously after the USB device explore code is
finished and the USB enumeration lock is no longer locked. This makes
porting easier and also ensures us that character devices must
eventually go away after a USB device detach.

While at it ensure that "flag_iserror" is only written when "priv_mtx"
is locked, which is protecting it.

MFC after: 5 days


# b217d184 05-Jan-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Add 64-bit DMA support in the XHCI controller driver.
- Fix some comments and whitespace while at it.

MFC after: 1 month
Submitted by: marius@


# ece4b0bd 05-Jan-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Make a bunch of USB debug SYSCTLs tunable, so that their value(s) can
be set before the USB device(s) are probed.


# f80ccb40 09-Oct-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Refine support for disabling USB enumeration to allow device detach
and suspend and resume of existing devices.

MFC after: 2 weeks


# c38aa253 08-Oct-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for disabling USB enumeration in general or on selected
USB HUBs.

MFC after: 2 weeks


# c6549428 05-Aug-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Rename driver name a bit to avoid unit number confusion in dmesg.

MFC after: 3 days


# af3b2549 27-Jun-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Pull in r267961 and r267973 again. Fix for issues reported will follow.


# 37a107a4 27-Jun-2014 Glen Barber <gjb@FreeBSD.org>

Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

1) no output from sysctl(8)
2) erroneously returning ENOMEM with tools like truss(1)
or uname(1)
truss: can not get etype: Cannot allocate memory


# 3da1cf1e 27-Jun-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies


# cabe79d9 10-Jun-2014 Marius Strobl <marius@FreeBSD.org>

Avoid the USB device disconnected and controller shutdown clutter on system
shutdown by putting the former under !rebooting and turning the latter into
debug messages.

Reviewed by: hps
MFC after: 1 week
Sponsored by: Bally Wulff Games & Entertainment GmbH


# d64e9217 08-Jun-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Resolve a deadlock setting the USB configuration index from userspace
on USB HUBs by moving the code into the USB explore threads. The
deadlock happens because child devices of the USB HUB don't have the
expected reference count when called from outside the explore
thread. Only the HUB device itself, which the IOCTL interface locks,
gets the correct reference count.

MFC after: 3 days


# 4a4da38f 07-Jun-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Make WITNESS happy by giving USB mutexes different names.

Reported by: trociny @
MFC after: 3 days


# 0b4dc07d 29-May-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

Hook the ISP/SAF1761 driver into MIPS kernel builds.
- Update FDT file for BERI DE4 boards.
- Add needed kernel configuration keywords.
- Rename module to saf1761otg so that the device unit number does not
interfere with the hardware ID in dmesg.

Sponsored by: DARPA, AFRL


# 2fe7ad87 18-May-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

- Add softc pointer argument to FIFO functions as an optimisation.
- Implement support for interrupt filters in the DWC OTG driver, to
reduce the amount of CPU task switching when only feeding the FIFOs.
- Add common spinlock to the USB bus structure.

MFC after: 2 weeks


# 39c913fb 16-May-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

- Allow the SAF1761 driver to attach to the root HUB USB driver.

Sponsored by: DARPA, AFRL


# 468f354b 07-Dec-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix typos.

Found by: remko


# 563ab081 06-Dec-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve the XHCI command timeout recovery handling code.

MFC after: 1 week


# 751aaf5a 23-Apr-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Add convenience wrapper functions to run callbacks in the context of the
USB explore thread.


# a18a7a41 12-Feb-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Resolve a LOR after r246616. Protect control requests using the USB device
enumeration lock. Make sure all callers of usbd_enum_lock() check the return
value. Remove the control transfer specific lock. Bump the FreeBSD version
number, hence external USB modules may need to be recompiled due to a USB
device structure change.

MFC after: 1 week


# 9b3a48ee 05-Feb-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Add defines to more easily allow a single threaded version of the FreeBSD
USB stack. This is useful for non-kernel purposes, like the loader.


# 61bfd867 30-Jan-2013 Sofian Brabez <sbz@FreeBSD.org>

Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays

Reviewed by: cognet
Approved by: cognet


# d2b99310 30-Jan-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

Modify the FreeBSD USB kernel code so that it can be compiled directly
into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems
or embedded platforms. This is also useful for out of the system compilation
of the FreeBSD USB stack for various purposes. The USB kernel files can
now optionally include a global header file which should include all needed
definitions required to compile the FreeBSD USB stack. When the global USB
header file is included, no other USB header files will be included by
default.

Add new file containing the USB stack configuration for the
FreeBSD loader build.

Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all
USB files follow the same style.

Use cases:
- console in loader via USB
- loading kernel via USB

Discussed with: Hiroki Sato, hrs @ EuroBSDCon


# 83cadd7d 26-Oct-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.
Rearrange the tunables and belonging sysctl declarations, so
that they are next to eachother.

Submitted by: n_hibma @
MFC after: 1 week


# 268ae63a 09-Sep-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for DWC OTG.


# 02f728af 03-Mar-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Make sure that the USB system suspend event is executed synchronously
and not asynchronously. This fixes problems related to USB system
suspend and resume. It is assumed that we are always allowed to sleep
from the device_suspend() method.

MFC after: 1 week
Submitted by: jkim


# 6bbe7cdf 02-Jan-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Make sure we probe and attach the root HUB after
resume else no devices will appear again.

MFC after: 1 day


# d42cc946 23-Dec-2011 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

- Enable usbus on octusb


# d63cc02d 19-Dec-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Make the recently added "no_shutdown_wait" sysctl writeable.

Suggested by: avg @
MFC after: 3 days


# 5ed294ae 19-Dec-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Add code to wait for USB shutdown to be executed at system shutdown.
Add sysctl which can be used to skip this waiting.

MFC after: 3 days


# 6bd3e535 19-Dec-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Add missing unlock of USB controller's lock, when
doing shutdown, suspend and resume.

Suggested by: avg @
MFC after: 3 days


# 2e141748 13-Dec-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement better support for USB controller suspend and resume.

This patch should remove the need for kldunload of USB
controller drivers at suspend and kldload of USB controller
drivers at resume.

This patch also fixes some build issues in avr32dci.c

MFC after: 2 weeks


# 6472ac3d 07-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


# ccac019a 26-Feb-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

- Correct USB 3.0 wire-speed to 5.0Gbps

MFC after: 3 days
Approved by: thompsa (mentor)


# 88334428 09-Feb-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Minor cleanup:
- use device_printf() instead of printf() to give more accurate warnings.
- use memcpy() instead of bcopy().
- add missing #if's for non-FreeBSD compilation.

Approved by: thompsa (mentor)


# 8be09334 18-Jan-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Make USB packet filtering code optional.

Approved by: thompsa (mentor)


# 58ccf5b4 11-Jan-2011 John Baldwin <jhb@FreeBSD.org>

Remove unneeded includes of <sys/linker_set.h>. Other headers that use
it internally contain nested includes.

Reviewed by: bde


# b4436382 25-Nov-2010 Weongyo Jeong <weongyo@FreeBSD.org>

Removes a unused function `usb_bus_find'.


# fe1c24e3 24-Nov-2010 Weongyo Jeong <weongyo@FreeBSD.org>

Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load /
unloaded repeatly. Attaching the USB pf is moved to usbus device's
attach.

Pointed by: yongari


# e376f9c3 24-Nov-2010 Weongyo Jeong <weongyo@FreeBSD.org>

Removes all duplicated code with BPF that it's greatly simplified and
take all benefits whenever BPF code is improved.

Pointed by: jkim
Reviewed by: thompsa


# 18ec6525 21-Nov-2010 Weongyo Jeong <weongyo@FreeBSD.org>

Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers. Its implementations
are almost based on BPF code and very similar with it except it's
little bit customized for USB packet only. The userland program
usbdump(8) would be committed soon.

Discussed with: hps, thompsa, yongari


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 963169b4 04-Oct-2010 Hans Petter Selasky <hselasky@FreeBSD.org>

This commit adds full support for USB 3.0 devices in host and device
mode in the USB core. The patch mostly consists of updating the USB
HUB code to support USB 3.0 HUBs. This patch also add some more USB
controller methods to support more active-alike USB controllers like
the XHCI which needs to be informed about various device state events.

USB 3.0 HUBs are not tested yet, due to lack of hardware, but are
believed to work.

After this update the initial device descriptor is only read twice
when we know that the bMaxPacketSize is too small for a single packet
transfer of this descriptor.

Approved by: thompsa (mentor)


# 864bc412 04-Oct-2010 Hans Petter Selasky <hselasky@FreeBSD.org>

Add missing DRIVER_MODULE() entry for the musbotg driver.
Add some more comments.

Approved by: thompsa (mentor)


# 3df007ce 04-Oct-2010 Hans Petter Selasky <hselasky@FreeBSD.org>

The root mount hold reference was not released on USB controller
attach failures during boot. Fix this.

Approved by: thompsa (mentor)


# f3619333 17-May-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r208013

Add missing ifdefs for usb power saving support.


# e727a16c 12-May-2010 Andrew Thompson <thompsa@FreeBSD.org>

Add missing ifdefs for usb power saving support.

Submitted by: Hans Petter Selasky


# b766264d 06-Apr-2010 Andrew Thompson <thompsa@FreeBSD.org>

MFC r205005

Wrap the proc wakeup special case for ddb in ifdef DDB.

Submitted by: Giovanni Trematerra


# f0c078e6 11-Mar-2010 Andrew Thompson <thompsa@FreeBSD.org>

Wrap the proc wakeup special case for ddb in ifdef DDB.

Submitted by: Giovanni Trematerra


# c1b5138f 09-Dec-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFC r199816

Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.


# 767cb2e2 25-Nov-2009 Andrew Thompson <thompsa@FreeBSD.org>

Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.


# 1063b450 29-Oct-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFC r197553

- clean up USB detach logic. There seems to be some problems detaching multiple
USB HUBs connected in series from the root.


# 61908699 29-Oct-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFC r196488

- allow disabling "root_mount_hold()" by setting a sysctl/tunable at boot
- remove some redundant initial explore code


# d88688c7 28-Sep-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 @ 168387

- clean up USB detach logic. There seems to be some problems detaching multiple
USB HUBs connected in series from the root.

- after this patch the rule is:
1) Always use device_detach() on the USB HUB first.
2) Never just device_delete_child() on the USB HUB, because that function
will traverse to all the device leaves and free them first, and then the USB
stack will free the devices twice which doesn't work very well.

- make sure the did DMA delay gets set after the timeout has elapsed to make
logic more clear. There is no functional difference.

Submitted by: Hans Petter Selasky


# 34b48722 23-Aug-2009 Alfred Perlstein <alfred@FreeBSD.org>

- allow disabling "root_mount_hold()" by
setting a sysctl/tunable at boot
- remove some redundant initial explore code

Submitted by: hps


# 247db074 20-Aug-2009 John Baldwin <jhb@FreeBSD.org>

MFC 196403: Temporarily revert the new-bus locking for 8.0 release.

Approved by: re (kib)


# a56fe095 20-Aug-2009 John Baldwin <jhb@FreeBSD.org>

Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by: re (kib), attilio


# 444b9186 02-Aug-2009 Attilio Rao <attilio@FreeBSD.org>

Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by: ed, hps, jhb, imp, mav, scottl
No answer by: ariff, thompsa, yongari
Tested by: pho,
G. Trematerra <giovanni dot trematerra at gmail dot com>,
Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by: Yahoo! Incorporated
Approved by: re (ksmith)


# a0c61406 29-Jul-2009 Alfred Perlstein <alfred@FreeBSD.org>

USB controller:
- allow disabling "root_mount_hold()" by setting "hw.usb.no_boot_wait" sysctl

Submitted by: hps
Approved by: re


# ed6d949a 22-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

- Make struct usb_xfer opaque so that drivers can not access the internals
- Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h


# a593f6b8 14-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

s/usb2_/usb_|usbd_/ on all function names for the USB stack.


# f9cb546c 29-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Revert the size_t part of the last commit for the moment, this blows up the
USB_ADD_BYTES macro.


# f171eb9b 29-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Fix function arguments were previously they matched the typedef by accident.


# e0a69b51 29-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

s/usb2_/usb_/ on all typedefs for the USB stack.


# 760bc48e 28-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

s/usb2_/usb_/ on all C structs for the USB stack.


# 9360ae40 20-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.

Submitted by: Hans Petter Selasky


# 8d2dd5dd 20-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Use enums for speed and rev data types.


# 672c9965 22-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@160706

Resolve possible device side mode deadlock by creating another thread.

Submitted by: Hans Petter Selasky


# 853a10a5 09-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

Revert r190676,190677

The geom and CAM changes for root_hold are the wrong solution for USB design
quirks.

Requested by: scottl


# fde87526 05-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

Provide a better commit log for r190735, forced by making a whitespace change.

Refactor how we interface with the root HUB. This is achieved by making a
direct call from usb2_do_request to the host controller for root hub requests,
this call will perform the controller specific register read/writes and return
the error code.

This cuts out a lot of code in the host controller files and saves one thread
per USB bus.

Submitted by: Hans Petter Selasky


# 39307315 05-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@159922

Refactor how we interface with the root HUB. This cuts around 1200 lines of
code totally and saves one thread per USB bus.

Submitted by: Hans Petter Selasky


# 4eae601e 05-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@159909

- make usb2_power_mask_t 16-bit
- remove "usb2_config_sub" structure from "usb2_config". To compensate for this
"usb2_config" has a new field called "usb_mode" which select for which mode
the current xfer entry is active. Options are: a) Device mode only b) Host
mode only (default-by-zero) c) Both modes. This change was scripted using
the following sed script: "s/\.mh\././g".
- the standard packet size table in "usb_transfer.c" is now a function, hence
the code for the function uses less memory than the table itself.

Submitted by: Hans Petter Selasky


# bdd41206 05-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@159866

- memory usage reduction by only allocating the required USB pipes and USB
interfaces.
- cleanup some USB parsing functions to be more flexible.

Submitted by: Hans Petter Selasky


# 684e3f22 05-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@159700

Get rid of the last CALLOUT_RETURNUNLOCKED reference.

Submitted by: Hans Petter Selasky


# 626fc9fe 03-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

Add a how argument to root_mount_hold() so it can be passed NOWAIT and be called
in situations where sleeping isnt allowed.


# bdc081c6 20-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@159392

Add ifdefs for making parts of usb conditional.

Submitted by: Hans Petter Selasky


# ab42e8b2 20-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb @159430

- Move tunable defines into usb_core.h and dependancy towards usb_defs.h
- Leave hardcoded defines in "usb_defs.h".
- Allow overriding all tunable defines.
- Add more customisable typedefs.
- Correct maximum device number.

Submitted by: Hans Petter Selasky


# 1be5bf51 10-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

Fix a possible NULL pointer access at controller attach.

Submitted by: Hans Petter Selasky


# 02ac6454 23-Feb-2009 Andrew Thompson <thompsa@FreeBSD.org>

Move the new USB stack into its new home.