lkml.org 
[lkml]   [1998]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: MAX_DMA_ADDRESS, virt_to_bus (and 3c505.c bug)
Date
> 	if (virt_to_bus(skb->data) < MAX_DMA_ADDRESS) {
> memcpy(device->bouncebuf, skb->data, skb->len);
> device->txbuf = device->bouncebuf;
> } else
> device->txbuf = skb->data;
>
> This does not work, because the MAX_DMA_ADDRESS is #defined to be
> PAGE_OFFSET+0x01000000, so it refers to the _virtual_ address instead of
> the bus one. The correct condition should be

It also has another error.
>
> if (skb->data < MAX_DMA_ADDRESS) ...

Nope

(skb->data+skb->len)

and you ought to check it doesnt span a page. The 85230 driver has the
right bits in for that now. I've never seen a frame spanning a 64K boundary
on x86, and the mm may actually mean it cant occur.

Alan


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [from the cache]
©2003-2011 Jasper Spaans