6 * |
6 * |
7 * This file is part of the IgH EtherCAT Master. |
7 * This file is part of the IgH EtherCAT Master. |
8 * |
8 * |
9 * The IgH EtherCAT Master is free software; you can redistribute it |
9 * The IgH EtherCAT Master is free software; you can redistribute it |
10 * and/or modify it under the terms of the GNU General Public License |
10 * and/or modify it under the terms of the GNU General Public License |
11 * as published by the Free Software Foundation; version 2 of the License. |
11 * as published by the Free Software Foundation; either version 2 of the |
|
12 * License, or (at your option) any later version. |
12 * |
13 * |
13 * The IgH EtherCAT Master is distributed in the hope that it will be |
14 * The IgH EtherCAT Master is distributed in the hope that it will be |
14 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 * GNU General Public License for more details. |
17 * GNU General Public License for more details. |
17 * |
18 * |
18 * You should have received a copy of the GNU General Public License |
19 * You should have received a copy of the GNU General Public License |
19 * along with the IgH EtherCAT Master; if not, write to the Free Software |
20 * along with the IgH EtherCAT Master; if not, write to the Free Software |
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
21 * |
22 * |
|
23 * The right to use EtherCAT Technology is granted and comes free of |
|
24 * charge under condition of compatibility of product made by |
|
25 * Licensee. People intending to distribute/sell products based on the |
|
26 * code, have to sign an agreement to guarantee that products using |
|
27 * software based on IgH EtherCAT master stay compatible with the actual |
|
28 * EtherCAT specification (which are released themselves as an open |
|
29 * standard) as the (only) precondition to have the right to use EtherCAT |
|
30 * Technology, IP and trade marks. |
|
31 * |
22 *****************************************************************************/ |
32 *****************************************************************************/ |
23 |
33 |
24 /** |
34 /** |
25 \file |
35 \file |
26 EtherCAT driver for RTL8139-compatible NICs. |
36 EtherCAT driver for RTL8139-compatible NICs. |
118 "rtl8139-diag -mmmaaavvveefN" output |
128 "rtl8139-diag -mmmaaavvveefN" output |
119 enable RTL8139_DEBUG below, and look at 'dmesg' or kernel log |
129 enable RTL8139_DEBUG below, and look at 'dmesg' or kernel log |
120 |
130 |
121 */ |
131 */ |
122 |
132 |
123 #define DRV_NAME "8139too_ec" |
133 #define DRV_NAME "ec_8139too" |
124 #define DRV_VERSION "0.9.27" |
134 #define DRV_VERSION "0.9.27" |
125 |
135 |
126 #include <linux/config.h> |
136 #include <linux/config.h> |
127 #include <linux/module.h> |
137 #include <linux/module.h> |
128 #include <linux/kernel.h> |
138 #include <linux/kernel.h> |
327 {PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, RTL8139 }, |
337 {PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, RTL8139 }, |
328 {PCI_ANY_ID, 0x8139, 0x13d1, 0xab06, 0, 0, RTL8139 }, |
338 {PCI_ANY_ID, 0x8139, 0x13d1, 0xab06, 0, 0, RTL8139 }, |
329 |
339 |
330 {0,} |
340 {0,} |
331 }; |
341 }; |
332 MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl); |
342 |
|
343 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ |
|
344 |
|
345 //MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl); |
|
346 |
|
347 /* EtherCAT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ |
333 |
348 |
334 static struct { |
349 static struct { |
335 const char str[ETH_GSTRING_LEN]; |
350 const char str[ETH_GSTRING_LEN]; |
336 } ethtool_stats_keys[] = { |
351 } ethtool_stats_keys[] = { |
337 { "early_rx" }, |
352 { "early_rx" }, |
2217 } |
2232 } |
2218 } |
2233 } |
2219 else |
2234 else |
2220 { |
2235 { |
2221 ecdev_receive(rtl_ec_dev, |
2236 ecdev_receive(rtl_ec_dev, |
2222 &rx_ring[ring_offset + 4] + ETH_HLEN, |
2237 &rx_ring[ring_offset + 4], pkt_size); |
2223 pkt_size - ETH_HLEN); |
|
2224 dev->last_rx = jiffies; |
2238 dev->last_rx = jiffies; |
2225 tp->stats.rx_bytes += pkt_size; |
2239 tp->stats.rx_bytes += pkt_size; |
2226 tp->stats.rx_packets++; |
2240 tp->stats.rx_packets++; |
2227 } |
2241 } |
2228 |
2242 |