| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
CID 1453335.
|
|
|
|
| |
ok mpi@
|
|
|
|
|
|
| |
usbd_device2interface_handle().
ok visa@
|
|
|
|
| |
ok tedu@, visa@
|
|
|
|
|
| |
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
|
|
|
|
|
|
|
| |
do it instead.
If anything bad happen due to a malformed descriptor it makes no sense
to try to attach a driver, and bail before probing.
|
|
|
|
|
|
|
|
|
|
|
|
| |
indicating a warm reset has happened. Communicate this as UPS_C_BH_PORT_RESET
to the upper layers and make uhub(4) clear this bit such that we receive
further connection status change notifications. Make sure we only do this
for super speed (USB 3.0) hubs as high speed (USB 2.0) hubs use the same bit
for UPS_C_PORT_L1.
Make hotplugging USB 3.0 devices work on my MacBookPro12,1.
ok mpi@
|
|
|
|
|
|
|
|
|
|
| |
speed ports may have the XHCI_PS_PRC bit set after xhci(4) attaches. Just
clearing this bit isn't enough though, since the device is already connected
and no further connection status change is signalled. So fake one.
This makes the integrated SD card reader in the MacBookPro12,1 attach.
ok mpi@
|
|
|
|
|
|
|
|
| |
into its own functions.
Needed for upcoming "port link state" change handling.
Tested by sobrado@
|
|
|
|
|
|
|
|
|
|
| |
There's not bit to indicate the speed of a USB3.0 device attached to a hub
port so do not abuse the PORT_TEST bit. Instead make the xhci(4) root hub
report the PORT_POWER_SS bit when appropriate and use it to determin the
speed of a new device.
While here make the root hub report the link state and config error, from
FreeBSD.
|
|
|
|
|
|
|
|
| |
been found: it was a hardware failure.
When a bus is explored, do not probe the ports which status hasn't
changed. This saves a lot of I/O when attaching/detaching devices
and might help with some timing related problems.
|
| |
|
| |
|
|
|
|
| |
ok deraadt@ tedu@
|
|
|
|
| |
a regression reported by ajacoutot@.
|
|
|
|
|
|
|
|
| |
interrupt routine properly initialize a variable. Finally stop talking
about the "bus event handler thread". Our USB stack has only one thread
doing discovery for all buses.
Prompted by a report from Patrick Wildt.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
Without knowing their depth, hubs couldn't find the bits correspdonding
to their downstream port in the route-string. Now USB 3.0 devices just
work(tm) anywhere in your hub chain.
This commit would not have been possible without the cheese provided by
miod@ at #HAMoween.
|
|
|
|
|
| |
anything with it and it simplifies this mess in order to implement
warm reset.
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
in the hub, not from some random value from the stack.
|
|
|
|
|
|
|
|
|
|
|
|
| |
be able to use USB 3.0 devices behind an external hub.
This is a bit tricky because the SS status use a different power bit
that maps to the Low speed one. So no longer accept devices without
power bit and fallback to the parent hub's speed in case the status
does not report any particular speed.
Note that xhci(4) root hubs still set the traditionnal UPS_PORT_POWER
bit with the correct device speed.
|
| |
|
|
|
|
| |
to help integrating super speed hubs that use a different descriptor.
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
|
|
| |
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!
|
| |
|
|
|
|
|
|
| |
non-superspeed hub descriptors. This is the minimal change I
came with to be able to properly attach and use USB 3.0 devices
attached to a xHCI root hub, uhub(4) clearly needs some love.
|
|
|
|
|
| |
This will help us deal with the different hub device descriptors used
by super speed devices.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
special glasses.
No object change if UHUB_DEBUG is not defined.
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
|
| |
Found by Amit Kulkarni using clang.
Fix from jakemsr; his diff was sitting on tech@ since February.
ok myself, phessler, sthen, jasper
and also pirofti, mikeb, krw (back in February)
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
them from userland, and nothing in the kernel uses them.
ok krw@, miod@
|
|
|
|
|
|
|
| |
usbd_deactivete() and usbd_is_dying()
* use usbd_deactivate() in activate()/DEACTIVATE
* convert a few more direct checks of the associated bus' dying flag
with usbd_is_dying()
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
determined by bNbrPorts in hub descriptor.
USB hub sends status packet to host, it contains status bits for each port
and hub itself. So, the packet size is ceil((port + 1) / 8) bytes.
If host requests smaller than that size, the hub behavior is undefined.
Some hub (Intel's RMH for example) sends whole status every time,
it makes babble of USB. This is the reason that uhub_intr() of old code
was suffered from USBD_IOERROR,
Okay deraadt@ and yuo@.
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
This is needed for the addition of further suspend/resume actions.
Okay deraadt@, marco@.
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
so that it shows up before the :. as a result, all the usb devices do not
need to have name printing code anymore. all this now works and prints
nicely because usbd_probe_and_attach() is serialized. ok kettenis
|
|
|
|
|
|
|
|
| |
USB_DECLARE_DRIVER macros.
No binary change.
ok dlg.
|
|
|
|
|
|
| |
No binary change.
ok mk.
|