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 60 of file device.c.
◆ ec_device_clear()
Destructor.
- Parameters
-
Definition at line 159 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 179 of file device.c.
◆ ec_device_detach()
Disconnect from net_device.
- Parameters
-
Definition at line 210 of file device.c.
◆ ec_device_open()
Opens the EtherCAT device.
- Returns
- 0 in case of success, else < 0
- Parameters
-
Definition at line 239 of file device.c.
◆ ec_device_close()
Stops the EtherCAT device.
- Returns
- 0 in case of success, else < 0
- Parameters
-
Definition at line 272 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 301 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 320 of file device.c.
◆ ec_device_clear_stats()
Clears the frame statistics.
- Parameters
-
Definition at line 359 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 463 of file device.c.
◆ ec_device_update_stats()
Update device statistics.
- Parameters
-
Definition at line 481 of file device.c.