35 #ifndef __EC_SLAVE_CONFIG_H__ 36 #define __EC_SLAVE_CONFIG_H__ 38 #include <linux/list.h> 60 #define EC_CONFIG_INFO(sc, fmt, args...) \ 61 printk(KERN_INFO "EtherCAT %u %u:%u: " fmt, sc->master->index, \ 62 sc->alias, sc->position, ##args) 74 #define EC_CONFIG_ERR(sc, fmt, args...) \ 75 printk(KERN_ERR "EtherCAT ERROR %u %u:%u: " fmt, sc->master->index, \ 76 sc->alias, sc->position, ##args) 88 #define EC_CONFIG_WARN(sc, fmt, args...) \ 89 printk(KERN_WARNING "EtherCAT WARNING %u %u:%u: " fmt, \ 90 sc->master->index, sc->alias, sc->position, ##args) 105 #define EC_CONFIG_DBG(sc, level, fmt, args...) \ 107 if (sc->master->debug_level >= level) { \ 108 printk(KERN_DEBUG "EtherCAT DEBUG %u %u:%u: " fmt, \ 109 sc->master->index, sc->alias, sc->position, ##args); \ 156 uint16_t, uint32_t, uint32_t);
void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t, uint16_t, uint32_t, uint32_t)
Slave configuration constructor.
struct list_head sdo_configs
List of SDO configurations.
ec_soe_request_t * ecrt_slave_config_create_soe_request_err(ec_slave_config_t *, uint8_t, uint16_t, size_t)
Same as ecrt_slave_config_create_soe_request(), but with ERR_PTR() return value.
ec_reg_request_t * ec_slave_config_find_reg_request(ec_slave_config_t *, unsigned int)
Finds a register handler via its position in the list.
const ec_flag_t * ec_slave_config_get_flag_by_pos_const(const ec_slave_config_t *, unsigned int)
Finds a flag via its position in the list.
void ec_slave_config_load_default_sync_config(ec_slave_config_t *)
Loads the default PDO assignment from the slave object.
unsigned int ec_slave_config_idn_count(const ec_slave_config_t *)
Get the number of IDN configurations.
EtherCAT slave structure.
unsigned int ec_slave_config_sdo_count(const ec_slave_config_t *)
Get the number of SDO configurations.
uint8_t used_fmmus
Number of FMMUs used.
uint32_t product_code
Slave product code.
uint16_t position
Index after alias.
struct list_head list
List item.
ec_master_t * master
Master owning the slave configuration.
EtherCAT CoE emergency ring buffer structure.
uint16_t alias
Slave alias.
EtherCAT CoE emergency ring buffer.
#define EC_MAX_FMMUS
Maximum number of FMMUs per slave.
Global definitions and macros.
ec_fmmu_config_t fmmu_configs[EC_MAX_FMMUS]
FMMU configurations.
ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT]
DC sync signals.
struct list_head flags
List of feature flags.
ec_voe_handler_t * ec_slave_config_find_voe_handler(ec_slave_config_t *, unsigned int)
Finds a VoE handler via its position in the list.
ec_sync_config_t sync_configs[EC_MAX_SYNC_MANAGERS]
Sync manager configurations.
struct list_head reg_requests
List of register requests.
Slave configutation feature flag.
struct list_head sdo_requests
List of SDO requests.
ec_sdo_request_t * ecrt_slave_config_create_sdo_request_err(ec_slave_config_t *, uint16_t, uint8_t, size_t)
Same as ecrt_slave_config_create_sdo_request(), but with ERR_PTR() return value.
EtherCAT Slave Configuration Feature Flag.
struct list_head voe_handlers
List of VoE handlers.
const ec_sdo_request_t * ec_slave_config_get_sdo_by_pos_const(const ec_slave_config_t *, unsigned int)
Finds an SDO configuration via its position in the list.
uint16_t dc_assign_activate
Vendor-specific AssignActivate word.
ec_soe_request_t * ec_slave_config_find_soe_request(ec_slave_config_t *, unsigned int)
Finds a SoE request via its position in the list.
uint16_t watchdog_intervals
Process data watchdog intervals (see spec.
Vendor specific over EtherCAT handler.
struct list_head soe_requests
List of SoE requests.
EtherCAT FMMU configuration structure.
ec_slave_t * slave
Slave pointer.
uint16_t watchdog_divider
Watchdog divider as a number of 40ns intervals (see spec.
ec_voe_handler_t * ecrt_slave_config_create_voe_handler_err(ec_slave_config_t *, size_t)
Same as ecrt_slave_config_create_voe_handler(), but with ERR_PTR() return value.
ec_reg_request_t * ecrt_slave_config_create_reg_request_err(ec_slave_config_t *, size_t)
Same as ecrt_slave_config_create_reg_request(), but with ERR_PTR() return value.
void ec_slave_config_clear(ec_slave_config_t *)
Slave configuration destructor.
struct list_head soe_configs
List of SoE configurations.
unsigned int ec_slave_config_flag_count(const ec_slave_config_t *)
Get the number of feature flags.
int ec_slave_config_attach(ec_slave_config_t *)
Attaches the configuration to the addressed slave object.
ec_coe_emerg_ring_t emerg_ring
CoE emergency ring buffer.
Sync manager configuration.
EtherCAT slave sync signal configuration.
uint32_t vendor_id
Slave vendor ID.
ec_sdo_request_t * ec_slave_config_find_sdo_request(ec_slave_config_t *, unsigned int)
Finds a CoE SDO request via its position in the list.
const ec_soe_request_t * ec_slave_config_get_idn_by_pos_const(const ec_slave_config_t *, unsigned int)
Finds an IDN configuration via its position in the list.
void ec_slave_config_detach(ec_slave_config_t *)
Detaches the configuration from a slave object.
EtherCAT slave configuration.
#define EC_MAX_SYNC_MANAGERS
Maximum number of sync managers per slave.
ec_flag_t * ec_slave_config_find_flag(ec_slave_config_t *, const char *)
Finds a flag.
#define EC_SYNC_SIGNAL_COUNT
Number of DC sync signals.
Sercos-over-EtherCAT request.