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 62 of file device.c.
◆ ec_device_clear()
Destructor.
- Parameters
-
Definition at line 171 of file device.c.
◆ ec_device_attach()
Associate with net_device.
- Parameters
-
| device | EtherCAT device |
| net_dev | The net_device structure |
| poll | pointer to device's poll function |
| module | the device's module |
Definition at line 194 of file device.c.
◆ ec_device_detach()
Disconnect from net_device.
- Parameters
-
Definition at line 225 of file device.c.
◆ ec_device_open()
Opens the EtherCAT device.
- Returns
- 0 in case of success, else < 0
- Parameters
-
Definition at line 254 of file device.c.
◆ ec_device_close()
Stops the EtherCAT device.
- Returns
- 0 in case of success, else < 0
- Parameters
-
Definition at line 287 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 316 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 335 of file device.c.
◆ ec_device_clear_stats()
Clears the frame statistics.
- Parameters
-
Definition at line 374 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 498 of file device.c.
◆ ec_device_update_stats()
Update device statistics.
- Parameters
-
Definition at line 520 of file device.c.