| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
opened with a callback.
If a driver opens an interrupt pipe without callback function, like
umct(4) does with one of its bulk in endpoints being reported as an
interrupt endpoint, then we can end up aborting a transfer which is
different from the interrupt one.
Issue reported by Roberto E. Vargas Caballero, ok deraadt@
|
|
|
|
|
|
|
|
|
| |
It seems mpi introduced a problem into ehci.c rev 1.162
two weeks ago. An error check that used to return NULL
now jumps to the end of the function, but sqtd isn't
initialised at that point.
ok miod@ deraadt@
|
|
|
|
|
|
|
|
|
|
|
| |
so that we do not end up allocating two times new descriptors.
This happens if a thread finds an empty list, start allocating, got
interrupted and the interrupt also finds an empty list.
Fix an issue reported by Nils Frohberg.
ok yuo@, pirofti@
|
|
|
|
| |
real impact since this descriptor is not used in the kernel. From NetBSD.
|
|
|
|
|
|
|
|
| |
explore thread will not disconnect the root hub. The flag will be
set before detaching the children, like it is done during a suspend-
resume cycle.
Fix a panic when unplugging a cardbus *hci(4).
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
since this function is optional get rid of the no-op ones.
ok ratchov@
|
|
|
|
|
|
|
| |
Apart from improving readability, this will help us reduce the number of
no-op functions now that some of them are optional.
ok ratchov@
|
| |
|
|
|
|
|
| |
usbd_xfer pointer to the routines processing finished transfers to make
it crystal clear that the timeout and abort logic is the same everywhere.
|
|
|
|
| |
host controller because autoconf(9) already does it.
|
|
|
|
|
|
|
|
|
| |
This leak is similar to the public xfer leak #1 that was affecting
device interrupt pipes except that root hubs are rarely detached.
Note that this xfer is never associated to any TD and is just used
to indicate that some of the HC ports has changed status, so there
is no need to flag it as "done" before completing it.
|
|
|
|
|
|
| |
Now that aborting interrupt pipes does not prevent us from freeing
the associated xfer, make sure to flag this xfer as "done" even if
there's no need to abort it in hardware.
|
|
|
|
|
|
|
| |
This has the side effect of simplifying and reducing the differences
between the various *hci_alloc_*_chain() functions since they are the
principal place where we want to known if the transfer is a read or a
write.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every call to usbd_abort_pipe() on an interrupt pipe would simply
reset the intrxfer pointer, which would prevent usbd_close_pipe()
to free it. Since we abort pipes in a lot of situations: when a
device is detached, when a USB-to-serial adapter is closed, when
an error occurs, when the machine is suspended, etc, this would
result in hundreds of leaked xfers in most of my machines.
xhci(4) is not affected, but you can't enable it right now since
the stack is not ready :)
While here put a KASSERT() to make sure drivers are only calling
the interrupt abort method for intrxfer, if that's not the case,
please let met know.
|
|
|
|
|
|
| |
per-driver pool(9) instead.
With inputs from mikeb@
|
|
|
|
|
|
|
|
|
| |
Since pipe methods have an xfer argument, always use it to get acces to
various data structure (pipe, bus, device) instead of having a different
way to get a pointer to these descriptors in every function.
Also kill the {E,U}XFER() macro and use a consistent name accross all the
methods for {e,u}hci_xfer.
|
|
|
|
|
|
|
| |
because USB_START_ADDR is defined to 0 and the softc is M_ZERO'd,
assume that root hubs are the only devices with a depth of 0.
Root hubs can now happily be detached and reattached.
|
| |
|
| |
|
|
|
|
|
|
|
| |
descriptor they are linked to, so no need to dereference their pipe
pointer. Simplify a lot of affectations, no functional change.
ok pirofti@
|
|
|
|
|
| |
so merge them into usbd_str() to not introduce other copies with
the upcoming HC drivers.
|
|
|
|
|
|
|
| |
before reseting the controller in order to save power when the machine is
suspended.
ok deraadt@
|
|
|
|
|
|
|
|
|
| |
request and instead re-open the default pipe with updated values when
attaching a new device, adapted from FreeBSD r162977.
This fixes a problem where the controller could have cached the previous
values and would fail to get the device descriptor, leaving the device
unrecognized with a message like: "device problem, disabling port n".
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
coherently through all our controller drivers and kill the mstohz() macro.
ok pirofti@
|
|
|
|
|
|
|
| |
the timeout task in the *_timeout() routine. It now becomes obvious
that the allocx/freex hooks can be merged.
ok pirofti@
|
|
|
|
| |
never read.
|
|
|
|
| |
of defining it in every controller specific structure.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not places the ports into suspend mode now that we detach/attach
all USB devicess during a suspend/resume cycle.
Emit a reset when reinitializing the controller after resume and
try to use the same logic as in ehci_init().
Correctly wait for the controller to set the HCHalted bit to one
before attempting a reset.
Tested by many and have been in snap for a week.
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
usbd_xfer object' which includes the `abort_task'. Otherwise
usb_abort_task_thread() may try to dequeue the recycled task then it
causes panic with page fault.
reported by Edd Barrett and Wade, Daniel.
ok mpi
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
| |
fake randomizer for pre-boot. We still need better interrupt scheduling,
but this makes that more clear.
ok yuo mpi
|
|
|
|
|
|
|
|
|
|
| |
paths are reflexive. It is now possible to fail part-way through a
suspend sequence, and recover along the resume code path.
Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used
after hibernate (and suspend too) to finish the job. Some drivers
must be converted at the same time to use this instead of shutdown hooks
(the others will follow at a later time)
ok kettenis mlarkin
|
|
|
|
| |
Spotted by Artturi Alm. Thanks!
|
|
|
|
|
|
|
|
|
|
| |
wait for an interrupt when the bus is in polling mode. Otherwise
some devices like my YE-Data USB Floppy take a short sharp trip to
ddb> at 'halt -p'.
Most of the functions were already doing the wait.
ok miod@. With modification that printf's become DPRINTF's.
|
|
|
|
|
| |
superflous code. This fix an abort loop problem reported by Gerhard Roth,
based on his initial diff. Has been in snap for some weeks, ok deraadt@
|
|
|
|
|
|
| |
NULL-terminated.
Part of a larger diff from Gerhard Roth
|
|
|
|
|
|
| |
first and last qTD pointers to NULL because only iTDs will be used.
Part of a larger diff from Gerhard Roth
|
|
|
|
| |
Part of a larger diff from Gerhard Roth, ok miod@
|
|
|
|
| |
ok miod@
|
|
|
|
|
|
| |
'sqtdend' argument when freeing one of them.
Part of a larger diff from Gerhard Roth with some tweaks, ok miod@
|
|
|
|
|
|
| |
parentheses where needed to get the resulting mask right.
ok krw@ yuo@ deraadt@
|
|
|
|
|
|
|
|
| |
that's ever used it, and it's long since been changed to use
DVACT_{QUIESCE,SUSPEND,RESUME} instead.
ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it
up a few weeks ago
|
| |
|
|
|
|
|
|
| |
in *hci_softc
ok miod@, krw@
|