summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhci.c
Commit message (Collapse)AuthorAgeFilesLines
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Fix just the worst of the timeout race conditions that the previousiedowse2004-11-161-1/+2
| | | | | | 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-40/+16
| | | | | | | 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-16/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Handle all types of interrupts when operating the uhci(4) controller injhb2004-10-281-2/+2
| | | | | | | | polled mode. PR: kern/73000 Submitted by: Daan Vreeken <Danovitsch at Vitsch dot net> MFC after: 1 month
* The macro for the function specifier inline is spelled '__inline'.stefanf2004-10-031-3/+3
|
* Reinstate a usb_transfer_complete() call that got lost in theiedowse2004-08-021-0/+1
| | | | previous revision.
* Make the USB subsystem unloadable and detachable, though currentlyiedowse2004-08-021-3/+14
| | | | | a significant amount of memory may be leaked each time a host controller is detached.
* 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
* Diff reduction to NetBSD.le2004-05-231-3/+5
| | | | | | | | | | | | | MFNetBSD 1.177; author: toshii Use the correct wValue to get hub desriptors. Also, make wValue checks of root hub codes less strict. MFNetBSD 1.178: author: martin Interrupt descriptors might become invalid while being processed in uhci_check_intr - so remember their next pointer before calling it. Patch provided by Matthew Orgass in PR kern/24542. Obtained from: NetBSD
* Fix a suspend/resume issue. My Compaq N400c works fine.shiba2004-01-121-0/+3
|
* MFNetBSD:joe2003-11-101-0/+10
| | | | | | | revision 1.176 date: 2003/11/04 19:11:21; author: mycroft; Ignore a CRCTO error on a SETUP transaction in combination with STALLED or NAK. This fixes problems with the GL641.
* MFNetBSD:joe2003-11-091-1/+2
| | | | | date: 2003/09/12 16:18:08; author: mycroft; Tweak a debugging printf().
* Revise the NetBSD revision control strings.joe2003-11-091-10/+1
|
* MFNetBSD:joe2003-11-091-3/+3
| | | | | | - 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-3/+2
| | | | Reviewed by: joe among others
* MFNetBSD:joe2003-07-141-10/+11
| | | | | | date: 2003/05/13 04:41:59; author: gson; Function names printed in debug messages did not always match the actual name of the function.
* MFNetBSD: revision 1.172joe2003-07-141-1/+1
| | | | | date: 2003/02/23 04:19:26; author: simonb; Remove unreachable break after return.
* MFNetBSD: revision 1.170joe2003-07-141-1/+5
| | | | | date: 2003/02/19 01:35:04; author: augustss; Bail out early in isoc_done if the ii is not on the interrupt list.
* MFNetBSD: rev 1.169joe2003-07-141-6/+21
| | | | | date: 2003/02/16 23:15:28; author: augustss; Don't take xfers off the interrupt list if they are not on it yet.
* Make a note of which patches we already have incorporated from NetBSD.joe2003-07-141-1/+6
|
* MFNetBSD:joe2003-07-141-2/+6
| | | | | date: 2003/02/08 03:32:51; author: ichiro; change URL pointers of USB[1,2] specification
* MFNetBSD: rev 1.166joe2003-07-141-13/+99
| | | | | | | | | | date: 2002/12/31 02:21:31; author: dsainty; Be somewhat more persuasive about enabling the port on a port reset. USB protocol dictates that the port enable must be implied by the port reset. To implement this on (at least) the VIA VT83C572 this means we need to wait around tweaking the chip state until the port actually transitions to enabled (or the device goes away). Likely fixes kern/11018.
* MFNetBSD: 1.165joe2003-07-141-3/+8
| | | | | date: 2002/12/31 02:04:49; author: dsainty; CONSTCOND away some lint warnings
* remove \n at end of panic strings. They are added by the call to panic.jmg2003-07-041-7/+7
| | | | | | This brings us more in line with Net/OpenBSD Obtained from: Net/OpenBSD
* WARNING: white space diffjmg2003-07-041-4/+4
| | | | | | 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.
* Make uhci_waitintr() robust to interrupts being enabled, even thoughiedowse2003-03-111-4/+3
| | | | | | | | | it is expected that they will not be enabled at the time that it is called. This is reported to work around a problem in RELENG_4 where the kernel panics on boot if FAST_IPSEC and crypto support are enabled. Tested by: Scott Johnson <scottj@insane.com>
* Implement outgoing interrupt pipes. It is part of the USB 1.1 spec.jhay2003-02-281-3/+13
| | | | The Lego Infrared Tower use it.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* When resuming after a system suspend, re-issue the UHCI_CMD_MAXPiedowse2002-12-261-0/+1
| | | | | | | | | | command in case this setting was not saved. Since bandwidth reclamation (-current only) often results in bus activity continuing to the end of every frame, most transfers would fail with IOERROR if this setting is missed. Reviewed by: n_hibma MFC after: 1 week
* In rev 1.51 of usb_port.h I switched over to using the USB_USE_SOFTINTRjoe2002-09-301-0/+6
| | | | | | | | | | | | | | | code path to fix a bug in the non USB_USE_SOFTINTR path that caused the usb bus to hang and generally misbehave when devices were unplugged. In the process though it also reduced the throughput of usb devices because of a less than optimal implementation under FreeBSD. This commit fixes the non USB_USE_SOFTINTR code in uhci and ohci so that it works again, and switches back to using this code path. The uhci code has been tested, but the ohci code hasn't. It's essentially the same anyway and so I don't envisage any difficulties. Code for uhci submitted by: Maksim Yevmenkin <myevmenk@exodus.net>
* Use the hw.usb sysctl tree instead of debug.usb.joe2002-08-081-1/+4
| | | | Requested by: imp
* Replace the FOO_DEBUG definitions with USB_DEBUG, and switch thejoe2002-07-311-26/+26
| | | | | | 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.
* Get bored with hard coded debug level variables and introduce a debug.usbjoe2002-07-311-0/+3
| | | | | | sysctl tree for tweaking them real-time. Reviewed by: iedowse
* Remove some strange code that allocates memory and then immediatelyiedowse2002-07-301-26/+2
| | | | | | | | frees it again. The idea was to perform M_WAITOK allocations in a process context to reduce the risk of later interrupt-context M_NOWAIT allocations failing, but in fact this code can be called from contexts where it is not desirable to sleep (e.g. if_start routines), so it causes lots of witness "could sleep" warnings.
* NetBSD have adopted our usage of the DMAADDR macro:joe2002-05-281-1/+1
| | | | | | | | date: 2002/05/28 12:42:39; author: augustss; Change DMAADDR macro slightly. Update the $NetBSD$ tags to reflect this and make slight changes to usb_mem.h so that we're in sync with each other.
* MFNetBSD: ohci.c (1.124), uhci.c (1.159), usbdi.c (1.100)joe2002-05-261-3/+3
| | | | | | | | | date: 2002/05/19 06:24:31; author: augustss; state: Exp; Update dma memory access API a little. NetBSD have adopted our way of using the KERNADDR macro. Update the revision tags to show that we're in sync, and remove the casts that they did in their adaptation.
* Move the new byte order function prototypes from <sys/param.h> tomike2002-04-261-0/+1
| | | | <sys/endian.h>. This puts us in line with NetBSD and OpenBSD.
* General white space cleanup, to synchronise with NetBSD.joe2002-04-071-26/+36
|
* MFNetBSD:joe2002-04-071-3/+3
| | | | | | | | revision 1.157 date: 2002/03/16 16:13:41; author: tsutsui; state: Exp; lines: +4 -4 Fix a couple of typo: - s/ehci/uhci/ (in unused arg of macro) - s/ohci/uhci/ (in panic message)
* MFNetBSD:joe2002-04-071-2/+2
| | | | | | revision 1.156 date: 2002/03/04 00:53:33; author: augustss; state: Exp; lines: +3 -3 Use the correct pointer for the timeout abort.
* MFNetBSD:joe2002-04-071-8/+7
| | | | | | revision 1.155 date: 2002/02/27 12:42:41; author: augustss; state: Exp; lines: +8 -8 Move the interrupt bailout when a cancelled ii is found.
* MFNetBSD:joe2002-04-071-8/+13
| | | | | | | revision 1.154 date: 2002/02/27 12:12:45; author: augustss; state: Exp; lines: +14 -9 Remove spurious splusb(). Lower abort hardware wait.
* MFNetBSD:joe2002-04-071-23/+67
| | | | | | | revision 1.153 date: 2002/02/11 11:40:33; author: augustss; state: Exp; lines: +67 -26 Switch to the same abort mechanism as in [eo]hci; it should be more robust.
* MFNetBSD:joe2002-04-071-2/+2
| | | | | | | revision 1.151 date: 2002/01/27 23:00:34; author: augustss; state: Exp; lines: +3 -3 Use M_WAITOK instead of M_NOWAIT when allocating extra descriptors. Spotted by OpenBSD.
* MFNetBSD: hid.c (1.22), uhci.c (1.150), usb_subr.c (1.97)joe2002-04-071-3/+3
| | | | | date: 2002/01/14 13:23:37; author: tsutsui; Call malloc(9) with M_ZERO flag instead of memset() after malloc().
* Update $NetBSD$ idents.joe2002-04-071-1/+1
|
OpenPOWER on IntegriCloud