| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
partly from Alessandro Ricci
|
|
|
|
|
|
|
|
| |
actual length which has been allocated. We saw cases where the
wTotalLength value is changing on a second read, e.g. when a USB device
was waked up from sleep mode.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
| |
device which returns a spurious value for wTotalLength on a configuration
descriptor request. Therefore don't relay on wTotalLength for free(9)
but on the length variable which was used for the malloc(9) before.
The issue was reported by
Mikolaj Kucharski <mikolaj (at) kucharski (dot) name> on bugs@.
Discussed and ok deraadt@
|
|
|
|
| |
ok visa@, kn@, cheloha@
|
|
|
|
| |
ok 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@
|
|
|
|
| |
ok deraadt@, ratchov@
|
|
|
|
|
|
|
| |
never be called to convince compilers and static analysis tools a path
that uses uninitialised memory does not exist.
ok krw@ mpi@
|
|
|
|
|
|
|
| |
The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
|
|
|
|
| |
ok deraadt@, dlg@
|
|
|
|
| |
ok mpi@
|
|
|
|
|
|
| |
with expected behavior.
OK mpi@ patrick@
|
|
|
|
|
| |
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
way.
ok natano@
|
|
|
|
|
|
| |
contained the pointer it received from user land. usbioctl() has
to reset it, otherwise user supplied data is passed to free().
OK mpi@
|
|
|
|
|
|
| |
is done in ugen(4).
Found by Grant Czajkowski during the GSoC 2015.
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
|
| |
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
detached, in order to prevent a deadlock situation.
This situation can occur if the thread detaching a device is sleeping,
waiting for all submitted transfers to finish, and the device's pipes
have not yet been aborted. This can happen when a USB Ethernet device
is being detached while a userland program is doing an ioctl(2).
Abort tasks need to be able to run in such case since timed out transfers
rely on them to be properly completed.
ok deraadt@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
should be considered as dead. In such condition the stack no longer
submits I/O or schedules any USB task for its bus.
However we need an explore task to detach the root hub since only the
task thread is supposed to discover buses and attach/detach devices in
order to avoid races.
So reset the bus' dying flag when marking it as disconnecting in order
to let the task be scheduled. This should be safe because a detached
or halted HC should not trigger any new interrupt.
Fix a panic when detaching USB PCMCIA cards reported by Tilo Stritzky.
|
|
|
|
| |
with the correct ipl to prevent your CPU from locking against itself.
|
|
|
|
| |
to help integrating super speed hubs that use a different descriptor.
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
| |
whitespaces while here.
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
delicate. HC drivers do not always accept to be left alone.
I don't know if it is a love crisis, but apparently receiving a root
hub status change interrupt before having an uhub(4) attached breaks
resume.
So make sure the root hub is re-attached before interrupt get enabled.
It is safe to do it during DVACT_RESUME since attaching root hubs do
not require any USB transfer.
Based on a diff from yasuoka@, fix a regression introduced in last
commit an reported by Abel Abraham Camarillo Ojeda on tech@ and Nils
R on bugs@.
|
|
|
|
|
|
|
|
|
|
| |
before suspending the machine.
Prior to this commit, devices were logically disconnected after
resuming the machine leading to funny races since the controller
was reset in between.
ok deraadt@
|
|
|
|
|
| |
the correct speed. This has no effect for the moment since there is no
such driver in our tree, but something tells me it might change soon.
|
|
|
|
|
|
|
|
| |
kernel resumes normal (non-cold, able to run processes, etc) operation.
Previously we were relying on specific DVACT_RESUME op's in drivers
creating callback/threads themselves, but that has become too common,
indicating the need for a built-in mechanism.
ok dlg kettenis, tested by a sufficient amount of people
|
|
|
|
|
|
| |
cleaning up some shutdown-hook related code on the way.
(A few drivers related to sparc are still skipped at kettenis' request)
ok kettenis mlarkin, tested by many others too
|
|
|
|
|
|
|
|
|
|
| |
smaller than the requested one. From ws@NetBSD via miod@.
This problem can only occur when the USBD_SHORT_XFER_OK flag is set,
otherwise completed transfers with a length smaller than the one
submitted are treated as errors.
ok miod@
|
|
|
|
|
|
|
| |
for functions related to the usb(4) driver and keep usbd_* for generic
USB layer functions.
ok mglocker@
|
| |
|
|
|
|
|
|
| |
there. Some spacing while here.
Suggested and ok mpi@
|
|
|
|
|
|
| |
device descriptor.
Help and ok mpi@
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
| |
Those are the equivalents for ugen(4)'s USB_GET_CONFIG_DESC and
USB_GET_FULL_DESC.
Help and OK mpi@, jmc@
|
| |
|
|
|
|
|
| |
absolutely do not need to include vnode.h because it includes uvm_extern.h
and you want the idiotic TRUE FALSE defines from uvm.
|
|
|
|
| |
ok deraadt@
|
|
|
|
|
|
| |
number. No functional change.
ok miod@
|
|
|
|
|
|
| |
is invalid or valid but with no device found.
ok miod@
|
|
|
|
| |
Might help a few laptops resume their usb devices better.
|
|
|
|
|
|
|
| |
sys/kthread.h, use sys/timeout.h explicitly. Noted by Michael
Knudsen.
ok deraadt@ kettenis@ guenther@
|