EtherCAT device methods.
More...
Go to the source code of this file.
|
enum | { EXTRA_HEADROOM = 64
} |
|
EtherCAT device methods.
Definition in file device.c.
◆ ec_device_init()
Constructor.
- Returns
- 0 in case of success, else < 0
- Parameters
-
device | EtherCAT device |
master | master owning the device |
Definition at line 68 of file device.c.
◆ ec_device_clear()
Destructor.
- Parameters
-
Definition at line 167 of file device.c.
◆ ec_device_attach()
Associate with net_device.
- Parameters
-
device | EtherCAT device |
net_dev | net_device structure |
poll | pointer to device's poll function |
module | the device's module |
Definition at line 187 of file device.c.
◆ ec_device_detach()
Disconnect from net_device.
- Parameters
-
Definition at line 218 of file device.c.
◆ ec_device_open()
Opens the EtherCAT device.
- Returns
- 0 in case of success, else < 0
- Parameters
-
Definition at line 247 of file device.c.
◆ ec_device_close()
Stops the EtherCAT device.
- Returns
- 0 in case of success, else < 0
- Parameters
-
Definition at line 284 of file device.c.
◆ ec_device_tx_data()
Returns a pointer to the device's transmit memory.
- Returns
- pointer to the TX socket buffer
- Parameters
-
Definition at line 317 of file device.c.
◆ ec_device_send()
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 336 of file device.c.
◆ ec_device_clear_stats()
Clears the frame statistics.
- Parameters
-
Definition at line 379 of file device.c.
◆ ec_device_poll()
Calls the poll function 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
-
Definition at line 483 of file device.c.
◆ ec_device_update_stats()
Update device statistics.
- Parameters
-
Definition at line 501 of file device.c.