EtherCAT device interface


Detailed Description

Master interface for EtherCAT-capable network device drivers.

Through the EtherCAT device interface, EtherCAT-capable network device drivers are able to connect their device(s) to the master, pass received frames and notify the master about status changes. The master on his part, can send his frames through connected devices.


Functions

void ecdev_receive (ec_device_t *device, const void *data, size_t size)
 Accepts a received frame.
void ecdev_link_state (ec_device_t *device, uint8_t state)
 Sets a new link state.
ec_device_tecdev_register (unsigned int master_index, struct net_device *net_dev, ec_isr_t isr, struct module *module)
 Connects an EtherCAT device to a certain master.
void ecdev_unregister (unsigned int master_index, ec_device_t *device)
 Disconnect an EtherCAT device from the master.
int ecdev_start (unsigned int master_index)
 Starts the master associated with the device.
void ecdev_stop (unsigned int master_index)
 Stops the master associated with the device.


Function Documentation

void ecdev_receive ec_device_t device,
const void *  data,
size_t  size
 

Accepts a received frame.

Forwards the received data to the master. The master will analyze the frame and dispatch the received commands to the sending instances.

Parameters:
device  EtherCAT device
data  pointer to received data
size  number of bytes received

Definition at line 235 of file device.c.

void ecdev_link_state ec_device_t device,
uint8_t  state
 

Sets a new link state.

If the device notifies the master about the link being down, the master will not try to send frames using this device.

Parameters:
device  EtherCAT device
state  new link state

Definition at line 262 of file device.c.

ec_device_t* ecdev_register unsigned int  master_index,
struct net_device *  net_dev,
ec_isr_t  isr,
struct module *  module
 

Connects an EtherCAT device to a certain master.

The master will use the device for sending and receiving frames. It is required that no other instance (for example the kernel IP stack) uses the device.

Returns:
0 on success, else < 0
Parameters:
master_index  master index
net_dev  net_device of the device
isr  interrupt service routine
module  pointer to the module

Definition at line 287 of file module.c.

void ecdev_unregister unsigned int  master_index,
ec_device_t device
 

Disconnect an EtherCAT device from the master.

The device is disconnected from the master and all device ressources are freed.

Attention:
Before calling this function, the ecdev_stop() function has to be called, to be sure that the master does not use the device any more.
Parameters:
master_index  master index
device  EtherCAT device

Definition at line 334 of file module.c.

int ecdev_start unsigned int  master_index  ) 
 

Starts the master associated with the device.

This function has to be called by the network device driver to tell the master that the device is ready to send and receive data. The master will enter the idle mode then.

Parameters:
master_index  master index

Definition at line 362 of file module.c.

void ecdev_stop unsigned int  master_index  ) 
 

Stops the master associated with the device.

Tells the master to stop using the device for frame IO. Has to be called before unregistering the device.

Parameters:
master_index  master index

Definition at line 386 of file module.c.


Generated on Fri Sep 1 14:56:57 2006 for IgH EtherCAT master by  doxygen 1.4.6