Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
netdev.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
#include <linux/tcp.h>
#include <linux/ipv6.h>
#include <linux/slab.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/pm_qos.h>
#include <linux/pm_runtime.h>
#include <linux/aer.h>
#include <linux/prefetch.h>
#include "e1000.h"

Go to the source code of this file.

Data Structures

struct  e1000_reg_info
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_EXTRAVERSION   "-k"
 
#define DRV_VERSION   "2.1.4" DRV_EXTRAVERSION
 
#define DEFAULT_MSG_ENABLE   (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)
 
#define E1000_RDFH   0x02410 /* Rx Data FIFO Head - RW */
 
#define E1000_RDFT   0x02418 /* Rx Data FIFO Tail - RW */
 
#define E1000_RDFHS   0x02420 /* Rx Data FIFO Head Saved - RW */
 
#define E1000_RDFTS   0x02428 /* Rx Data FIFO Tail Saved - RW */
 
#define E1000_RDFPC   0x02430 /* Rx Data FIFO Packet Count - RW */
 
#define E1000_TDFH   0x03410 /* Tx Data FIFO Head - RW */
 
#define E1000_TDFT   0x03418 /* Tx Data FIFO Tail - RW */
 
#define E1000_TDFHS   0x03420 /* Tx Data FIFO Head Saved - RW */
 
#define E1000_TDFTS   0x03428 /* Tx Data FIFO Tail Saved - RW */
 
#define E1000_TDFPC   0x03430 /* Tx Data FIFO Packet Count - RW */
 
#define TX_WAKE_THRESHOLD   32
 
#define rxtop   (rx_ring->rx_skb_top)
 
#define E1000_IVAR_INT_ALLOC_VALID   0x8
 
#define E1000_EIAC_MASK_82574   0x01F00000
 
#define SPEED_MODE_BIT   (1 << 21)
 
#define PAGE_USE_COUNT(S)
 
#define E1000_TX_FLAGS_CSUM   0x00000001
 
#define E1000_TX_FLAGS_VLAN   0x00000002
 
#define E1000_TX_FLAGS_TSO   0x00000004
 
#define E1000_TX_FLAGS_IPV4   0x00000008
 
#define E1000_TX_FLAGS_NO_FCS   0x00000010
 
#define E1000_TX_FLAGS_VLAN_MASK   0xffff0000
 
#define E1000_TX_FLAGS_VLAN_SHIFT   16
 
#define MINIMUM_DHCP_PACKET_SIZE   282
 
#define E1000_CTRL_ADVD3WUC   0x00100000
 
#define E1000_CTRL_EN_PHY_PWR_MGMT   0x00200000
 

Functions

 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)")
 
void e1000e_reset_interrupt_capability (struct e1000_adapter *adapter)
 
void e1000e_set_interrupt_capability (struct e1000_adapter *adapter)
 
void e1000e_get_hw_control (struct e1000_adapter *adapter)
 
void e1000e_release_hw_control (struct e1000_adapter *adapter)
 
int e1000e_setup_tx_resources (struct e1000_ring *tx_ring)
 
int e1000e_setup_rx_resources (struct e1000_ring *rx_ring)
 
void e1000e_free_tx_resources (struct e1000_ring *tx_ring)
 
void e1000e_free_rx_resources (struct e1000_ring *rx_ring)
 
void e1000e_write_itr (struct e1000_adapter *adapter, u32 itr)
 
void e1000e_power_up_phy (struct e1000_adapter *adapter)
 
void e1000e_reset (struct e1000_adapter *adapter)
 
int e1000e_up (struct e1000_adapter *adapter)
 
void e1000e_down (struct e1000_adapter *adapter)
 
void e1000e_reinit_locked (struct e1000_adapter *adapter)
 
