fp@1209: /****************************************************************************** fp@1209: * fp@1209: * $Id$ fp@1209: * fp@1209: * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH fp@1209: * fp@1209: * This file is part of the IgH EtherCAT Master. fp@1209: * fp@1209: * The IgH EtherCAT Master is free software; you can redistribute it fp@1209: * and/or modify it under the terms of the GNU General Public License fp@1209: * as published by the Free Software Foundation; either version 2 of the fp@1209: * License, or (at your option) any later version. fp@1209: * fp@1209: * The IgH EtherCAT Master is distributed in the hope that it will be fp@1209: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1209: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fp@1209: * GNU General Public License for more details. fp@1209: * fp@1209: * You should have received a copy of the GNU General Public License fp@1209: * along 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@1209: * The right to use EtherCAT Technology is granted and comes free of fp@1209: * charge under condition of compatibility of product made by fp@1209: * Licensee. People intending to distribute/sell products based on the fp@1209: * code, have to sign an agreement to guarantee that products using fp@1209: * software based on IgH EtherCAT master stay compatible with the actual fp@1209: * EtherCAT specification (which are released themselves as an open fp@1209: * standard) as the (only) precondition to have the right to use EtherCAT fp@1209: * Technology, IP and trade marks. fp@1209: * fp@1209: *****************************************************************************/ fp@1209: fp@1209: /** fp@1209: \file fp@1209: 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@1209: /** 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@1209: size_t data_size; /**< Size of Sdo 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@1209: fp@1209: /*****************************************************************************/ fp@1209: fp@1209: #endif