Subject: Re: i82544EI ethernet driver
To: Kate Feng <feng1@bnl.gov>
From: Jason Thorpe <thorpej@shagadelic.org>
List: port-powerpc
Date: 11/16/2004 13:53:50
--Apple-Mail-27--71737853
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


On Nov 15, 2004, at 11:28 AM, Kate Feng wrote:

> I am porting it to  a big-endian PowerPC.   Thus,
> 1) for data buffer,  I  think I  should add :
>
>   sc->sc_ctrl |= CTRL_BEM;
>
> prio to
>
>   /* Write the control registers. */
>   CSR_WRITE(WMREG_CTRL, sc->sc_ctrl);

No, you don't need to do this.  The data buffer should be treated as a 
stream of octets.  These "byte swap data buffer" options are almost 
universally useless.

> 2) for the descriptor,  I should keep the original
> codes  htole32/le32toh, and le16toh....

Yes, those handle the descriptors for you.

> Meanwhile, I should  do
>
> #define BYTE_ORDER    BIG_ENDIAN

No, this is already done by the shared PowerPC header files.

As Allen mentioned, this driver is already known to work on big-endian 
platforms, including the PowerPC.  You should not have to do anything 
to make it function properly.

         -- Jason R. Thorpe <thorpej@shagadelic.org>


--Apple-Mail-27--71737853
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFBmnbuOpVKkaBm8XkRAjftAKDDacXx3UwdKK4XFcdOATyr6Uuw+ACgyBbi
yHpMOqUnTGKsOWeXs1hvirE=
=AaEP
-----END PGP SIGNATURE-----

--Apple-Mail-27--71737853--