| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
When an isochronous transfer of n frames is scheduled, the last frame
i.e. frame number (n - 1) must be set to generate an interrupt.
ok mpi
|
| |
|
|
|
|
|
| |
C99 inline semantics resulted in undefined symbols.
OK deraadt@ mpi@ dlg@
|
|
|
|
| |
ok visa@
|
|
|
|
| |
USB is the last real user of IPL_SOFTNET.
|
|
|
|
|
|
|
|
|
|
|
| |
*_root_ctrl_start() routines are synchronous and all end up calling
usb_transfer_complete() in the non-error case. After calling this
function it is unsafe to dereference ``xfer'' since the transfer
callback has been called. So returning USBD_IN_PROGRESS is wrong in
this case since transfers are always completed at this point.
So return USBD_NORMAL_COMPLETION or the corresponding error code if
something wrong happen.
|
|
|
|
|
|
|
|
|
| |
This code contains a use-after-free which be addressed in an upcoming
diff.
This fix xhci(4) polling mode.
ok kettenis@
|
|
|
|
|
|
| |
Found by LLVM/Clang Static Analyzer.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
|
|
| |
this break some devices.
As found the hardway by Hugo Sastre via sobrado@
|
|
|
|
|
|
|
|
| |
when an isochronous transfer is done.
Frame lengths are just input values and no driver mess with them.
ok ratchov@, jmatthew@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
| |
ok dlg@ mpi@ bcook@ millert@ miod@
|
|
|
|
|
|
| |
hardware.
ok mpi@, deraadt@
|
|
|
|
| |
ok deraadt@ tedu@
|
| |
|
|
|
|
| |
with the correct ipl to prevent your CPU from locking against itself.
|
|
|
|
| |
in every HC driver.
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
|
| |
DVACT_QUIESCE was not passed to usb(4) and a new uhub(4) device was
reattached at every resume.
Problem reported by mlarkin@
|
|
|
|
| |
allows ramdisk kernels to build again
|
|
|
|
|
|
|
|
|
|
| |
status changes because it might be freed when detaching the root uhub(4).
Also do not reschedule a timeout if the pipe is being aborted.
Finally do not add more code to retrieve the 'bInterval' value of the
root hub endpoint descriptor since this value is hardcoded in the uhci(4)
driver.
|
|
|
|
|
| |
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.
|
|
|
|
| |
per-driver pool(9) instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
ohci.c:193:1: error: unused function 'OREAD1' [-Werror,-Wunused-function]
ohci.c:200:1: error: unused function 'OREAD2' [-Werror,-Wunused-function]
uhci.c:256:1: error: unused function 'UREAD4' [-Werror,-Wunused-function]
ok deraadt@
|
|
|
|
|
|
| |
coherently through all our controller drivers and kill the mstohz() macro.
ok pirofti@
|
|
|
|
|
|
|
|
|
| |
uninitialized variable in case the transfer we were waiting for
timed out; problem reported by oga@bitrig.
So bring uhci_waitintr() in sync with its equivalent in ohci(4)
and ehci(4), stop using an uhci_xfer, do not dereference it and
set the correct status of the transfer.
|
|
|
|
|
|
|
|
| |
any transfer when autoconf(9) asks for it.
This brings uhci(4) in sync with ohci(4) and ehci(4).
ok pirofti@
|
|
|
|
|
|
|
| |
first step to merge the code of our controllers that deal with usbd
transfers.
Tested with miod@
|
|
|
|
| |
of defining it in every controller specific structure.
|
|
|
|
|
|
|
|
|
|
| |
transfer is submitted when a zero-length bulk or interrupt transfer
is requested.
This is the missing part of FreeBSD's svn r159024 that should have
been committed with ehci's r1.57.
ok uebayasi@
|
|
|
|
|
|
| |
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
|