master/ioctl.h
changeset 1259 5f9d1abbee71
parent 1258 900f1124e8f8
child 1264 e7882f246d7a
equal deleted inserted replaced
1258:900f1124e8f8 1259:5f9d1abbee71
    54 #define EC_IO(nr)           _IO(EC_IOCTL_TYPE, nr)
    54 #define EC_IO(nr)           _IO(EC_IOCTL_TYPE, nr)
    55 #define EC_IOR(nr, type)   _IOR(EC_IOCTL_TYPE, nr, type)
    55 #define EC_IOR(nr, type)   _IOR(EC_IOCTL_TYPE, nr, type)
    56 #define EC_IOW(nr, type)   _IOW(EC_IOCTL_TYPE, nr, type)
    56 #define EC_IOW(nr, type)   _IOW(EC_IOCTL_TYPE, nr, type)
    57 #define EC_IOWR(nr, type) _IOWR(EC_IOCTL_TYPE, nr, type)
    57 #define EC_IOWR(nr, type) _IOWR(EC_IOCTL_TYPE, nr, type)
    58 
    58 
       
    59 // Command-line tool
    59 #define EC_IOCTL_MASTER                EC_IOR(0x00, ec_ioctl_master_t)
    60 #define EC_IOCTL_MASTER                EC_IOR(0x00, ec_ioctl_master_t)
    60 #define EC_IOCTL_SLAVE                EC_IOWR(0x01, ec_ioctl_slave_t)
    61 #define EC_IOCTL_SLAVE                EC_IOWR(0x01, ec_ioctl_slave_t)
    61 #define EC_IOCTL_SLAVE_SYNC           EC_IOWR(0x02, ec_ioctl_slave_sync_t)
    62 #define EC_IOCTL_SLAVE_SYNC           EC_IOWR(0x02, ec_ioctl_slave_sync_t)
    62 #define EC_IOCTL_SLAVE_SYNC_PDO       EC_IOWR(0x03, ec_ioctl_slave_sync_pdo_t)
    63 #define EC_IOCTL_SLAVE_SYNC_PDO       EC_IOWR(0x03, ec_ioctl_slave_sync_pdo_t)
    63 #define EC_IOCTL_SLAVE_SYNC_PDO_ENTRY EC_IOWR(0x04, ec_ioctl_slave_sync_pdo_entry_t)
    64 #define EC_IOCTL_SLAVE_SYNC_PDO_ENTRY EC_IOWR(0x04, ec_ioctl_slave_sync_pdo_entry_t)
    77 #define EC_IOCTL_CONFIG               EC_IOWR(0x12, ec_ioctl_config_t)
    78 #define EC_IOCTL_CONFIG               EC_IOWR(0x12, ec_ioctl_config_t)
    78 #define EC_IOCTL_CONFIG_PDO           EC_IOWR(0x13, ec_ioctl_config_pdo_t)
    79 #define EC_IOCTL_CONFIG_PDO           EC_IOWR(0x13, ec_ioctl_config_pdo_t)
    79 #define EC_IOCTL_CONFIG_PDO_ENTRY     EC_IOWR(0x14, ec_ioctl_config_pdo_entry_t)
    80 #define EC_IOCTL_CONFIG_PDO_ENTRY     EC_IOWR(0x14, ec_ioctl_config_pdo_entry_t)
    80 #define EC_IOCTL_CONFIG_SDO           EC_IOWR(0x15, ec_ioctl_config_sdo_t)
    81 #define EC_IOCTL_CONFIG_SDO           EC_IOWR(0x15, ec_ioctl_config_sdo_t)
    81 
    82 
       
    83 // Application interface
    82 #define EC_IOCTL_REQUEST                EC_IO(0x16)
    84 #define EC_IOCTL_REQUEST                EC_IO(0x16)
    83 #define EC_IOCTL_CREATE_DOMAIN          EC_IO(0x17)
    85 #define EC_IOCTL_CREATE_DOMAIN          EC_IO(0x17)
    84 #define EC_IOCTL_CREATE_SLAVE_CONFIG  EC_IOWR(0x18, ec_ioctl_config_t)
    86 #define EC_IOCTL_CREATE_SLAVE_CONFIG  EC_IOWR(0x18, ec_ioctl_config_t)
    85 #define EC_IOCTL_ACTIVATE              EC_IOR(0x19, size_t)
    87 #define EC_IOCTL_ACTIVATE              EC_IOR(0x19, size_t)
    86 #define EC_IOCTL_SEND                   EC_IO(0x1a)
    88 #define EC_IOCTL_SEND                   EC_IO(0x1a)
    87 #define EC_IOCTL_RECEIVE                EC_IO(0x1b)
    89 #define EC_IOCTL_RECEIVE                EC_IO(0x1b)
    88 #define EC_IOCTL_SC_SYNC               EC_IOW(0x1c, ec_ioctl_config_t)
    90 #define EC_IOCTL_MASTER_STATE          EC_IOR(0x1c, ec_master_state_t)
    89 #define EC_IOCTL_SC_ADD_PDO            EC_IOW(0x1c, ec_ioctl_config_pdo_t)
    91 #define EC_IOCTL_SC_SYNC               EC_IOW(0x1d, ec_ioctl_config_t)
    90 #define EC_IOCTL_SC_CLEAR_PDOS         EC_IOW(0x1d, ec_ioctl_config_pdo_t)
    92 #define EC_IOCTL_SC_ADD_PDO            EC_IOW(0x1e, ec_ioctl_config_pdo_t)
    91 #define EC_IOCTL_SC_ADD_ENTRY          EC_IOW(0x1e, ec_ioctl_add_pdo_entry_t)
    93 #define EC_IOCTL_SC_CLEAR_PDOS         EC_IOW(0x1f, ec_ioctl_config_pdo_t)
    92 #define EC_IOCTL_SC_CLEAR_ENTRIES      EC_IOW(0x1f, ec_ioctl_config_pdo_t)
    94 #define EC_IOCTL_SC_ADD_ENTRY          EC_IOW(0x20, ec_ioctl_add_pdo_entry_t)
    93 #define EC_IOCTL_SC_REG_PDO_ENTRY     EC_IOWR(0x20, ec_ioctl_reg_pdo_entry_t)
    95 #define EC_IOCTL_SC_CLEAR_ENTRIES      EC_IOW(0x21, ec_ioctl_config_pdo_t)
    94 #define EC_IOCTL_SC_SDO                EC_IOW(0x21, ec_ioctl_sc_sdo_t)
    96 #define EC_IOCTL_SC_REG_PDO_ENTRY     EC_IOWR(0x22, ec_ioctl_reg_pdo_entry_t)
    95 #define EC_IOCTL_DOMAIN_OFFSET          EC_IO(0x22)
    97 #define EC_IOCTL_SC_SDO                EC_IOW(0x23, ec_ioctl_sc_sdo_t)
    96 #define EC_IOCTL_DOMAIN_PROCESS         EC_IO(0x23)
    98 #define EC_IOCTL_SC_STATE             EC_IOWR(0x24, ec_ioctl_sc_state_t)
    97 #define EC_IOCTL_DOMAIN_QUEUE           EC_IO(0x24)
    99 #define EC_IOCTL_DOMAIN_OFFSET          EC_IO(0x25)
       
   100 #define EC_IOCTL_DOMAIN_PROCESS         EC_IO(0x26)
       
   101 #define EC_IOCTL_DOMAIN_QUEUE           EC_IO(0x27)
       
   102 #define EC_IOCTL_DOMAIN_STATE         EC_IOWR(0x28, ec_ioctl_domain_state_t)
       
   103 
       
   104 /*****************************************************************************/
    98 
   105 
    99 #define EC_IOCTL_STRING_SIZE 64
   106 #define EC_IOCTL_STRING_SIZE 64
   100 
   107 
   101 /*****************************************************************************/
   108 /*****************************************************************************/
   102 
   109 
   411     size_t size;
   418     size_t size;
   412 } ec_ioctl_sc_sdo_t;
   419 } ec_ioctl_sc_sdo_t;
   413 
   420 
   414 /*****************************************************************************/
   421 /*****************************************************************************/
   415 
   422 
       
   423 typedef struct {
       
   424     // inputs
       
   425     uint32_t config_index;
       
   426 
       
   427     // outputs
       
   428     ec_slave_config_state_t *state;
       
   429 } ec_ioctl_sc_state_t;
       
   430 
       
   431 /*****************************************************************************/
       
   432 
       
   433 typedef struct {
       
   434     // inputs
       
   435     uint32_t domain_index;
       
   436 
       
   437     // outputs
       
   438     ec_domain_state_t *state;
       
   439 } ec_ioctl_domain_state_t;
       
   440 
       
   441 /*****************************************************************************/
       
   442 
   416 /** \endcond */
   443 /** \endcond */
   417 
   444 
   418 #endif
   445 #endif