summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ohci.c
Commit message (Collapse)AuthorAgeFilesLines
* Make intr_nesting_level per-process, rather than per-cpu. Setupjake2001-01-211-1/+1
| | | | | | | | interrupt threads to run with it always >= 1, so that malloc can detect M_WAITOK from "interrupt" context. This is also necessary in order to context switch from sched_ithd() directly. Reviewed By: peter
* Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variablesjake2001-01-101-1/+1
| | | | other then curproc.
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* Undo previous commit. <machine/clock.h> is needed for the prototypen_hibma2000-10-161-0/+1
| | | | for DELAY().
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Remove __P prototypes to reduce diffs between the NetBSD and FreeBSDn_hibma2000-07-171-96/+96
| | | | versions.
* Change Lennart's e-mail address.n_hibma2000-05-141-1/+1
|
* OpenBSD has a broken debugger that does not grok static. Use an_hibma2000-04-031-117/+117
| | | | | | #define Static static that the OpenBSD folks can define it to be empty if they like.
* Get rid of the last remnants of powerhook abuse.n_hibma2000-03-181-2/+2
|
* Add the TD's to the hash when they are created not when they are used.n_hibma2000-03-151-16/+41
| | | | | | | | | | This makes it possible to handle the done queue even when the end of tail TD has ended up on the done queue as well (the xfer in this case is NULL but the next field is valid, so we simply skip that element. Make sure we mark all the handled transfers as handled. Stop using powerhooks. They are a NetBSD-ism.
* Correctly handle the conversion from virtual to physical addresses. Then_hibma2000-02-101-26/+54
| | | | | | | | | | | | problem was basically (for offset > 4096): vtophys(addr) + offset != vtophys(addr + offset) Also, use TD's with a maximum size of 4k instead of 8kb for OHCI controllers. This problem occurs in drivers that use large transfer sizes: umass, host2host and ethernet with jumbo frames.
* Get the KASSERT right.n_hibma2000-01-291-1/+1
|
* Fix debugging output. The TDs are linked through the dnext field, notn_hibma2000-01-291-1/+2
| | | | nexttd.
* Remove a warning from LINTn_hibma2000-01-291-1/+1
|
* Unbreak LINT.n_hibma2000-01-291-1/+1
| | | | Pointed out by: Peter Wemm
* First part of the fix for ohci_hash_find_td panic.n_hibma2000-01-291-4/+21
| | | | | | | Some controllers submit bogus pointers to the Done queue. ohci_hash_find_td fails to find these in its hash and panics. Instead of panicing we now assume the whole done queue is lost and let the timeout code to clean up the mess after us.
* Add comments and debugging info.n_hibma2000-01-291-9/+20
|
* The toggle carry bit is stored in the headp not the tailp.n_hibma2000-01-291-2/+2
|
* Mask off the last two bits before comparing. It might just be that somen_hibma2000-01-291-4/+8
| | | | hardware might leave those bits in the wrong state.
* Tripmine for bad hardware.n_hibma2000-01-291-0/+4
|
* Correct the list of error messages. It was incomplete.n_hibma2000-01-281-0/+3
|
* Move the defines to the right location.n_hibma2000-01-271-7/+14
| | | | | | | Add a DIAGNOSTIC when closing interrupt pipes. Insert splx(s) which were left out with iso pipes (non-functional yet) and in a DIAGNOSTIC.
* Add commentsn_hibma2000-01-261-6/+27
|
* Fix a warning in DIAGNOSTIC code.peter2000-01-231-1/+1
|
* More USB ethernet tweaks:wpaul2000-01-201-62/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* Add an extra debugging message.n_hibma2000-01-101-1/+4
|
* Synchronisation with NetBSD 1999/11/27n_hibma1999-11-281-31/+32
| | | | | | | | | | | | | | | | | - 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-500/+692
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 includes.n_hibma1999-11-081-1/+1
| | | | Pushed-By: phk
* Major synchronisation with the NetBSD USB stack:n_hibma1999-10-071-422/+527
| | | | | | | | | | | - 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
* Correct URL's and change ifdef to if defined (following rest of style inn_hibma1999-08-281-3/+3
| | | | file)
* Don't schedule the next transaction if the pipe is being aborted.dfr1999-08-261-1/+0
|
* Add comments, change variable names to make them consistent (r -> err,n_hibma1999-07-251-5/+5
| | | | timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.)
* Trivial tweak to avoid a warning.peter1999-05-081-0/+2
|
* Clean up debugging outputn_hibma1999-05-031-8/+13
|
* UHCI_DEBUG should of course be OHCI_DEBUGn_hibma1999-04-171-13/+12
| | | | Reported by: MAEKAWA Masahide <bishop@rr.iij4u.or.jp>
* Bring the 'new-bus' to the i386. This extensively changes the way thepeter1999-04-161-6/+4
| | | | | | | | | | | | | | | | | | 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-12/+21
| | | | | | | 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)
* Textual changesn_hibma1999-01-221-3/+4
|
* 1) Bug fix: Interrupt transfers worked only for the first packet.n_hibma1999-01-131-12/+17
| | | | | The second packet was not seen as finished. 2) Textual changes
* %b takes ints, not u_longs.eivind1999-01-121-4/+4
|
* Sync with NetBSD sources. Almost there. Mostly style fixes.n_hibma1999-01-101-2/+2
|
* Major synchronisation with NetBSD USB coden_hibma1999-01-071-186/+324
|
* The OHCI interfaces I have access to map their control regs etc. intojulian1998-12-141-4/+4
| | | | | | | memory address space rather than IO space.. reflect this when looking for the interface revision register. If this is not true for them all then we probably need some smarter code.
* Added Id to all filesn_hibma1998-12-141-0/+1
|
* Added commentn_hibma1998-12-141-0/+3
|
* If we failed to probe/attach somehow, we never have a sc->sc_hccajulian1998-12-111-0/+3
| | | | | | | | | | | | | | but the present PCI probe code still thinks we are there as the pci attach can't return an error code. This means we are in the shared interrupt list, but have not been set up. If we are sharing ints with another device, ohci_intr will be called and will coredump on a NULL reference. So just return if it is called when not set up. This fixes the symptom and not the cause. The right answer is to let the PCI system know that the attach failed, or to fail earlier (in the PCI probe). The attach() is a void fn() so it can't return failure..
* Preliminary support for OHCI motherboardsn_hibma1998-12-091-0/+2078
OpenPOWER on IntegriCloud