83 /*****************************************************************************/ |
83 /*****************************************************************************/ |
84 |
84 |
85 /** EtherCAT datagram. |
85 /** EtherCAT datagram. |
86 */ |
86 */ |
87 typedef struct { |
87 typedef struct { |
88 struct list_head list; /**< Needed by domain datagram lists. */ |
88 struct list_head queue; /**< Master datagram queue item. */ |
89 struct list_head queue; /**< Master datagram send-receive queue item. */ |
|
90 struct list_head fsm_queue; /**< Master datagram fsm queue item. */ |
|
91 struct list_head sent; /**< Master list item for sent datagrams. */ |
89 struct list_head sent; /**< Master list item for sent datagrams. */ |
|
90 ec_device_index_t device_index; /**< Device via which the datagram shall |
|
91 be / was sent. */ |
92 ec_datagram_type_t type; /**< Datagram type (APRD, BWR, etc.). */ |
92 ec_datagram_type_t type; /**< Datagram type (APRD, BWR, etc.). */ |
93 uint8_t address[EC_ADDR_LEN]; /**< Recipient address. */ |
93 uint8_t address[EC_ADDR_LEN]; /**< Recipient address. */ |
94 uint8_t *data; /**< Datagram payload. */ |
94 uint8_t *data; /**< Datagram payload. */ |
95 ec_origin_t data_origin; /**< Origin of the \a data memory. */ |
95 ec_origin_t data_origin; /**< Origin of the \a data memory. */ |
96 size_t mem_size; /**< Datagram \a data memory size. */ |
96 size_t mem_size; /**< Datagram \a data memory size. */ |
97 size_t data_size; /**< Size of the data in \a data. */ |
97 size_t data_size; /**< Size of the data in \a data. */ |
98 ec_domain_t *domain; /**< Owning domain (may be null for non-domain |
|
99 datagrams) */ |
|
100 uint8_t index; /**< Index (set by master). */ |
98 uint8_t index; /**< Index (set by master). */ |
101 uint16_t working_counter; /**< Working counter. */ |
99 uint16_t working_counter; /**< Working counter. */ |
102 ec_datagram_state_t state; /**< State. */ |
100 ec_datagram_state_t state; /**< State. */ |
103 #ifdef EC_HAVE_CYCLES |
101 #ifdef EC_HAVE_CYCLES |
104 cycles_t cycles_sent; /**< Time, when the datagram was sent. */ |
102 cycles_t cycles_sent; /**< Time, when the datagram was sent. */ |
131 int ec_datagram_fprw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
129 int ec_datagram_fprw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
132 int ec_datagram_frmw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
130 int ec_datagram_frmw(ec_datagram_t *, uint16_t, uint16_t, size_t); |
133 int ec_datagram_brd(ec_datagram_t *, uint16_t, size_t); |
131 int ec_datagram_brd(ec_datagram_t *, uint16_t, size_t); |
134 int ec_datagram_bwr(ec_datagram_t *, uint16_t, size_t); |
132 int ec_datagram_bwr(ec_datagram_t *, uint16_t, size_t); |
135 int ec_datagram_brw(ec_datagram_t *, uint16_t, size_t); |
133 int ec_datagram_brw(ec_datagram_t *, uint16_t, size_t); |
136 int ec_datagram_lrd(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
134 int ec_datagram_lrd(ec_datagram_t *, uint32_t, size_t); |
137 int ec_datagram_lwr(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
135 int ec_datagram_lwr(ec_datagram_t *, uint32_t, size_t); |
138 int ec_datagram_lrw(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
136 int ec_datagram_lrw(ec_datagram_t *, uint32_t, size_t); |
|
137 int ec_datagram_lrd_ext(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
|
138 int ec_datagram_lwr_ext(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
|
139 int ec_datagram_lrw_ext(ec_datagram_t *, uint32_t, size_t, uint8_t *); |
139 |
140 |
140 void ec_datagram_print_state(const ec_datagram_t *); |
141 void ec_datagram_print_state(const ec_datagram_t *); |
141 void ec_datagram_print_wc_error(const ec_datagram_t *); |
142 void ec_datagram_print_wc_error(const ec_datagram_t *); |
142 void ec_datagram_output_stats(ec_datagram_t *); |
143 void ec_datagram_output_stats(ec_datagram_t *); |
143 const char *ec_datagram_type_string(const ec_datagram_t *); |
144 const char *ec_datagram_type_string(const ec_datagram_t *); |
144 void ec_datagram_output_info(const ec_datagram_t *); |
|
145 |
145 |
146 /*****************************************************************************/ |
146 /*****************************************************************************/ |
147 |
147 |
148 #endif |
148 #endif |