fp@1209: /****************************************************************************** fp@1209: * fp@1209: * $Id$ fp@1209: * fp@1326: * Copyright (C) 2006-2008 Florian Pose, Ingenieurgemeinschaft IgH fp@1209: * fp@1209: * This file is part of the IgH EtherCAT Master. fp@1209: * fp@1326: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1326: * modify it under the terms of the GNU General Public License version 2, as fp@1326: * published by the Free Software Foundation. fp@1209: * fp@1326: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1326: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1326: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1326: * Public License for more details. fp@1209: * fp@1326: * You should have received a copy of the GNU General Public License along fp@1326: * with the IgH EtherCAT Master; if not, write to the Free Software fp@1209: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1209: * fp@1363: * --- fp@1363: * fp@1363: * The license mentioned above concerns the source code only. Using the fp@1363: * EtherCAT technology and brand is only permitted in compliance with the fp@1363: * industrial property and similar rights of Beckhoff Automation GmbH. fp@1209: * fp@1209: *****************************************************************************/ fp@1209: fp@1209: /** fp@1209: \file fp@1327: Vendor specific over EtherCAT protocol handler. fp@1209: */ fp@1209: fp@1209: /*****************************************************************************/ fp@1209: fp@1209: #ifndef __EC_VOE_HANDLER_H__ fp@1209: #define __EC_VOE_HANDLER_H__ fp@1209: fp@1209: #include fp@1209: fp@1209: #include "globals.h" fp@1209: #include "datagram.h" fp@1209: fp@1209: /*****************************************************************************/ fp@1209: fp@1327: /** Vendor specific over EtherCAT handler. fp@1209: */ fp@1209: struct ec_voe_handler { fp@1209: struct list_head list; /**< List item. */ fp@1209: ec_slave_config_t *config; /**< Parent slave configuration. */ fp@1209: ec_datagram_t datagram; /**< State machine datagram. */ fp@1218: uint32_t vendor_id; /**< Vendor ID for the header. */ fp@1218: uint16_t vendor_type; /**< Vendor type for the header. */ fp@1327: size_t data_size; /**< Size of VoE data. */ fp@1209: ec_direction_t dir; /**< Direction. EC_DIR_OUTPUT means writing to fp@1209: the slave, EC_DIR_INPUT means reading from the fp@1209: slave. */ fp@1209: void (*state)(ec_voe_handler_t *); /**< State function */ fp@1209: ec_internal_request_state_t request_state; /**< Handler state. */ fp@1209: unsigned int retries; /**< retries upon datagram timeout */ fp@1209: unsigned long jiffies_start; /**< Timestamp for timeout calculation. */ fp@1209: }; fp@1209: fp@1209: /*****************************************************************************/ fp@1209: fp@1209: int ec_voe_handler_init(ec_voe_handler_t *, ec_slave_config_t *, size_t); fp@1209: void ec_voe_handler_clear(ec_voe_handler_t *); fp@1264: size_t ec_voe_handler_mem_size(const ec_voe_handler_t *); fp@1209: fp@1209: /*****************************************************************************/ fp@1209: fp@1209: #endif