>1. Etherboot version seems to be non-concerned about endianness issues so
>i am trying to fix the passing of different
>pointers between card and driver.
>
>2.secondly i have also observed one objectionable issue betwwen linux
>eepro100.c and etherboot one.
Both issues are because the author of the Etherboot driver based it on
an early Linux driver where the mistake was to assume that all the world
is a x86. The Linux driver repented of its endianness sin but the
Etherboot one remained in error.
>in etherboot the txfd and commandbits has been defined like,
>
>in ETHERBOOT
>enum commands {
> CmdNOp = 0, CmdIASetup = 0x10000, CmdConfigure = 0x20000,
> CmdMulticastList = 0x30000, CmdTx = 0x40000, CmdTDR = 0x50000,
> CmdDump = 0x60000, CmdDiagnose = 0x70000,
> CmdSuspend = 0x40000000, /* Suspend after completion. */
> CmdIntr = 0x20000000, /* Interrupt after completion. */
> CmdTxFlex = 0x00080000, /* Use "Flexible mode" for CmdTx
>command. */
>};
>
>
>and in LINUX version it is,
>enum commands {
> CmdNOp = 0,
> CmdIASetup = 1,
> CmdConfigure = 2,
> CmdMulticastList = 3,
> CmdTx = 4,
> CmdTDR = 5,
> CmdDump = 6,
> CmdDiagnose = 7,
> CmdSuspend = 0x4000,
> CmdIntr = 0x2000,
> CmdTxFlex = 0x0008,
> };
You have them swapped around actually.
>in ETHERBOOT version the structure TxFD is
>static struct TxFD {
> volatile s16 status;
> s16 command;
> u32 link;
> u32 tx_desc_addr;
> s32 count;
>
> u32 tx_buf_addr0;
> s32 tx_buf_size0;
> u32 tx_buf_addr1;
> s32 tx_buf_size1;
>) txfd;
>
>in LINUX version ,
>
>struct TxFD {
> s32 status;
> u32 link;
> u32 tx_desc_addr;
> s32 count;
>#define TX_DESCR_BUF_OFFSET 16
>u32 tx_buf_addr0;
> s32 tx_buf_size0;
> u32 tx_buf_addr1;
> s32 tx_buf_size1;
>
>};
>
>why these two drivers using different structure for driving the same chip.
The Linux one is more correct because it allows the endianess to be
adjusted with a call to cpu_to_le32.
If you could fix the endian sensitivity by changing all the places that
use status and command to use a single 32 bit status field, that would
be a lovely contribution. Thanks.
|