36 #include <linux/module.h> 37 #include <linux/jiffies.h> 38 #include <linux/slab.h> 53 if (!(reg->
data = (uint8_t *) kmalloc(size, GFP_KERNEL))) {
54 EC_ERR(
"Failed to allocate %zu bytes of register memory.\n", size);
58 INIT_LIST_HEAD(®->
list);
60 memset(reg->
data, 0x00, size);
64 reg->
state = EC_INT_REQUEST_INIT;
106 reg->
state = EC_INT_REQUEST_QUEUED;
117 reg->
state = EC_INT_REQUEST_QUEUED;
void ecrt_reg_request_write(ec_reg_request_t *reg, uint16_t address, size_t size)
Schedule an register write operation.
uint16_t ring_position
Ring position for emergency requests.
ec_internal_request_state_t state
Request state.
void ecrt_reg_request_read(ec_reg_request_t *reg, uint16_t address, size_t size)
Schedule a register read operation.
size_t transfer_size
Size of the data to transfer.
uint16_t address
Register address.
size_t mem_size
Size of data memory.
int ec_reg_request_init(ec_reg_request_t *reg, size_t size)
Register request constructor.
Values read by the master.
EtherCAT register request structure.
uint8_t * data
Pointer to data memory.
#define EC_ERR(fmt, args...)
Convenience macro for printing EtherCAT-specific errors to syslog.
ec_direction_t dir
Direction.
void ec_reg_request_clear(ec_reg_request_t *reg)
Register request destructor.
ec_request_state_t
Request state.
uint8_t * ecrt_reg_request_data(ec_reg_request_t *reg)
Access to the register request's data.
Values written by the master.
const ec_request_state_t ec_request_state_translation_table[]
Global request state type translation table.
struct list_head list
List item.
ec_request_state_t ecrt_reg_request_state(const ec_reg_request_t *reg)
Get the current state of the register request.