fp@145: /****************************************************************************** fp@145: * fp@145: * $Id$ fp@145: * fp@197: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@197: * fp@197: * This file is part of the IgH EtherCAT Master. fp@197: * fp@197: * The IgH EtherCAT Master is free software; you can redistribute it fp@197: * and/or modify it under the terms of the GNU General Public License fp@197: * as published by the Free Software Foundation; version 2 of the License. fp@197: * fp@197: * The IgH EtherCAT Master is distributed in the hope that it will be fp@197: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@197: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@197: * GNU General Public License for more details. fp@197: * fp@197: * You should have received a copy of the GNU General Public License fp@197: * along with the IgH EtherCAT Master; if not, write to the Free Software fp@197: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@197: * fp@145: *****************************************************************************/ fp@145: fp@199: /** fp@199: \file fp@199: Ethernet-over-EtherCAT (EoE) fp@199: */ fp@199: fp@199: /*****************************************************************************/ fp@199: fp@145: #include fp@203: #include fp@145: fp@145: #include "../include/ecrt.h" fp@145: #include "globals.h" fp@145: #include "slave.h" fp@145: #include "command.h" fp@145: fp@145: /*****************************************************************************/ fp@145: fp@197: /** fp@197: State of an EoE object. fp@197: */ fp@197: fp@145: typedef enum fp@145: { fp@197: EC_EOE_IDLE, /**< Idle. The next step ist to check for data. */ fp@197: EC_EOE_CHECKING, /**< Checking frame was sent. */ fp@197: EC_EOE_FETCHING /**< There is new data. Fetching frame was sent. */ fp@145: } fp@145: ec_eoe_state_t; fp@145: fp@145: /*****************************************************************************/ fp@145: fp@197: /** fp@197: Ethernet-over-EtherCAT (EoE) Object. fp@197: The master creates one of these objects for each slave that supports the fp@197: EoE protocol. fp@197: */ fp@197: fp@145: typedef struct fp@145: { fp@197: struct list_head list; /**< list item */ fp@197: ec_slave_t *slave; /**< pointer to the corresponding slave */ fp@197: ec_eoe_state_t rx_state; /**< state of the state machine */ fp@203: struct net_device *dev; /**< net_device for virtual ethernet device */ fp@210: uint8_t opened; /**< net_device is opened */ fp@145: } fp@145: ec_eoe_t; fp@145: fp@145: /*****************************************************************************/ fp@145: fp@203: int ec_eoe_init(ec_eoe_t *, ec_slave_t *); fp@145: void ec_eoe_clear(ec_eoe_t *); fp@145: void ec_eoe_run(ec_eoe_t *); fp@145: void ec_eoe_print(const ec_eoe_t *); fp@145: fp@145: /*****************************************************************************/