History log of /freebsd-current/sys/dev/usb/controller/ohci.c
Revision Date Author Comments
# 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


# ffd8101e 13-Apr-2022 John Baldwin <jhb@FreeBSD.org>

usb: Add a __usbdebug_used for variables only used under #ifdef USB_DEBUG.

Use it for various variables only used in DPRINTF debug traces
conditional on USB_DEBUG.


# 8fc2a3c4 10-Jul-2021 Hans Petter Selasky <hselasky@FreeBSD.org>

Factor out repeated code in the USB controller drivers to avoid bugs
computing the same isochronous start frame number over and over again.

PR: 257082
MFC after: 1 week
Sponsored by: NVIDIA Networking


# 52ab576d 17-Dec-2020 John Baldwin <jhb@FreeBSD.org>

Use __containerof() instead of home-rolled versions.

Reviewed by: imp, hselasky
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D27582


# 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


# 151ba793 24-Dec-2017 Alexander Kabaev <kan@FreeBSD.org>

Do pass removing some write-only variables from the kernel.

This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385


# 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.


# 20733245 02-May-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

dev/usb: minor spelling fixes in comments.

No functional change.

Reviewed by: hselasky


# 057b4402 26-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: extend use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.


# 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


# e892b3fe 11-Dec-2013 Hans Petter Selasky <hselasky@FreeBSD.org>

USB method structures for USB controllers and USB pipes should be
constant and does not need to be modified. This also saves a small
amount of RAM.


# 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


# 37506412 24-Oct-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Make several timing parameters of the USB enumeration sequence tuneable.
Also update the port reset time from 250ms to 50ms. Some USB devices
have a hard limit in hardware at 222ms for the port reset time and will
not enumerate unless this delay is closer to the usb.org defined value.
This patch can fix enumeration with some USB devices.

Tested by: Guido van Rooij
Submitted by: Nick Hibma
MFC after: 1 week


# 0324d54a 30-Sep-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Inherit USB mode from RootHUB port where the USB device is connected.
Only RootHUB ports can be dual mode. Disallow OTG ports on external HUBs.
This simplifies some checks in the USB controller drivers.

MFC after: 1 week


# 6d917491 02-Apr-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix compiler warnings, mostly signed issues,
when USB modules are compiled with WARNS=9.

MFC after: 1 weeks


# 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


# 271ae033 12-Nov-2011 Hans Petter Selasky <hselasky@FreeBSD.org>

Style change.
- Make it easier to port the USB code to other platforms by only using
one set of memory functions for clearing and copying memory. None of
the memory copies are overlapping. This means using bcopy() is not
required.
- Fix a compile warning when USB_HAVE_BUSDMA=0
- Add missing semicolon in avr32dci.
- Update some comments.

MFC after: 1 week


# 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.


# 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


# 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.


# 3b6f59ee 13-Oct-2010 Hans Petter Selasky <hselasky@FreeBSD.org>

Correct some root HUB descriptor fields in multiple controller drivers.
Remove an unused structure.

Approved by: thompsa (mentor)


# 527aa7b2 01-Sep-2010 Andrew Thompson <thompsa@FreeBSD.org>

Change argument for usbd_get_dma_delay() from USB bus to USB device, some
embedded hardware needs to know exactly which device is in question before it
exactly can decide the required delay.

Submitted by: Hans Petter Selasky


# a4cadedb 22-Jun-2010 Andrew Thompson <thompsa@FreeBSD.org>

Add support for LOW speed BULK transfers. This mode is not recommended by the
USB 2.0 standard, though some USB devices use it anyway.

Submitted by: Hans Petter Selasky


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

MFC r199675

Provide tunables for some of the usb sysctls that affect boot behaviour.

Submitted by: Andriy Gapon


# c13fd8d4 22-Nov-2009 Andrew Thompson <thompsa@FreeBSD.org>

Provide tunables for some of the usb sysctls that affect boot behaviour.

Submitted by: Andriy Gapon


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

MFC r198151

Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
all host controllers at the same time, we avoid problems where the BIOS will
actually write to the USB registers of all the USB host controllers every time
we handover one of them, and consequently reset the OS programmed values.


# c2e8b89c 26-Oct-2009 Andrew Thompson <thompsa@FreeBSD.org>

Revert r198500 for now, this will break situations when
hw.pci.usb_early_takeover is set to zero and the SMM release
is never done.

Pointed out by: marcel


# 77cbe30e 26-Oct-2009 Andrew Thompson <thompsa@FreeBSD.org>

Remove usb controller takeover code now that it is handled by the pci code.

Reminded by: jhb
Reviewed by: HPS


# 1def609a 15-Oct-2009 Andrew Thompson <thompsa@FreeBSD.org>

Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
all host controllers at the same time, we avoid problems where the BIOS will
actually write to the USB registers of all the USB host controllers every time
we handover one of them, and consequently reset the OS programmed values.

Submitted by: avg
Reviewed by: jhb


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

USB CORE:
- Add minimum polling support to drive UMASS
and UKBD in case of panic.
- Add extra check to ukbd probe to fix problem about
mouse devices attaching like keyboards.
- P4 ID: 166148

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.


# ae60fdfb 07-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

Rename usb pipes to endpoints as it better represents what they are, and struct
usb_pipe may be used for a different purpose later on.


# 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


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

- rename usb2_mode to usb_mode [1]
- change variable types to use the enum

Submitted by: Hans Petter Selasky [1]


# ec8f3127 05-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Revert part of r191494 which used the udev state to mark suspending, this needs
to be set via two variables (peer_suspended and self_suspended) and can not be
merged into one.

Submitted by: Hans Petter Selasky
Pointy hat: me


# bd216778 25-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

Track the usb device state as its powered on, addressed and configured. This helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.

Implement the suspend tracking as a udev state too.


# 459d369e 22-Apr-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@160930

Change the roothub exec functions to take the usb request and data pointers
directly rather than placing them on the parent bus struct.

Submitted by: Hans Petter Selasky


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

Remove usb_sw_transfer.[ch] which are now empty after r190735.


# 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


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

MFp4 //depot/projects/usb@159946

Some cancelable flags are always true. Substitute these away. These cancelable
flags were mostly useful with the root HUB which is now handled differently.

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


# b3e9a2aa 27-Mar-2009 Andrew Thompson <thompsa@FreeBSD.org>

The buffer start and end phys addresses should be 0x0 for an OHCI zero length
packet, this fixes LS/FS devices on the Gateworks 2348 XScale board.

Reviewed by: HPS


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

MFp4 //depot/projects/usb @159479,159502,159516,159522,159529

Workaround for buggy USB hardware not handling new SETUP packet before STATUS
stage is complete, this allows xfers to endpoint0 to return a short frame.

Submitted by: Hans Petter Selasky
Reported by: me


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

MFp4 //depot/projects/usb @159431,159437,159438

- start using the new USB typedefs in the USB core
- Remove usage of USB_ADD_BYTES()

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


# 4a35cda7 23-Feb-2009 Andrew Thompson <thompsa@FreeBSD.org>

MFp4 //depot/projects/usb@157853

Clean up old way of polling the USB hardware. The existing polling support was
a bit hackish.

Submitted by: Hans Petter Selasky


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

Move the new USB stack into its new home.