5 * Include file for Gigabit Ethernet device driver for Network
\r
6 * Interface Cards (NICs) utilizing the Tamarack Microelectronics
\r
7 * Inc. IPG Gigabit or Triple Speed Ethernet Media Access
\r
11 * Sundance Technology, Inc.
\r
12 * 1485 Saratoga Avenue
\r
14 * San Jose, CA 95129
\r
16 * www.sundanceti.com
\r
17 * craig_rich@sundanceti.com
\r
19 * Rev Date Description
\r
20 * --------------------------------------------------------------
\r
21 * 0.1 11/8/99 Initial revision work begins
\r
23 * 0.2 12/1/99 Minor update to modversions.h inclusion.
\r
25 * 0.3 12/30/99 Updates to fully comply with IPG spec.
\r
27 * 0.4 4/24/00 Updates to allow for removal of FCS generation
\r
29 * 0.5 8/15/00 Updates for MII PHY registers and fields.
\r
31 * 0.6 8/31/00 Updates to change to using 64 bit data types
\r
33 * 0.7 10/31/00 Added DDEBUG_MSG to allow for easy activation of
\r
34 * individual DEBUG_MSGs.
\r
36 * 0.8 11/06/00 Changed LastFreedRxBuff to LastRestoredRxBuff for
\r
39 * 0.9 11/10/00 Changed Sundance DeviceID to 0x9020
\r
41 * 0.10 2/14/01 Changed "DROP_ON_ERRORS", breaking out Ethernet from
\r
44 * 0.11 3/16/01 Changed "IPG_FRAMESBETWEENTXCOMPLETES" to
\r
45 * "IPG_FRAMESBETWEENTXDMACOMPLETES" since will
\r
46 * be using TxDMAIndicate instead of TxIndicate to
\r
47 * improve performance. Added TFDunavailCount and
\r
48 * RFDlistendCount to aid in performance improvement.
\r
50 * 0.12 3/22/01 Removed IPG_DROP_ON_RX_TCPIP_ERRORS.
\r
52 * 0.13 3/23/01 Removed IPG_TXQUEUE_MARGIN.
\r
54 * 0.14 3/30/01 Broke out sections into multiple files and added
\r
55 * OS version specific detection and settings.
\r
60 * Linux header utilization:
\r
62 * config.h For PCI support, namely CONFIG_PCI macro.
\r
64 * version.h For Linux kernel version detection.
\r
66 * module.h For modularized driver support.
\r
68 * kernel.h For 'printk'.
\r
70 * pci.h PCI support, including ID, VENDOR, and CLASS
\r
71 * standard definitions; PCI specific structures,
\r
72 * including pci_dev struct.
\r
74 * ioport.h I/O ports, check_region, request_region,
\r
77 * errno.h Standard error numbers, e.g. ENODEV.
\r
79 * asm/io.h For reading/writing I/O ports, and for virt_to_bus
\r
82 * delay.h For milisecond delays.
\r
84 * types.h For specific typedefs (i.e. u32, u16, u8).
\r
86 * netdevice.h For device structure needed for network support.
\r
88 * etherdevice.h For ethernet device support.
\r
90 * init.h For __initfunc.
\r
92 * skbuff.h Socket buffer (skbuff) definition.
\r
94 * asm/bitops.h For test_and_set_bit, clear_bit functions.
\r
96 * asm/spinlock.h For spin_lock_irqsave, spin_lock_irqrestore functions.
\r
101 #include <linux/config.h>
\r
102 #include <linux/version.h>
\r
103 #include <linux/module.h>
\r
105 #if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)) && defined(MODVERSIONS))
\r
106 #include <linux/modversions.h>
\r
109 #include <linux/kernel.h>
\r
110 #include <linux/pci.h>
\r
111 #include <linux/ioport.h>
\r
112 #include <linux/errno.h>
\r
113 #include <asm/io.h>
\r
114 #include <linux/delay.h>
\r
115 #include <linux/types.h>
\r
116 #include <linux/netdevice.h>
\r
117 #include <linux/etherdevice.h>
\r
118 #include <linux/init.h>
\r
119 #include <linux/skbuff.h>
\r
120 #include <linux/version.h>
\r
121 #include <asm/bitops.h>
\r
122 /*#include <asm/spinlock.h>*/
\r
124 #define DrvVer "2.09d"
\r
126 const char *version =
\r
127 "ipg : "DrvVer" Written by Craig Rich, www.sundanceti.com\n";
\r
129 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0))
\r
130 char kernel_version[] = UTS_RELEASE;
\r
133 #if (defined(MODULE) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,1,15)))
\r
134 MODULE_AUTHOR("IC Plus Corp. 2003 ");
\r
135 MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver "DrvVer);
\r
138 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
\r
139 #define IPG_LINUX2_2
\r
140 #undef IPG_LINUX2_4
\r
142 #define IPG_DEV_KFREE_SKB(skb) dev_kfree_skb(skb)
\r
144 #define IPG_HOST2BUS_MAP(addr) virt_to_bus(addr)
\r
146 #define IPG_PCI_RESOURCE_START(dev, bar) dev->base_address[bar]
\r
148 #define IPG_TX_NOTBUSY(dev) clear_bit(0,(void*)&dev->tbusy)
\r
149 #define IPG_IS_TX_BUSY(dev) test_and_set_bit(0, (void*)&dev->tbusy)
\r
151 #define IPG_DEVICE_TYPE struct device
\r
152 #define IPG_STATS_TYPE struct enet_statistics
\r
154 #undef IPG_LINUX2_2
\r
155 #define IPG_LINUX2_4
\r
157 #define IPG_DEV_KFREE_SKB(skb) dev_kfree_skb_irq(skb)
\r
159 #define IPG_HOST2BUS_MAP(addr) addr
\r
161 #define IPG_PCI_RESOURCE_START(dev, bar) dev->resource[bar].start
\r
163 #define IPG_TX_NOTBUSY(dev) netif_wake_queue(dev)
\r
164 #define IPG_IS_TX_BUSY(dev) netif_queue_stopped(dev)
\r
166 #define IPG_DEVICE_TYPE struct net_device
\r
167 #define IPG_STATS_TYPE struct net_device_stats
\r
170 /* Order of the following includes is important, the following must
\r
175 #include "ipg_constants.h"
\r
176 #include "ipg_tune.h"
\r
177 #include "ipg_macros.h"
\r
178 #include "ipg_structs.h"
\r
179 #include "PhyParam.h"
\r