device.c File Reference


Detailed Description

EtherCAT device methods.

Definition in file device.c.

Go to the source code of this file.

Functions

int ec_device_init (ec_device_t *device, ec_master_t *master, struct net_device *net_dev, ec_isr_t isr, struct module *module)
 Device constructor.
void ec_device_clear (ec_device_t *device)
 EtherCAT device destuctor.
int ec_device_open (ec_device_t *device)
 Opens the EtherCAT device.
int ec_device_close (ec_device_t *device)
 Stops the EtherCAT device.
uint8_t * ec_device_tx_data (ec_device_t *device)
 Returns a pointer to the device's transmit memory.
void ec_device_send (ec_device_t *device, size_t size)
 Sends the content of the transmit socket buffer.
void ec_device_call_isr (ec_device_t *device)
 Calls the interrupt service routine of the assigned net_device.
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.


Function Documentation

int ec_device_init ec_device_t device,
ec_master_t master,
struct net_device *  net_dev,
ec_isr_t  isr,
struct module *  module
 

Device constructor.

Returns:
0 in case of success, else < 0
Parameters:
device  EtherCAT device
master  master owning the device
net_dev  net_device structure
isr  pointer to device's ISR
module  pointer to the owning module

Definition at line 57 of file device.c.

void ec_device_clear ec_device_t device  ) 
 

EtherCAT device destuctor.

Parameters:
device  EtherCAT device

Definition at line 107 of file device.c.

int ec_device_open ec_device_t device  ) 
 

Opens the EtherCAT device.

Returns:
0 in case of success, else < 0
Parameters:
device  EtherCAT device

Definition at line 121 of file device.c.

int ec_device_close ec_device_t device  ) 
 

Stops the EtherCAT device.

Returns:
0 in case of success, else < 0
Parameters:
device  EtherCAT device

Definition at line 152 of file device.c.

uint8_t* ec_device_tx_data ec_device_t device  ) 
 

Returns a pointer to the device's transmit memory.

Returns:
pointer to the TX socket buffer
Parameters:
device  EtherCAT device

Definition at line 176 of file device.c.

void ec_device_send ec_device_t device,
size_t  size
 

Sends the content of the transmit socket buffer.

Cuts the socket buffer content to the (now known) size, and calls the start_xmit() function of the assigned net_device.

Parameters:
device  EtherCAT device
size  number of bytes to send

Definition at line 189 of file device.c.

void ec_device_call_isr ec_device_t device  ) 
 

Calls the interrupt service routine of the assigned net_device.

The master itself works without using interrupts. Therefore the processing of received data and status changes of the network device has to be done by the master calling the ISR "manually".

Parameters:
device  EtherCAT device

Definition at line 219 of file device.c.


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