IgH EtherCAT Master  1.6.9
rtdm-ioctl.c File Reference

EtherCAT master character device. More...

Go to the source code of this file.

Macros

#define DEBUG_LATENCY   0
 Set to 1 to enable ioctl() latency tracing.
#define ATTRIBUTES
 Optional compiler attributes fo ioctl() functions.
#define ec_ioctl_lock(lock)
#define ec_ioctl_unlock(lock)
#define ec_ioctl_lock_interruptible(lock)
#define ec_copy_to_user(to, from, n, ctx)
#define ec_copy_from_user(to, from, n, ctx)

Functions

static void ec_ioctl_strcpy (char *target, const char *source)
 Copies a string to an ioctl structure.
static ATTRIBUTES int ec_ioctl_module (void *arg, ec_ioctl_context_t *ctx)
 Get module information.
static ATTRIBUTES int ec_ioctl_master (ec_master_t *master, void *arg)
 Get master information.
static ATTRIBUTES int ec_ioctl_slave (ec_master_t *master, void *arg)
 Get slave information.
static ATTRIBUTES int ec_ioctl_slave_sync (ec_master_t *master, void *arg)
 Get slave sync manager information.
static ATTRIBUTES int ec_ioctl_slave_sync_pdo (ec_master_t *master, void *arg)
 Get slave sync manager PDO information.
static ATTRIBUTES int ec_ioctl_slave_sync_pdo_entry (ec_master_t *master, void *arg)
 Get slave sync manager PDO entry information.
static ATTRIBUTES int ec_ioctl_domain (ec_master_t *master, void *arg)
 Get domain information.
static ATTRIBUTES int ec_ioctl_domain_fmmu (ec_master_t *master, void *arg)
 Get domain FMMU information.
static ATTRIBUTES int ec_ioctl_domain_data (ec_master_t *master, void *arg)
 Get domain data.
static ATTRIBUTES int ec_ioctl_master_debug (ec_master_t *master, void *arg)
 Set master debug level.
static ATTRIBUTES int ec_ioctl_master_rescan (ec_master_t *master, void *arg)
 Issue a bus scan.
static ATTRIBUTES int ec_ioctl_slave_state (ec_master_t *master, void *arg)
 Set slave state.
static ATTRIBUTES int ec_ioctl_slave_sdo (ec_master_t *master, void *arg)
 Get slave SDO information.
static ATTRIBUTES int ec_ioctl_slave_sdo_entry (ec_master_t *master, void *arg)
 Get slave SDO entry information.
static ATTRIBUTES int ec_ioctl_slave_sdo_upload (ec_master_t *master, void *arg)
 Upload SDO.
static ATTRIBUTES int ec_ioctl_slave_sdo_download (ec_master_t *master, void *arg)
 Download SDO.
static ATTRIBUTES int ec_ioctl_slave_sii_read (ec_master_t *master, void *arg)
 Read a slave's SII.
static ATTRIBUTES int ec_ioctl_slave_sii_write (ec_master_t *master, void *arg)
 Write a slave's SII.
static ATTRIBUTES int ec_ioctl_slave_reg_read (ec_master_t *master, void *arg)
 Read a slave's registers.
static ATTRIBUTES int ec_ioctl_slave_reg_write (ec_master_t *master, void *arg)
 Write a slave's registers.
static ATTRIBUTES int ec_ioctl_config (ec_master_t *master, void *arg)
 Get slave configuration information.
static ATTRIBUTES int ec_ioctl_config_pdo (ec_master_t *master, void *arg)
 Get slave configuration PDO information.
static ATTRIBUTES int ec_ioctl_config_pdo_entry (ec_master_t *master, void *arg)
 Get slave configuration PDO entry information.
static ATTRIBUTES int ec_ioctl_config_sdo (ec_master_t *master, void *arg)
 Get slave configuration SDO information.
static ATTRIBUTES int ec_ioctl_config_idn (ec_master_t *master, void *arg)
 Get slave configuration IDN information.
static ATTRIBUTES int ec_ioctl_config_flag (ec_master_t *master, void *arg)
 Get slave configuration feature flag information.
static ATTRIBUTES int ec_ioctl_config_ip (ec_master_t *master, void *arg)
 Get configured EoE IP parameters for a given slave configuration.
