History log of /freebsd/sys/dev/usb/usb_device.c (Results 1 – 25 of 313)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 114080d1 04-Oct-2024 Ed Maste <emaste@FreeBSD.org>

usb: fix loop in usb_config_parse

By inspection, index increment was missing.

PR: 281843
Reported by: Matt Jacobson
Reviewed by: bz, markj
Fixes: e4611d26265f ("usb(4): Call optional endpoint_unin

usb: fix loop in usb_config_parse

By inspection, index increment was missing.

PR: 281843
Reported by: Matt Jacobson
Reviewed by: bz, markj
Fixes: e4611d26265f ("usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting.")
Sponsored by: The FreeBSD Foundation

show more ...


Revision tags: release/13.4.0
# 5b8f97d8 04-Sep-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

usb: change LIST to SLIST to avoid LinuxKPI conflicts

In order to better integrate modern LinuxKPI USB this tries to reduce
a contention point of "LIST". Given there is no need to use a LIST here
c

usb: change LIST to SLIST to avoid LinuxKPI conflicts

In order to better integrate modern LinuxKPI USB this tries to reduce
a contention point of "LIST". Given there is no need to use a LIST here
change it to SLIST to avoid conflicts.
It is a workaround which does not solve the actual problem (overlapping
namespaces) but it helps us a lot for now.

Sponsored by: The FreeBSD Foundation
X-MFC? unclear
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46534

show more ...


# 5b56413d 25-Jul-2024 Warner Losh <imp@FreeBSD.org>

newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY

Sponsored by: Netflix


Revision tags: release/14.1.0
# 604511f8 20-Apr-2024 Gordon Bergling <gbe@FreeBSD.org>

usb(4): Remove a double word in a source code comment

- s/of of/of/

MFC after: 3 days


Revision tags: release/13.3.0, release/14.0.0
# 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

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

show more ...


Revision tags: release/13.2.0
# 9b077d72 31-Mar-2023 Hans Petter Selasky <hselasky@FreeBSD.org>

usb(4): Separate the fast path and the slow path to avoid races and use-after-free for the USB FS interface.

Bad behaving user-space USB applicatoins may crash the kernel by issuing
USB FS related i

usb(4): Separate the fast path and the slow path to avoid races and use-after-free for the USB FS interface.

Bad behaving user-space USB applicatoins may crash the kernel by issuing
USB FS related ioctl(2)'s out of their expected order. By default
the USB FS ioctl(2) interface is only available to the
administrator, root, and driver applications like webcamd(8) needs
to be hijacked in order for this to happen.

The issue is the fast-path code does not always see updates made
by the slow-path code, and may then work on freed memory.

This is easily fixed by using an EPOCH(9) type of synchronization
mechanism. A SX(9) lock will be used as a substitute for EPOCH(9),
due to the need for sleepability. In addition most calls going into
the fast-path originate from a single user-space process and the
need for multi-thread performance is not present.

Differential Revision: https://reviews.freebsd.org/D39373
Reviewed by: markj@
Reported by: C Turt <ecturt@gmail.com>
admbugs: 994
MFC after: 1 week
Sponsored by: NVIDIA Networking

show more ...


# e4611d26 15-Dec-2022 Hans Petter Selasky <hselasky@FreeBSD.org>

usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting.

MFC after: 1 week
Sponsored by: NVIDIA Networking


Revision tags: release/12.4.0, release/13.1.0
# 3ee94386 26-Apr-2022 Kornel Duleba <mindal@semihalf.com>

usb: Respect NO_INQUIRY quirk during device enumeration

Both usb_iface_is_cdrom and usb_msc_auto_quirk functions use SCSI INQUIRY
command to probe various properties of usb mass storage devices.
The

usb: Respect NO_INQUIRY quirk during device enumeration

Both usb_iface_is_cdrom and usb_msc_auto_quirk functions use SCSI INQUIRY
command to probe various properties of usb mass storage devices.
The problem here is that some very broken devices don't like this command.
Check if UQ_MSC_NO_INQUIRY quirk is set and skip cdrom and quirk
autodetection in that case.

Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: hps, wma
Differential Revision: https://reviews.freebsd.org/D35075

show more ...


# 7520b888 21-Feb-2022 Hans Petter Selasky <hselasky@FreeBSD.org>

usb(4): Automagically apply all quirks for USB mass storage devices.

Currently there are five quirks the USB stack tries to automagically detect:
- UQ_MSC_NO_PREVENT_ALLOW
- UQ_MSC_NO_SYNC_CACHE
- U

usb(4): Automagically apply all quirks for USB mass storage devices.

Currently there are five quirks the USB stack tries to automagically detect:
- UQ_MSC_NO_PREVENT_ALLOW
- UQ_MSC_NO_SYNC_CACHE
- UQ_MSC_NO_TEST_UNIT_READY
- UQ_MSC_NO_GETMAXLUN
- UQ_MSC_NO_START_STOP

If any of the quirks above are set, no further quirks will be probed.

If any of the USB mass storage tests fail, the USB device is
re-enumerated as a last resort to clear any error states from the
device. Then the USB stack will try to probe and attach the umass<N>
device passing the detected quirks.

While at it give more details in dmesg about what is going on.

Tested by: several
Submitted by: Idwer Vollering <vidwer_fbsdbugs@gmail.com>
Differential Revision: https://reviews.freebsd.org/D30919
MFC after: 1 week
Sponsored by: NVIDIA Networking

show more ...


# c6df6f53 10-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 unlock

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

show more ...


Revision tags: release/12.3.0, release/13.0.0
# b1f99f9c 15-Dec-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve handling of alternate settings in the USB stack.

Move initialization of num_altsetting under USB_CFG_INIT, else
there will be a page fault when enumerating USB devices.

PR: 251856
MFC afte

Improve handling of alternate settings in the USB stack.

Move initialization of num_altsetting under USB_CFG_INIT, else
there will be a page fault when enumerating USB devices.

PR: 251856
MFC after: 1 week
Submitted by: Ma, Horse <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies // NVIDIA Networking

show more ...


# b8b3f4fd 15-Dec-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Improve handling of alternate settings in the USB stack.

Allow setting the alternate interface number to fail when there is only
one alternate setting present, to comply with the USB specification.

Improve handling of alternate settings in the USB stack.

Allow setting the alternate interface number to fail when there is only
one alternate setting present, to comply with the USB specification.

Refactor how iface->num_altsetting is computed.

Bump the __FreeBSD_version due to change of core USB structure.

PR: 251856
MFC after: 1 week
Submitted by: Ma, Horse <Shichun.Ma@dell.com>
Sponsored by: Mellanox Technologies // NVIDIA Networking

show more ...


Revision tags: release/12.2.0
# 9dd3156e 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

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


# c7aa572c 31-Jul-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# 94140f47 22-Jul-2020 Mark Johnston <markj@FreeBSD.org>

usb(4): Stop checking for failures from malloc(M_WAITOK).

Handle the fact that parts of usb(4) can be compiled into the boot
loader, where M_WAITOK does not guarantee a successful allocation.

PR:

usb(4): Stop checking for failures from malloc(M_WAITOK).

Handle the fact that parts of usb(4) can be compiled into the boot
loader, where M_WAITOK does not guarantee a successful allocation.

PR: 240545
Submitted by: Andrew Reiter <arr@watson.org> (original version)
Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25706

show more ...


Revision tags: release/11.4.0
# 5e055201 28-May-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Don't allow USB device drivers to parent own interface.
It will prevent proper USB device detach.

MFC after: 3 days
Sponsored by: Mellanox Technologies


# f54ab96d 11-May-2020 Hans Petter Selasky <hselasky@FreeBSD.org>

Refresh the USB device strings when a USB device is re-enumerated.

Submitted by: Horse Ma <Shichun.Ma@dell.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies


Revision tags: release/12.1.0, release/11.3.0
# 0269ae4c 06-Jun-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @348740

Sponsored by: The FreeBSD Foundation


# e2e050c8 20-May-2019 Conrad Meyer <cem@FreeBSD.org>

Extract eventfilter declarations to sys/_eventfilter.h

This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea

Extract eventfilter declarations to sys/_eventfilter.h

This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions. The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended). Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.

