device.h File Reference


Detailed Description

EtherCAT device structure.

Definition in file device.h.

Go to the source code of this file.

Data Structures

struct  ec_device
 EtherCAT device. More...

Functions

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


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.

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.

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.

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.


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