Re: 2.1.21-patch_drivers_net-1

Keith Owens (kaos@ocs.com.au)
Thu, 16 Jan 1997 10:40:42 +1100


On Wed, 15 Jan 1997 20:42:48 +0000 (GMT),
alan@lxorguk.ukuu.org.uk (Alan Cox) wrote:
>> +++ linux/drivers/net/lance.c Wed Jan 15 15:10:18 1997
>> @@ -309,7 +309,7 @@
>> {
>> int *port;
>>
>> - if (high_memory <= 16*1024*1024)
>> + if (high_memory <= (void *) MAX_DMA_ADDRESS)
>> lance_need_isa_bounce_buffers = 0;
>
>Rejected. The original code is correct. The lance 16bit has a 24bit internal
>DMA counter limit.

Since the kernel moved, high_memory is always (at least) 0xC0000000 so
the original code always fails and uses bounce buffers. On my 20Mb
system, high_memory = 0xC1400000, MAX_DMA_ADDRESS = 0xC10000000. The
alternative was

virt_to_bus(high_memory) <= 16*1024*1024

but I dislike hard coded magic numbers.