lkml.org 
[lkml]   [2014]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1] Driver for Beckhoff CX5020 EtherCAT master module.
From
From: Darek Marcinkiewicz <reksio@newterm.pl>
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.


\
 
 \ /
  Last update: 2014-04-26 18:41    [W:3.121 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site