Submitted by Hiroyuki Aizu <eyes@navi.org>
(refer to [FreeBSD-users-jp 65061])
Tested by Hiroharu Tamaru <tamaru@myn.rcast.u-tokyo.ac.jp>
(refer to [bsd-usb:689])
the dataphysend calculation could only possibly work if the virtual buffer
is also physically contiguous. Calculate dataphysend by calculating the
ending virtual address first, then converting to a physical address.
The second bug applies only to NetBSD and OpenBSD and involves the curlen
calculation in the two-contiguous-physical-pages case (which we don't support).
Also cleanup the use of the OHIC_PAGE() macro on dataphysend and add a panic
if len goes negative (meaning we lost the physical page translation
representing the end of the buffer).
IMHO the dataphysend is still bokered since it might be misrepresented
by shared userland page mappings. The whole section needs to be rewritten
to use the virtual address range.
MFC after: 3 days
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>
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.
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.
revision 1.124
date: 2002/05/26 03:10:02; author: minoura; state: Exp; lines: +3 -3
Clear done_head in the HCCA *before* acknoledging the interrupt.
Driver lost some completed transfers under heavy loads.
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.
revision 1.101
date: 2001/02/20 15:20:32; author: minoura;
Re-initialize some registers after resuming from suspend.
Some APM BIOSes do not restore them.
Reviewd by augustss.
revision 1.97
date: 2000/12/31 14:29:54; author: augustss; state: Exp; lines: +17 -3
Make the controller survive suspend/resume. Thanks to Steve Woodford
<steve@mctavish.co.uk> for testing.
revision 1.95
date: 2000/12/13 03:09:06; author: augustss; state: Exp; lines: +19 -3
Make the ohci driver not hang suspend/resume. It still doesn't resume
correctly. From itohy@netbsd.org (ITOH Yasufumi) PR kern/11714.
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.
revision 1.106
date: 2001/11/09 15:01:57; author: augustss; state: Exp; lines: +73 -57
Fix a bug in xfer abort processing when the HC executes ahead of what
the driver aborts.
Don't block RHSC interrupts.
revision 1.103
date: 2001/09/11 07:00:19; author: augustss; state: Exp; lines: +4 -1
Don't go top mode OPERATIONAL (before reset) on startup even
if BIOS claims to have initialized the controller.
(1.39), usbdi.c (1.79), usbdi.h (1.47), usbdivar.h (1.62)
date: 2001/01/21 02:39:52; author: augustss;
Add code to use soft interrupt to handle USB interrupt processing.
Don't enable the code since it doesn't work with the kludgy Ethernet
drivers.
date: 2000/08/08 19:51:46; author: tv; state: Exp; lines: +24 -13
%b -> bitmask_snprintf()
Because this code is shared, add a macro for bitmask_snprintf()
that should expand to the equivalent snprintf() on non-NetBSD
systems. This is only used in ?HCI_DEBUG cases anyway.
ohci.c (1.85), ohcireg.h (1.17):
----------------------------
date: 2000/04/01 09:27:35; author: augustss;
Add a delay before reading the number of ports from the controller to
avoid getting 0 from it.
----------------------------
ohci.c (1.83), ohcireg.h (1.16), ohcivar.h (1.21)
===================================================================
date: 2000/03/29 01:46:26; author: augustss;
A first stab at support for isochronous transfers.
===================================================================
ohcivar.h (1.22), uhcivar.h (1.29):
============================================================
date: 2000/04/25 09:20:55; author: augustss;
Move the size of the mapped bus_space region into the bus
independent softc.
============================================================
ohci.c (1.88), uhci.c (1.112):
============================================================
date: 2000/04/25 14:28:13; author: augustss;
Insert (very conservative!) bus_space_barrier() calls at
all register accesses.
The bus_space(9) man page says you've gotta have them...
============================================================