37 #include <linux/slab.h> 51 uint32_t logical_offset,
54 const unsigned int used[]
60 INIT_LIST_HEAD(&pair->
list);
83 #if EC_MAX_NUM_DEVICES > 1 84 if (!(pair->send_buffer = kmalloc(data_size, GFP_KERNEL))) {
86 "Failed to allocate domain send buffer!\n");
97 logical_offset, data_size, data);
102 logical_offset, data_size);
111 logical_offset, data_size, data);
115 logical_offset, data_size);
121 logical_offset, data_size, data);
155 unsigned int dev_idx;
163 #if EC_MAX_NUM_DEVICES > 1 164 if (pair->send_buffer) {
165 kfree(pair->send_buffer);
181 unsigned int dev_idx;
182 uint16_t pair_wc = 0;
#define EC_DATAGRAM_NAME_SIZE
Size of the datagram description string.
unsigned int expected_working_counter
Expectord working conter.
#define ec_master_num_devices(MASTER)
Number of Ethernet devices.
int ec_datagram_lwr_ext(ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory)
Initializes an EtherCAT LWR datagram with external memory.
char name[EC_DATAGRAM_NAME_SIZE]
Description of the datagram.
uint16_t working_counter
Working counter.
const char * ec_device_names[2]
Device names.
void ec_datagram_output_stats(ec_datagram_t *datagram)
Outputs datagram statistics at most every second.
int ec_datagram_lwr(ec_datagram_t *datagram, uint32_t offset, size_t data_size)
Initializes an EtherCAT LWR datagram.
EtherCAT master structure.
void ec_datagram_zero(ec_datagram_t *datagram)
Fills the datagram payload memory with zeros.
ec_datagram_state_t state
State.
uint16_t ec_datagram_pair_process(ec_datagram_pair_t *pair, uint16_t wc_sum[])
Process received data.
ec_device_index_t
Master devices.
void ec_datagram_pair_clear(ec_datagram_pair_t *pair)
Datagram pair destructor.
unsigned int index
Index (just a number).
int ec_datagram_lrd_ext(ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory)
Initializes an EtherCAT LRD datagram with external memory.
#define EC_MASTER_ERR(master, fmt, args...)
Convenience macro for printing master-specific errors to syslog.
Values read by the master.
ec_device_index_t device_index
Device via which the datagram shall be / was sent.
int ec_datagram_lrd(ec_datagram_t *datagram, uint32_t offset, size_t data_size)
Initializes an EtherCAT LRD datagram.
int ec_datagram_prealloc(ec_datagram_t *datagram, size_t size)
Allocates internal payload memory.
int ec_datagram_pair_init(ec_datagram_pair_t *pair, ec_domain_t *domain, uint32_t logical_offset, uint8_t *data, size_t data_size, const unsigned int used[])
Datagram pair constructor.
ec_domain_t * domain
Parent domain.
void ec_datagram_init(ec_datagram_t *datagram)
Constructor.
struct list_head list
List header.
EtherCAT datagram pair structure.
int ec_datagram_lrw_ext(ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory)
Initializes an EtherCAT LRW datagram with external memory.
ec_datagram_t datagrams[EC_MAX_NUM_DEVICES]
Datagrams.
Values written by the master.
int ec_datagram_lrw(ec_datagram_t *datagram, uint32_t offset, size_t data_size)
Initializes an EtherCAT LRW datagram.
ec_master_t * master
EtherCAT master owning the domain.
void ec_datagram_clear(ec_datagram_t *datagram)
Destructor.