History log of /freebsd-current/sys/dev/usb/controller/atmegadci.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


# e73b02f6 04-Apr-2022 Warner Losh <imp@FreeBSD.org>

atmegadci: eliminate unused variables sc, ep_no

Sponsored by: Netflix


# a3cea156 28-Dec-2021 Andrew Turner <andrew@FreeBSD.org>

Fix undefined behaviour in the USB controllers

The USB controller drivers assume they can cast a NULL pointer to a
struct and find the address of a member. KUBSan complains about this so
replace with the __offsetof and __containerof macros that use either a
builtin function where available, or the same NULL pointer on older
compilers without the builtin.

Reviewers: hselasky

Subscribers: imp

Reviewed by: hselasky
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33865


# 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


# 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


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


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


# 40ba168d 13-May-2014 Hans Petter Selasky <hselasky@FreeBSD.org>

- Isochronous transfers should use the alternate next transfer
descriptor upon receiving a short packet, in host and device mode.
- Correct some comments.


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


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

Use string literals in string descriptors for marginally
better readability.

Submitted by: Christoph Mallon


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

Provide one global language string descriptor for
american english instead of giving each module its
own.

Submitted by: Christoph Mallon


# 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


# 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


# a5cf1aaa 12-Aug-2012 Hans Petter Selasky <hselasky@FreeBSD.org>

Add support for the so-called streams feature of BULK endpoints
in SUPER-speed mode, USB 3.0.

This feature has not been tested yet, due to lack of hardware.

This feature is useful when implementing protocols like UASP,
USB attached SCSI which promises higher USB mass storage throughput.

This patch also implements support for hardware processing of endpoints
for increased performance. The switching to hardware processing
of an endpoint is done via a callback to the USB controller driver. The
stream feature is implemented like a variant of a hardware USB protocol.

USB controller drivers implementing device mode needs to be updated to
implement the new "xfer_stall" USB controller method and remove the
"xfer" argument from the "set_stall" method.

The API's toward existing USB drivers are preserved. To setup a USB transfer
in stream mode, set the "stream_id" field of the USB config structure to
the desired value.

The maximum number of BULK streams is currently hardcoded and limited to 8
via a define in usb_freebsd.h.

All USB drivers should be re-compiled after this change.

LibUSB will be updated next week to support streams mode. A new IOCTL to
setup BULK streams as already been implemented. The ugen device nodes
currently only supports stream ID zero.

The FreeBSD version has been bumped.

MFC after: 2 weeks


# 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


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


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


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

MFC r199673

Initialise variable before use.

Submitted by: Hans Petter Selasky


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


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

Initialise variable before use.

Submitted by: Hans Petter Selasky


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

MFC r197556

Clear all interrupts rather than just SETUP packet.


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

Clear all interrupts rather than just SETUP packet.

Submitted by: Hans Petter Selasky


# 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


# 29bd7d7e 27-Jun-2009 Andrew Thompson <thompsa@FreeBSD.org>

Sync to p4

- Add support for devices that handle set and clear stall in hardware.
- Add missing get timestamp function
- Add more xfer flags

Submitted by: Hans Petter Selasky
Approved by: re (kib)


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


# 476183df 21-May-2009 Andrew Thompson <thompsa@FreeBSD.org>

Improve device mode (gadget) stall handling.

Some hardware easily comes out of sync with regard to whether the current or
the next control transfer should be stalled, if a stall command is always
issued before receiving the SETUP packet. After this patch the stall command
will only be issued when a transfer should actually be stalled.

Submitted by: Hans Petter Selasky


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


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

- Add new register definitions
- Enable the controller and wait for the PLL to start

Submitted by: Hans Petter Selasky


# 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


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

MFp4 //depot/projects/usb@160708

Need to check Read/Write allowed before writing any data for non-control
transfers.

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


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

MFp4 //depot/projects/usb@159926

Minor code factorisation in atmegadci.c

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


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

MFp4 //depot/projects/usb@159674

Fix more corner cases around reception of SETUP packets.

Submitted by: Hans Petter Selasky


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

MFp4 //depot/projects/usb@159673

Fix a corner case around stalling SETUP packets in device side mode.

Submitted by: Hans Petter Selasky


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

MFp4 //depot/projects/usb@159671

Fix interrupt register setting on the atmegadci controller.

Submitted by: Hans Petter Selasky


# 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


# 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


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

MFp4 //depot/projects/usb 158981,159016,159024

Sync support for ATMEGA DCI parts.

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.