devices/igb/igb-3.18-ethercat.h
author Florian Pose
Fri, 05 Oct 2018 10:24:11 +0200
branchstable-1.5
changeset 2724 b4a109b9e2a8
parent 2686 91cb9cf20f6c
permissions -rw-r--r--
Set --enable-sii-assign by default.
2685
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     1
/* Intel(R) Gigabit Ethernet Linux driver
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     2
 * Copyright(c) 2007-2014 Intel Corporation.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     3
 *
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     4
 * This program is free software; you can redistribute it and/or modify it
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     5
 * under the terms and conditions of the GNU General Public License,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     6
 * version 2, as published by the Free Software Foundation.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     7
 *
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     8
 * This program is distributed in the hope it will be useful, but WITHOUT
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
     9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    10
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    11
 * more details.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    12
 *
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    13
 * You should have received a copy of the GNU General Public License along with
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    14
 * this program; if not, see <http://www.gnu.org/licenses/>.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    15
 *
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    16
 * The full GNU General Public License is included in this distribution in
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    17
 * the file called "COPYING".
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    18
 *
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    19
 * Contact Information:
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    20
 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    21
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
2686
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
    22
 *
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
    23
 * vim: noexpandtab
2685
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    24
 */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    25
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    26
/* Linux PRO/1000 Ethernet Driver main header file */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    27
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    28
#ifndef _IGB_H_
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    29
#define _IGB_H_
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    30
2686
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
    31
/* EtherCAT header file */
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
    32
#include "../ecdev.h"
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
    33
2685
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    34
#include "e1000_mac-3.18-ethercat.h"
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    35
#include "e1000_82575-3.18-ethercat.h"
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    36
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    37
#include <linux/clocksource.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    38
#include <linux/net_tstamp.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    39
#include <linux/ptp_clock_kernel.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    40
#include <linux/bitops.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    41
#include <linux/if_vlan.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    42
#include <linux/i2c.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    43
#include <linux/i2c-algo-bit.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    44
#include <linux/pci.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    45
#include <linux/mdio.h>
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    46
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    47
struct igb_adapter;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    48
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    49
#define E1000_PCS_CFG_IGN_SD	1
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    50
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    51
/* Interrupt defines */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    52
#define IGB_START_ITR		648 /* ~6000 ints/sec */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    53
#define IGB_4K_ITR		980
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    54
#define IGB_20K_ITR		196
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    55
#define IGB_70K_ITR		56
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    56
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    57
/* TX/RX descriptor defines */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    58
#define IGB_DEFAULT_TXD		256
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    59
#define IGB_DEFAULT_TX_WORK	128
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    60
#define IGB_MIN_TXD		80
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    61
#define IGB_MAX_TXD		4096
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    62
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    63
#define IGB_DEFAULT_RXD		256
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    64
#define IGB_MIN_RXD		80
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    65
#define IGB_MAX_RXD		4096
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    66
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    67
#define IGB_DEFAULT_ITR		3 /* dynamic */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    68
#define IGB_MAX_ITR_USECS	10000
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    69
#define IGB_MIN_ITR_USECS	10
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    70
#define NON_Q_VECTORS		1
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    71
#define MAX_Q_VECTORS		8
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    72
#define MAX_MSIX_ENTRIES	10
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    73
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    74
/* Transmit and receive queues */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    75
#define IGB_MAX_RX_QUEUES	8
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    76
#define IGB_MAX_RX_QUEUES_82575	4
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    77
#define IGB_MAX_RX_QUEUES_I211	2
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    78
#define IGB_MAX_TX_QUEUES	8
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    79
#define IGB_MAX_VF_MC_ENTRIES	30
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    80
#define IGB_MAX_VF_FUNCTIONS	8
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    81
#define IGB_MAX_VFTA_ENTRIES	128
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    82
#define IGB_82576_VF_DEV_ID	0x10CA
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    83
#define IGB_I350_VF_DEV_ID	0x1520
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    84
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    85
/* NVM version defines */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    86
#define IGB_MAJOR_MASK		0xF000
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    87
#define IGB_MINOR_MASK		0x0FF0
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    88
#define IGB_BUILD_MASK		0x000F
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    89
#define IGB_COMB_VER_MASK	0x00FF
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    90
#define IGB_MAJOR_SHIFT		12
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    91
#define IGB_MINOR_SHIFT		4
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    92
#define IGB_COMB_VER_SHFT	8
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    93
#define IGB_NVM_VER_INVALID	0xFFFF
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    94
#define IGB_ETRACK_SHIFT	16
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    95
#define NVM_ETRACK_WORD		0x0042
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    96
#define NVM_COMB_VER_OFF	0x0083
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    97
#define NVM_COMB_VER_PTR	0x003d
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    98
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
    99
