devices/e1000/e1000-2.6.26-orig.h
author Florian Pose
Fri, 05 Oct 2018 10:24:11 +0200
branchstable-1.5
changeset 2724 b4a109b9e2a8
parent 1360 afcea72f0040
permissions -rw-r--r--
Set --enable-sii-assign by default.
1360
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/*******************************************************************************
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
  Intel PRO/1000 Linux driver
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
  Copyright(c) 1999 - 2006 Intel Corporation.
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     5
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
  This program is free software; you can redistribute it and/or modify it
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     7
  under the terms and conditions of the GNU General Public License,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     8
  version 2, as published by the Free Software Foundation.
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     9
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    10
  This program is distributed in the hope it will be useful, but WITHOUT
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    11
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
  more details.
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
  You should have received a copy of the GNU General Public License along with
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
  this program; if not, write to the Free Software Foundation, Inc.,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    17
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    19
  The full GNU General Public License is included in this distribution in
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    20
  the file called "COPYING".
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    21
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
  Contact Information:
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
  Linux NICS <linux.nics@intel.com>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    26
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
*******************************************************************************/
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    28
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    30
/* Linux PRO/1000 Ethernet Driver main header file */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
#ifndef _E1000_H_
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
#define _E1000_H_
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
#include <linux/stddef.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
#include <linux/module.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
#include <linux/types.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
#include <asm/byteorder.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
#include <linux/init.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
#include <linux/mm.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
#include <linux/errno.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    42
#include <linux/ioport.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    43
#include <linux/pci.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
#include <linux/kernel.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    45
#include <linux/netdevice.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    46
#include <linux/etherdevice.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    47
#include <linux/skbuff.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    48
#include <linux/delay.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    49
#include <linux/timer.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
#include <linux/slab.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
#include <linux/vmalloc.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    52
#include <linux/interrupt.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
#include <linux/string.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
#include <linux/pagemap.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    55
#include <linux/dma-mapping.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    56
#include <linux/bitops.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    57
#include <asm/io.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    58
#include <asm/irq.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    59
#include <linux/capability.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    60
#include <linux/in.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    61
#include <linux/ip.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    62
#include <linux/ipv6.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    63
#include <linux/tcp.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    64
#include <linux/udp.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    65
#include <net/pkt_sched.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    66
#include <linux/list.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    67
#include <linux/reboot.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    68
#include <net/checksum.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    69
#include <linux/mii.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
#include <linux/ethtool.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
#include <linux/if_vlan.h>
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    72
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    73
#define BAR_0		0
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    74
#define BAR_1		1
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    75
#define BAR_5		5
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    76
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    77
#define INTEL_E1000_ETHERNET_DEVICE(device_id) {\
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    78
	PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)}
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    79
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    80
struct e1000_adapter;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    81
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    82
#include "e1000_hw.h"
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    83
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    84
#ifdef DBG
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    85
#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    86
#else
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    87
#define E1000_DBG(args...)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    88
#endif
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    89
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    90
#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    91
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    92
#define PFX "e1000: "
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    93
#define DPRINTK(nlevel, klevel, fmt, args...) \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    94
	(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    95
	printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    96
		__FUNCTION__ , ## args))
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    97
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    98
#define E1000_MAX_INTR 10
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    99
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   100
/* TX/RX descriptor defines */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   101
#define E1000_DEFAULT_TXD                  256
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   102
#define E1000_MAX_TXD                      256
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   103
#define E1000_MIN_TXD                       80
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   104
#define E1000_MAX_82544_TXD               4096
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   105
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   106
#define E1000_DEFAULT_RXD                  256
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   107
#define E1000_MAX_RXD                      256
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   108
#define E1000_MIN_RXD                       80
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   109
#define E1000_MAX_82544_RXD               4096
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   110
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   111
/* this is the size past which hardware will drop packets when setting LPE=0 */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   112
#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   113
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   114
/* Supported Rx Buffer Sizes */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   115
#define E1000_RXBUFFER_128   128    /* Used for packet split */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   116
#define E1000_RXBUFFER_256   256    /* Used for packet split */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   117
#define E1000_RXBUFFER_512   512
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   118
#define E1000_RXBUFFER_1024  1024
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   119
#define E1000_RXBUFFER_2048  2048
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   120
#define E1000_RXBUFFER_4096  4096
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   121
#define E1000_RXBUFFER_8192  8192
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   122
#define E1000_RXBUFFER_16384 16384
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   123
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   124
/* SmartSpeed delimiters */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   125
#define E1000_SMARTSPEED_DOWNSHIFT 3
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   126
#define E1000_SMARTSPEED_MAX       15
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   127
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   128
/* Packet Buffer allocations */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   129
#define E1000_PBA_BYTES_SHIFT 0xA
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   130
#define E1000_TX_HEAD_ADDR_SHIFT 7
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   131
#define E1000_PBA_TX_MASK 0xFFFF0000
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   132
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   133
/* Flow Control Watermarks */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   134
#define E1000_FC_HIGH_DIFF 0x1638  /* High: 5688 bytes below Rx FIFO size */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   135
#define E1000_FC_LOW_DIFF 0x1640   /* Low:  5696 bytes below Rx FIFO size */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   136
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   137
#define E1000_FC_PAUSE_TIME 0x0680 /* 858 usec */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   138
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   139
/* How many Tx Descriptors do we need to call netif_wake_queue ? */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   140
#define E1000_TX_QUEUE_WAKE	16
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   141
/* How many Rx Buffers do we bundle into one write to the hardware ? */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   142
#define E1000_RX_BUFFER_WRITE	16	/* Must be power of 2 */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   143
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   144
#define AUTO_ALL_MODES            0
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   145
#define E1000_EEPROM_82544_APM    0x0004
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   146
#define E1000_EEPROM_ICH8_APME    0x0004
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   147
#define E1000_EEPROM_APME         0x0400
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   148
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   149
#ifndef E1000_MASTER_SLAVE
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   150
/* Switch to override PHY master/slave setting */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   151
#define E1000_MASTER_SLAVE	e1000_ms_hw_default
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   152
#endif
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   153
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   154
#define E1000_MNG_VLAN_NONE -1
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   155
/* Number of packet split data buffers (not including the header buffer) */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   156
#define PS_PAGE_BUFFERS MAX_PS_BUFFERS-1
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   157
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   158
/* wrapper around a pointer to a socket buffer,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   159
 * so a DMA handle can be stored along with the buffer */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   160
struct e1000_buffer {
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   161
	struct sk_buff *skb;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   162
	dma_addr_t dma;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   163
	unsigned long time_stamp;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   164
	u16 length;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   165
	u16 next_to_watch;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   166
};
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   167
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   168
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   169
struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; };
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   170
struct e1000_ps_page_dma { u64 ps_page_dma[PS_PAGE_BUFFERS]; };
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   171
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   172
struct e1000_tx_ring {
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   173
	/* pointer to the descriptor ring memory */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   174
	void *desc;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   175
	/* physical address of the descriptor ring */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   176
	dma_addr_t dma;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   177
	/* length of descriptor ring in bytes */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   178
	unsigned int size;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   179
	/* number of descriptors in the ring */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   180
	unsigned int count;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   181
	/* next descriptor to associate a buffer with */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   182
	unsigned int next_to_use;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   183
	/* next descriptor to check for DD status bit */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   184
	unsigned int next_to_clean;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   185
	/* array of buffer information structs */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   186
	struct e1000_buffer *buffer_info;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   187
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   188
	spinlock_t tx_lock;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   189
	u16 tdh;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   190
	u16 tdt;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   191
	bool last_tx_tso;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   192
};
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   193
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   194
struct e1000_rx_ring {
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   195
	/* pointer to the descriptor ring memory */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   196
	void *desc;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   197
	/* physical address of the descriptor ring */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   198
	dma_addr_t dma;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   199
	/* length of descriptor ring in bytes */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   200
	unsigned int size;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   201
	/* number of descriptors in the ring */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   202
	unsigned int count;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   203
	/* next descriptor to associate a buffer with */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   204
	unsigned int next_to_use;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   205
	/* next descriptor to check for DD status bit */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   206
	unsigned int next_to_clean;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   207
	/* array of buffer information structs */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   208
	struct e1000_buffer *buffer_info;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   209
	/* arrays of page information for packet split */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   210
	struct e1000_ps_page *ps_page;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   211
	struct e1000_ps_page_dma *ps_page_dma;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   212
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   213
	/* cpu for rx queue */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   214
	int cpu;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   215
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   216
	u16 rdh;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   217
	u16 rdt;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   218
};
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   219
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   220
#define E1000_DESC_UNUSED(R) \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   221
	((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   222
	(R)->next_to_clean - (R)->next_to_use - 1)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   223
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   224
#define E1000_RX_DESC_PS(R, i)	    \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   225
	(&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   226
#define E1000_RX_DESC_EXT(R, i)	    \
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   227
	(&(((union e1000_rx_desc_extended *)((R).desc))[i]))
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   228
#define E1000_GET_DESC(R, i, type)	(&(((struct type *)((R).desc))[i]))
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   229
#define E1000_RX_DESC(R, i)		E1000_GET_DESC(R, i, e1000_rx_desc)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   230
#define E1000_TX_DESC(R, i)		E1000_GET_DESC(R, i, e1000_tx_desc)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   231
#define E1000_CONTEXT_DESC(R, i)	E1000_GET_DESC(R, i, e1000_context_desc)
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   232
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   233
/* board specific private data structure */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   234
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   235
struct e1000_adapter {
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   236
	struct timer_list tx_fifo_stall_timer;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   237
	struct timer_list watchdog_timer;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   238
	struct timer_list phy_info_timer;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   239
	struct vlan_group *vlgrp;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   240
	u16 mng_vlan_id;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   241
	u32 bd_number;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   242
	u32 rx_buffer_len;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   243
	u32 wol;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   244
	u32 smartspeed;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   245
	u32 en_mng_pt;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   246
	u16 link_speed;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   247
	u16 link_duplex;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   248
	spinlock_t stats_lock;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   249
#ifdef CONFIG_E1000_NAPI
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   250
	spinlock_t tx_queue_lock;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   251
#endif
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   252
	unsigned int total_tx_bytes;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   253
	unsigned int total_tx_packets;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   254
	unsigned int total_rx_bytes;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   255
	unsigned int total_rx_packets;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   256
	/* Interrupt Throttle Rate */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   257
	u32 itr;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   258
	u32 itr_setting;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   259
	u16 tx_itr;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   260
	u16 rx_itr;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   261
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   262
	struct work_struct reset_task;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   263
	u8 fc_autoneg;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   264
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   265
	struct timer_list blink_timer;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   266
	unsigned long led_status;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   267
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   268
	/* TX */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   269
	struct e1000_tx_ring *tx_ring;      /* One per active queue */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   270
	unsigned int restart_queue;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   271
	unsigned long tx_queue_len;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   272
	u32 txd_cmd;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   273
	u32 tx_int_delay;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   274
	u32 tx_abs_int_delay;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   275
	u32 gotcl;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   276
	u64 gotcl_old;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   277
	u64 tpt_old;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   278
	u64 colc_old;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   279
	u32 tx_timeout_count;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   280
	u32 tx_fifo_head;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   281
	u32 tx_head_addr;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   282
	u32 tx_fifo_size;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   283
	u8  tx_timeout_factor;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   284
	atomic_t tx_fifo_stall;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   285
	bool pcix_82544;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   286
	bool detect_tx_hung;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   287
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   288
	/* RX */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   289
#ifdef CONFIG_E1000_NAPI
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   290
	bool (*clean_rx) (struct e1000_adapter *adapter,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   291
			  struct e1000_rx_ring *rx_ring,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   292
			  int *work_done, int work_to_do);
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   293
#else
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   294
	bool (*clean_rx) (struct e1000_adapter *adapter,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   295
			  struct e1000_rx_ring *rx_ring);
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   296
#endif
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   297
	void (*alloc_rx_buf) (struct e1000_adapter *adapter,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   298
			      struct e1000_rx_ring *rx_ring,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   299
				int cleaned_count);
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   300
	struct e1000_rx_ring *rx_ring;      /* One per active queue */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   301
#ifdef CONFIG_E1000_NAPI
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   302
	struct napi_struct napi;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   303
	struct net_device *polling_netdev;  /* One per active queue */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   304
#endif
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   305
	int num_tx_queues;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   306
	int num_rx_queues;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   307
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   308
	u64 hw_csum_err;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   309
	u64 hw_csum_good;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   310
	u64 rx_hdr_split;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   311
	u32 alloc_rx_buff_failed;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   312
	u32 rx_int_delay;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   313
	u32 rx_abs_int_delay;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   314
	bool rx_csum;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   315
	unsigned int rx_ps_pages;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   316
	u32 gorcl;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   317
	u64 gorcl_old;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   318
	u16 rx_ps_bsize0;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   319
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   320
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   321
	/* OS defined structs */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   322
	struct net_device *netdev;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   323
	struct pci_dev *pdev;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   324
	struct net_device_stats net_stats;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   325
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   326
	/* structs defined in e1000_hw.h */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   327
	struct e1000_hw hw;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   328
	struct e1000_hw_stats stats;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   329
	struct e1000_phy_info phy_info;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   330
	struct e1000_phy_stats phy_stats;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   331
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   332
	u32 test_icr;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   333
	struct e1000_tx_ring test_tx_ring;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   334
	struct e1000_rx_ring test_rx_ring;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   335
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   336
	int msg_enable;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   337
	bool have_msi;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   338
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   339
	/* to not mess up cache alignment, always add to the bottom */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   340
	bool tso_force;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   341
	bool smart_power_down;	/* phy smart power down */
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   342
	bool quad_port_a;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   343
	unsigned long flags;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   344
	u32 eeprom_wol;
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   345
};
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   346
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   347
enum e1000_state_t {
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   348
	__E1000_TESTING,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   349
	__E1000_RESETTING,
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   350
	__E1000_DOWN
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   351
};
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   352
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   353
extern char e1000_driver_name[];
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   354
extern const char e1000_driver_version[];
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   355
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   356
extern void e1000_power_up_phy(struct e1000_adapter *);
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   357
extern void e1000_set_ethtool_ops(struct net_device *netdev);
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   358
extern void e1000_check_options(struct e1000_adapter *adapter);
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   359
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   360
afcea72f0040 Added e1000 driver for 2.6.26, thanks to M. Luescher.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   361
#endif /* _E1000_H_ */