28 #include <linux/module.h> 29 #include <linux/jiffies.h> 30 #include <linux/slab.h> 45 if (!(reg->
data = (uint8_t *) kmalloc(size, GFP_KERNEL))) {
46 EC_ERR(
"Failed to allocate %zu bytes of register memory.\n", size);
50 INIT_LIST_HEAD(®->
list);
52 memset(reg->
data, 0x00, size);
56 reg->
state = EC_INT_REQUEST_INIT;
98 reg->
state = EC_INT_REQUEST_QUEUED;
110 reg->
state = EC_INT_REQUEST_QUEUED;
uint16_t ring_position
Ring position for emergency requests.
ec_internal_request_state_t state
Request state.
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.
uint8_t * ecrt_reg_request_data(const ec_reg_request_t *reg)
Access to the register request's data.
int ecrt_reg_request_write(ec_reg_request_t *reg, uint16_t address, size_t size)
Schedule an register write operation.
ec_request_state_t ecrt_reg_request_state(const ec_reg_request_t *reg)
Get the current state of the register request.
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.
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.
int ecrt_reg_request_read(ec_reg_request_t *reg, uint16_t address, size_t size)
Schedule a register read operation.