struct vf_data_storage {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   100
	unsigned char vf_mac_addresses[ETH_ALEN];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   101
	u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   102
	u16 num_vf_mc_hashes;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   103
	u16 vlans_enabled;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   104
	u32 flags;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   105
	unsigned long last_nack;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   106
	u16 pf_vlan; /* When set, guest VLAN config not allowed. */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   107
	u16 pf_qos;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   108
	u16 tx_rate;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   109
	bool spoofchk_enabled;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   110
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   111
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   112
#define IGB_VF_FLAG_CTS            0x00000001 /* VF is clear to send data */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   113
#define IGB_VF_FLAG_UNI_PROMISC    0x00000002 /* VF has unicast promisc */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   114
#define IGB_VF_FLAG_MULTI_PROMISC  0x00000004 /* VF has multicast promisc */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   115
#define IGB_VF_FLAG_PF_SET_MAC     0x00000008 /* PF has set MAC address */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   116
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   117
/* RX descriptor control thresholds.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   118
 * PTHRESH - MAC will consider prefetch if it has fewer than this number of
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   119
 *           descriptors available in its onboard memory.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   120
 *           Setting this to 0 disables RX descriptor prefetch.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   121
 * HTHRESH - MAC will only prefetch if there are at least this many descriptors
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   122
 *           available in host memory.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   123
 *           If PTHRESH is 0, this should also be 0.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   124
 * WTHRESH - RX descriptor writeback threshold - MAC will delay writing back
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   125
 *           descriptors until either it has this many to write back, or the
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   126
 *           ITR timer expires.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   127
 */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   128
#define IGB_RX_PTHRESH	((hw->mac.type == e1000_i354) ? 12 : 8)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   129
#define IGB_RX_HTHRESH	8
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   130
#define IGB_TX_PTHRESH	((hw->mac.type == e1000_i354) ? 20 : 8)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   131
#define IGB_TX_HTHRESH	1
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   132
#define IGB_RX_WTHRESH	((hw->mac.type == e1000_82576 && \
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   133
			  (adapter->flags & IGB_FLAG_HAS_MSIX)) ? 1 : 4)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   134
