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