| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
filled by the callee, change the usb_allocmem() API to take another
argument for the flags.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the import in '99 all buffers allocated using usb_allocmem() have
been mapped COHERENT. On some ARM SoCs, where the USB controller
is not coherent with the caches, this means the buffers were mapped
uncached. This drastically reduces the performance, especially on
reads.
We already added cache syncs before and after USB transfers, but so
far those have essentially been no-ops. Since other drivers make
use of the same allocation code, and those haven't been proven to
have correct syncs, we can't just remove the COHERENT flag.
This splits the allocation into coherent and non-coherent blocks.
All drivers who call usb_allocmem() themselves now pass a flag to
show they require coherent blocks. Onced verified that they also
work fine without coherent, or once they have been refactored, we
can remove this again.
On a ure(4) connected to an i.MX8MQ, the receive performance is
10x as fast as before. The Raspberry Pi's ethernet receive speed
doubled.
Debugged using dt(4)
Original diff from Marius Strobl
Feedback from kettenis@
Tested on an i.MX8MQ (arm64) by patrick@
Tested on a Raspberry Pi (arm64) by tobhe@
Tested on an ERL (octeon) by Janne Johansson
ok mpi@ gerhard@ tobhe@
|
|
|
|
| |
ok anton@, visa@
|
|
|
|
| |
Reported by anton@ and Natasha Kerensikova
|
|
|
|
| |
ok ratchov@, visa@
|
|
|
|
| |
ok okan@, tedu@, visa@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gathered from usb devices.
Cache them early in usbd_new_device() instead of querying the device
several times (the content wont change anyway) and uselessly generating
usb traffic (which could conflict with other access..)
The heuristic stays the same, first look in the device descriptor, then
try to match against usb_known_vendors/usb_known_products, then fallback
to use the idVendor/idProduct codes.
Remove the now useless 'usedev' parameter from usbd_fill_deviceinfo().
Tested from bsd & bsd.rd.
suggested by and ok mpi@
|
|
|
|
|
|
|
|
| |
name coming from usbd_devinfo_vp() instead of the dummy "Generic USB
video class device" string, makes it easier to differentiate multiple
webcams in firefox's webrtc permission dialog.
ok/help mpi@
|
|
|
|
| |
ok deraadt@, dlg@
|
|
|
|
|
| |
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
|
|
|
|
|
|
| |
Return a char * rather using a void function for usbd_get_device_string()
ok patrick@
|
|
|
|
|
|
|
|
|
|
|
| |
ioctl(USB_DEVICEINFO) not to issue any further requests to gather
information. Thus reducing stress on connected usb devices.
This fixes an issue where usbdevs called in a loop causes a USB mass
storage device to halt operation.
Adapted from a similar commit in NetBSD.
ok mpi@
|
|
|
|
|
|
| |
Otherwise we might leave a port in an unwanted state.
Found while investigating timeout issues on xhci(4).
|
|
|
|
|
|
|
|
| |
changed. This saves a lot of I/O when attaching/detaching devices
and might help with some timing related problems.
Has been in snap for ten days, committing now so that people testing
xhci(4) test the same thing w/ snapshots and their own kernel.
|
| |
|
|
|
|
| |
to the way USB buses are discovered.
|
|
|
|
|
| |
anything with it and it simplifies this mess in order to implement
warm reset.
|
|
|
|
| |
Prodded by a comment from stsp@.
|
| |
|
|
|
|
| |
to help integrating super speed hubs that use a different descriptor.
|
|
|
|
|
|
|
|
|
| |
even knows your children! So let him handle the seperation correctly.
Do not rewrite your own custom config_detach_children(9) and as a bonus
start removing the usbd_port tentacles from the stack.
ok pirofti@, yuo@, miod@, deraadt@
|
|
|
|
|
|
|
|
|
| |
explicitly set it when required.
Right now xhci(4) does not need such function because it assigns
addresses when the first pipe of a device is opened.
ok yuo@, pirofti@
|
|
|
|
|
|
|
|
|
|
|
| |
the boot process, USB devices must be attached or detached from the usb
task thread in order to avoid races with periodical explorations issued
by uhub(4) interrupts.
Respect this rule when detaching root hubs during a suspend/resume cycle
and avoid some hangs due to the aforementioned race.
Tested by Mattieu Baptiste, thanks!
|
|
|
|
| |
ok dlg@ mpi@ deraadt@
|
|
|
|
| |
Okay mpi@
|
| |
|
|
|
|
|
| |
it in various drivers, mainly HC, instead of always rerolling our
own.
|
| |
|
|
|
|
| |
of defining it in every controller specific structure.
|
|
|
|
|
|
|
| |
no direct impact since its return value is never checked but it allows
me to get rid of one (usless) status value.
Note that usbd_status should be used for USB transfers.
|
|
|
|
|
|
|
| |
memory leaks and abort the pipe if requests are still pending because
most of our drivers don't do anything if usbd_close_pipe() fails.
ok miod@
|
|
|
|
| |
them.
|
|
|
|
|
|
|
| |
for functions related to the usb(4) driver and keep usbd_* for generic
USB layer functions.
ok mglocker@
|
|
|
|
|
|
| |
are only used as wrappers around usb_{alloc,free}mem().
ok deraadt@, mglocker@
|
|
|
|
|
|
|
|
|
| |
definitions instead. We don't change usb.h for now to stay compatible
with userland.
Tested by mpi@ on macppc and myself on i386.
ok mpi@
|
| |
|
| |
|
|
|
|
|
|
| |
number. No functional change.
ok miod@
|
|
|
|
| |
leftover from the "usb event" stuff removal. Diff from Tobias Ulmer.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
interfaces as being claimed in the usbd_device's copy of the interface
descriptors
* allow ugen(4) to be attached if there are unused interfaces in a
configuration that has had drivers attached
* make ugen(4) aware that it may be sharing a device with (an)other
driver(s), and if so:
* do not let ugen(4) change the configuration
* do not let ugen(4) access the already claimed interfaces
discussed with deraadt and miod
|
|
|
|
|
|
| |
* add functions to increment and decrement the reference count, and a
function to wait until the reference count is zero
ok martynas@
|
|
|
|
|
|
|
|
|
| |
* add usbd_deactivate(), which should be use to set the dying flag in
struct usbd_device
* add usbd_is_dying(), which can be used to check if either the device
or the associated bus dying flag has been set
* use usbd_is_dying() to check if the deivce or bus is dying before
issuing transfers or requests
|
|
|
|
|
|
|
|
|
| |
is dying, instead of setting a flag in struct usb_softc. as
usbd_device_handle has a pointer to the usbd_bus it's attached to,
usb devices, and functions they run or functions run on their behalf,
can now easily check if their bus is dying. use this to stop
usbd_do_request* from running and the usb task thread from adding
new tasks when a device's bus is dying.
|
|
|
|
|
|
|
| |
USB bus, make usb_explore() a usb_task. reduces races during normal
USB device detach, since now usb_tasks and detach happen in the same
process.
ok yuo@, matthew@ helped with the task thread loop
|
|
|
|
|
|
|
|
| |
of the last element. Bad technique. Use a pointer to the array. The
author (or later people) will often not pay attention to the consequences
of structure padding & alignment issues when they add new fields to the
base structure, and there will be fireworks.
tested by jasper, too
|
|
|
|
| |
ok jsing@, miod@
|
|
|
|
|
|
|
| |
which is exactly what it was trying to do.
Tested on all *hci controllers with a bunch of usb devices by at least ckuethe@
and I.
|
|
|
|
|
|
|
|
|
|
|
| |
add new quirk entry for uvideo which is required isoc transfer.
Some usb2.0 devices use isochronous transfer but current usb
subsystem does not support isoc transfer in ehci(usb2.0) bus.
This patch introduce new psuedo usb hub request UHF_PORT_DISOWN_TO_1_1
to handover the device to ehci to usb1.1 bus(ohci or uhci).
ok mglocker@ deraadt@ fgsch@
|
|
|
|
|
|
|
|
|
| |
Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.
OK deraadt@
|
|
|
|
|
|
|
|
| |
(which was used to define USB_USE_SOFTINTR).
No binary changes.
ok dlg, mk.
|