#define IGB_TX_WTHRESH	((hw->mac.type == e1000_82576 && \
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   135
			  (adapter->flags & IGB_FLAG_HAS_MSIX)) ? 1 : 16)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   136
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   137
/* this is the size past which hardware will drop packets when setting LPE=0 */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   138
#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   139
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   140
/* Supported Rx Buffer Sizes */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   141
#define IGB_RXBUFFER_256	256
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   142
#define IGB_RXBUFFER_2048	2048
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   143
#define IGB_RX_HDR_LEN		IGB_RXBUFFER_256
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   144
#define IGB_RX_BUFSZ		IGB_RXBUFFER_2048
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   145
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   146
/* How many Rx Buffers do we bundle into one write to the hardware ? */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   147
#define IGB_RX_BUFFER_WRITE	16 /* Must be power of 2 */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   148
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   149
#define AUTO_ALL_MODES		0
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   150
#define IGB_EEPROM_APME		0x0400
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   151
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   152
#ifndef IGB_MASTER_SLAVE
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   153
/* Switch to override PHY master/slave setting */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   154
#define IGB_MASTER_SLAVE	e1000_ms_hw_default
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   155
#endif
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   156
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   157
#define IGB_MNG_VLAN_NONE	-1
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   158
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   159
enum igb_tx_flags {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   160
	/* cmd_type flags */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   161
	IGB_TX_FLAGS_VLAN	= 0x01,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   162
	IGB_TX_FLAGS_TSO	= 0x02,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   163
	IGB_TX_FLAGS_TSTAMP	= 0x04,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   164
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   165
	/* olinfo flags */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   166
	IGB_TX_FLAGS_IPV4	= 0x10,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   167
	IGB_TX_FLAGS_CSUM	= 0x20,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   168
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   169
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   170
/* VLAN info */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   171
#define IGB_TX_FLAGS_VLAN_MASK	0xffff0000
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   172
#define IGB_TX_FLAGS_VLAN_SHIFT	16
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   173
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   174
/* The largest size we can write to the descriptor is 65535.  In order to
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   175
 * maintain a power of two alignment we have to limit ourselves to 32K.
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   176
 */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   177
#define IGB_MAX_TXD_PWR	15
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   178
#define IGB_MAX_DATA_PER_TXD	(1 << IGB_MAX_TXD_PWR)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   179
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   180
/* Tx Descriptors needed, worst case */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   181
#define TXD_USE_COUNT(S) DIV_ROUND_UP((S), IGB_MAX_DATA_PER_TXD)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   182
#define DESC_NEEDED (MAX_SKB_FRAGS + 4)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   183
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   184
/* EEPROM byte offsets */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   185
#define IGB_SFF_8472_SWAP		0x5C
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   186
#define IGB_SFF_8472_COMP		0x5E
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   187
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   188
/* Bitmasks */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   189
#define IGB_SFF_ADDRESSING_MODE		0x4
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   190
#define IGB_SFF_8472_UNSUP		0x00
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   191
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   192
/* wrapper around a pointer to a socket buffer,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   193
 * so a DMA handle can be stored along with the buffer
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   194
 */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   195
struct igb_tx_buffer {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   196
	union e1000_adv_tx_desc *next_to_watch;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   197
	unsigned long time_stamp;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   198
	struct sk_buff *skb;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   199
	unsigned int bytecount;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   200
	u16 gso_segs;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   201
	__be16 protocol;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   202
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   203
	DEFINE_DMA_UNMAP_ADDR(dma);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   204
	DEFINE_DMA_UNMAP_LEN(len);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   205
	u32 tx_flags;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   206
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   207
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   208
struct igb_rx_buffer {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   209
	dma_addr_t dma;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   210
	struct page *page;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   211
	unsigned int page_offset;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   212
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   213
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   214
struct igb_tx_queue_stats {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   215
	u64 packets;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   216
	u64 bytes;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   217
	u64 restart_queue;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   218
	u64 restart_queue2;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   219
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   220
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   221
struct igb_rx_queue_stats {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   222
	u64 packets;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   223
	u64 bytes;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   224
	u64 drops;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   225
	u64 csum_err;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   226
	u64 alloc_failed;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   227
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   228
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   229
struct igb_ring_container {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   230
	struct igb_ring *ring;		/* pointer to linked list of rings */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   231
	unsigned int total_bytes;	/* total bytes processed this int */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   232
	unsigned int total_packets;	/* total packets processed this int */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   233
	u16 work_limit;			/* total work allowed per interrupt */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   234
	u8 count;			/* total number of rings in vector */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   235
	u8 itr;				/* current ITR setting for ring */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   236
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   237
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   238
struct igb_ring {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   239
	struct igb_q_vector *q_vector;	/* backlink to q_vector */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   240
	struct net_device *netdev;	/* back pointer to net_device */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   241
	struct device *dev;		/* device pointer for dma mapping */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   242
	union {				/* array of buffer info structs */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   243
		struct igb_tx_buffer *tx_buffer_info;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   244
		struct igb_rx_buffer *rx_buffer_info;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   245
	};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   246
	void *desc;			/* descriptor ring memory */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   247
	unsigned long flags;		/* ring specific flags */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   248
	void __iomem *tail;		/* pointer to ring tail register */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   249
	dma_addr_t dma;			/* phys address of the ring */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   250
	unsigned int  size;		/* length of desc. ring in bytes */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   251
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   252
	u16 count;			/* number of desc. in the ring */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   253
	u8 queue_index;			/* logical index of the ring*/
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   254
	u8 reg_idx;			/* physical index of the ring */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   255
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   256
	/* everything past this point are written often */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   257
	u16 next_to_clean;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   258
	u16 next_to_use;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   259
	u16 next_to_alloc;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   260
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   261
	union {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   262
		/* TX */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   263
		struct {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   264
			struct igb_tx_queue_stats tx_stats;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   265
			struct u64_stats_sync tx_syncp;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   266
			struct u64_stats_sync tx_syncp2;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   267
		};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   268
		/* RX */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   269
		struct {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   270
			struct sk_buff *skb;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   271
			struct igb_rx_queue_stats rx_stats;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   272
			struct u64_stats_sync rx_syncp;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   273
		};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   274
	};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   275
} ____cacheline_internodealigned_in_smp;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   276
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   277
struct igb_q_vector {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   278
	struct igb_adapter *adapter;	/* backlink */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   279
	int cpu;			/* CPU for DCA */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   280
	u32 eims_value;			/* EIMS mask value */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   281
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   282
	u16 itr_val;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   283
	u8 set_itr;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   284
	void __iomem *itr_register;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   285
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   286
	struct igb_ring_container rx, tx;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   287
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   288
	struct napi_struct napi;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   289
	struct rcu_head rcu;	/* to avoid race with update stats on free */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   290
	char name[IFNAMSIZ + 9];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   291
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   292
	/* for dynamic allocation of rings associated with this q_vector */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   293
	struct igb_ring ring[0] ____cacheline_internodealigned_in_smp;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   294
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   295
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   296
enum e1000_ring_flags_t {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   297
	IGB_RING_FLAG_RX_SCTP_CSUM,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   298
	IGB_RING_FLAG_RX_LB_VLAN_BSWAP,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   299
	IGB_RING_FLAG_TX_CTX_IDX,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   300
	IGB_RING_FLAG_TX_DETECT_HANG
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   301
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   302
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   303
#define IGB_TXD_DCMD (E1000_ADVTXD_DCMD_EOP | E1000_ADVTXD_DCMD_RS)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   304
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   305
#define IGB_RX_DESC(R, i)	\
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   306
	(&(((union e1000_adv_rx_desc *)((R)->desc))[i]))
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   307
#define IGB_TX_DESC(R, i)	\
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   308
	(&(((union e1000_adv_tx_desc *)((R)->desc))[i]))
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   309
#define IGB_TX_CTXTDESC(R, i)	\
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   310
	(&(((struct e1000_adv_tx_context_desc *)((R)->desc))[i]))
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   311
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   312
/* igb_test_staterr - tests bits within Rx descriptor status and error fields */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   313
static inline __le32 igb_test_staterr(union e1000_adv_rx_desc *rx_desc,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   314
				      const u32 stat_err_bits)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   315
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   316
	return rx_desc->wb.upper.status_error & cpu_to_le32(stat_err_bits);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   317
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   318
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   319
/* igb_desc_unused - calculate if we have unused descriptors */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   320
static inline int igb_desc_unused(struct igb_ring *ring)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   321
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   322
	if (ring->next_to_clean > ring->next_to_use)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   323
		return ring->next_to_clean - ring->next_to_use - 1;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   324
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   325
	return ring->count + ring->next_to_clean - ring->next_to_use - 1;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   326
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   327
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   328
#ifdef CONFIG_IGB_HWMON
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   329
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   330
#define IGB_HWMON_TYPE_LOC	0
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   331
#define IGB_HWMON_TYPE_TEMP	1
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   332
#define IGB_HWMON_TYPE_CAUTION	2
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   333
#define IGB_HWMON_TYPE_MAX	3
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   334
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   335
struct hwmon_attr {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   336
	struct device_attribute dev_attr;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   337
	struct e1000_hw *hw;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   338
	struct e1000_thermal_diode_data *sensor;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   339
	char name[12];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   340
	};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   341
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   342
struct hwmon_buff {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   343
	struct attribute_group group;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   344
	const struct attribute_group *groups[2];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   345
	struct attribute *attrs[E1000_MAX_SENSORS * 4 + 1];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   346
	struct hwmon_attr hwmon_list[E1000_MAX_SENSORS * 4];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   347
	unsigned int n_hwmon;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   348
	};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   349
#endif
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   350
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   351
#define IGB_RETA_SIZE	128
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   352
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   353
/* board specific private data structure */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   354
struct igb_adapter {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   355
	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   356
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   357
	struct net_device *netdev;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   358
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   359
	unsigned long state;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   360
	unsigned int flags;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   361
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   362
	unsigned int num_q_vectors;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   363
	struct msix_entry msix_entries[MAX_MSIX_ENTRIES];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   364
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   365
	/* Interrupt Throttle Rate */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   366
	u32 rx_itr_setting;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   367
	u32 tx_itr_setting;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   368
	u16 tx_itr;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   369
	u16 rx_itr;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   370
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   371
	/* TX */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   372
	u16 tx_work_limit;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   373
	u32 tx_timeout_count;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   374
	int num_tx_queues;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   375
	struct igb_ring *tx_ring[16];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   376
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   377
	/* RX */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   378
	int num_rx_queues;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   379
	struct igb_ring *rx_ring[16];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   380
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   381
	u32 max_frame_size;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   382
	u32 min_frame_size;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   383
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   384
	struct timer_list watchdog_timer;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   385
	struct timer_list phy_info_timer;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   386
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   387
	u16 mng_vlan_id;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   388
	u32 bd_number;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   389
	u32 wol;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   390
	u32 en_mng_pt;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   391
	u16 link_speed;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   392
	u16 link_duplex;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   393
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   394
	struct work_struct reset_task;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   395
	struct work_struct watchdog_task;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   396
	bool fc_autoneg;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   397
	u8  tx_timeout_factor;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   398
	struct timer_list blink_timer;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   399
	unsigned long led_status;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   400
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   401
	/* OS defined structs */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   402
	struct pci_dev *pdev;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   403
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   404
	spinlock_t stats64_lock;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   405
	struct rtnl_link_stats64 stats64;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   406
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   407
	/* structs defined in e1000_hw.h */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   408
	struct e1000_hw hw;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   409
	struct e1000_hw_stats stats;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   410
	struct e1000_phy_info phy_info;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   411
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   412
	u32 test_icr;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   413
	struct igb_ring test_tx_ring;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   414
	struct igb_ring test_rx_ring;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   415
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   416
	int msg_enable;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   417
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   418
	struct igb_q_vector *q_vector[MAX_Q_VECTORS];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   419
	u32 eims_enable_mask;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   420
	u32 eims_other;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   421
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   422
	/* to not mess up cache alignment, always add to the bottom */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   423
	u16 tx_ring_count;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   424
	u16 rx_ring_count;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   425
	unsigned int vfs_allocated_count;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   426
	struct vf_data_storage *vf_data;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   427
	int vf_rate_link_speed;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   428
	u32 rss_queues;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   429
	u32 wvbr;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   430
	u32 *shadow_vfta;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   431
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   432
	struct ptp_clock *ptp_clock;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   433
	struct ptp_clock_info ptp_caps;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   434
	struct delayed_work ptp_overflow_work;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   435
	struct work_struct ptp_tx_work;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   436
	struct sk_buff *ptp_tx_skb;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   437
	struct hwtstamp_config tstamp_config;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   438
	unsigned long ptp_tx_start;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   439
	unsigned long last_rx_ptp_check;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   440
	unsigned long last_rx_timestamp;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   441
	spinlock_t tmreg_lock;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   442
	struct cyclecounter cc;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   443
	struct timecounter tc;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   444
	u32 tx_hwtstamp_timeouts;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   445
	u32 rx_hwtstamp_cleared;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   446
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   447
	char fw_version[32];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   448
#ifdef CONFIG_IGB_HWMON
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   449
	struct hwmon_buff *igb_hwmon_buff;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   450
	bool ets;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   451
#endif
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   452
	struct i2c_algo_bit_data i2c_algo;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   453
	struct i2c_adapter i2c_adap;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   454
	struct i2c_client *i2c_client;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   455
	u32 rss_indir_tbl_init;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   456
	u8 rss_indir_tbl[IGB_RETA_SIZE];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   457
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   458
	unsigned long link_check_timeout;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   459
	int copper_tries;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   460
	struct e1000_info ei;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   461
	u16 eee_advert;
2686
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
   462
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
   463
	/* EtherCAT device variables */
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
   464
	ec_device_t *ecdev;
91cb9cf20f6c EtherCAT functionality of igb driver.
Florian Pose <fp@igh.de>
parents: 2685
diff changeset
   465
	unsigned long ec_watchdog_jiffies;
2685
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   466
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   467
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   468
#define IGB_FLAG_HAS_MSI		(1 << 0)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   469
#define IGB_FLAG_DCA_ENABLED		(1 << 1)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   470
#define IGB_FLAG_QUAD_PORT_A		(1 << 2)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   471
#define IGB_FLAG_QUEUE_PAIRS		(1 << 3)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   472
#define IGB_FLAG_DMAC			(1 << 4)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   473
#define IGB_FLAG_PTP			(1 << 5)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   474
#define IGB_FLAG_RSS_FIELD_IPV4_UDP	(1 << 6)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   475
#define IGB_FLAG_RSS_FIELD_IPV6_UDP	(1 << 7)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   476
#define IGB_FLAG_WOL_SUPPORTED		(1 << 8)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   477
#define IGB_FLAG_NEED_LINK_UPDATE	(1 << 9)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   478
#define IGB_FLAG_MEDIA_RESET		(1 << 10)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   479
#define IGB_FLAG_MAS_CAPABLE		(1 << 11)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   480
#define IGB_FLAG_MAS_ENABLE		(1 << 12)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   481
#define IGB_FLAG_HAS_MSIX		(1 << 13)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   482
#define IGB_FLAG_EEE			(1 << 14)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   483
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   484
/* Media Auto Sense */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   485
#define IGB_MAS_ENABLE_0		0X0001
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   486
#define IGB_MAS_ENABLE_1		0X0002
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   487
#define IGB_MAS_ENABLE_2		0X0004
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   488
#define IGB_MAS_ENABLE_3		0X0008
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   489
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   490
/* DMA Coalescing defines */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   491
#define IGB_MIN_TXPBSIZE	20408
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   492
#define IGB_TX_BUF_4096		4096
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   493
#define IGB_DMCTLX_DCFLUSH_DIS	0x80000000  /* Disable DMA Coal Flush */
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   494
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   495
#define IGB_82576_TSYNC_SHIFT	19
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   496
#define IGB_TS_HDR_LEN		16
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   497
enum e1000_state_t {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   498
	__IGB_TESTING,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   499
	__IGB_RESETTING,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   500
	__IGB_DOWN,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   501
	__IGB_PTP_TX_IN_PROGRESS,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   502
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   503
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   504
enum igb_boards {
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   505
	board_82575,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   506
};
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   507
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   508
extern char igb_driver_name[];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   509
extern char igb_driver_version[];
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   510
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   511
int igb_up(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   512
void igb_down(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   513
void igb_reinit_locked(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   514
void igb_reset(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   515
int igb_reinit_queues(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   516
void igb_write_rss_indir_tbl(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   517
int igb_set_spd_dplx(struct igb_adapter *, u32, u8);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   518
int igb_setup_tx_resources(struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   519
int igb_setup_rx_resources(struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   520
void igb_free_tx_resources(struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   521
void igb_free_rx_resources(struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   522
void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   523
void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   524
void igb_setup_tctl(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   525
void igb_setup_rctl(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   526
netdev_tx_t igb_xmit_frame_ring(struct sk_buff *, struct igb_ring *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   527
void igb_unmap_and_free_tx_resource(struct igb_ring *, struct igb_tx_buffer *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   528
void igb_alloc_rx_buffers(struct igb_ring *, u16);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   529
void igb_update_stats(struct igb_adapter *, struct rtnl_link_stats64 *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   530
bool igb_has_link(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   531
void igb_set_ethtool_ops(struct net_device *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   532
void igb_power_up_link(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   533
void igb_set_fw_version(struct igb_adapter *);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   534
void igb_ptp_init(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   535
void igb_ptp_stop(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   536
void igb_ptp_reset(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   537
void igb_ptp_rx_hang(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   538
void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   539
void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   540
			 struct sk_buff *skb);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   541
int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   542
int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   543
#ifdef CONFIG_IGB_HWMON
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   544
void igb_sysfs_exit(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   545
int igb_sysfs_init(struct igb_adapter *adapter);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   546
#endif
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   547
static inline s32 igb_reset_phy(struct e1000_hw *hw)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   548
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   549
	if (hw->phy.ops.reset)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   550
		return hw->phy.ops.reset(hw);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   551
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   552
	return 0;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   553
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   554
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   555
static inline s32 igb_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   556
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   557
	if (hw->phy.ops.read_reg)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   558
		return hw->phy.ops.read_reg(hw, offset, data);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   559
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   560
	return 0;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   561
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   562
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   563
static inline s32 igb_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   564
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   565
	if (hw->phy.ops.write_reg)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   566
		return hw->phy.ops.write_reg(hw, offset, data);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   567
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   568
	return 0;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   569
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   570
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   571
static inline s32 igb_get_phy_info(struct e1000_hw *hw)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   572
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   573
	if (hw->phy.ops.get_phy_info)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   574
		return hw->phy.ops.get_phy_info(hw);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   575
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   576
	return 0;
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   577
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   578
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   579
static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring)
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   580
{
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   581
	return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index);
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   582
}
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   583
740291442c05 Added clean igb driver from kernel 3.18 (no EtherCAT yet).
Florian Pose <fp@igh.de>
parents:
diff changeset
   584
#endif /* _IGB_H_ */