Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: i82544EI ethernet driver



On Mon, Nov 15, 2004 at 02:56:11PM -0500, Kate Feng wrote:
> You mentioned the code was tested for both big-endian and
> little-endian.  It must be somewhere I have to do
> #define BYTE_ORDER BIG_ENDIAN
> 
> Does that make sense ?

The bus_space(9) interface and proper coding practice should prevent
you from needing to #define BYTE_ORDER BIG_ENDIAN.  The byte order
on CPU->PCI reads/writes should be handled by the bus_space API.
The byte order for DMA should be handled by the usage of htole32
macros.  These won't do anything on little-endian systems, but will
swap the bytes for big-endian systems so that the PCI device will
read little-endian format.

Are you having difficulty with the driver as it is?

-allen

-- 
                  Use NetBSD!  http://www.netbsd.org/



Home | Main Index | Thread Index | Old Index