master/master.h
branchstable-1.1
changeset 1728 4cf9c3e9f0bd
parent 1719 42ed27ae6785
child 1731 60b2aad9d40b
equal deleted inserted replaced
1727:861f4715ed6f 1728:4cf9c3e9f0bd
    42 #define _EC_MASTER_H_
    42 #define _EC_MASTER_H_
    43 
    43 
    44 #include <linux/list.h>
    44 #include <linux/list.h>
    45 #include <linux/sysfs.h>
    45 #include <linux/sysfs.h>
    46 #include <linux/timer.h>
    46 #include <linux/timer.h>
       
    47 #include <asm/atomic.h>
    47 
    48 
    48 #include "device.h"
    49 #include "device.h"
    49 #include "domain.h"
    50 #include "domain.h"
    50 #include "fsm.h"
    51 #include "fsm.h"
    51 
    52 
    89 */
    90 */
    90 
    91 
    91 struct ec_master
    92 struct ec_master
    92 {
    93 {
    93     struct list_head list; /**< list item for module's master list */
    94     struct list_head list; /**< list item for module's master list */
    94     unsigned int reserved; /**< non-zero, if the master is reserved for RT */
    95     atomic_t available; /**< zero, if the master is reserved for RT */
    95     unsigned int index; /**< master index */
    96     unsigned int index; /**< master index */
    96 
    97 
    97     struct kobject kobj; /**< kobject */
    98     struct kobject kobj; /**< kobject */
    98 
    99 
    99     ec_device_t *device; /**< EtherCAT device */
   100     ec_device_t *device; /**< EtherCAT device */
   156 int ec_master_bus_scan(ec_master_t *);
   157 int ec_master_bus_scan(ec_master_t *);
   157 
   158 
   158 // misc.
   159 // misc.
   159 void ec_master_output_stats(ec_master_t *);
   160 void ec_master_output_stats(ec_master_t *);
   160 void ec_master_clear_slaves(ec_master_t *);
   161 void ec_master_clear_slaves(ec_master_t *);
   161 void ec_master_measure_bus_time(ec_master_t *);
   162 int ec_master_measure_bus_time(ec_master_t *);
   162 
   163 
   163 // other methods
   164 // other methods
   164 void ec_sync_config(const ec_sii_sync_t *, const ec_slave_t *, uint8_t *);
   165 void ec_sync_config(const ec_sii_sync_t *, const ec_slave_t *, uint8_t *);
   165 void ec_fmmu_config(const ec_fmmu_t *, const ec_slave_t *, uint8_t *);
   166 void ec_fmmu_config(const ec_fmmu_t *, const ec_slave_t *, uint8_t *);
   166 void ec_master_calc_addressing(ec_master_t *);
   167 void ec_master_calc_addressing(ec_master_t *);