Re: [PATCH 1/1] Driver for Beckhoff CX5020 EtherCAT master module.

From: David Miller
Date: Sat Apr 26 2014 - 12:24:19 EST


From: Darek Marcinkiewicz <reksio@xxxxxxxxxx>
Date: Thu, 24 Apr 2014 22:46:15 +0200

> +struct desc_header {
> + u32 next:24;
> + u32 reserved1:7;
> + u32 next_valid:1;
> + u32 recv:1;
> + u32 reserved2:31;
> + u16 len:12;
> + u16 reserved3:4;
> + u16 port;
> + u32 reserved4;
> + u64 timestamp;
> +};
> +
> +struct rx_desc {
> + struct desc_header header;
> +#define RX_PAYLOAD_SIZE 0x7e8
> + u8 data[RX_PAYLOAD_SIZE];
> +};
> +
> +struct tx_header {
> + u16 length;
> + u8 port0:1;
> + u8 port1:1;
> + u8 reserved1:6;
> + u8 ts_enable:1;
> + u8 reserved2:7;
> + u32 sent:1;
> + u32 reserved3:31;
> + u64 timestamp;
> +};

All of these descriptor structures need to be properly annotated using
endianness types, and their fields accessed using proper endian
translating interfaces such as le32_to_cpu() et al.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/