summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhub.c
Commit message (Collapse)AuthorAgeFilesLines
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Merge up-to-date with NetBSD. No functional changes.joe2003-07-141-6/+2
|
* MFNetBSD:joe2003-07-141-5/+3
| | | | | | | date: 2002/10/01 01:25:25; author: thorpej; Use CFATTACH_DECL(). Not a functional change on FreeBSD.
* MFNetBSD:joe2003-07-141-2/+1
| | | | | | date: 2002/09/23 05:51:20; author: simonb; Remove breaks after returns, unreachable returns and returns after returns(!).
* MFNetBSD:joe2003-07-141-1/+5
| | | | | date: 2003/02/08 03:32:51; author: ichiro; change URL pointers of USB[1,2] specification
* As defined by USB Specification Rev 2.0 (in section 11.24.2.5), tojoe2003-07-141-1/+1
| | | | | | | | | | | | | | get a Hub descriptor, we have to set req.wValue to "Descriptor Type and Descriptor Index". In this case, Descriptor Type is 0x29 (UDESC_HUB), Descriptor Index should be 0. If I don't do a check (dev->address > 1 ... ), root hub fails. A new Cytronix 4-port USB 2.0 Hub (Cypress CY7C65640 chip) now works after this patch. Submitted by: Alexander Pohoyda <alexander.pohoyda@gmx.net> MFC after: 7 days
* WARNING: white space diffjmg2003-07-041-15/+15
| | | | | | This code reduces the number of trailing white space to be more in line w/ NetBSD. I don't regenerate usbdevs, saving that for when it really changes.
* Use the hw.usb sysctl tree instead of debug.usb.joe2002-08-081-1/+2
| | | | Requested by: imp
* Replace the FOO_DEBUG definitions with USB_DEBUG, and switch thejoe2002-07-311-1/+1
| | | | | | debugging levels to off by default. Now that debug levels can be tweaked by sysctl we don't need to go through hoops to get the different usb parts to produce debug data.
* Wake up Joe! It would help if I included sys/sysctl.h.joe2002-07-311-0/+1
|
* Add a sysctl (debug.usb.uhub) for tweaking the uhub debug levels.joe2002-07-311-1/+3
|
* Avoid reprobing on loading a driver. This does not work as the ivars setn_hibma2002-06-171-0/+15
| | | | | | | | | during the previous probe are stale. What really should be done is route the probe through device_probe_and_attach bit this is one of those ICBBATIASS (I can't be bothered as there is a simpler solution). The user can easily replug the device after kldloading a new device driver.
* Reduce the difference between our version and NetBSD's. (Nojoe2002-04-071-11/+10
| | | | functional changes.)
* MFNetBSD:joe2002-04-071-1/+2
| | | | | | revision 1.57 date: 2001/11/20 16:08:37; author: augustss; state: Exp; lines: +3 -2 Add a comment.
* MFNetBSD: ohci.c (1.109), uhci.c (1.144), uhub.c (1.56), usb.c (1.57),joe2002-04-071-1/+1
| | | | | | | | usbdi.c (1.86), usbdivar.h (1.66) [Some partial, because most of this was merged in a while ago] date: 2001/11/20 13:48:03; author: augustss; Keep track of device speed for USB 2.0.
* MFNetBSD:joe2002-04-071-3/+3
| | | | | | revision 1.55 date: 2001/11/16 02:21:54; author: augustss; state: Exp; lines: +4 -4 Better error message.
* MFNetBSD: uhub.c (1.54), usb_subr.c (1.92)joe2002-04-071-1/+18
| | | | | date: 2001/11/16 01:57:47; author: augustss; Handle devices that disappear during reset gracefully.
* MFNetBSD:joe2002-04-071-2/+8
| | | | | | revision 1.52 date: 2001/10/26 17:53:59; author: augustss; state: Exp; lines: +8 -2 Compare pointer with NULL instead of using them as a condition.
* MFNetBSD:joe2002-04-071-3/+3
| | | | | | revision 1.51 date: 2001/10/24 15:30:17; author: augustss; state: Exp; lines: +3 -3 Better debug message.
* MFNetBSD: uhub.c (1.49), usb.c (1.51), usbdi.h (1.48), usbdivar.h (1.63)joe2002-04-021-2/+3
| | | | | | | | | date: 2001/01/21 19:00:06; author: augustss; Change the operation of the USB event thread. Before it only performed USB device discovery, now it can also perform (short) tasks for device drivers that need a process context, but don't have one. This is not pretty, but better than using busy-wait in an interrupt context.
* Merge from NetBSD:joe2002-02-191-4/+13
| | | | | * rev 1.47: Update a URL * rev 1.56: Keep track of device speed for USB 2.0.
* Merge from NetBSD.joe2002-01-281-1/+4
| | | | | | | | | | | | | | | | | | | | uhub.c: revision 1.37 usb.4: revision 1.30 usb.c: revision 1.38 usb.h: revision 1.40 usb_port.h: revision 1.21 usb_subr.c: revision 1.65 usbdi.h: revision 1.40 Split the attach/detach events up into device, driver and controller attach and detach events. The commit message from NetBSD was: date: 2000/02/02 07:34:00; author: augustss; state: Exp; Change the USB event mechanism to include more information about devices and drivers. Partly from FreeBSD. Also rework usbd to take these new event types into account.
* Rearrange the code in USB_DETACH, so that it's like NetBSD's. Nojoe2002-01-261-6/+6
| | | | functional change.
* Sync with NetBSD:joe2002-01-021-1/+1
| | | | | | date: 2000/02/29 21:37:01; author: augustss; state: Exp; Distinguish between device and interface classes. (I finally found a document that said that they were different.)
* Only clear endpoint stall if status was USBD_STALLED.n_hibma2001-09-021-3/+3
| | | | | This avoids panicing the system by unplugging a hub. The interrupt transfer would sometimes arrive after the driver had been removed.
* Do NOT allocate a 1K buffer on the kernel stack.julian2001-08-101-2/+12
| | | | | Found by: Smashed u-area and hardware watch points. MFC after: 1 week
* Bugfix: device_resume should be connected to bus_generic_resume notn_hibma2001-01-051-1/+1
| | | | | | *_suspend. Submitted by: kazu
* Sync with NetBSD:n_hibma2000-10-161-22/+14
| | | | | | Add seatbelts. Be more lenient towards restarting the ports: If a port manages to connect successfully reset the restartcount.
* Remove __P prototypes to reduce diffs between the NetBSD and FreeBSDn_hibma2000-07-171-2/+2
| | | | versions.
* Sync with NetBSD:n_hibma2000-05-141-88/+79
| | | | | Make the behaviour more similar to what the Microsoft uhub driver does.
* Change Lennart's e-mail address.n_hibma2000-05-141-1/+1
|
* Initialise the debug value.n_hibma2000-05-071-1/+1
|
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-7/+7
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Add support for DEVICE_SUSPEND, DEVICE_RESUME and DEVICE_SHUTDOWNn_hibma2000-01-201-2/+8
| | | | | | | | | | methods for USB devices. However: with none of the devices I have here suspend seems to work properly. This is probably a bug in uhci_power which I still have to look at. Prodded and pushed by: Christopher Masto <chris@netmonger.net>
* More USB ethernet tweaks:wpaul2000-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Sync ohci, uhci and usbdi modules with NetBSD in order to obtain the following improvements: o New USBD_NO_TSLEEP flag can be used in place of UQ_NO_TSLEEP quirk. This allows drivers to specify busy waiting only for certain transfers (namely control transfers for reading/writing registers and stuff). o New USBD_FORCE_SHORT_XFER flag can be used to deal with devices like the ADMtek Pegasus that sense the end of bulk OUT transfers in a special way (if a transfer is exactly a multiple of 64 bytes in size, you need to send an extra empty packet to terminate the transfer). o usbd_open_pipe_intr() now accepts an interval argument which can be used to change the rate at which the interrupt callback routine is invoked. Specifying USBD_DEFAULT_INTERVAL uses the value specified in the device's config data, but drivers can override it if needed. - Change if_aue to use USBD_FORCE_SHORT_XFER for packet transmissions. - Change if_aue, if_kue and if_cue to use USBD_NO_TSLEEP for all control transfers. We no longer force the non-tsleep hack for bulk transfers since these are done asynchronously anyway. - Removed quirk entry fiddling from if_aue and if_kue since we don't need it anymore now that we have the USBD_NO_TSLEEP flag. - Tweak ulpt, uhid, ums and ukbd drivers to use the new arg to usbd_open_pipe_intr(). - Add a flag to the softc struct in the ethernet drivers to indicate when a device has been detached, and use this flag to perform tests to prevent the drivers from trying to do control transfers if this is the case. This is necessary because calling if_detach() with INET6 enabled will eventually result in a call to the driver's ioctl() routine to delete the multicast groups on the interface, which will result in attempts to perform control transfers. (It's possible this also happens even without INET6 support enabled.) This is pointless since we know that if the detach method has been called, the hardware has been unplugged. - Changed watchdog timeout routines to just call the driver init routines to initialize the device states without trying to close and re-open the pipes. This is partly because we don't want to frob things at interrupt context, but also because this doesn't seem to work right and I don't want to panic the system just because a USB device may have stopped responding. - Fix aue_rxeof() to be a little smarter about detecting when a double transfer is needed. Unfortunately, the design of the chip makes it hard to get this exactly right. Hopefully, this will go away once either Nick or Lennart finds the bug in the uhci driver that makes this ugly hack necessary. - Also sync usbdevs with NetBSD.
* Synchronisation with NetBSD 1999/11/27n_hibma1999-11-281-13/+21
| | | | | | | | | | | | | | | | | - more req[uest]->xfer changes. - get the corresponding NetBSD Id's right ohci.c - move untimeout above print statement - remove usb_delay that panics the system (tsleep in intr context) when ohcidebug > 5. ugen.c - create the devices for endpoints with make_dev. uhub.c - change from using usbdebug to uhubdebug - add more debugging statements
* Synchronisation with NetBSD as of 1999/11/16:n_hibma1999-11-171-185/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaning up the code: - Declare many functions static - Change variable names to make them more self explanatory - Change usbd_request_handle -> usbd_xfer_handle - Syntactical changes - Remove some unused code - Other KNF changes Interrupt context handling - Change delay to usbd_delay_ms were possible (takes polling mode into account) - Change detection mechanism for interrupt context Add support for pre-allocation DMA-able memory by device driver Add preliminary support for isochronous to the UHCI driver (not for OHCI yet). usb.c, uhci.c, ohci.c - Initial attempt at detachable USB host controllers - Handle the use_polling flag with a lttle more care and only set it if we are cold booting. usb.c, uhci.c ohci.c, usbdi.c usbdi_util.c usb_subr.c - Make sure an aborted pipe is marked as not running. - Start queued request in the right order. - Insert some more DIAGNOSTIC sanity checks. - Remove (almost) unused definitions USBD_XFER_OUT and USBD_XFER_IN. usb.c, usb_subr.c - Add an event mechanism so that a userland process can watch devices come and go. ohci.c - Handle the case when a USB transfer is so long that it crosses two page (4K) boundaries. OHCI cannot do that with a single TD so we make a chain. ulpt.c - Use a bigger buffer when transferring data. - Pre-allocate the DMA buffer. This makes the driver slightly more efficient. - Comment out the GET_DEVICE_ID code, because for some unknown reason it causes printing to fail sometimes. usb.h - Add a macro to extract the isoc type. - Add a macro to check whether the routine has been entered after splusb and if not, complain. usbdi.c - Fix a glitch in dequeueing and aborting requests on interrupt pipes. - Add a flag in the request to determine if the data copying is done by the driver or the usbdi layer.
* Remove superfluous header file includesn_hibma1999-11-081-4/+7
| | | | | | Remove definition of initialiser. Some clean up.
* Major synchronisation with the NetBSD USB stack:n_hibma1999-10-071-99/+212
| | | | | | | | | | | - Some cleanup and improvements in the uhci and ohci drivers - Support for plugging and unplugging devices improved - Now available is bulk transport over OHCI controllers - Resume and suspend have been temporarily been disabled again. Proper support for it is available in the uhci.c and ohci.c files but I have not yet spent the brain cycles to use it. - OpenBSD now uses the USB stack as well - Add FreeBSD tags
* Move the declaration of the interrupt type from the driver structuredfr1999-05-081-1/+0
| | | | to the BUS_SETUP_INTR call.
* Remove double removal of children of a hub. (remove disconnected method)n_hibma1999-05-031-29/+2
| | | | | | This was introduced when merging a patch for the newbus people. And change the debugging flag from USB_DEBUG to UHUB_DEBUG.
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-5/+19
| | | | | | | | | | | | | | | | | | i386 platform boots, it is no longer ISA-centric, and is fully dynamic. Most old drivers compile and run without modification via 'compatability shims' to enable a smoother transition. eisa, isapnp and pccard* are not yet using the new resource manager. Once fully converted, all drivers will be loadable, including PCI and ISA. (Some other changes appear to have snuck in, including a port of Soren's ATA driver to the Alpha. Soren, back this out if you need to.) This is a checkpoint of work-in-progress, but is quite functional. The bulk of the work was done over the last few years by Doug Rabson and Garrett Wollman. Approved by: core
* 1) Make debugging more selective.n_hibma1999-04-111-14/+11
| | | | | | | 2) create function usbd_errstr which turns a usbd_status into a sensible error message 3) Change the printf in DPRINTF to logprintf which is a define for log(KERN_DEBUG, x)
* Reenable the recursive disconnection from a hub. Stop gap solutionn_hibma1999-04-111-7/+9
| | | | | | until the newbus version of uhub.c is ready. Submitted by: Kazutaka YOKOTA
* Cosmetical changes.n_hibma1999-03-221-2/+2
|
* Bug fix: Trap 12 when ugen not present and therefore unattached physicaln_hibma1999-02-211-2/+7
| | | | device removed.
* Textual changesn_hibma1999-01-221-20/+35
|
* Corrected the latent fact that the uhub driver was providing a driver forn_hibma1999-01-141-4/+22
| | | | | the usb device class instead of the uhub devclass. Only a problem with more than one USB host controller.
* Sync with NetBSD sources. Almost there. Mostly style fixes.n_hibma1999-01-101-3/+5
|
* Major synchronisation with NetBSD USB coden_hibma1999-01-071-174/+181
|
OpenPOWER on IntegriCloud