Age | Commit message (Collapse) | Author |
|
'NULL' instead of '0'.
ok deraadt@
|
|
before usbd_close_pipe(), since usbd_close_pipe() already takes care
about aborting non-empty pipes.
As investigated by gerhard@ usbdi.c rev. 1.57 did add usbd_abort_pipe()
to usbd_close_pipe(), but the drivers didn't get cleaned up afterwards.
ok gerhard@
|
|
ok visa@, kn@, cheloha@
|
|
timed out. If usbd_get_desc() returns USBD_TIMEOUT the chance is high
that the next call will do the same and it slows down attachement of
devices a lot. Makes reattaching USB at resume a lot faster with my
umb(4) card (which likes to time out).
"move fast and fix things" deraadt@
|
|
Should prevent a race seen by florian@ where userland emits an
USB_DEVICEINFO ioctl(2) for a device whose product/vendor names
haven't yet been filled.
ok florian@
|
|
|
|
ok anton@, visa@
|
|
Reported by anton@ and Natasha Kerensikova
|
|
|
|
|
|
ok ratchov@, visa@
|
|
ok visa@
|
|
ok tedu@, visa@
|
|
ok okan@, tedu@, visa@
|
|
USB_DEVICEINFO.
devel/libusb1 requires this piece of information.
ok jcs@, mikeb@, jasper@, sthen@
|
|
seen by the stack.
This will allows us to debug port status changes without relying on
external tools, like lsusb(1), that generate I/O.
While here correct USB3 LS port defines.
|
|
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@
|
|
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
|
|
|
|
ok natano visa
|
|
from jsg@
|
|
as per section 4.8.2.1 of xHCI specification.
Note that we never got this correctly.
Spotted by and ok jsg@
|
|
before using it as the ``wMaxPacketSize'' of the default endpoint.
This prevents host controller drivers from using incorrect value, in
particular 0, that makes ehci(4) crash.
While here do the 0xff -> 512 conversion for super speed devices.
Crash found with a facedancer21.
ok deraadt@
|
|
function for parsing and checking endpoint descriptors.
More checks will be added later to prevent malformed descriptors of
being used.
|
|
These descriptors are filled with value parsed from untrusted USB
descriptors and we don't want to left memory unitialized if an error
occurs during the parsing.
|
|
descriptors.
No functionnal change.
|
|
to NULL.
Prevent a use after free triggerable with invalid interface descriptor.
Found with umap2 and a facedancer21.
|
|
descriptor with a bad type.
Found with umap2 and a facedancer21.
|
|
Return a char * rather using a void function for usbd_get_device_string()
ok patrick@
|
|
fallback method to actually do its work and look up the strings via
the vendor and product id.
Regression noticed and ok tb@, ok mpi@
|
|
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@
|
|
disabled or if allocating memory during the attachment process failed.
Problem reported by and original diff from James Hastings on bugs@.
ok deraadt@
|
|
its descriptor. Fixes flaky attach of USB devices (most importantly the
detachable keyboard) on the Thinkpad Helix 2, and perhaps elsewhere.
Problem diagnosed by mpi; ok mpi@
|
|
Avoids a NULL dereference encountered with a device I have.
ok mpi@
|
|
Otherwise we might leave a port in an unwanted state.
Found while investigating timeout issues on xhci(4).
|
|
ok tedu@ deraadt@
|
|
ok deraadt@ tedu@
|
|
to the way USB buses are discovered.
|
|
anything with it and it simplifies this mess in order to implement
warm reset.
|
|
|
|
this hack in the drivers that need it.
Tested by many, thanks! ok pirofti@, kettenis@
|
|
prior to calling usbd_new_device().
This will let us set the specified default Max Packet Size before opening
the control pipe and reduces spaghetti!
ok stsp@
|
|
a pointer, found by clang.
|
|
to help integrating super speed hubs that use a different descriptor.
|
|
after discussions with beck deraadt kettenis.
|
|
that usbd_detach() should only be called by the thread doing USB
bus exploration to prevent attach/detach races.
|
|
by guenther@.
While here set the dying flag of the disconnected device so that most of
the DVACT_ACTIVATE handlers can go.
|
|
does not match the hardware address.
This change only matters for xHCI buses where the controller assigns
device addresses. But it is the simplest way to comply with the stack
requirement of assigning the first `logical' address to the root hub
device.
Device addresses are not much used anyway and a cleanup will follow to
avoid possible confusions.
This makes usbdevs(8) correctly report devices connected to xhci(4).
|