Subject: Re: DMA beyond end of isa
To: None <tech-kern@NetBSD.ORG>
From: Antti Miettinen <amiettin@trshp.trs.ntc.nokia.com>
List: tech-kern
Date: 01/06/1996 23:55:59
>I don't buy this example.  I _do not_ think that isa/if_ed should be
>modified to use the big-endian mode on a big-endian machine, for a
>couple of reasons:
>
>	(1) potential improper implementation of that feature in
>	    cheep PeeCee hardware.  8-)

Yes - I think so too and that is why I wrote:
>[..] Because
>some clones might not handle m68k byteorder it's better not to use
>it. [..]

I really think that it is better to read everything as-is from the ISA
space and think carefully about swapping in the driver itself.

>I think that what i'm trying to get at is, e.g. there should be no
>explicit cases in _any_ of the ISA drivers about the endianness of the
>host machine.  functions that are part of the ISA software interface
>in the kernel (including inb, outb, etc., and various memory access
>and copy functions, etc.) should do the right thing, and the drivers
>should be written so that they work transparently.

I think one can't make for example insw always do the right thing
automatically. I don't claim to know much about ethernet drivers, but
for example in the if_ed driver insw is used to get some data to the
host memory space from the NIC. This data has one word which should be
interpreted as a 16 bit integer by the host processor. Other parts
should be interpreted as raw data. Therefore this one word should be
swapped if the host processor is big endian. Rest of the data should
remain unswapped.

	-- antti