29#ifndef __EC_DEVICE_H__
30#define __EC_DEVICE_H__
32#include <linux/interrupt.h>
43#define EC_TX_RING_SIZE 2
50#define EC_DEBUG_RING_SIZE 10
54} ec_debug_frame_dir_t;
57 ec_debug_frame_dir_t dir;
60 unsigned int data_size;
76 struct net_device *
dev;
87 struct timeval timeval_poll;
118 ec_debug_frame_t debug_frames[EC_DEBUG_RING_SIZE];
119 unsigned int debug_frame_index;
120 unsigned int debug_frame_count;
143void ec_device_debug_ring_append(
ec_device_t *, ec_debug_frame_dir_t,
144 const void *,
size_t);
145void ec_device_debug_ring_print(
const ec_device_t *);
Network interface for debugging purposes.
int ec_device_init(ec_device_t *, ec_master_t *)
Constructor.
void ec_device_clear_stats(ec_device_t *)
Clears the frame statistics.
void ec_device_clear(ec_device_t *)
Destructor.
uint8_t * ec_device_tx_data(ec_device_t *)
Returns a pointer to the device's transmit memory.
void ec_device_update_stats(ec_device_t *)
Update device statistics.
void ec_device_detach(ec_device_t *)
Disconnect from net_device.
void ec_device_attach(ec_device_t *, struct net_device *, ec_pollfunc_t, struct module *)
Associate with net_device.
#define EC_TX_RING_SIZE
Size of the transmit ring.
int ec_device_open(ec_device_t *)
Opens the EtherCAT device.
void ec_device_send(ec_device_t *, size_t)
Sends the content of the transmit socket buffer.
void ec_device_poll(ec_device_t *)
Calls the poll function of the assigned net_device.
int ec_device_close(ec_device_t *)
Stops the EtherCAT device.
EtherCAT interface for EtherCAT device drivers.
void(* ec_pollfunc_t)(struct net_device *)
Device poll function type.
struct ec_device ec_device_t
Global definitions and macros.
#define EC_RATE_COUNT
Number of statistic rate intervals to maintain.
#define EC_MAX_DATA_SIZE
Resulting maximum data size of a single datagram in a frame.
struct ec_master ec_master_t
Debugging network interface.
u64 tx_errors
Number of transmit errors.
uint8_t open
true, if the net_device has been opened
u64 tx_count
Number of frames sent.
s32 tx_frame_rates[EC_RATE_COUNT]
Transmit rates in frames/s for different statistics cycle periods.
ec_master_t * master
EtherCAT master.
u64 last_rx_bytes
Number of bytes received of last statistics cycle.
s32 rx_byte_rates[EC_RATE_COUNT]
Receive rates in byte/s for different statistics cycle periods.
u64 last_rx_count
Number of frames received of last statistics cycle.
s32 tx_byte_rates[EC_RATE_COUNT]
Transmit rates in byte/s for different statistics cycle periods.
struct sk_buff * tx_skb[EC_TX_RING_SIZE]
transmit skb ring
struct module * module
pointer to the device's owning module
s32 rx_frame_rates[EC_RATE_COUNT]
Receive rates in frames/s for different statistics cycle periods.
struct net_device * dev
pointer to the assigned net_device
u64 tx_bytes
Number of bytes sent.
ec_pollfunc_t poll
pointer to the device's poll function
u64 rx_count
Number of frames received.
uint8_t link_state
device link state
u64 last_tx_bytes
Number of bytes sent of last statistics cycle.
unsigned int tx_ring_index
last ring entry used to transmit
unsigned long jiffies_poll
jiffies of last poll
u64 last_tx_count
Number of frames sent of last statistics cycle.
u64 rx_bytes
Number of bytes received.