00001 /****************************************************************************** 00002 * 00003 * $Id: ethernet.h 533 2006-09-01 12:35:41Z fp $ 00004 * 00005 * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH 00006 * 00007 * This file is part of the IgH EtherCAT Master. 00008 * 00009 * The IgH EtherCAT Master is free software; you can redistribute it 00010 * and/or modify it under the terms of the GNU General Public License 00011 * as published by the Free Software Foundation; either version 2 of the 00012 * License, or (at your option) any later version. 00013 * 00014 * The IgH EtherCAT Master is distributed in the hope that it will be 00015 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with the IgH EtherCAT Master; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 * The right to use EtherCAT Technology is granted and comes free of 00024 * charge under condition of compatibility of product made by 00025 * Licensee. People intending to distribute/sell products based on the 00026 * code, have to sign an agreement to guarantee that products using 00027 * software based on IgH EtherCAT master stay compatible with the actual 00028 * EtherCAT specification (which are released themselves as an open 00029 * standard) as the (only) precondition to have the right to use EtherCAT 00030 * Technology, IP and trade marks. 00031 * 00032 *****************************************************************************/ 00033 00039 /*****************************************************************************/ 00040 00041 #include <linux/list.h> 00042 #include <linux/netdevice.h> 00043 00044 #include "../include/ecrt.h" 00045 #include "globals.h" 00046 #include "slave.h" 00047 #include "datagram.h" 00048 00049 /*****************************************************************************/ 00050 00055 typedef struct 00056 { 00057 struct list_head queue; 00058 struct sk_buff *skb; 00059 } 00060 ec_eoe_frame_t; 00061 00062 /*****************************************************************************/ 00063 00064 typedef struct ec_eoe ec_eoe_t; 00072 struct ec_eoe 00073 { 00074 struct list_head list; 00075 ec_slave_t *slave; 00076 ec_datagram_t datagram; 00077 void (*state)(ec_eoe_t *); 00078 struct net_device *dev; 00079 struct net_device_stats stats; 00080 unsigned int opened; 00081 unsigned long rate_jiffies; 00082 struct sk_buff *rx_skb; 00083 off_t rx_skb_offset; 00084 size_t rx_skb_size; 00085 uint8_t rx_expected_fragment; 00086 uint32_t rx_counter; 00087 uint32_t rx_rate; 00088 struct list_head tx_queue; 00089 unsigned int tx_queue_active; 00090 unsigned int tx_queued_frames; 00091 spinlock_t tx_queue_lock; 00092 ec_eoe_frame_t *tx_frame; 00093 uint8_t tx_frame_number; 00094 uint8_t tx_fragment_number; 00095 size_t tx_offset; 00096 uint32_t tx_counter; 00097 uint32_t tx_rate; 00098 }; 00099 00100 /*****************************************************************************/ 00101 00102 int ec_eoe_init(ec_eoe_t *); 00103 void ec_eoe_clear(ec_eoe_t *); 00104 void ec_eoe_run(ec_eoe_t *); 00105 int ec_eoe_active(const ec_eoe_t *); 00106 00107 /*****************************************************************************/
1.4.6