Matthew Dillon 698df1f738 Fix two bugs in the DMA chaining code for OHCI. The first bug is that
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
2002-12-20 18:47:39 +00:00
..
2002-12-14 22:25:35 +00:00
2002-12-18 21:47:52 +00:00
2002-12-16 00:49:36 +00:00
2002-10-18 21:41:41 +00:00
2002-12-18 18:52:20 +00:00
2002-12-18 11:46:59 +00:00
2002-12-20 11:24:02 +00:00
2002-11-20 15:21:06 +00:00
2002-11-27 06:04:49 +00:00
2002-12-14 01:56:26 +00:00