Page 1 of 1

Order of bytes in MACDriver

Posted: Wed Aug 20, 2014 10:07 am
by xnr
I'm trying to implement a MACDriver for a new platform. I am wondering how mac_lld_write_transmit_descriptor is supposed to work regarding byte order. (ChibiOS 2.6.4)

Should a program like this ...

Code: Select all

  uint8_t buf[] = {
               0x01, 0x02, 0x03, 0x04,
               0x05, 0x06, 0x07, 0x08,
               0x09, 0x10, 0x11, 0x12,
               0x13, 0x14, 0x15, 0x16,
               0x17, 0x18, 0x19, 0x20,
  };

  macWriteTransmitDescriptor(tdp, buf, 20);

... lead to a tcpdump (tcpdump -XX) like this:

Code: Select all

0x0000:  0102 0304 0506 0708 0910 1112 1314 1516
0x0010:  1718 1920

? Or should they be changed in any kind?

I'm a bit confused because my mcu expects uint32_t to be written to EthMac and therefore byte orders are very confusing.

Re: Order of bytes in MACDriver

Posted: Wed Aug 20, 2014 10:36 am
by Giovanni
Hi,

The order looks correct, the descriptor is a stream that writes directly into the frame so the order must be the same.

Giovanni

Re: Order of bytes in MACDriver

Posted: Wed Aug 20, 2014 10:45 am
by xnr
Unfortunately, my output doesn't look that way (yet). But now I know how it should look like. :)

Thanks again for your quick support!