summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ehci.c
Commit message (Collapse)AuthorAgeFilesLines
* fix a "little-endian-big-endian confusion that luckily:julian2005-01-091-2/+2
| | | | | | | | | | | 1/ doesn't matter on most of our architectures 2/ will never happen unless we start queueing multiple trasactions to a single endpoint at one time (which we do not allow yet). If anyone has a big_endian machine with EHCI they might check this if they are having problems with EHCI but it's unlikely even there.. Submitted by: Hans Petter Selasky <hselasky@c2i.net> MFC after: 3 days
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Fix comment. One of the two "Step 4" shuold be a "step 5"julian2005-01-051-1/+1
|
* Rewrite ehci_abort_xfer() to use the method hinted at in the EHCI spec.julian2004-12-291-45/+107
| | | | | | | | | | | | | to remove a transaction from the async schedule. The previous method didn't work well and led to the hardware writing to free'd buffers etc, as it didn't always know that the transaction had been aborted. Written after consultation with David Brownell who wrote the Linux EHCI driver. As part of this give the sqh structure a "previous" pointer. MFC after: 1 week
* Slight change to formatting so that 'ctags' doesn'tjulian2004-12-181-1/+3
| | | | | | | give up on teh file half way through.. Might have been my mistake earlier anyhow. No actual code change MFC after: 5 days
* Make LINT compile.phk2004-12-141-1/+1
| | | | | | | When leaving functions for ddb use don't make them static: it makes gcc think they are unused. Shouldn't this be in #ifdef DDB anyway ?
* A bunch more whitespace and formatting diff reductions for NetBSD.julian2004-12-141-17/+19
| | | | | Obtained from: NetBSD MFC after: 1 week
* Don't abandon ship just because the number of companions doesn't seem correct.julian2004-12-141-3/+6
| | | | | Obtained from: NetBSD MFC after: 1 week
* Small formatting change..julian2004-12-141-1/+1
| | | | | | | Move a declaration to the same place as in NetBSD. Obtained from: NetBSD MFC after: 1 week
* Fix just the worst of the timeout race conditions that the previousiedowse2004-11-161-1/+5
| | | | | | backed out commits were trying to address: when cancelling the timeout callout, also cancel the abort_task event, since it is possible that the timeout has already fired and set up an abort_task.
* Back out my recent changes for timeout races, as there have beeniedowse2004-11-121-45/+19
| | | | | | | reports of problems. The bug is probably that there are cases where `xfer->timeout && !sc->sc_bus.use_polling' is not a suitable test for an active timeout callout, so an explicit flag will be necessary. Apologies for the breakage.
* Attempt to fix a number of race conditions in the handling ofiedowse2004-11-091-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | transfer timeouts that typically cause a transfer to be completed twice, resulting in panics and page faults: o A transfer completion interrupt could arrive while an abort_task event was set up, so the transfer would be aborted after it had completed. This is very easy to reproduce. Fix this by setting the transfer status to USBD_TIMEOUT before scheduling the abort_task so that the transfer completion code will ignore it. o The transfer completion code could execute concurrently with the timeout callout, leaving the callout blocked (e.g. waiting for Giant) while the transfer completion code runs. In this case, callout_stop() does not prevent the callout from running, so again the timeout code would run after the transfer was complete. Handle this case by checking the return value from callout_stop(), and ignoring the transfer if the callout could not be removed. o Finally, protect against a timeout callout occurring while a transfer is being aborted by another process. Here we arrange for the timeout processing to ignore the transfer, and use callout_drain() to ensure that the callout has really gone before completing the transfer. This was tested by repeatedly performing USB transfers with a timeout set to approximately the same as the normal transfer completion time. In the PR below, apparently this occurred by accident with a particular printer and the default timeout. PR: kern/71491
* The ehci_dump() function shouldn't be declared static, as it isiedowse2004-11-031-1/+1
| | | | | | just a convenience function to be called from debuggers that gets compiled in when EHCI_DEBUG is defined. Move its declaration to make this more obvious.
* Merge recent USB2/EHCI related changes from NetBSD:iedowse2004-11-031-80/+119
| | | | | | | | | | | | | | | | o Reduce the interrupt delay to 2 microframes. o Follow the spec more closely when updating the overlay qTD in the QH. o No need to generate an interrupt at the data part of a control transfer, it's generated by the status transfer. o Make sure to update the data toggle on short transfers. o Turn the printf about needing toggle update into a DPRINTF. o Keep track of what high speed port (if any) a device belongs to so we can set the transaction translator fields for the transfer. o Verbosely refuse to open low/full speed pipes that depend on unimplemented split transaction support. o Fix various typos in comments. Obtained from: NetBSD
* Save and restore state across suspend/resume events.iedowse2004-10-301-37/+91
| | | | | Submitted by: David Gwynne <dlg@openbsd.org> Obtained from: OpenBSD (+ extra patches supplied by David)
* Make the USB subsystem unloadable and detachable, though currentlyiedowse2004-08-021-9/+13
| | | | | a significant amount of memory may be leaked each time a host controller is detached.
* Attempt to follow the correct procedure for synchronising with theiedowse2004-08-021-3/+0
| | | | | | | system BIOS to disable legacy device emulation as per the "EHCI Extended Capability: Pre-OS to OS Handoff Synchronisation" section of the EHCI spec. BIOSes that implement legacy emulation using SMIs are supposed to disable the emulation when this procedure is performed.
* Implement basic support for EHCI interrupt pipes. This is unlikelyiedowse2004-08-011-11/+266
| | | | | | | | to be particularly correct or optimal, but it seems to be enough to allow the attachment of USB2 hubs and USB2 devices connected via USB2 hubs. None of the split transaction support is implemented in our USB stack, so USB1 peripherals will definitely not work when connected via USB2 hubs.
* Diff reduction to NetBSD.le2004-07-191-2/+1
| | | | | | | | ehci.c rev. 1.69, author: mycroft uhci.c rev. 1.179, author: mycroft hcpriv is not actually used here. Remove references to it. Obtained from: NetBSD
* MFNetBSD.le2004-07-151-6/+6
| | | | | | | | | | | rev. 1.67, author: mycroft Fix a byte order error. rev. 1.68, author: mycroft Adjust some silliness that was causing us to do extra work for "frame list rollover" interrupts, which we pretty much ignore. Obtained from: NetBSD
* Unbreak -O2 build: initialize nstatus to avoid uninitialized warning.marcel2004-07-031-1/+3
|
* MFNetBSD.le2004-07-011-2/+3
| | | | | | | rev 1.66, author: mycroft Fix an endianness problem (EHCI_NULL was being double-swapped). Obtained from: NetBSD
* MFNetBSD ehci.c and ehcireg.hle2004-06-261-44/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ehci.c (1.55), ehcireg.h (1.16); author: mycroft Set the data toggle correctly, and use EHCI_QTD_DTC. This fixes problems with my ALi-based drive enclosure (it works now, rather than failing to attach). Also seems to work with a GL811-based enclosure and an ASUS enclosure with a CD-RW, on both Intel and NEC controllers. Note: The ALi enclosure is currently very SLOW, due to some issue with taking too long to notice that the QTD is complete. This requires more investigation. ehci.c (1.56); author: mycroft Failure to properly mask off UE_DIR_IN from the endpoint address was causing OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set spuriously, causing rather interesting lossage. Suddenly I get MUCH better performance with ehci... ehci.c (1.58); author: mycroft Fix a stupid bug in ehci_check_intr() that caused use to try to complete a transaction that was still running. Now ehci can handle multiple devices being active at once. ehci.c (1.59); author: enami As the ehci_idone() now uses the variable `epipe' unconditionally, always declare it (in other words, make this file compile w/o EHCI_DEBUG). ehci.c (1.60); author: mycroft Remove comment about the data toggle being borked. ehci.c (1.61); author: mycroft Update comment. ehci.c (1.62); author: mycroft Adjust a couple of comments to make it clear WTF is going on. ehci.c (1.63); author: mycroft Fix an error in a debug printf(). ehci.c (1.64), ehcireg.h (1.17); author: mycroft Further cleanup of toggle handling. Now that we use EHCI_QH_DTC, we don't need to fiddle with the TOGGLE bit in the overlay descriptor, so minimize how much we fuss with it. Obtained from: NetBSD
* Diff reduction to NetBSDjulian2004-03-191-23/+56
| | | | | | | Trying to figure out why this only works with SOME EHCI controllers. Obtained from: NetBSD MFC after: 1 week
* MFNetBSD:joe2003-11-101-3/+4
| | | | | | date: 2003/10/18 04:50:35; author: simonb Remove assigned-to but otherwise unused variables. Remove unreachable break after return statements.
* MFNetBSD:joe2003-11-091-1/+1
| | | | | | - remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD(). this mirrors the functionality of SLIST_REMOVE_HEAD() (the other singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* make usb bus_dma aware.jmg2003-07-151-10/+4
| | | | Reviewed by: joe among others
* add EHCI (USB 2.0) controller support.ticso2003-04-141-0/+2822
Approved by: joe gallatin (mentor) Obtained from: NetBSD
OpenPOWER on IntegriCloud