diff -r 505cf41488a4 -r 9cdd7669dc0b master/fsm_foe.h --- a/master/fsm_foe.h Thu Jan 10 12:34:58 2013 +0100 +++ b/master/fsm_foe.h Thu Jan 10 17:36:41 2013 +0100 @@ -2,7 +2,8 @@ * * $Id$ * - * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH + * Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH + * 2009-2012 Florian Pose * * This file is part of the IgH EtherCAT Master. * @@ -50,15 +51,15 @@ /** Finite state machines for the CANopen-over-EtherCAT protocol. */ struct ec_fsm_foe { - ec_slave_t *slave; /**< slave the FSM runs on */ - ec_datagram_t *datagram; /**< datagram used in the state machine */ - unsigned int retries; /**< retries upon datagram timeout */ + ec_slave_t *slave; /**< Slave the FSM runs on. */ + unsigned int retries; /**< Retries upon datagram timeout */ - void (*state)(ec_fsm_foe_t *); /**< FoE state function */ + void (*state)(ec_fsm_foe_t *, ec_datagram_t *); /**< FoE state function. */ + ec_datagram_t *datagram; /**< Datagram used in previous step. */ unsigned long jiffies_start; /**< FoE timestamp. */ - uint8_t subindex; /**< current subindex */ - ec_foe_request_t *request; /**< FoE request */ - uint8_t toggle; /**< toggle bit for segment commands */ + uint8_t subindex; /**< Current subindex. */ + ec_foe_request_t *request; /**< FoE request. */ + uint8_t toggle; /**< Toggle bit for segment commands. */ uint8_t *tx_buffer; /**< Buffer with data to transmit. */ uint32_t tx_buffer_size; /**< Size of data to transmit. */ @@ -80,11 +81,11 @@ /*****************************************************************************/ -void ec_fsm_foe_init(ec_fsm_foe_t *, ec_datagram_t *); +void ec_fsm_foe_init(ec_fsm_foe_t *); void ec_fsm_foe_clear(ec_fsm_foe_t *); -int ec_fsm_foe_exec(ec_fsm_foe_t *); -int ec_fsm_foe_success(ec_fsm_foe_t *); +int ec_fsm_foe_exec(ec_fsm_foe_t *, ec_datagram_t *); +int ec_fsm_foe_success(const ec_fsm_foe_t *); void ec_fsm_foe_transfer(ec_fsm_foe_t *, ec_slave_t *, ec_foe_request_t *);