Port-powerpc archive

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

Re: i82544EI ethernet driver




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@localhost>

Attachment: PGP.sig
Description: This is a digitally signed message part



Home | Main Index | Thread Index | Old Index