fp@2597: /***************************************************************************** fp@2597: * fp@2597: * $Id$ fp@2597: * fp@2597: * Copyright (C) 2006-2014 Florian Pose, Ingenieurgemeinschaft IgH fp@2597: * fp@2597: * This file is part of the IgH EtherCAT Master. fp@2597: * fp@2597: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@2597: * modify it under the terms of the GNU General Public License version 2, as fp@2597: * published by the Free Software Foundation. fp@2597: * fp@2597: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@2597: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@2597: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@2597: * Public License for more details. fp@2597: * fp@2597: * You should have received a copy of the GNU General Public License along fp@2597: * with the IgH EtherCAT Master; if not, write to the Free Software fp@2597: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@2597: * fp@2597: * --- fp@2597: * fp@2597: * The license mentioned above concerns the source code only. Using the fp@2597: * EtherCAT technology and brand is only permitted in compliance with the fp@2597: * industrial property and similar rights of Beckhoff Automation GmbH. fp@2597: * fp@2597: ****************************************************************************/ fp@2597: fp@2597: /** fp@2597: \file fp@2597: EtherCAT EoE set IP parameter state machines. fp@2597: */ fp@2597: fp@2597: /****************************************************************************/ fp@2597: fp@2597: #ifndef __EC_FSM_EOE_H__ fp@2597: #define __EC_FSM_EOE_H__ fp@2597: fp@2597: #include "globals.h" fp@2597: #include "datagram.h" fp@2597: #include "slave.h" fp@2597: #include "eoe_request.h" fp@2597: fp@2597: /****************************************************************************/ fp@2597: fp@2597: typedef struct ec_fsm_eoe ec_fsm_eoe_t; /**< \see ec_fsm_eoe */ fp@2597: fp@2597: /** Finite state machines for the Ethernet over EtherCAT protocol. fp@2597: */ fp@2597: struct ec_fsm_eoe { fp@2597: ec_slave_t *slave; /**< slave the FSM runs on */ fp@2597: unsigned int retries; /**< retries upon datagram timeout */ fp@2597: fp@2597: void (*state)(ec_fsm_eoe_t *, ec_datagram_t *); /**< EoE state function */ fp@2597: ec_datagram_t *datagram; /**< Datagram used in the previous step. */ fp@2597: unsigned long jiffies_start; /**< Timestamp. */ fp@2597: ec_eoe_request_t *request; /**< EoE request */ fp@2597: }; fp@2597: fp@2597: /****************************************************************************/ fp@2597: fp@2597: void ec_fsm_eoe_init(ec_fsm_eoe_t *); fp@2597: void ec_fsm_eoe_clear(ec_fsm_eoe_t *); fp@2597: fp@2597: void ec_fsm_eoe_set_ip_param(ec_fsm_eoe_t *, ec_slave_t *, fp@2597: ec_eoe_request_t *); fp@2597: fp@2597: int ec_fsm_eoe_exec(ec_fsm_eoe_t *, ec_datagram_t *); fp@2597: int ec_fsm_eoe_success(const ec_fsm_eoe_t *); fp@2597: fp@2597: /****************************************************************************/ fp@2597: fp@2597: #endif