static ATTRIBUTES int ec_ioctl_eoe_handler (ec_master_t *master, void *arg)
 Get EoE handler information.
static ATTRIBUTES int ec_ioctl_slave_eoe_ip_param (ec_master_t *master, void *arg)
 Request EoE IP parameter setting.
static ATTRIBUTES int ec_ioctl_request (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Request the master from userspace.
static ATTRIBUTES int ec_ioctl_create_domain (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Create a domain.
static ATTRIBUTES int ec_ioctl_create_slave_config (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Create a slave configuration.
static ATTRIBUTES int ec_ioctl_select_ref_clock (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Select the DC reference clock.
static ATTRIBUTES int ec_ioctl_activate (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Activates the master.
static ATTRIBUTES int ec_ioctl_deactivate (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Deactivates the master.
static ATTRIBUTES int ec_ioctl_set_send_interval (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Set max.
static ATTRIBUTES int ec_ioctl_send (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Send frames.
static ATTRIBUTES int ec_ioctl_receive (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Receive frames.
static ATTRIBUTES int ec_ioctl_master_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get the master state.
static ATTRIBUTES int ec_ioctl_master_link_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get the link state.
static ATTRIBUTES int ec_ioctl_app_time (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Set the master DC application time.
static ATTRIBUTES int ec_ioctl_sync_ref (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sync the reference clock.
static ATTRIBUTES int ec_ioctl_sync_ref_to (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sync the reference clock.
static ATTRIBUTES int ec_ioctl_sync_slaves (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sync the slave clocks.
static ATTRIBUTES int ec_ioctl_ref_clock_time (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get the system time of the reference clock.
static ATTRIBUTES int ec_ioctl_sync_mon_queue (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Queue the sync monitoring datagram.
static ATTRIBUTES int ec_ioctl_sync_mon_process (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Processes the sync monitoring datagram.
static ATTRIBUTES int ec_ioctl_reset (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Reset configuration.
static ATTRIBUTES int ec_ioctl_sc_sync (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Configure a sync manager.
static ATTRIBUTES int ec_ioctl_sc_watchdog (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Configure a slave's watchdogs.
static ATTRIBUTES int ec_ioctl_sc_add_pdo (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Add a PDO to the assignment.
static ATTRIBUTES int ec_ioctl_sc_clear_pdos (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Clears the PDO assignment.
static ATTRIBUTES int ec_ioctl_sc_add_entry (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Add an entry to a PDO's mapping.
static ATTRIBUTES int ec_ioctl_sc_clear_entries (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Clears the mapping of a PDO.
static ATTRIBUTES int ec_ioctl_sc_reg_pdo_entry (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Registers a PDO entry.
static ATTRIBUTES int ec_ioctl_sc_reg_pdo_pos (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Registers a PDO entry by its position.
static ATTRIBUTES int ec_ioctl_sc_dc (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets the DC AssignActivate word and the sync signal times.
static ATTRIBUTES int ec_ioctl_sc_sdo (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Configures an SDO.
static ATTRIBUTES int ec_ioctl_sc_emerg_size (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Set the emergency ring buffer size.
static ATTRIBUTES int ec_ioctl_sc_emerg_pop (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get an emergency message from the ring.
static ATTRIBUTES int ec_ioctl_sc_emerg_clear (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Clear the emergency ring.
static ATTRIBUTES int ec_ioctl_sc_emerg_overruns (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get the number of emergency overruns.
static ATTRIBUTES int ec_ioctl_sc_create_sdo_request (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Create an SDO request.
static ATTRIBUTES int ec_ioctl_sc_create_soe_request (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Create an SoE request.
static ATTRIBUTES int ec_ioctl_sc_create_reg_request (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Create a register request.
static ATTRIBUTES int ec_ioctl_sc_create_voe_handler (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Create a VoE handler.
static ATTRIBUTES int ec_ioctl_sc_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get the slave configuration's state.
static ATTRIBUTES int ec_ioctl_sc_idn (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Configures an IDN.
static ATTRIBUTES int ec_ioctl_sc_flag (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Configures a feature flag.
static ATTRIBUTES int ec_ioctl_sc_state_timeout (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets an AL state transition timeout.
static ATTRIBUTES int ec_ioctl_sc_ip (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Configures EoE IP parameters.
static ATTRIBUTES int ec_ioctl_domain_size (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Gets the domain's data size.
static ATTRIBUTES int ec_ioctl_domain_offset (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Gets the domain's offset in the total process data.
static ATTRIBUTES int ec_ioctl_domain_process (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Process the domain.
static ATTRIBUTES int ec_ioctl_domain_queue (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Queue the domain.
static ATTRIBUTES int ec_ioctl_domain_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Get the domain state.
static ATTRIBUTES int ec_ioctl_sdo_request_index (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets an SDO request's SDO index and subindex.
static ATTRIBUTES int ec_ioctl_sdo_request_timeout (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets an SDO request's timeout.
static ATTRIBUTES int ec_ioctl_sdo_request_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Gets an SDO request's state.
static ATTRIBUTES int ec_ioctl_sdo_request_read (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts an SDO read operation.
static ATTRIBUTES int ec_ioctl_sdo_request_write (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts an SDO write operation.
static ATTRIBUTES int ec_ioctl_sdo_request_data (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Read SDO data.
static ATTRIBUTES int ec_ioctl_soe_request_index (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets an SoE request's drive number and IDN.
static ATTRIBUTES int ec_ioctl_soe_request_timeout (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets an CoE request's timeout.
static ATTRIBUTES int ec_ioctl_soe_request_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Gets an SoE request's state.
static ATTRIBUTES int ec_ioctl_soe_request_read (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts an SoE IDN read operation.
static ATTRIBUTES int ec_ioctl_soe_request_write (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts an SoE IDN write operation.
static ATTRIBUTES int ec_ioctl_soe_request_data (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Read SoE IDN data.
static ATTRIBUTES int ec_ioctl_reg_request_data (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Read register data.
static ATTRIBUTES int ec_ioctl_reg_request_state (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Gets an register request's state.
static ATTRIBUTES int ec_ioctl_reg_request_write (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts an register write operation.
static ATTRIBUTES int ec_ioctl_reg_request_read (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts an register read operation.
static ATTRIBUTES int ec_ioctl_voe_send_header (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Sets the VoE send header.
static ATTRIBUTES int ec_ioctl_voe_rec_header (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Gets the received VoE header.
static ATTRIBUTES int ec_ioctl_voe_read (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts a VoE read operation.
static ATTRIBUTES int ec_ioctl_voe_read_nosync (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts a VoE read operation without sending a sync message first.
static ATTRIBUTES int ec_ioctl_voe_write (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Starts a VoE write operation.
static ATTRIBUTES int ec_ioctl_voe_exec (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Executes the VoE state machine.
static ATTRIBUTES int ec_ioctl_voe_data (ec_master_t *master, void *arg, ec_ioctl_context_t *ctx)
 Reads the received VoE data.
static ATTRIBUTES int ec_ioctl_slave_foe_read (ec_master_t *master, void *arg)
 Read a file from a slave via FoE.
static ATTRIBUTES int ec_ioctl_slave_foe_write (ec_master_t *master, void *arg)
 Write a file to a slave via FoE.
static ATTRIBUTES int ec_ioctl_slave_soe_read (ec_master_t *master, void *arg)
 Read an SoE IDN.
static ATTRIBUTES int ec_ioctl_slave_soe_write (ec_master_t *master, void *arg)
 Write an IDN to a slave via SoE.
static long ec_ioctl_nrt (ec_master_t *master, ec_ioctl_context_t *ctx, unsigned int cmd, void *arg)
 ioctl() function to use.
static long ec_ioctl_both (ec_master_t *master, ec_ioctl_context_t *ctx, unsigned int cmd, void *arg)
 Called when an ioctl() command is issued.
long ec_ioctl (ec_master_t *master, ec_ioctl_context_t *ctx, unsigned int cmd, void *arg)
 Called when an ioctl() command is issued.

Detailed Description

EtherCAT master character device.

Definition in file rtdm-ioctl.c.

Macro Definition Documentation

◆ DEBUG_LATENCY

#define DEBUG_LATENCY   0

Set to 1 to enable ioctl() latency tracing.

Requires CPU timestamp counter!

Definition at line 41 of file rtdm-ioctl.c.

◆ ATTRIBUTES

#define ATTRIBUTES

Optional compiler attributes fo ioctl() functions.

Definition at line 48 of file rtdm-ioctl.c.

◆ ec_ioctl_lock

#define ec_ioctl_lock ( lock)
Value:
rt_mutex_lock(lock)

Definition at line 63 of file rtdm-ioctl.c.

◆ ec_ioctl_unlock

#define ec_ioctl_unlock ( lock)
Value:
rt_mutex_unlock(lock)

Definition at line 64 of file rtdm-ioctl.c.

◆ ec_ioctl_lock_interruptible

#define ec_ioctl_lock_interruptible ( lock)
Value:
rt_mutex_lock_interruptible(lock)

Definition at line 67 of file rtdm-ioctl.c.

◆ ec_copy_to_user

#define ec_copy_to_user ( to,
from,
n,
ctx )
Value:
copy_to_user(to, from, n)

Definition at line 73 of file rtdm-ioctl.c.

◆ ec_copy_from_user

#define ec_copy_from_user ( to,
from,
n,
ctx )
Value:
copy_from_user(to, from, n)

Definition at line 74 of file rtdm-ioctl.c.

Function Documentation

◆ ec_ioctl_strcpy()

void ec_ioctl_strcpy ( char * target,
const char * source )
static

Copies a string to an ioctl structure.

Parameters
targetTarget.
sourceSource.

Definition at line 81 of file rtdm-ioctl.c.

◆ ec_ioctl_module()

ATTRIBUTES int ec_ioctl_module ( void * arg,
ec_ioctl_context_t * ctx )
static

Get module information.

Returns
Zero on success, otherwise a negative error code.
Parameters
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 100 of file rtdm-ioctl.c.

◆ ec_ioctl_master()

ATTRIBUTES int ec_ioctl_master ( ec_master_t * master,
void * arg )
static

Get master information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 122 of file rtdm-ioctl.c.

◆ ec_ioctl_slave()

ATTRIBUTES int ec_ioctl_slave ( ec_master_t * master,
void * arg )
static

Get slave information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 221 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sync()

ATTRIBUTES int ec_ioctl_slave_sync ( ec_master_t * master,
void * arg )
static

Get slave sync manager information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 308 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sync_pdo()

ATTRIBUTES int ec_ioctl_slave_sync_pdo ( ec_master_t * master,
void * arg )
static

Get slave sync manager PDO information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 361 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sync_pdo_entry()

ATTRIBUTES int ec_ioctl_slave_sync_pdo_entry ( ec_master_t * master,
void * arg )
static

Get slave sync manager PDO entry information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 420 of file rtdm-ioctl.c.

◆ ec_ioctl_domain()

ATTRIBUTES int ec_ioctl_domain ( ec_master_t * master,
void * arg )
static

Get domain information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 489 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_fmmu()

ATTRIBUTES int ec_ioctl_domain_fmmu ( ec_master_t * master,
void * arg )
static

Get domain FMMU information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 534 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_data()

ATTRIBUTES int ec_ioctl_domain_data ( ec_master_t * master,
void * arg )
static

Get domain data.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argUserspace address to store the results.

Definition at line 586 of file rtdm-ioctl.c.

◆ ec_ioctl_master_debug()

ATTRIBUTES int ec_ioctl_master_debug ( ec_master_t * master,
void * arg )
static

Set master debug level.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 631 of file rtdm-ioctl.c.

◆ ec_ioctl_master_rescan()

ATTRIBUTES int ec_ioctl_master_rescan ( ec_master_t * master,
void * arg )
static

Issue a bus scan.

Returns
Always zero (success).
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 645 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_state()

ATTRIBUTES int ec_ioctl_slave_state ( ec_master_t * master,
void * arg )
static

Set slave state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 662 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sdo()

ATTRIBUTES int ec_ioctl_slave_sdo ( ec_master_t * master,
void * arg )
static

Get slave SDO information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 697 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sdo_entry()

ATTRIBUTES int ec_ioctl_slave_sdo_entry ( ec_master_t * master,
void * arg )
static

Get slave SDO entry information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 746 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sdo_upload()

ATTRIBUTES int ec_ioctl_slave_sdo_upload ( ec_master_t * master,
void * arg )
static

Upload SDO.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 826 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sdo_download()

ATTRIBUTES int ec_ioctl_slave_sdo_download ( ec_master_t * master,
void * arg )
static

Download SDO.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 872 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sii_read()

ATTRIBUTES int ec_ioctl_slave_sii_read ( ec_master_t * master,
void * arg )
static

Read a slave's SII.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 920 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_sii_write()

ATTRIBUTES int ec_ioctl_slave_sii_write ( ec_master_t * master,
void * arg )
static

Write a slave's SII.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 968 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_reg_read()

ATTRIBUTES int ec_ioctl_slave_reg_read ( ec_master_t * master,
void * arg )
static

Read a slave's registers.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1056 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_reg_write()

ATTRIBUTES int ec_ioctl_slave_reg_write ( ec_master_t * master,
void * arg )
static

Write a slave's registers.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1138 of file rtdm-ioctl.c.

◆ ec_ioctl_config()

ATTRIBUTES int ec_ioctl_config ( ec_master_t * master,
void * arg )
static

Get slave configuration information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1226 of file rtdm-ioctl.c.

◆ ec_ioctl_config_pdo()

ATTRIBUTES int ec_ioctl_config_pdo ( ec_master_t * master,
void * arg )
static

Get slave configuration PDO information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1285 of file rtdm-ioctl.c.

◆ ec_ioctl_config_pdo_entry()

ATTRIBUTES int ec_ioctl_config_pdo_entry ( ec_master_t * master,
void * arg )
static

Get slave configuration PDO entry information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1341 of file rtdm-ioctl.c.

◆ ec_ioctl_config_sdo()

ATTRIBUTES int ec_ioctl_config_sdo ( ec_master_t * master,
void * arg )
static

Get slave configuration SDO information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1406 of file rtdm-ioctl.c.

◆ ec_ioctl_config_idn()

ATTRIBUTES int ec_ioctl_config_idn ( ec_master_t * master,
void * arg )
static

Get slave configuration IDN information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1470 of file rtdm-ioctl.c.

◆ ec_ioctl_config_flag()

ATTRIBUTES int ec_ioctl_config_flag ( ec_master_t * master,
void * arg )
static

Get slave configuration feature flag information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1534 of file rtdm-ioctl.c.

◆ ec_ioctl_config_ip()

ATTRIBUTES int ec_ioctl_config_ip ( ec_master_t * master,
void * arg )
static

Get configured EoE IP parameters for a given slave configuration.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1599 of file rtdm-ioctl.c.

◆ ec_ioctl_eoe_handler()

ATTRIBUTES int ec_ioctl_eoe_handler ( ec_master_t * master,
void * arg )
static

Get EoE handler information.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1667 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_eoe_ip_param()

ATTRIBUTES int ec_ioctl_slave_eoe_ip_param ( ec_master_t * master,
void * arg )
static

Request EoE IP parameter setting.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 1720 of file rtdm-ioctl.c.

◆ ec_ioctl_request()

ATTRIBUTES int ec_ioctl_request ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Request the master from userspace.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 1804 of file rtdm-ioctl.c.

◆ ec_ioctl_create_domain()

ATTRIBUTES int ec_ioctl_create_domain ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Create a domain.

Returns
Domain index on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 1829 of file rtdm-ioctl.c.

◆ ec_ioctl_create_slave_config()

ATTRIBUTES int ec_ioctl_create_slave_config ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Create a slave configuration.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 1853 of file rtdm-ioctl.c.

◆ ec_ioctl_select_ref_clock()

ATTRIBUTES int ec_ioctl_select_ref_clock ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Select the DC reference clock.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 1899 of file rtdm-ioctl.c.

◆ ec_ioctl_activate()

ATTRIBUTES int ec_ioctl_activate ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Activates the master.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 1940 of file rtdm-ioctl.c.

◆ ec_ioctl_deactivate()

ATTRIBUTES int ec_ioctl_deactivate ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Deactivates the master.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2024 of file rtdm-ioctl.c.

◆ ec_ioctl_set_send_interval()

ATTRIBUTES int ec_ioctl_set_send_interval ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Set max.

number of databytes in a cycle

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2042 of file rtdm-ioctl.c.

◆ ec_ioctl_send()

ATTRIBUTES int ec_ioctl_send ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Send frames.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2074 of file rtdm-ioctl.c.

◆ ec_ioctl_receive()

ATTRIBUTES int ec_ioctl_receive ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Receive frames.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2100 of file rtdm-ioctl.c.

◆ ec_ioctl_master_state()

ATTRIBUTES int ec_ioctl_master_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get the master state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2126 of file rtdm-ioctl.c.

◆ ec_ioctl_master_link_state()

ATTRIBUTES int ec_ioctl_master_link_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get the link state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2151 of file rtdm-ioctl.c.

◆ ec_ioctl_app_time()

ATTRIBUTES int ec_ioctl_app_time ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Set the master DC application time.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2184 of file rtdm-ioctl.c.

◆ ec_ioctl_sync_ref()

ATTRIBUTES int ec_ioctl_sync_ref ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sync the reference clock.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2208 of file rtdm-ioctl.c.

◆ ec_ioctl_sync_ref_to()

ATTRIBUTES int ec_ioctl_sync_ref_to ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sync the reference clock.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2234 of file rtdm-ioctl.c.

◆ ec_ioctl_sync_slaves()

ATTRIBUTES int ec_ioctl_sync_slaves ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sync the slave clocks.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2264 of file rtdm-ioctl.c.

◆ ec_ioctl_ref_clock_time()

ATTRIBUTES int ec_ioctl_ref_clock_time ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get the system time of the reference clock.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2290 of file rtdm-ioctl.c.

◆ ec_ioctl_sync_mon_queue()

ATTRIBUTES int ec_ioctl_sync_mon_queue ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Queue the sync monitoring datagram.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2321 of file rtdm-ioctl.c.

◆ ec_ioctl_sync_mon_process()

ATTRIBUTES int ec_ioctl_sync_mon_process ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Processes the sync monitoring datagram.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2347 of file rtdm-ioctl.c.

◆ ec_ioctl_reset()

ATTRIBUTES int ec_ioctl_reset ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Reset configuration.

Returns
Always zero (success).
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2373 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_sync()

ATTRIBUTES int ec_ioctl_sc_sync ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Configure a sync manager.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2394 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_watchdog()

ATTRIBUTES int ec_ioctl_sc_watchdog ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Configure a slave's watchdogs.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2447 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_add_pdo()

ATTRIBUTES int ec_ioctl_sc_add_pdo ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Add a PDO to the assignment.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2492 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_clear_pdos()

ATTRIBUTES int ec_ioctl_sc_clear_pdos ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Clears the PDO assignment.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2526 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_add_entry()

ATTRIBUTES int ec_ioctl_sc_add_entry ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Add an entry to a PDO's mapping.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2560 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_clear_entries()

ATTRIBUTES int ec_ioctl_sc_clear_entries ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Clears the mapping of a PDO.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2595 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_reg_pdo_entry()

ATTRIBUTES int ec_ioctl_sc_reg_pdo_entry ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Registers a PDO entry.

Returns
Process data offset on success, otherwise a negative error code.
Todo
sc or domain could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2629 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_reg_pdo_pos()

ATTRIBUTES int ec_ioctl_sc_reg_pdo_pos ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Registers a PDO entry by its position.

Returns
Process data offset on success, otherwise a negative error code.
Todo
sc or domain could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2676 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_dc()

ATTRIBUTES int ec_ioctl_sc_dc ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets the DC AssignActivate word and the sync signal times.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2726 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_sdo()

ATTRIBUTES int ec_ioctl_sc_sdo ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Configures an SDO.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2767 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_emerg_size()

ATTRIBUTES int ec_ioctl_sc_emerg_size ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Set the emergency ring buffer size.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2826 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_emerg_pop()

ATTRIBUTES int ec_ioctl_sc_emerg_pop ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get an emergency message from the ring.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2864 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_emerg_clear()

ATTRIBUTES int ec_ioctl_sc_emerg_clear ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Clear the emergency ring.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2908 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_emerg_overruns()

ATTRIBUTES int ec_ioctl_sc_emerg_overruns ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get the number of emergency overruns.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2941 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_create_sdo_request()

ATTRIBUTES int ec_ioctl_sc_create_sdo_request ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Create an SDO request.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 2986 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_create_soe_request()

ATTRIBUTES int ec_ioctl_sc_create_soe_request ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Create an SoE request.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3037 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_create_reg_request()

ATTRIBUTES int ec_ioctl_sc_create_reg_request ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Create a register request.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3090 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_create_voe_handler()

ATTRIBUTES int ec_ioctl_sc_create_voe_handler ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Create a VoE handler.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3144 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_state()

ATTRIBUTES int ec_ioctl_sc_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get the slave configuration's state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3194 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_idn()

ATTRIBUTES int ec_ioctl_sc_idn ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Configures an IDN.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3236 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_flag()

ATTRIBUTES int ec_ioctl_sc_flag ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Configures a feature flag.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3290 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_state_timeout()

ATTRIBUTES int ec_ioctl_sc_state_timeout ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets an AL state transition timeout.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3347 of file rtdm-ioctl.c.

◆ ec_ioctl_sc_ip()

ATTRIBUTES int ec_ioctl_sc_ip ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Configures EoE IP parameters.

Returns
Zero on success, otherwise a negative error code.
Todo
sc could be invalidated
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3389 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_size()

ATTRIBUTES int ec_ioctl_domain_size ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Gets the domain's data size.

Returns
Domain size, or a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3448 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_offset()

ATTRIBUTES int ec_ioctl_domain_offset ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Gets the domain's offset in the total process data.

Returns
Domain offset, or a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3482 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_process()

ATTRIBUTES int ec_ioctl_domain_process ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Process the domain.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3516 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_queue()

ATTRIBUTES int ec_ioctl_domain_queue ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Queue the domain.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3543 of file rtdm-ioctl.c.

◆ ec_ioctl_domain_state()

ATTRIBUTES int ec_ioctl_domain_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Get the domain state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3576 of file rtdm-ioctl.c.

◆ ec_ioctl_sdo_request_index()

ATTRIBUTES int ec_ioctl_sdo_request_index ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets an SDO request's SDO index and subindex.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3618 of file rtdm-ioctl.c.

◆ ec_ioctl_sdo_request_timeout()

ATTRIBUTES int ec_ioctl_sdo_request_timeout ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets an SDO request's timeout.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3654 of file rtdm-ioctl.c.

◆ ec_ioctl_sdo_request_state()

ATTRIBUTES int ec_ioctl_sdo_request_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Gets an SDO request's state.

Also pre-fetches the size of incoming data.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3692 of file rtdm-ioctl.c.

◆ ec_ioctl_sdo_request_read()

ATTRIBUTES int ec_ioctl_sdo_request_read ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts an SDO read operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3737 of file rtdm-ioctl.c.

◆ ec_ioctl_sdo_request_write()

ATTRIBUTES int ec_ioctl_sdo_request_write ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts an SDO write operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3773 of file rtdm-ioctl.c.

◆ ec_ioctl_sdo_request_data()

ATTRIBUTES int ec_ioctl_sdo_request_data ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Read SDO data.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3822 of file rtdm-ioctl.c.

◆ ec_ioctl_soe_request_index()

ATTRIBUTES int ec_ioctl_soe_request_index ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets an SoE request's drive number and IDN.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3862 of file rtdm-ioctl.c.

◆ ec_ioctl_soe_request_timeout()

ATTRIBUTES int ec_ioctl_soe_request_timeout ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets an CoE request's timeout.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3898 of file rtdm-ioctl.c.

◆ ec_ioctl_soe_request_state()

ATTRIBUTES int ec_ioctl_soe_request_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Gets an SoE request's state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3934 of file rtdm-ioctl.c.

◆ ec_ioctl_soe_request_read()

ATTRIBUTES int ec_ioctl_soe_request_read ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts an SoE IDN read operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 3981 of file rtdm-ioctl.c.

◆ ec_ioctl_soe_request_write()

ATTRIBUTES int ec_ioctl_soe_request_write ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts an SoE IDN write operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4017 of file rtdm-ioctl.c.

◆ ec_ioctl_soe_request_data()

ATTRIBUTES int ec_ioctl_soe_request_data ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Read SoE IDN data.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4066 of file rtdm-ioctl.c.

◆ ec_ioctl_reg_request_data()

ATTRIBUTES int ec_ioctl_reg_request_data ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Read register data.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4106 of file rtdm-ioctl.c.

◆ ec_ioctl_reg_request_state()

ATTRIBUTES int ec_ioctl_reg_request_state ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Gets an register request's state.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4153 of file rtdm-ioctl.c.

◆ ec_ioctl_reg_request_write()

ATTRIBUTES int ec_ioctl_reg_request_write ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts an register write operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4198 of file rtdm-ioctl.c.

◆ ec_ioctl_reg_request_read()

ATTRIBUTES int ec_ioctl_reg_request_read ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts an register read operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4245 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_send_header()

ATTRIBUTES int ec_ioctl_voe_send_header ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Sets the VoE send header.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4287 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_rec_header()

ATTRIBUTES int ec_ioctl_voe_rec_header ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Gets the received VoE header.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4332 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_read()

ATTRIBUTES int ec_ioctl_voe_read ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts a VoE read operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4385 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_read_nosync()

ATTRIBUTES int ec_ioctl_voe_read_nosync ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts a VoE read operation without sending a sync message first.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4421 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_write()

ATTRIBUTES int ec_ioctl_voe_write ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Starts a VoE write operation.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4457 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_exec()

ATTRIBUTES int ec_ioctl_voe_exec ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Executes the VoE state machine.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4502 of file rtdm-ioctl.c.

◆ ec_ioctl_voe_data()

ATTRIBUTES int ec_ioctl_voe_data ( ec_master_t * master,
void * arg,
ec_ioctl_context_t * ctx )
static

Reads the received VoE data.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.
ctxPrivate data structure of file handle.

Definition at line 4551 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_foe_read()

ATTRIBUTES int ec_ioctl_slave_foe_read ( ec_master_t * master,
void * arg )
static

Read a file from a slave via FoE.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 4591 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_foe_write()

ATTRIBUTES int ec_ioctl_slave_foe_write ( ec_master_t * master,
void * arg )
static

Write a file to a slave via FoE.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 4687 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_soe_read()

ATTRIBUTES int ec_ioctl_slave_soe_read ( ec_master_t * master,
void * arg )
static

Read an SoE IDN.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 4775 of file rtdm-ioctl.c.

◆ ec_ioctl_slave_soe_write()

ATTRIBUTES int ec_ioctl_slave_soe_write ( ec_master_t * master,
void * arg )
static

Write an IDN to a slave via SoE.

Returns
Zero on success, otherwise a negative error code.
Parameters
masterEtherCAT master.
argioctl() argument.

Definition at line 4824 of file rtdm-ioctl.c.

◆ ec_ioctl_nrt()

long ec_ioctl_nrt ( ec_master_t * master,
ec_ioctl_context_t * ctx,
unsigned int cmd,
void * arg )
static

ioctl() function to use.

Called when an ioctl() command is issued.

For RTDM, there will be ec_ioctl_rtdm_rt and ec_ioctl_rtdm_nrt. For "normal" cdev, there will be ec_ioctl_rt only.

nRT context only.

Returns
ioctl() return code.
Parameters
masterEtherCAT master.
ctxDevice context.
cmdioctl() command identifier.
argioctl() argument.

Definition at line 5216 of file rtdm-ioctl.c.

◆ ec_ioctl_both()

long ec_ioctl_both ( ec_master_t * master,
ec_ioctl_context_t * ctx,
unsigned int cmd,
void * arg )
static

Called when an ioctl() command is issued.

Both RT and nRT context.

Returns
ioctl() return code.
Parameters
masterEtherCAT master.
ctxDevice context.
cmdioctl() command identifier.
argioctl() argument.

Definition at line 4888 of file rtdm-ioctl.c.

◆ ec_ioctl()

long ec_ioctl ( ec_master_t * master,
ec_ioctl_context_t * ctx,
unsigned int cmd,
void * arg )

Called when an ioctl() command is issued.

RTDM: RT only.

Returns
ioctl() return code.
Parameters
masterEtherCAT master.
ctxDevice context.
cmdioctl() command identifier.
argioctl() argument.

Definition at line 4970 of file rtdm-ioctl.c.