fp@39: /****************************************************************************** fp@0: * fp@39: * $Id$ fp@0: * 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@246: * as published by the Free Software Foundation; either version 2 of the fp@246: * License, or (at your option) any later version. 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@246: * The right to use EtherCAT Technology is granted and comes free of fp@246: * charge under condition of compatibility of product made by fp@246: * Licensee. People intending to distribute/sell products based on the fp@246: * code, have to sign an agreement to guarantee that products using fp@246: * software based on IgH EtherCAT master stay compatible with the actual fp@246: * EtherCAT specification (which are released themselves as an open fp@246: * standard) as the (only) precondition to have the right to use EtherCAT fp@246: * Technology, IP and trade marks. fp@246: * fp@39: *****************************************************************************/ fp@0: fp@199: /** fp@199: \file fp@199: EtherCAT device structure. fp@199: */ fp@199: fp@199: /*****************************************************************************/ fp@199: fp@0: #ifndef _EC_DEVICE_H_ fp@0: #define _EC_DEVICE_H_ fp@0: fp@25: #include fp@25: fp@104: #include "../include/ecrt.h" fp@104: #include "../devices/ecdev.h" fp@54: #include "globals.h" fp@1731: fp@1731: #ifdef EC_DBG_IF fp@231: #include "debug.h" fp@1731: #endif fp@0: fp@39: /*****************************************************************************/ fp@0: fp@0: /** fp@195: EtherCAT device. fp@195: An EtherCAT device is a network interface card, that is owned by an fp@195: EtherCAT master to send and receive EtherCAT frames with. fp@0: */ fp@0: fp@54: struct ec_device fp@0: { fp@195: ec_master_t *master; /**< EtherCAT master */ fp@195: struct net_device *dev; /**< pointer to the assigned net_device */ fp@195: uint8_t open; /**< true, if the net_device has been opened */ fp@195: struct sk_buff *tx_skb; /**< transmit socket buffer */ fp@195: ec_isr_t isr; /**< pointer to the device's interrupt service routine */ fp@1732: cycles_t cycles_isr; /**< cycles of last ISR call */ fp@1732: unsigned long jiffies_isr; /**< jiffies of last ISR call */ fp@195: struct module *module; /**< pointer to the device's owning module */ fp@195: uint8_t link_state; /**< device link state */ fp@1731: #ifdef EC_DBG_IF fp@231: ec_debug_t dbg; /**< debug device */ fp@1731: #endif fp@54: }; fp@0: fp@39: /*****************************************************************************/ fp@0: fp@98: int ec_device_init(ec_device_t *, ec_master_t *, struct net_device *, fp@98: ec_isr_t, struct module *); fp@54: void ec_device_clear(ec_device_t *); fp@78: fp@54: int ec_device_open(ec_device_t *); fp@54: int ec_device_close(ec_device_t *); fp@78: fp@54: void ec_device_call_isr(ec_device_t *); fp@98: uint8_t *ec_device_tx_data(ec_device_t *); fp@78: void ec_device_send(ec_device_t *, size_t); fp@78: fp@39: /*****************************************************************************/ fp@0: fp@0: #endif