show more ...


Revision tags: release/12.0.0, release/11.2.0
# c140287a 28-May-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Change the default USB template from the current 0 to -1. The reason
is that current one (mass storage device) doesn't work as it is - it
needs to be set to 0 after the LUN is configured, which is w

Change the default USB template from the current 0 to -1. The reason
is that current one (mass storage device) doesn't work as it is - it
needs to be set to 0 after the LUN is configured, which is what the
cfumass rc script does. In other words: the current default does not
work, and to actually make it work it had to be set to -1 in
/boot/loader.conf.

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

show more ...


# f66c3cfc 30-Jan-2018 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make the handler routine for the hw.usb.template sysctl trigger the USB
host to reprobe the bus by switching the USB pull up resistors off and
back on. In other words - when FreeBSD is configured as

Make the handler routine for the hw.usb.template sysctl trigger the USB
host to reprobe the bus by switching the USB pull up resistors off and
back on. In other words - when FreeBSD is configured as a USB device,
changing the sysctl will be immediately noticed by the machine it's
connected to.

Reviewed by: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

show more ...


# 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

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.

show more ...


Revision tags: release/10.4.0, release/11.1.0
# 02ebdc78 31-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r307736 through r308146.


# 88f9a4ff 25-Oct-2016 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make the USB attach strings in dmesg include product name.

Note to self: MFC this to 9 and 8.

Reviewed by: hselasky@, imp@
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8259


12345678910>>...13