struct rtnl_link_stats64e1000e_get_stats64 (struct net_device *netdev, struct rtnl_link_stats64 *stats)
 
 MODULE_DEVICE_TABLE (pci, e1000_pci_tbl)
 
 module_init (e1000_init_module)
 
 module_exit (e1000_exit_module)
 
 MODULE_AUTHOR ("Intel Corporation, <[email protected]>")
 
 MODULE_DESCRIPTION ("Intel(R) PRO/1000 Network Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_VERSION)
 

Variables

char e1000e_driver_name [] = "e1000e"
 
const char e1000e_driver_version [] = DRV_VERSION
 

Macro Definition Documentation

#define DEFAULT_MSG_ENABLE   (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK)

Definition at line 63 of file netdev.c.

#define DRV_EXTRAVERSION   "-k"

Definition at line 57 of file netdev.c.

#define DRV_VERSION   "2.1.4" DRV_EXTRAVERSION

Definition at line 59 of file netdev.c.

#define E1000_CTRL_ADVD3WUC   0x00100000
#define E1000_CTRL_EN_PHY_PWR_MGMT   0x00200000
#define E1000_EIAC_MASK_82574   0x01F00000
#define E1000_IVAR_INT_ALLOC_VALID   0x8
#define E1000_RDFH   0x02410 /* Rx Data FIFO Head - RW */

Definition at line 90 of file netdev.c.

#define E1000_RDFHS   0x02420 /* Rx Data FIFO Head Saved - RW */

Definition at line 92 of file netdev.c.

#define E1000_RDFPC   0x02430 /* Rx Data FIFO Packet Count - RW */

Definition at line 94 of file netdev.c.

#define E1000_RDFT   0x02418 /* Rx Data FIFO Tail - RW */

Definition at line 91 of file netdev.c.

#define E1000_RDFTS   0x02428 /* Rx Data FIFO Tail Saved - RW */

Definition at line 93 of file netdev.c.

#define E1000_TDFH   0x03410 /* Tx Data FIFO Head - RW */

Definition at line 96 of file netdev.c.

#define E1000_TDFHS   0x03420 /* Tx Data FIFO Head Saved - RW */

Definition at line 98 of file netdev.c.

#define E1000_TDFPC   0x03430 /* Tx Data FIFO Packet Count - RW */

Definition at line 100 of file netdev.c.

#define E1000_TDFT   0x03418 /* Tx Data FIFO Tail - RW */

Definition at line 97 of file netdev.c.

#define E1000_TDFTS   0x03428 /* Tx Data FIFO Tail Saved - RW */

Definition at line 99 of file netdev.c.

#define E1000_TX_FLAGS_CSUM   0x00000001

Definition at line 4667 of file netdev.c.

#define E1000_TX_FLAGS_IPV4   0x00000008

Definition at line 4670 of file netdev.c.

#define E1000_TX_FLAGS_NO_FCS   0x00000010

Definition at line 4671 of file netdev.c.

#define E1000_TX_FLAGS_TSO   0x00000004

Definition at line 4669 of file netdev.c.

#define E1000_TX_FLAGS_VLAN   0x00000002

Definition at line 4668 of file netdev.c.

#define E1000_TX_FLAGS_VLAN_MASK   0xffff0000

Definition at line 4672 of file netdev.c.

#define E1000_TX_FLAGS_VLAN_SHIFT   16

Definition at line 4673 of file netdev.c.

#define MINIMUM_DHCP_PACKET_SIZE   282

Definition at line 4973 of file netdev.c.

#define PAGE_USE_COUNT (   S)
Value:
(((S) >> PAGE_SHIFT) + \
(((S) & (PAGE_SIZE - 1)) ? 1 : 0))

e1000_setup_rctl - configure the receive control registers : Board private structure

Definition at line 2884 of file netdev.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 29 of file netdev.c.

#define rxtop   (rx_ring->rx_skb_top)
#define SPEED_MODE_BIT   (1 << 21)
#define TX_WAKE_THRESHOLD   32

Function Documentation

void e1000e_down ( struct e1000_adapter adapter)

Definition at line 3644 of file netdev.c.

void e1000e_free_rx_resources ( struct e1000_ring rx_ring)

e1000e_free_rx_resources - Free Rx Resources : Rx descriptor ring

Free all receive software resources

Definition at line 2339 of file netdev.c.

void e1000e_free_tx_resources ( struct e1000_ring tx_ring)

e1000e_free_tx_resources - Free Tx Resources per Queue : Tx descriptor ring

Free all transmit software resources

Definition at line 2318 of file netdev.c.

void e1000e_get_hw_control ( struct e1000_adapter adapter)

e1000e_get_hw_control - get control of the h/w from f/w : address of board private structure

e1000e_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit. For ASF and Pass Through versions of f/w this means that the driver is loaded. For AMT version (only with 82573) of the f/w this means that the network i/f is open.

Definition at line 2135 of file netdev.c.

struct rtnl_link_stats64* e1000e_get_stats64 ( struct net_device netdev,
struct rtnl_link_stats64 stats 
)
read

e1000_get_stats64 - Get System Network Statistics : network interface device structure : rtnl_link_stats64 pointer

Returns the address of the device statistics structure.

Definition at line 5207 of file netdev.c.

void e1000e_power_up_phy ( struct e1000_adapter adapter)

e1000e_power_up_phy - restore link in case the phy was powered down : address of board private structure

The phy may be powered down to save power and turn off link when the driver is unloaded and wake on lan is not enabled (among others) *** this routine MUST be followed by a call to e1000e_reset ***

Definition at line 3366 of file netdev.c.

void e1000e_reinit_locked ( struct e1000_adapter adapter)

Definition at line 3700 of file netdev.c.

void e1000e_release_hw_control ( struct e1000_adapter adapter)

e1000e_release_hw_control - release control of the h/w to f/w : address of board private structure

e1000e_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit. For ASF and Pass Through versions of f/w this means that the driver is no longer loaded. For AMT version (only with 82573) i of the f/w this means that the network i/f is closed.

Definition at line 2161 of file netdev.c.

void e1000e_reset ( struct e1000_adapter adapter)

e1000e_reset - bring the hardware into a known good state

This function boots the hardware and enables some settings that require a configuration cycle of the hardware - those cannot be set/changed during runtime. After reset the device needs to be properly configured for Rx, Tx etc.

Definition at line 3398 of file netdev.c.

void e1000e_reset_interrupt_capability ( struct e1000_adapter adapter)

Definition at line 1913 of file netdev.c.

void e1000e_set_interrupt_capability ( struct e1000_adapter adapter)

e1000e_set_interrupt_capability - set MSI or MSI-X if supported

Attempt to configure interrupts using the best available capabilities of the hardware and kernel.

Definition at line 1931 of file netdev.c.

int e1000e_setup_rx_resources ( struct e1000_ring rx_ring)

e1000e_setup_rx_resources - allocate Rx resources (Descriptors) : Rx descriptor ring

Returns 0 on success, negative on failure

Definition at line 2233 of file netdev.c.

int e1000e_setup_tx_resources ( struct e1000_ring tx_ring)

e1000e_setup_tx_resources - allocate Tx resources (Descriptors) : Tx descriptor ring

Return 0 on success, negative on failure

Definition at line 2199 of file netdev.c.

int e1000e_up ( struct e1000_adapter adapter)

Definition at line 3593 of file netdev.c.

void e1000e_write_itr ( struct e1000_adapter adapter,
u32  itr 
)

e1000e_write_itr - write the ITR value to the appropriate registers : address of board private structure : new ITR value to program

e1000e_write_itr determines if the adapter is in MSI-X mode and, if so, writes the EITR registers with the ITR value. Otherwise, it writes the ITR value into the ITR register.

Definition at line 2501 of file netdev.c.

MODULE_AUTHOR ( "Intel  Corporation,
< linux.nics @intel.com >"   
)
MODULE_DESCRIPTION ( "Intel(R) PRO/1000 Network Driver"  )
MODULE_DEVICE_TABLE ( pci  ,
e1000_pci_tbl   
)
module_exit ( e1000_exit_module  )
module_init ( e1000_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Debug level (0=none,...,16=all)"   
)
MODULE_VERSION ( DRV_VERSION  )

Variable Documentation

char e1000e_driver_name[] = "e1000e"

Definition at line 60 of file netdev.c.

const char e1000e_driver_version[] = DRV_VERSION

Definition at line 61 of file netdev.c.