master/ioctl.h
changeset 2589 2b9c78543663
parent 2247 00e3937e0f0a
child 2597 0e145bb05859
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  *  $Id$
     3  *  $Id$
     4  *
     4  *
     5  *  Copyright (C) 2006-2008  Florian Pose, Ingenieurgemeinschaft IgH
     5  *  Copyright (C) 2006-2012  Florian Pose, Ingenieurgemeinschaft IgH
     6  *
     6  *
     7  *  This file is part of the IgH EtherCAT Master.
     7  *  This file is part of the IgH EtherCAT Master.
     8  *
     8  *
     9  *  The IgH EtherCAT Master is free software; you can redistribute it and/or
     9  *  The IgH EtherCAT Master is free software; you can redistribute it and/or
    10  *  modify it under the terms of the GNU General Public License version 2, as
    10  *  modify it under the terms of the GNU General Public License version 2, as
    54 
    54 
    55 /** EtherCAT master ioctl() version magic.
    55 /** EtherCAT master ioctl() version magic.
    56  *
    56  *
    57  * Increment this when changing the ioctl interface!
    57  * Increment this when changing the ioctl interface!
    58  */
    58  */
    59 #define EC_IOCTL_VERSION_MAGIC 13
    59 #define EC_IOCTL_VERSION_MAGIC 28
    60 
    60 
    61 // Command-line tool
    61 // Command-line tool
    62 #define EC_IOCTL_MODULE                EC_IOR(0x00, ec_ioctl_module_t)
    62 #define EC_IOCTL_MODULE                EC_IOR(0x00, ec_ioctl_module_t)
    63 #define EC_IOCTL_MASTER                EC_IOR(0x01, ec_ioctl_master_t)
    63 #define EC_IOCTL_MASTER                EC_IOR(0x01, ec_ioctl_master_t)
    64 #define EC_IOCTL_SLAVE                EC_IOWR(0x02, ec_ioctl_slave_t)
    64 #define EC_IOCTL_SLAVE                EC_IOWR(0x02, ec_ioctl_slave_t)
    94 
    94 
    95 // Application interface
    95 // Application interface
    96 #define EC_IOCTL_REQUEST                EC_IO(0x1e)
    96 #define EC_IOCTL_REQUEST                EC_IO(0x1e)
    97 #define EC_IOCTL_CREATE_DOMAIN          EC_IO(0x1f)
    97 #define EC_IOCTL_CREATE_DOMAIN          EC_IO(0x1f)
    98 #define EC_IOCTL_CREATE_SLAVE_CONFIG  EC_IOWR(0x20, ec_ioctl_config_t)
    98 #define EC_IOCTL_CREATE_SLAVE_CONFIG  EC_IOWR(0x20, ec_ioctl_config_t)
    99 #define EC_IOCTL_ACTIVATE              EC_IOR(0x21, size_t)
    99 #define EC_IOCTL_SELECT_REF_CLOCK      EC_IOW(0x21, uint32_t)
   100 #define EC_IOCTL_DEACTIVATE             EC_IO(0x22)
   100 #define EC_IOCTL_ACTIVATE              EC_IOR(0x22, ec_ioctl_master_activate_t)
   101 #define EC_IOCTL_SEND                   EC_IO(0x23)
   101 #define EC_IOCTL_DEACTIVATE             EC_IO(0x23)
   102 #define EC_IOCTL_RECEIVE                EC_IO(0x24)
   102 #define EC_IOCTL_SEND                   EC_IO(0x24)
   103 #define EC_IOCTL_MASTER_STATE          EC_IOR(0x25, ec_master_state_t)
   103 #define EC_IOCTL_RECEIVE                EC_IO(0x25)
   104 #define EC_IOCTL_APP_TIME              EC_IOW(0x26, ec_ioctl_app_time_t)
   104 #define EC_IOCTL_MASTER_STATE          EC_IOR(0x26, ec_master_state_t)
   105 #define EC_IOCTL_SYNC_REF               EC_IO(0x27)
   105 #define EC_IOCTL_MASTER_LINK_STATE    EC_IOWR(0x27, ec_ioctl_link_state_t)
   106 #define EC_IOCTL_SYNC_SLAVES            EC_IO(0x28)
   106 #define EC_IOCTL_APP_TIME              EC_IOW(0x28, ec_ioctl_app_time_t)
   107 #define EC_IOCTL_SYNC_MON_QUEUE         EC_IO(0x29)
   107 #define EC_IOCTL_SYNC_REF               EC_IO(0x29)
   108 #define EC_IOCTL_SYNC_MON_PROCESS      EC_IOR(0x2a, uint32_t)
   108 #define EC_IOCTL_SYNC_SLAVES            EC_IO(0x2a)
   109 #define EC_IOCTL_RESET                  EC_IO(0x2b)
   109 #define EC_IOCTL_REF_CLOCK_TIME        EC_IOR(0x2b, uint32_t)
   110 #define EC_IOCTL_SC_SYNC               EC_IOW(0x2c, ec_ioctl_config_t)
   110 #define EC_IOCTL_SYNC_MON_QUEUE         EC_IO(0x2c)
   111 #define EC_IOCTL_SC_WATCHDOG           EC_IOW(0x2d, ec_ioctl_config_t)
   111 #define EC_IOCTL_SYNC_MON_PROCESS      EC_IOR(0x2d, uint32_t)
   112 #define EC_IOCTL_SC_ADD_PDO            EC_IOW(0x2e, ec_ioctl_config_pdo_t)
   112 #define EC_IOCTL_RESET                  EC_IO(0x2e)
   113 #define EC_IOCTL_SC_CLEAR_PDOS         EC_IOW(0x2f, ec_ioctl_config_pdo_t)
   113 #define EC_IOCTL_SC_SYNC               EC_IOW(0x2f, ec_ioctl_config_t)
   114 #define EC_IOCTL_SC_ADD_ENTRY          EC_IOW(0x30, ec_ioctl_add_pdo_entry_t)
   114 #define EC_IOCTL_SC_WATCHDOG           EC_IOW(0x30, ec_ioctl_config_t)
   115 #define EC_IOCTL_SC_CLEAR_ENTRIES      EC_IOW(0x31, ec_ioctl_config_pdo_t)
   115 #define EC_IOCTL_SC_ADD_PDO            EC_IOW(0x31, ec_ioctl_config_pdo_t)
   116 #define EC_IOCTL_SC_REG_PDO_ENTRY     EC_IOWR(0x32, ec_ioctl_reg_pdo_entry_t)
   116 #define EC_IOCTL_SC_CLEAR_PDOS         EC_IOW(0x32, ec_ioctl_config_pdo_t)
   117 #define EC_IOCTL_SC_DC                 EC_IOW(0x33, ec_ioctl_config_t)
   117 #define EC_IOCTL_SC_ADD_ENTRY          EC_IOW(0x33, ec_ioctl_add_pdo_entry_t)
   118 #define EC_IOCTL_SC_SDO                EC_IOW(0x34, ec_ioctl_sc_sdo_t)
   118 #define EC_IOCTL_SC_CLEAR_ENTRIES      EC_IOW(0x34, ec_ioctl_config_pdo_t)
   119 #define EC_IOCTL_SC_SDO_REQUEST       EC_IOWR(0x35, ec_ioctl_sdo_request_t)
   119 #define EC_IOCTL_SC_REG_PDO_ENTRY     EC_IOWR(0x35, ec_ioctl_reg_pdo_entry_t)
   120 #define EC_IOCTL_SC_VOE               EC_IOWR(0x36, ec_ioctl_voe_t)
   120 #define EC_IOCTL_SC_REG_PDO_POS       EC_IOWR(0x36, ec_ioctl_reg_pdo_pos_t)
   121 #define EC_IOCTL_SC_STATE             EC_IOWR(0x37, ec_ioctl_sc_state_t)
   121 #define EC_IOCTL_SC_DC                 EC_IOW(0x37, ec_ioctl_config_t)
   122 #define EC_IOCTL_SC_IDN                EC_IOW(0x38, ec_ioctl_sc_idn_t)
   122 #define EC_IOCTL_SC_SDO                EC_IOW(0x38, ec_ioctl_sc_sdo_t)
   123 #define EC_IOCTL_DOMAIN_OFFSET          EC_IO(0x39)
   123 #define EC_IOCTL_SC_EMERG_SIZE         EC_IOW(0x39, ec_ioctl_sc_emerg_t)
   124 #define EC_IOCTL_DOMAIN_PROCESS         EC_IO(0x3a)
   124 #define EC_IOCTL_SC_EMERG_POP         EC_IOWR(0x3a, ec_ioctl_sc_emerg_t)
   125 #define EC_IOCTL_DOMAIN_QUEUE           EC_IO(0x3b)
   125 #define EC_IOCTL_SC_EMERG_CLEAR        EC_IOW(0x3b, ec_ioctl_sc_emerg_t)
   126 #define EC_IOCTL_DOMAIN_STATE         EC_IOWR(0x3c, ec_ioctl_domain_state_t)
   126 #define EC_IOCTL_SC_EMERG_OVERRUNS    EC_IOWR(0x3c, ec_ioctl_sc_emerg_t)
   127 #define EC_IOCTL_SDO_REQUEST_TIMEOUT  EC_IOWR(0x3d, ec_ioctl_sdo_request_t)
   127 #define EC_IOCTL_SC_SDO_REQUEST       EC_IOWR(0x3d, ec_ioctl_sdo_request_t)
   128 #define EC_IOCTL_SDO_REQUEST_STATE    EC_IOWR(0x3e, ec_ioctl_sdo_request_t)
   128 #define EC_IOCTL_SC_REG_REQUEST       EC_IOWR(0x3e, ec_ioctl_reg_request_t)
   129 #define EC_IOCTL_SDO_REQUEST_READ     EC_IOWR(0x3f, ec_ioctl_sdo_request_t)
   129 #define EC_IOCTL_SC_VOE               EC_IOWR(0x3f, ec_ioctl_voe_t)
   130 #define EC_IOCTL_SDO_REQUEST_WRITE    EC_IOWR(0x40, ec_ioctl_sdo_request_t)
   130 #define EC_IOCTL_SC_STATE             EC_IOWR(0x40, ec_ioctl_sc_state_t)
   131 #define EC_IOCTL_SDO_REQUEST_DATA     EC_IOWR(0x41, ec_ioctl_sdo_request_t)
   131 #define EC_IOCTL_SC_IDN                EC_IOW(0x41, ec_ioctl_sc_idn_t)
   132 #define EC_IOCTL_VOE_SEND_HEADER       EC_IOW(0x42, ec_ioctl_voe_t)
   132 #define EC_IOCTL_DOMAIN_SIZE            EC_IO(0x42)
   133 #define EC_IOCTL_VOE_REC_HEADER       EC_IOWR(0x43, ec_ioctl_voe_t)
   133 #define EC_IOCTL_DOMAIN_OFFSET          EC_IO(0x43)
   134 #define EC_IOCTL_VOE_READ              EC_IOW(0x44, ec_ioctl_voe_t)
   134 #define EC_IOCTL_DOMAIN_PROCESS         EC_IO(0x44)
   135 #define EC_IOCTL_VOE_READ_NOSYNC       EC_IOW(0x45, ec_ioctl_voe_t)
   135 #define EC_IOCTL_DOMAIN_QUEUE           EC_IO(0x45)
   136 #define EC_IOCTL_VOE_WRITE            EC_IOWR(0x46, ec_ioctl_voe_t)
   136 #define EC_IOCTL_DOMAIN_STATE         EC_IOWR(0x46, ec_ioctl_domain_state_t)
   137 #define EC_IOCTL_VOE_EXEC             EC_IOWR(0x47, ec_ioctl_voe_t)
   137 #define EC_IOCTL_SDO_REQUEST_INDEX    EC_IOWR(0x47, ec_ioctl_sdo_request_t)
   138 #define EC_IOCTL_VOE_DATA             EC_IOWR(0x48, ec_ioctl_voe_t)
   138 #define EC_IOCTL_SDO_REQUEST_TIMEOUT  EC_IOWR(0x48, ec_ioctl_sdo_request_t)
   139 #define EC_IOCTL_SET_SEND_INTERVAL     EC_IOW(0x49, size_t)
   139 #define EC_IOCTL_SDO_REQUEST_STATE    EC_IOWR(0x49, ec_ioctl_sdo_request_t)
   140 #define EC_IOCTL_MASTER_SC_STATE       EC_IOR(0x50, ec_master_state_t)
   140 #define EC_IOCTL_SDO_REQUEST_READ     EC_IOWR(0x4a, ec_ioctl_sdo_request_t)
   141 #define EC_IOCTL_SC_OVERLAPPING_IO     EC_IOW(0x51, ec_ioctl_config_t)
   141 #define EC_IOCTL_SDO_REQUEST_WRITE    EC_IOWR(0x4b, ec_ioctl_sdo_request_t)
       
   142 #define EC_IOCTL_SDO_REQUEST_DATA     EC_IOWR(0x4c, ec_ioctl_sdo_request_t)
       
   143 #define EC_IOCTL_REG_REQUEST_DATA     EC_IOWR(0x4d, ec_ioctl_reg_request_t)
       
   144 #define EC_IOCTL_REG_REQUEST_STATE    EC_IOWR(0x4e, ec_ioctl_reg_request_t)
       
   145 #define EC_IOCTL_REG_REQUEST_WRITE    EC_IOWR(0x4f, ec_ioctl_reg_request_t)
       
   146 #define EC_IOCTL_REG_REQUEST_READ     EC_IOWR(0x50, ec_ioctl_reg_request_t)
       
   147 #define EC_IOCTL_VOE_SEND_HEADER       EC_IOW(0x51, ec_ioctl_voe_t)
       
   148 #define EC_IOCTL_VOE_REC_HEADER       EC_IOWR(0x52, ec_ioctl_voe_t)
       
   149 #define EC_IOCTL_VOE_READ              EC_IOW(0x53, ec_ioctl_voe_t)
       
   150 #define EC_IOCTL_VOE_READ_NOSYNC       EC_IOW(0x54, ec_ioctl_voe_t)
       
   151 #define EC_IOCTL_VOE_WRITE            EC_IOWR(0x55, ec_ioctl_voe_t)
       
   152 #define EC_IOCTL_VOE_EXEC             EC_IOWR(0x56, ec_ioctl_voe_t)
       
   153 #define EC_IOCTL_VOE_DATA             EC_IOWR(0x57, ec_ioctl_voe_t)
       
   154 #define EC_IOCTL_SET_SEND_INTERVAL     EC_IOW(0x58, size_t)
   142 
   155 
   143 /*****************************************************************************/
   156 /*****************************************************************************/
   144 
   157 
   145 #define EC_IOCTL_STRING_SIZE 64
   158 #define EC_IOCTL_STRING_SIZE 64
   146 
   159 
   168         uint8_t attached;
   181         uint8_t attached;
   169         uint8_t link_state;
   182         uint8_t link_state;
   170         uint64_t tx_count;
   183         uint64_t tx_count;
   171         uint64_t rx_count;
   184         uint64_t rx_count;
   172         uint64_t tx_bytes;
   185         uint64_t tx_bytes;
       
   186         uint64_t rx_bytes;
   173         uint64_t tx_errors;
   187         uint64_t tx_errors;
   174         uint32_t tx_frame_rates[EC_RATE_COUNT];
   188         int32_t tx_frame_rates[EC_RATE_COUNT];
   175         uint32_t tx_byte_rates[EC_RATE_COUNT];
   189         int32_t rx_frame_rates[EC_RATE_COUNT];
   176         int32_t loss_rates[EC_RATE_COUNT];
   190         int32_t tx_byte_rates[EC_RATE_COUNT];
   177     } devices[2];
   191         int32_t rx_byte_rates[EC_RATE_COUNT];
       
   192     } devices[EC_MAX_NUM_DEVICES];
       
   193     uint32_t num_devices;
       
   194     uint64_t tx_count;
       
   195     uint64_t rx_count;
       
   196     uint64_t tx_bytes;
       
   197     uint64_t rx_bytes;
       
   198     int32_t tx_frame_rates[EC_RATE_COUNT];
       
   199     int32_t rx_frame_rates[EC_RATE_COUNT];
       
   200     int32_t tx_byte_rates[EC_RATE_COUNT];
       
   201     int32_t rx_byte_rates[EC_RATE_COUNT];
       
   202     int32_t loss_rates[EC_RATE_COUNT];
   178     uint64_t app_time;
   203     uint64_t app_time;
   179     uint16_t ref_clock;
   204     uint16_t ref_clock;
   180 } ec_ioctl_master_t;
   205 } ec_ioctl_master_t;
   181 
   206 
   182 /*****************************************************************************/
   207 /*****************************************************************************/
   184 typedef struct {
   209 typedef struct {
   185     // input
   210     // input
   186     uint16_t position;
   211     uint16_t position;
   187 
   212 
   188     // outputs
   213     // outputs
       
   214     unsigned int device_index;
   189     uint32_t vendor_id;
   215     uint32_t vendor_id;
   190     uint32_t product_code;
   216     uint32_t product_code;
   191     uint32_t revision_number;
   217     uint32_t revision_number;
   192     uint32_t serial_number;
   218     uint32_t serial_number;
   193     uint16_t alias;
   219     uint16_t alias;
   278     // inputs
   304     // inputs
   279     uint32_t index;
   305     uint32_t index;
   280 
   306 
   281     // outputs
   307     // outputs
   282     uint32_t data_size;
   308     uint32_t data_size;
   283     uint32_t tx_size;
       
   284     uint32_t logical_base_address;
   309     uint32_t logical_base_address;
   285     uint16_t working_counter;
   310     uint16_t working_counter[EC_MAX_NUM_DEVICES];
   286     uint16_t expected_working_counter;
   311     uint16_t expected_working_counter;
   287     uint32_t fmmu_count;
   312     uint32_t fmmu_count;
   288 } ec_ioctl_domain_t;
   313 } ec_ioctl_domain_t;
   289 
   314 
   290 /*****************************************************************************/
   315 /*****************************************************************************/
   298     uint16_t slave_config_alias;
   323     uint16_t slave_config_alias;
   299     uint16_t slave_config_position;
   324     uint16_t slave_config_position;
   300     uint8_t sync_index;
   325     uint8_t sync_index;
   301     ec_direction_t dir;
   326     ec_direction_t dir;
   302     uint32_t logical_address;
   327     uint32_t logical_address;
   303     uint32_t domain_address;
       
   304     uint32_t data_size;
   328     uint32_t data_size;
   305 } ec_ioctl_domain_fmmu_t;
   329 } ec_ioctl_domain_fmmu_t;
   306 
   330 
   307 /*****************************************************************************/
   331 /*****************************************************************************/
   308 
   332 
   355 typedef struct {
   379 typedef struct {
   356     // inputs
   380     // inputs
   357     uint16_t slave_position;
   381     uint16_t slave_position;
   358     uint16_t sdo_index;
   382     uint16_t sdo_index;
   359     uint8_t sdo_entry_subindex;
   383     uint8_t sdo_entry_subindex;
   360     uint32_t target_size;
   384     size_t target_size;
   361     uint8_t *target;
   385     uint8_t *target;
   362 
   386 
   363     // outputs
   387     // outputs
   364     uint32_t data_size;
   388     size_t data_size;
   365     uint32_t abort_code;
   389     uint32_t abort_code;
   366 } ec_ioctl_slave_sdo_upload_t;
   390 } ec_ioctl_slave_sdo_upload_t;
   367 
   391 
   368 /*****************************************************************************/
   392 /*****************************************************************************/
   369 
   393 
   371     // inputs
   395     // inputs
   372     uint16_t slave_position;
   396     uint16_t slave_position;
   373     uint16_t sdo_index;
   397     uint16_t sdo_index;
   374     uint8_t sdo_entry_subindex;
   398     uint8_t sdo_entry_subindex;
   375     uint8_t complete_access;
   399     uint8_t complete_access;
   376     uint32_t data_size;
   400     size_t data_size;
   377     uint8_t *data;
   401     uint8_t *data;
   378 
   402 
   379     // outputs
   403     // outputs
   380     uint32_t abort_code;
   404     uint32_t abort_code;
   381 } ec_ioctl_slave_sdo_download_t;
   405 } ec_ioctl_slave_sdo_download_t;
   393 /*****************************************************************************/
   417 /*****************************************************************************/
   394 
   418 
   395 typedef struct {
   419 typedef struct {
   396     // inputs
   420     // inputs
   397     uint16_t slave_position;
   421     uint16_t slave_position;
   398     uint16_t offset;
   422     uint8_t emergency;
   399     uint16_t length;
   423     uint16_t address;
       
   424     size_t size;
   400     uint8_t *data;
   425     uint8_t *data;
   401 } ec_ioctl_slave_reg_t;
   426 } ec_ioctl_slave_reg_t;
   402 
   427 
   403 /*****************************************************************************/
   428 /*****************************************************************************/
   404 
   429 
   405 typedef struct {
   430 typedef struct {
   406     // inputs
   431     // inputs
   407     uint16_t slave_position;
   432     uint16_t slave_position;
   408     uint16_t offset;
   433     uint16_t offset;
   409     uint32_t buffer_size;
   434     size_t buffer_size;
   410     uint8_t *buffer;
   435     uint8_t *buffer;
   411 
   436 
   412     // outputs
   437     // outputs
   413     uint32_t data_size;
   438     size_t data_size;
   414     uint32_t result;
   439     uint32_t result;
   415     uint32_t error_code;
   440     uint32_t error_code;
   416     char file_name[32];
   441     char file_name[32];
   417 } ec_ioctl_slave_foe_t;
   442 } ec_ioctl_slave_foe_t;
   418 
   443 
   421 typedef struct {
   446 typedef struct {
   422     // inputs
   447     // inputs
   423     uint16_t slave_position;
   448     uint16_t slave_position;
   424     uint8_t drive_no;
   449     uint8_t drive_no;
   425     uint16_t idn;
   450     uint16_t idn;
   426     uint32_t mem_size;
   451     size_t mem_size;
   427     uint8_t *data;
   452     uint8_t *data;
   428 
   453 
   429     // outputs
   454     // outputs
   430     size_t data_size;
   455     size_t data_size;
   431     uint16_t error_code;
   456     uint16_t error_code;
   462         uint32_t pdo_count;
   487         uint32_t pdo_count;
   463         uint8_t config_this;
   488         uint8_t config_this;
   464     } syncs[EC_MAX_SYNC_MANAGERS];
   489     } syncs[EC_MAX_SYNC_MANAGERS];
   465     uint16_t watchdog_divider;
   490     uint16_t watchdog_divider;
   466     uint16_t watchdog_intervals;
   491     uint16_t watchdog_intervals;
   467     uint8_t allow_overlapping_pdos;
       
   468     uint32_t sdo_count;
   492     uint32_t sdo_count;
   469     uint32_t idn_count;
   493     uint32_t idn_count;
   470     int32_t slave_position;
   494     int32_t slave_position;
   471     uint16_t dc_assign_activate;
   495     uint16_t dc_assign_activate;
   472     ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT];
   496     ec_sync_signal_t dc_sync[EC_SYNC_SIGNAL_COUNT];
   515     uint32_t sdo_pos;
   539     uint32_t sdo_pos;
   516 
   540 
   517     // outputs
   541     // outputs
   518     uint16_t index;
   542     uint16_t index;
   519     uint8_t subindex;
   543     uint8_t subindex;
   520     uint32_t size;
   544     size_t size;
   521     uint8_t data[EC_MAX_SDO_DATA_SIZE];
   545     uint8_t data[EC_MAX_SDO_DATA_SIZE];
       
   546     uint8_t complete_access;
   522 } ec_ioctl_config_sdo_t;
   547 } ec_ioctl_config_sdo_t;
   523 
   548 
   524 /*****************************************************************************/
   549 /*****************************************************************************/
   525 
   550 
   526 /** Maximum size for displayed IDN data.
   551 /** Maximum size for displayed IDN data.
   564 #endif
   589 #endif
   565 
   590 
   566 /*****************************************************************************/
   591 /*****************************************************************************/
   567 
   592 
   568 typedef struct {
   593 typedef struct {
       
   594     // outputs
       
   595     void *process_data;
       
   596     size_t process_data_size;
       
   597 } ec_ioctl_master_activate_t;
       
   598 
       
   599 /*****************************************************************************/
       
   600 
       
   601 typedef struct {
   569     // inputs
   602     // inputs
   570     uint32_t config_index;
   603     uint32_t config_index;
   571     uint16_t pdo_index;
   604     uint16_t pdo_index;
   572     uint16_t entry_index;
   605     uint16_t entry_index;
   573     uint8_t entry_subindex;
   606     uint8_t entry_subindex;
   580     // inputs
   613     // inputs
   581     uint32_t config_index;
   614     uint32_t config_index;
   582     uint16_t entry_index;
   615     uint16_t entry_index;
   583     uint8_t entry_subindex;
   616     uint8_t entry_subindex;
   584     uint32_t domain_index;
   617     uint32_t domain_index;
   585     
   618 
   586     // outputs
   619     // outputs
   587     unsigned int bit_position;
   620     unsigned int bit_position;
   588 } ec_ioctl_reg_pdo_entry_t;
   621 } ec_ioctl_reg_pdo_entry_t;
       
   622 
       
   623 /*****************************************************************************/
       
   624 
       
   625 typedef struct {
       
   626     // inputs
       
   627     uint32_t config_index;
       
   628     uint32_t sync_index;
       
   629     uint32_t pdo_pos;
       
   630     uint32_t entry_pos;
       
   631     uint32_t domain_index;
       
   632 
       
   633     // outputs
       
   634     unsigned int bit_position;
       
   635 } ec_ioctl_reg_pdo_pos_t;
   589 
   636 
   590 /*****************************************************************************/
   637 /*****************************************************************************/
   591 
   638 
   592 typedef struct {
   639 typedef struct {
   593     // inputs
   640     // inputs
   596     uint8_t subindex;
   643     uint8_t subindex;
   597     const uint8_t *data;
   644     const uint8_t *data;
   598     size_t size;
   645     size_t size;
   599     uint8_t complete_access;
   646     uint8_t complete_access;
   600 } ec_ioctl_sc_sdo_t;
   647 } ec_ioctl_sc_sdo_t;
       
   648 
       
   649 /*****************************************************************************/
       
   650 
       
   651 typedef struct {
       
   652     // inputs
       
   653     uint32_t config_index;
       
   654     size_t size;
       
   655     uint8_t *target;
       
   656 
       
   657     // outputs
       
   658     int32_t overruns;
       
   659 } ec_ioctl_sc_emerg_t;
   601 
   660 
   602 /*****************************************************************************/
   661 /*****************************************************************************/
   603 
   662 
   604 typedef struct {
   663 typedef struct {
   605     // inputs
   664     // inputs
   650 /*****************************************************************************/
   709 /*****************************************************************************/
   651 
   710 
   652 typedef struct {
   711 typedef struct {
   653     // inputs
   712     // inputs
   654     uint32_t config_index;
   713     uint32_t config_index;
       
   714     size_t mem_size;
       
   715 
       
   716     // inputs/outputs
       
   717     uint32_t request_index;
       
   718     uint8_t *data;
       
   719     ec_request_state_t state;
       
   720     uint8_t new_data;
       
   721     uint16_t address;
       
   722     size_t transfer_size;
       
   723 } ec_ioctl_reg_request_t;
       
   724 
       
   725 /*****************************************************************************/
       
   726 
       
   727 typedef struct {
       
   728     // inputs
       
   729     uint32_t config_index;
   655 
   730 
   656     // inputs/outputs
   731     // inputs/outputs
   657     uint32_t voe_index;
   732     uint32_t voe_index;
   658     uint32_t *vendor_id;
   733     uint32_t *vendor_id;
   659     uint16_t *vendor_type;
   734     uint16_t *vendor_type;
   664 
   739 
   665 /*****************************************************************************/
   740 /*****************************************************************************/
   666 
   741 
   667 typedef struct {
   742 typedef struct {
   668     // inputs
   743     // inputs
       
   744     uint32_t dev_idx;
       
   745 
       
   746     // outputs
       
   747     ec_master_link_state_t *state;
       
   748 } ec_ioctl_link_state_t;
       
   749 
       
   750 /*****************************************************************************/
       
   751 
       
   752 typedef struct {
       
   753     // inputs
   669     uint64_t app_time;
   754     uint64_t app_time;
   670 } ec_ioctl_app_time_t;
   755 } ec_ioctl_app_time_t;
   671 
   756 
   672 /*****************************************************************************/
   757 /*****************************************************************************/
   673 
   758 
       
   759 #ifdef __KERNEL__
       
   760 
       
   761 /** Context data structure for file handles.
       
   762  */
       
   763 typedef struct {
       
   764     unsigned int writable; /**< Device was opened with write permission. */
       
   765     unsigned int requested; /**< Master was requested via this file handle. */
       
   766     uint8_t *process_data; /**< Total process data area. */
       
   767     size_t process_data_size; /**< Size of the \a process_data. */
       
   768 } ec_ioctl_context_t;
       
   769 
       
   770 long ec_ioctl(ec_master_t *, ec_ioctl_context_t *, unsigned int,
       
   771         void __user *);
       
   772 
       
   773 #ifdef EC_RTDM
       
   774 
       
   775 long ec_ioctl_rtdm(ec_master_t *, ec_ioctl_context_t *, unsigned int,
       
   776         void __user *);
       
   777 int ec_rtdm_mmap(ec_ioctl_context_t *, void **);
       
   778 
       
   779 #endif
       
   780 
       
   781 #endif
       
   782 
       
   783 /*****************************************************************************/
       
   784 
   674 /** \endcond */
   785 /** \endcond */
   675 
   786 
   676 #endif
   787 #endif