Subject: am79900.c assumes little-endian processor?
To: None <>
From: David Edelsohn <>
List: tech-net
Date: 11/08/1999 18:49:41
	I have been trying to use the NetBSD PCnet device driver
(if_le_pci.c, lance.c, am79900.c) on a big-endian PowerPC system with
disasterous results when the card is started for external activity.  The
Linux PCnet32 driver does work with the system and I notice that the Linux
driver forces multi-word memory values to little-endian when communicating
with the adapter while the NetBSD driver does not.  The macppc port of
NetBSD does uniformly byte-reverse access to all PCI adapters through bus
space and that aspect of the configuration of the adapter does function

	The aspect of the am79900.c driver which does not byte-reverse
values is the assignment to the initialization block (am79900_meminit),
for example.  If the controller is accessing the values as little-endian,
then the addresses for its ring buffers and descriptors would be jumbled
and the adapter would scibble over incorrect pieces of memory, which could
explain what I am experiencing.

	I am somewhat surprised that no one else has tried to use a Lance
Ethernet 79900 on a big-endian system with NetBSD device drivers and
encountered this problem.  I am hoping that I am mistaken and severely
confused.  What am I missing?

Thanks, David
David Edelsohn                                      T.J. Watson Research Center                                  P.O. Box 218
+1 914 945 4364 (TL 862)                            Yorktown Heights, NY 10598