ESXi-5.5-U3
This commit is contained in:
parent
d6b9b2ac58
commit
5fc7f20805
104 changed files with 38532 additions and 16411 deletions
|
@ -0,0 +1,9 @@
|
|||
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE - IT IS GENERATED BY THE DRIVER BUILD.
|
||||
*
|
||||
* If you need to change the driver's name spaces, look in the scons
|
||||
* files for the driver's defineVmkDriver() rule.
|
||||
*/
|
||||
|
||||
VMK_NAMESPACE_REQUIRED("com.vmware.usb", "9.2.2.0");
|
|
@ -170,6 +170,9 @@ typedef vmk_uint32 vmk_LinkSpeed;
|
|||
/** Uplink link speed 10000Mbps */
|
||||
#define VMK_LINK_SPEED_10000_MBPS 10000
|
||||
|
||||
/** Uplink link speed 20000Mbps */
|
||||
#define VMK_LINK_SPEED_20000_MBPS 20000
|
||||
|
||||
/** Uplink link speed 40000Mbps */
|
||||
#define VMK_LINK_SPEED_40000_MBPS 40000
|
||||
|
||||
|
|
|
@ -1354,6 +1354,31 @@ vmk_NmpSatpAPActivatePathsHelper (
|
|||
vmk_uint32 starStopUnitTimeoutMs,
|
||||
vmk_Bool *pathsActivated);
|
||||
|
||||
/*
|
||||
************************************************************************
|
||||
* vmk_NmpSatpSetProbeFailuresOptionFlag -- */ /**
|
||||
*
|
||||
* \ingroup NMP_SATP_API
|
||||
* \brief Sets the option to handle retry failures for probe commands.
|
||||
*
|
||||
* Sets the SATP's preference on handling continuous RETRY failures
|
||||
* for probe sync commands. If set then the path will be marked dead
|
||||
* after a timeout else the path state will not be updated. If a SATP
|
||||
* uses NMP's default probing mechanism via
|
||||
* vmk_NmpSatpAPUpdatePathStatesHelper or
|
||||
* vmk_NmpSatpAAUpdatePathStatesHelper then this API must be called
|
||||
* from the SATP when the config option 'enable_action_OnRetryErrors'
|
||||
* or 'disable_action_OnRetryErrors' is set.
|
||||
*
|
||||
* \param[in] nmpDevice NMP device
|
||||
* \param[in] flag VMK_TRUE indicates option is ON
|
||||
* VMK_FALSE indicates option is OFF
|
||||
*
|
||||
************************************************************************
|
||||
*/
|
||||
void
|
||||
vmk_NmpSatpSetProbeFailuresOptionFlag(vmk_NmpDevice *nmpDevice, vmk_Bool flag);
|
||||
|
||||
#endif /* _VMK_NMP_SATP_H_ */
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
|
|
@ -170,6 +170,9 @@ typedef vmk_uint32 vmk_LinkSpeed;
|
|||
/** Uplink link speed 10000Mbps */
|
||||
#define VMK_LINK_SPEED_10000_MBPS 10000
|
||||
|
||||
/** Uplink link speed 20000Mbps */
|
||||
#define VMK_LINK_SPEED_20000_MBPS 20000
|
||||
|
||||
/** Uplink link speed 40000Mbps */
|
||||
#define VMK_LINK_SPEED_40000_MBPS 40000
|
||||
|
||||
|
|
|
@ -1354,6 +1354,31 @@ vmk_NmpSatpAPActivatePathsHelper (
|
|||
vmk_uint32 starStopUnitTimeoutMs,
|
||||
vmk_Bool *pathsActivated);
|
||||
|
||||
/*
|
||||
************************************************************************
|
||||
* vmk_NmpSatpSetProbeFailuresOptionFlag -- */ /**
|
||||
*
|
||||
* \ingroup NMP_SATP_API
|
||||
* \brief Sets the option to handle retry failures for probe commands.
|
||||
*
|
||||
* Sets the SATP's preference on handling continuous RETRY failures
|
||||
* for probe sync commands. If set then the path will be marked dead
|
||||
* after a timeout else the path state will not be updated. If a SATP
|
||||
* uses NMP's default probing mechanism via
|
||||
* vmk_NmpSatpAPUpdatePathStatesHelper or
|
||||
* vmk_NmpSatpAAUpdatePathStatesHelper then this API must be called
|
||||
* from the SATP when the config option 'enable_action_OnRetryErrors'
|
||||
* or 'disable_action_OnRetryErrors' is set.
|
||||
*
|
||||
* \param[in] nmpDevice NMP device
|
||||
* \param[in] flag VMK_TRUE indicates option is ON
|
||||
* VMK_FALSE indicates option is OFF
|
||||
*
|
||||
************************************************************************
|
||||
*/
|
||||
void
|
||||
vmk_NmpSatpSetProbeFailuresOptionFlag(vmk_NmpDevice *nmpDevice, vmk_Bool flag);
|
||||
|
||||
#endif /* _VMK_NMP_SATP_H_ */
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define BUILD_NUMBER "build-00000"
|
||||
#define BUILD_NUMBER_NUMERIC 00000
|
||||
#define BUILD_NUMBER_NUMERIC_STRING "00000"
|
||||
#define PRODUCT_BUILD_NUMBER "product-build-00000"
|
||||
#define PRODUCT_BUILD_NUMBER_NUMERIC 00000
|
||||
#define PRODUCT_BUILD_NUMBER_NUMERIC_STRING "00000"
|
||||
#define BUILD_NUMBER "build-2899292"
|
||||
#define BUILD_NUMBER_NUMERIC 2899292
|
||||
#define BUILD_NUMBER_NUMERIC_STRING "2899292"
|
||||
#define PRODUCT_BUILD_NUMBER "product-build-30998"
|
||||
#define PRODUCT_BUILD_NUMBER_NUMERIC 30998
|
||||
#define PRODUCT_BUILD_NUMBER_NUMERIC_STRING "30998"
|
||||
|
|
|
@ -3,16 +3,16 @@ This server should have SSH access enabled: Customize System/View Logs ->
|
|||
Troubleshooting Options -> Enable SSH
|
||||
|
||||
To install the package create a working directory on a datastore on the
|
||||
ESXi server, e.g., "/vmfs/volumes/Storage1/install" and copy the binary
|
||||
ESXi server, e.g., "/vmfs/volumes/datastore1/" and copy the binary
|
||||
disclosure created by the build:
|
||||
|
||||
scp centos-5.3-x64.tar root@esx.example.org:/vmfs/volumes/Storage1/install/centos-5.3-x64.tar
|
||||
scp centos-5.3-x64.tar root@esx.example.org:/vmfs/volumes/datastore1/centos-5.3-x64.tar
|
||||
|
||||
On the ESXi host, verify the shipped version:
|
||||
|
||||
Replace the shipped version with the custom build:
|
||||
|
||||
cd /vmfs/volumes/Storage1/install
|
||||
cd /vmfs/volumes/datastore1/
|
||||
tar xf centos-5.3-x64.tar
|
||||
./update-drivers.sh
|
||||
|
||||
|
|
1181
build-vmkdrivers.sh
Executable file → Normal file
1181
build-vmkdrivers.sh
Executable file → Normal file
File diff suppressed because one or more lines are too long
|
@ -54,7 +54,7 @@
|
|||
#endif
|
||||
|
||||
#define DRV_NAME "ahci"
|
||||
#define DRV_VERSION "3.0-20vmw"
|
||||
#define DRV_VERSION "3.0-22vmw"
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
static int ahci_skip_host_reset = 0;
|
||||
|
@ -651,7 +651,16 @@ static const struct pci_device_id ahci_pci_tbl[] = {
|
|||
{ PCI_VDEVICE(INTEL, 0x8d64), board_ahci }, /* Wellsburg RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
|
||||
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
|
||||
{ PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */
|
||||
{ PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0xa102), board_ahci }, /* Sunrise Point-H AHCI */
|
||||
{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
|
||||
{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0xa106), board_ahci }, /* Sunrise Point-H RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */
|
||||
{ PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
|
||||
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
|
||||
|
@ -762,6 +771,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
|
|||
{ PCI_VDEVICE(SEAMICRO, 0x2923), board_ahci }, /* 2923 */
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
|
||||
/* Samsung */
|
||||
{ PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci }, /* Samsung PCIe SSD */
|
||||
|
||||
/* Generic, PCI class code for AHCI */
|
||||
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },
|
||||
|
|
File diff suppressed because it is too large
Load diff
89
vmkdrivers/src_9/drivers/net/e1000e/80003es2lan.h
Normal file
89
vmkdrivers/src_9/drivers/net/e1000e/80003es2lan.h
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_80003ES2LAN_H_
|
||||
#define _E1000E_80003ES2LAN_H_
|
||||
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL 0x02
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL 0x10
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE 0x1F
|
||||
|
||||
#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS 0x0008
|
||||
#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS 0x0800
|
||||
#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING 0x0010
|
||||
|
||||
#define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT 0x0004
|
||||
#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000
|
||||
#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000
|
||||
|
||||
#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C
|
||||
#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004
|
||||
|
||||
#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gig Carry Extend Padding */
|
||||
#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000
|
||||
|
||||
#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8
|
||||
#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN 0x9
|
||||
|
||||
/* GG82563 PHY Specific Status Register (Page 0, Register 16 */
|
||||
#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE 0x0002 /* 1=Reversal Dis */
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_MASK 0x0060
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_MDI 0x0000 /* 00=Manual MDI */
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_MDIX 0x0020 /* 01=Manual MDIX */
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_AUTO 0x0060 /* 11=Auto crossover */
|
||||
|
||||
/* PHY Specific Control Register 2 (Page 0, Register 26) */
|
||||
#define GG82563_PSCR2_REVERSE_AUTO_NEG 0x2000 /* 1=Reverse Auto-Neg */
|
||||
|
||||
/* MAC Specific Control Register (Page 2, Register 21) */
|
||||
/* Tx clock speed for Link Down and 1000BASE-T for the following speeds */
|
||||
#define GG82563_MSCR_TX_CLK_MASK 0x0007
|
||||
#define GG82563_MSCR_TX_CLK_10MBPS_2_5 0x0004
|
||||
#define GG82563_MSCR_TX_CLK_100MBPS_25 0x0005
|
||||
#define GG82563_MSCR_TX_CLK_1000MBPS_25 0x0007
|
||||
|
||||
#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */
|
||||
|
||||
/* DSP Distance Register (Page 5, Register 26)
|
||||
* 0 = <50M
|
||||
* 1 = 50-80M
|
||||
* 2 = 80-100M
|
||||
* 3 = 110-140M
|
||||
* 4 = >140M
|
||||
*/
|
||||
#define GG82563_DSPD_CABLE_LENGTH 0x0007
|
||||
|
||||
/* Kumeran Mode Control Register (Page 193, Register 16) */
|
||||
#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
|
||||
|
||||
/* Max number of times Kumeran read/write should be validated */
|
||||
#define GG82563_MAX_KMRN_RETRY 0x5
|
||||
|
||||
/* Power Management Control Register (Page 193, Register 20) */
|
||||
/* 1=Enable SERDES Electrical Idle */
|
||||
#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE 0x0001
|
||||
|
||||
/* In-Band Control Register (Page 194, Register 18) */
|
||||
#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
54
vmkdrivers/src_9/drivers/net/e1000e/82571.h
Normal file
54
vmkdrivers/src_9/drivers/net/e1000e/82571.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_82571_H_
|
||||
#define _E1000E_82571_H_
|
||||
|
||||
#define ID_LED_RESERVED_F746 0xF746
|
||||
#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \
|
||||
(ID_LED_OFF1_ON2 << 8) | \
|
||||
(ID_LED_DEF1_DEF2 << 4) | \
|
||||
(ID_LED_DEF1_DEF2))
|
||||
|
||||
#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
|
||||
#define AN_RETRY_COUNT 5 /* Autoneg Retry Count value */
|
||||
|
||||
/* Intr Throttling - RW */
|
||||
#define E1000_EITR_82574(_n) (0x000E8 + (0x4 * (_n)))
|
||||
|
||||
#define E1000_EIAC_82574 0x000DC /* Ext. Interrupt Auto Clear - RW */
|
||||
#define E1000_EIAC_MASK_82574 0x01F00000
|
||||
|
||||
#define E1000_IVAR_INT_ALLOC_VALID 0x8
|
||||
|
||||
/* Manageability Operation Mode mask */
|
||||
#define E1000_NVM_INIT_CTRL2_MNGM 0x6000
|
||||
|
||||
#define E1000_BASE1000T_STATUS 10
|
||||
#define E1000_IDLE_ERROR_COUNT_MASK 0xFF
|
||||
#define E1000_RECEIVE_ERROR_COUNTER 21
|
||||
#define E1000_RECEIVE_ERROR_MAX 0xFFFF
|
||||
bool e1000_check_phy_82574(struct e1000_hw *hw);
|
||||
bool e1000e_get_laa_state_82571(struct e1000_hw *hw);
|
||||
void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state);
|
||||
|
||||
#endif
|
805
vmkdrivers/src_9/drivers/net/e1000e/defines.h
Normal file
805
vmkdrivers/src_9/drivers/net/e1000e/defines.h
Normal file
|
@ -0,0 +1,805 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_DEFINES_H_
|
||||
#define _E1000E_DEFINES_H_
|
||||
|
||||
/* Number of Transmit and Receive Descriptors must be a multiple of 8 */
|
||||
#define REQ_TX_DESCRIPTOR_MULTIPLE 8
|
||||
#define REQ_RX_DESCRIPTOR_MULTIPLE 8
|
||||
|
||||
/* Definitions for power management and wakeup registers */
|
||||
/* Wake Up Control */
|
||||
#define E1000_WUC_APME 0x00000001 /* APM Enable */
|
||||
#define E1000_WUC_PME_EN 0x00000002 /* PME Enable */
|
||||
#define E1000_WUC_PME_STATUS 0x00000004 /* PME Status */
|
||||
#define E1000_WUC_APMPME 0x00000008 /* Assert PME on APM Wakeup */
|
||||
#define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */
|
||||
|
||||
/* Wake Up Filter Control */
|
||||
#define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
|
||||
#define E1000_WUFC_MAG 0x00000002 /* Magic Packet Wakeup Enable */
|
||||
#define E1000_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */
|
||||
#define E1000_WUFC_MC 0x00000008 /* Directed Multicast Wakeup Enable */
|
||||
#define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
|
||||
#define E1000_WUFC_ARP 0x00000020 /* ARP Request Packet Wakeup Enable */
|
||||
|
||||
/* Wake Up Status */
|
||||
#define E1000_WUS_LNKC E1000_WUFC_LNKC
|
||||
#define E1000_WUS_MAG E1000_WUFC_MAG
|
||||
#define E1000_WUS_EX E1000_WUFC_EX
|
||||
#define E1000_WUS_MC E1000_WUFC_MC
|
||||
#define E1000_WUS_BC E1000_WUFC_BC
|
||||
|
||||
/* Extended Device Control */
|
||||
#define E1000_CTRL_EXT_LPCD 0x00000004 /* LCD Power Cycle Done */
|
||||
#define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* SW Definable Pin 3 data */
|
||||
#define E1000_CTRL_EXT_FORCE_SMBUS 0x00000800 /* Force SMBus mode */
|
||||
#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
|
||||
#define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */
|
||||
#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */
|
||||
#define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000 /* DMA Dynamic Clk Gating */
|
||||
#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
|
||||
#define E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES 0x00C00000
|
||||
#define E1000_CTRL_EXT_EIAME 0x01000000
|
||||
#define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Drv loaded bit for FW */
|
||||
#define E1000_CTRL_EXT_IAME 0x08000000 /* Int ACK Auto-mask */
|
||||
#define E1000_CTRL_EXT_PBA_CLR 0x80000000 /* PBA Clear */
|
||||
#define E1000_CTRL_EXT_LSECCK 0x00001000
|
||||
#define E1000_CTRL_EXT_PHYPDEN 0x00100000
|
||||
|
||||
/* Receive Descriptor bit definitions */
|
||||
#define E1000_RXD_STAT_DD 0x01 /* Descriptor Done */
|
||||
#define E1000_RXD_STAT_EOP 0x02 /* End of Packet */
|
||||
#define E1000_RXD_STAT_IXSM 0x04 /* Ignore checksum */
|
||||
#define E1000_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */
|
||||
#define E1000_RXD_STAT_UDPCS 0x10 /* UDP xsum calculated */
|
||||
#define E1000_RXD_STAT_TCPCS 0x20 /* TCP xsum calculated */
|
||||
#define E1000_RXD_ERR_CE 0x01 /* CRC Error */
|
||||
#define E1000_RXD_ERR_SE 0x02 /* Symbol Error */
|
||||
#define E1000_RXD_ERR_SEQ 0x04 /* Sequence Error */
|
||||
#define E1000_RXD_ERR_CXE 0x10 /* Carrier Extension Error */
|
||||
#define E1000_RXD_ERR_TCPE 0x20 /* TCP/UDP Checksum Error */
|
||||
#define E1000_RXD_ERR_IPE 0x40 /* IP Checksum Error */
|
||||
#define E1000_RXD_ERR_RXE 0x80 /* Rx Data Error */
|
||||
#define E1000_RXD_SPC_VLAN_MASK 0x0FFF /* VLAN ID is in lower 12 bits */
|
||||
|
||||
#define E1000_RXDEXT_STATERR_TST 0x00000100 /* Time Stamp taken */
|
||||
#define E1000_RXDEXT_STATERR_CE 0x01000000
|
||||
#define E1000_RXDEXT_STATERR_SE 0x02000000
|
||||
#define E1000_RXDEXT_STATERR_SEQ 0x04000000
|
||||
#define E1000_RXDEXT_STATERR_CXE 0x10000000
|
||||
#define E1000_RXDEXT_STATERR_RXE 0x80000000
|
||||
|
||||
/* mask to determine if packets should be dropped due to frame errors */
|
||||
#define E1000_RXD_ERR_FRAME_ERR_MASK ( \
|
||||
E1000_RXD_ERR_CE | \
|
||||
E1000_RXD_ERR_SE | \
|
||||
E1000_RXD_ERR_SEQ | \
|
||||
E1000_RXD_ERR_CXE | \
|
||||
E1000_RXD_ERR_RXE)
|
||||
|
||||
/* Same mask, but for extended and packet split descriptors */
|
||||
#define E1000_RXDEXT_ERR_FRAME_ERR_MASK ( \
|
||||
E1000_RXDEXT_STATERR_CE | \
|
||||
E1000_RXDEXT_STATERR_SE | \
|
||||
E1000_RXDEXT_STATERR_SEQ | \
|
||||
E1000_RXDEXT_STATERR_CXE | \
|
||||
E1000_RXDEXT_STATERR_RXE)
|
||||
|
||||
#define E1000_MRQC_RSS_FIELD_MASK 0xFFFF0000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV4 0x00020000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6 0x00100000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_TCP 0x00200000
|
||||
|
||||
#define E1000_RXDPS_HDRSTAT_HDRSP 0x00008000
|
||||
|
||||
/* Management Control */
|
||||
#define E1000_MANC_SMBUS_EN 0x00000001 /* SMBus Enabled - RO */
|
||||
#define E1000_MANC_ASF_EN 0x00000002 /* ASF Enabled - RO */
|
||||
#define E1000_MANC_ARP_EN 0x00002000 /* Enable ARP Request Filtering */
|
||||
#define E1000_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */
|
||||
#define E1000_MANC_BLK_PHY_RST_ON_IDE 0x00040000 /* Block phy resets */
|
||||
/* Enable MAC address filtering */
|
||||
#define E1000_MANC_EN_MAC_ADDR_FILTER 0x00100000
|
||||
/* Enable MNG packets to host memory */
|
||||
#define E1000_MANC_EN_MNG2HOST 0x00200000
|
||||
|
||||
#define E1000_MANC2H_PORT_623 0x00000020 /* Port 0x26f */
|
||||
#define E1000_MANC2H_PORT_664 0x00000040 /* Port 0x298 */
|
||||
#define E1000_MDEF_PORT_623 0x00000800 /* Port 0x26f */
|
||||
#define E1000_MDEF_PORT_664 0x00000400 /* Port 0x298 */
|
||||
|
||||
/* Receive Control */
|
||||
#define E1000_RCTL_EN 0x00000002 /* enable */
|
||||
#define E1000_RCTL_SBP 0x00000004 /* store bad packet */
|
||||
#define E1000_RCTL_UPE 0x00000008 /* unicast promisc enable */
|
||||
#define E1000_RCTL_MPE 0x00000010 /* multicast promisc enable */
|
||||
#define E1000_RCTL_LPE 0x00000020 /* long packet enable */
|
||||
#define E1000_RCTL_LBM_NO 0x00000000 /* no loopback mode */
|
||||
#define E1000_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */
|
||||
#define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */
|
||||
#define E1000_RCTL_DTYP_PS 0x00000400 /* Packet Split descriptor */
|
||||
#define E1000_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */
|
||||
#define E1000_RCTL_RDMTS_HEX 0x00010000
|
||||
#define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */
|
||||
#define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */
|
||||
#define E1000_RCTL_BAM 0x00008000 /* broadcast enable */
|
||||
/* these buffer sizes are valid if E1000_RCTL_BSEX is 0 */
|
||||
#define E1000_RCTL_SZ_2048 0x00000000 /* Rx buffer size 2048 */
|
||||
#define E1000_RCTL_SZ_1024 0x00010000 /* Rx buffer size 1024 */
|
||||
#define E1000_RCTL_SZ_512 0x00020000 /* Rx buffer size 512 */
|
||||
#define E1000_RCTL_SZ_256 0x00030000 /* Rx buffer size 256 */
|
||||
/* these buffer sizes are valid if E1000_RCTL_BSEX is 1 */
|
||||
#define E1000_RCTL_SZ_16384 0x00010000 /* Rx buffer size 16384 */
|
||||
#define E1000_RCTL_SZ_8192 0x00020000 /* Rx buffer size 8192 */
|
||||
#define E1000_RCTL_SZ_4096 0x00030000 /* Rx buffer size 4096 */
|
||||
#define E1000_RCTL_VFE 0x00040000 /* vlan filter enable */
|
||||
#define E1000_RCTL_CFIEN 0x00080000 /* canonical form enable */
|
||||
#define E1000_RCTL_CFI 0x00100000 /* canonical form indicator */
|
||||
#define E1000_RCTL_DPF 0x00400000 /* discard pause frames */
|
||||
#define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */
|
||||
#define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */
|
||||
#define E1000_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */
|
||||
|
||||
/* Use byte values for the following shift parameters
|
||||
* Usage:
|
||||
* psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) &
|
||||
* E1000_PSRCTL_BSIZE0_MASK) |
|
||||
* ((ROUNDUP(value1, 1024) >> E1000_PSRCTL_BSIZE1_SHIFT) &
|
||||
* E1000_PSRCTL_BSIZE1_MASK) |
|
||||
* ((ROUNDUP(value2, 1024) << E1000_PSRCTL_BSIZE2_SHIFT) &
|
||||
* E1000_PSRCTL_BSIZE2_MASK) |
|
||||
* ((ROUNDUP(value3, 1024) << E1000_PSRCTL_BSIZE3_SHIFT) |;
|
||||
* E1000_PSRCTL_BSIZE3_MASK))
|
||||
* where value0 = [128..16256], default=256
|
||||
* value1 = [1024..64512], default=4096
|
||||
* value2 = [0..64512], default=4096
|
||||
* value3 = [0..64512], default=0
|
||||
*/
|
||||
|
||||
#define E1000_PSRCTL_BSIZE0_MASK 0x0000007F
|
||||
#define E1000_PSRCTL_BSIZE1_MASK 0x00003F00
|
||||
#define E1000_PSRCTL_BSIZE2_MASK 0x003F0000
|
||||
#define E1000_PSRCTL_BSIZE3_MASK 0x3F000000
|
||||
|
||||
#define E1000_PSRCTL_BSIZE0_SHIFT 7 /* Shift _right_ 7 */
|
||||
#define E1000_PSRCTL_BSIZE1_SHIFT 2 /* Shift _right_ 2 */
|
||||
#define E1000_PSRCTL_BSIZE2_SHIFT 6 /* Shift _left_ 6 */
|
||||
#define E1000_PSRCTL_BSIZE3_SHIFT 14 /* Shift _left_ 14 */
|
||||
|
||||
/* SWFW_SYNC Definitions */
|
||||
#define E1000_SWFW_EEP_SM 0x01
|
||||
#define E1000_SWFW_PHY0_SM 0x02
|
||||
#define E1000_SWFW_PHY1_SM 0x04
|
||||
#define E1000_SWFW_CSR_SM 0x08
|
||||
|
||||
/* Device Control */
|
||||
#define E1000_CTRL_FD 0x00000001 /* Full duplex.0=half; 1=full */
|
||||
#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004 /*Blocks new Master reqs */
|
||||
#define E1000_CTRL_LRST 0x00000008 /* Link reset. 0=normal,1=reset */
|
||||
#define E1000_CTRL_ASDE 0x00000020 /* Auto-speed detect enable */
|
||||
#define E1000_CTRL_SLU 0x00000040 /* Set link up (Force Link) */
|
||||
#define E1000_CTRL_ILOS 0x00000080 /* Invert Loss-Of Signal */
|
||||
#define E1000_CTRL_SPD_SEL 0x00000300 /* Speed Select Mask */
|
||||
#define E1000_CTRL_SPD_10 0x00000000 /* Force 10Mb */
|
||||
#define E1000_CTRL_SPD_100 0x00000100 /* Force 100Mb */
|
||||
#define E1000_CTRL_SPD_1000 0x00000200 /* Force 1Gb */
|
||||
#define E1000_CTRL_FRCSPD 0x00000800 /* Force Speed */
|
||||
#define E1000_CTRL_FRCDPX 0x00001000 /* Force Duplex */
|
||||
#define E1000_CTRL_LANPHYPC_OVERRIDE 0x00010000 /* SW control of LANPHYPC */
|
||||
#define E1000_CTRL_LANPHYPC_VALUE 0x00020000 /* SW value of LANPHYPC */
|
||||
#define E1000_CTRL_MEHE 0x00080000 /* Memory Error Handling Enable */
|
||||
#define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */
|
||||
#define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */
|
||||
#define E1000_CTRL_ADVD3WUC 0x00100000 /* D3 WUC */
|
||||
#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000 /* PHY PM enable */
|
||||
#define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */
|
||||
#define E1000_CTRL_RST 0x04000000 /* Global reset */
|
||||
#define E1000_CTRL_RFCE 0x08000000 /* Receive Flow Control enable */
|
||||
#define E1000_CTRL_TFCE 0x10000000 /* Transmit flow control enable */
|
||||
#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */
|
||||
#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */
|
||||
|
||||
#define E1000_PCS_LCTL_FORCE_FCTRL 0x80
|
||||
|
||||
#define E1000_PCS_LSTS_AN_COMPLETE 0x10000
|
||||
|
||||
/* Device Status */
|
||||
#define E1000_STATUS_FD 0x00000001 /* Duplex 0=half 1=full */
|
||||
#define E1000_STATUS_LU 0x00000002 /* Link up.0=no,1=link */
|
||||
#define E1000_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */
|
||||
#define E1000_STATUS_FUNC_SHIFT 2
|
||||
#define E1000_STATUS_FUNC_1 0x00000004 /* Function 1 */
|
||||
#define E1000_STATUS_TXOFF 0x00000010 /* transmission paused */
|
||||
#define E1000_STATUS_SPEED_MASK 0x000000C0
|
||||
#define E1000_STATUS_SPEED_10 0x00000000 /* Speed 10Mb/s */
|
||||
#define E1000_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */
|
||||
#define E1000_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */
|
||||
#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Compltn by NVM */
|
||||
#define E1000_STATUS_PHYRA 0x00000400 /* PHY Reset Asserted */
|
||||
#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Master request status */
|
||||
|
||||
#define HALF_DUPLEX 1
|
||||
#define FULL_DUPLEX 2
|
||||
|
||||
#define ADVERTISE_10_HALF 0x0001
|
||||
#define ADVERTISE_10_FULL 0x0002
|
||||
#define ADVERTISE_100_HALF 0x0004
|
||||
#define ADVERTISE_100_FULL 0x0008
|
||||
#define ADVERTISE_1000_HALF 0x0010 /* Not used, just FYI */
|
||||
#define ADVERTISE_1000_FULL 0x0020
|
||||
|
||||
/* 1000/H is not supported, nor spec-compliant. */
|
||||
#define E1000_ALL_SPEED_DUPLEX ( \
|
||||
ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \
|
||||
ADVERTISE_100_FULL | ADVERTISE_1000_FULL)
|
||||
#define E1000_ALL_NOT_GIG ( \
|
||||
ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \
|
||||
ADVERTISE_100_FULL)
|
||||
#define E1000_ALL_100_SPEED (ADVERTISE_100_HALF | ADVERTISE_100_FULL)
|
||||
#define E1000_ALL_10_SPEED (ADVERTISE_10_HALF | ADVERTISE_10_FULL)
|
||||
#define E1000_ALL_HALF_DUPLEX (ADVERTISE_10_HALF | ADVERTISE_100_HALF)
|
||||
|
||||
#define AUTONEG_ADVERTISE_SPEED_DEFAULT E1000_ALL_SPEED_DUPLEX
|
||||
|
||||
/* LED Control */
|
||||
#define E1000_PHY_LED0_MODE_MASK 0x00000007
|
||||
#define E1000_PHY_LED0_IVRT 0x00000008
|
||||
#define E1000_PHY_LED0_MASK 0x0000001F
|
||||
|
||||
#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F
|
||||
#define E1000_LEDCTL_LED0_MODE_SHIFT 0
|
||||
#define E1000_LEDCTL_LED0_IVRT 0x00000040
|
||||
#define E1000_LEDCTL_LED0_BLINK 0x00000080
|
||||
|
||||
#define E1000_LEDCTL_MODE_LINK_UP 0x2
|
||||
#define E1000_LEDCTL_MODE_LED_ON 0xE
|
||||
#define E1000_LEDCTL_MODE_LED_OFF 0xF
|
||||
|
||||
/* Transmit Descriptor bit definitions */
|
||||
#define E1000_TXD_DTYP_D 0x00100000 /* Data Descriptor */
|
||||
#define E1000_TXD_POPTS_IXSM 0x01 /* Insert IP checksum */
|
||||
#define E1000_TXD_POPTS_TXSM 0x02 /* Insert TCP/UDP checksum */
|
||||
#define E1000_TXD_CMD_EOP 0x01000000 /* End of Packet */
|
||||
#define E1000_TXD_CMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
|
||||
#define E1000_TXD_CMD_IC 0x04000000 /* Insert Checksum */
|
||||
#define E1000_TXD_CMD_RS 0x08000000 /* Report Status */
|
||||
#define E1000_TXD_CMD_RPS 0x10000000 /* Report Packet Sent */
|
||||
#define E1000_TXD_CMD_DEXT 0x20000000 /* Desc extension (0 = legacy) */
|
||||
#define E1000_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */
|
||||
#define E1000_TXD_CMD_IDE 0x80000000 /* Enable Tidv register */
|
||||
#define E1000_TXD_STAT_DD 0x00000001 /* Descriptor Done */
|
||||
#define E1000_TXD_STAT_EC 0x00000002 /* Excess Collisions */
|
||||
#define E1000_TXD_STAT_LC 0x00000004 /* Late Collisions */
|
||||
#define E1000_TXD_STAT_TU 0x00000008 /* Transmit underrun */
|
||||
#define E1000_TXD_CMD_TCP 0x01000000 /* TCP packet */
|
||||
#define E1000_TXD_CMD_IP 0x02000000 /* IP packet */
|
||||
#define E1000_TXD_CMD_TSE 0x04000000 /* TCP Seg enable */
|
||||
#define E1000_TXD_STAT_TC 0x00000004 /* Tx Underrun */
|
||||
#define E1000_TXD_EXTCMD_TSTAMP 0x00000010 /* IEEE1588 Timestamp packet */
|
||||
|
||||
/* Transmit Control */
|
||||
#define E1000_TCTL_EN 0x00000002 /* enable Tx */
|
||||
#define E1000_TCTL_PSP 0x00000008 /* pad short packets */
|
||||
#define E1000_TCTL_CT 0x00000ff0 /* collision threshold */
|
||||
#define E1000_TCTL_COLD 0x003ff000 /* collision distance */
|
||||
#define E1000_TCTL_RTLC 0x01000000 /* Re-transmit on late collision */
|
||||
#define E1000_TCTL_MULR 0x10000000 /* Multiple request support */
|
||||
|
||||
/* SerDes Control */
|
||||
#define E1000_SCTL_DISABLE_SERDES_LOOPBACK 0x0400
|
||||
#define E1000_SCTL_ENABLE_SERDES_LOOPBACK 0x0410
|
||||
|
||||
/* Receive Checksum Control */
|
||||
#define E1000_RXCSUM_TUOFL 0x00000200 /* TCP / UDP checksum offload */
|
||||
#define E1000_RXCSUM_IPPCSE 0x00001000 /* IP payload checksum enable */
|
||||
#define E1000_RXCSUM_PCSD 0x00002000 /* packet checksum disabled */
|
||||
|
||||
/* Header split receive */
|
||||
#define E1000_RFCTL_NFSW_DIS 0x00000040
|
||||
#define E1000_RFCTL_NFSR_DIS 0x00000080
|
||||
#define E1000_RFCTL_ACK_DIS 0x00001000
|
||||
#define E1000_RFCTL_EXTEN 0x00008000
|
||||
#define E1000_RFCTL_IPV6_EX_DIS 0x00010000
|
||||
#define E1000_RFCTL_NEW_IPV6_EXT_DIS 0x00020000
|
||||
|
||||
/* Collision related configuration parameters */
|
||||
#define E1000_COLLISION_THRESHOLD 15
|
||||
#define E1000_CT_SHIFT 4
|
||||
#define E1000_COLLISION_DISTANCE 63
|
||||
#define E1000_COLD_SHIFT 12
|
||||
|
||||
/* Default values for the transmit IPG register */
|
||||
#define DEFAULT_82543_TIPG_IPGT_COPPER 8
|
||||
|
||||
#define E1000_TIPG_IPGT_MASK 0x000003FF
|
||||
|
||||
#define DEFAULT_82543_TIPG_IPGR1 8
|
||||
#define E1000_TIPG_IPGR1_SHIFT 10
|
||||
|
||||
#define DEFAULT_82543_TIPG_IPGR2 6
|
||||
#define DEFAULT_80003ES2LAN_TIPG_IPGR2 7
|
||||
#define E1000_TIPG_IPGR2_SHIFT 20
|
||||
|
||||
#define MAX_JUMBO_FRAME_SIZE 0x3F00
|
||||
#define E1000_TX_PTR_GAP 0x1F
|
||||
|
||||
/* Extended Configuration Control and Size */
|
||||
#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020
|
||||
#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001
|
||||
#define E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE 0x00000008
|
||||
#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020
|
||||
#define E1000_EXTCNF_CTRL_GATE_PHY_CFG 0x00000080
|
||||
#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000
|
||||
#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16
|
||||
#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK 0x0FFF0000
|
||||
#define E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT 16
|
||||
|
||||
#define E1000_PHY_CTRL_D0A_LPLU 0x00000002
|
||||
#define E1000_PHY_CTRL_NOND0A_LPLU 0x00000004
|
||||
#define E1000_PHY_CTRL_NOND0A_GBE_DISABLE 0x00000008
|
||||
#define E1000_PHY_CTRL_GBE_DISABLE 0x00000040
|
||||
|
||||
#define E1000_KABGTXD_BGSQLBIAS 0x00050000
|
||||
|
||||
/* Low Power IDLE Control */
|
||||
#define E1000_LPIC_LPIET_SHIFT 24 /* Low Power Idle Entry Time */
|
||||
|
||||
/* PBA constants */
|
||||
#define E1000_PBA_8K 0x0008 /* 8KB */
|
||||
#define E1000_PBA_16K 0x0010 /* 16KB */
|
||||
|
||||
#define E1000_PBA_RXA_MASK 0xFFFF
|
||||
|
||||
#define E1000_PBS_16K E1000_PBA_16K
|
||||
|
||||
/* Uncorrectable/correctable ECC Error counts and enable bits */
|
||||
#define E1000_PBECCSTS_CORR_ERR_CNT_MASK 0x000000FF
|
||||
#define E1000_PBECCSTS_UNCORR_ERR_CNT_MASK 0x0000FF00
|
||||
#define E1000_PBECCSTS_UNCORR_ERR_CNT_SHIFT 8
|
||||
#define E1000_PBECCSTS_ECC_ENABLE 0x00010000
|
||||
|
||||
#define IFS_MAX 80
|
||||
#define IFS_MIN 40
|
||||
#define IFS_RATIO 4
|
||||
#define IFS_STEP 10
|
||||
#define MIN_NUM_XMITS 1000
|
||||
|
||||
/* SW Semaphore Register */
|
||||
#define E1000_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */
|
||||
#define E1000_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */
|
||||
#define E1000_SWSM_DRV_LOAD 0x00000008 /* Driver Loaded Bit */
|
||||
|
||||
#define E1000_SWSM2_LOCK 0x00000002 /* Secondary driver semaphore bit */
|
||||
|
||||
/* Interrupt Cause Read */
|
||||
#define E1000_ICR_TXDW 0x00000001 /* Transmit desc written back */
|
||||
#define E1000_ICR_LSC 0x00000004 /* Link Status Change */
|
||||
#define E1000_ICR_RXSEQ 0x00000008 /* Rx sequence error */
|
||||
#define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */
|
||||
#define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */
|
||||
#define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */
|
||||
/* If this bit asserted, the driver should claim the interrupt */
|
||||
#define E1000_ICR_INT_ASSERTED 0x80000000
|
||||
#define E1000_ICR_RXQ0 0x00100000 /* Rx Queue 0 Interrupt */
|
||||
#define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */
|
||||
#define E1000_ICR_TXQ0 0x00400000 /* Tx Queue 0 Interrupt */
|
||||
#define E1000_ICR_TXQ1 0x00800000 /* Tx Queue 1 Interrupt */
|
||||
#define E1000_ICR_OTHER 0x01000000 /* Other Interrupts */
|
||||
|
||||
/* PBA ECC Register */
|
||||
#define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */
|
||||
#define E1000_PBA_ECC_COUNTER_SHIFT 20 /* ECC counter shift value */
|
||||
#define E1000_PBA_ECC_CORR_EN 0x00000001 /* Enable ECC error correction */
|
||||
#define E1000_PBA_ECC_STAT_CLR 0x00000002 /* Clear ECC error counter */
|
||||
#define E1000_PBA_ECC_INT_EN 0x00000004 /* Enable ICR bit 5 on ECC error */
|
||||
|
||||
/* This defines the bits that are set in the Interrupt Mask
|
||||
* Set/Read Register. Each bit is documented below:
|
||||
* o RXT0 = Receiver Timer Interrupt (ring 0)
|
||||
* o TXDW = Transmit Descriptor Written Back
|
||||
* o RXDMT0 = Receive Descriptor Minimum Threshold hit (ring 0)
|
||||
* o RXSEQ = Receive Sequence Error
|
||||
* o LSC = Link Status Change
|
||||
*/
|
||||
#define IMS_ENABLE_MASK ( \
|
||||
E1000_IMS_RXT0 | \
|
||||
E1000_IMS_TXDW | \
|
||||
E1000_IMS_RXDMT0 | \
|
||||
E1000_IMS_RXSEQ | \
|
||||
E1000_IMS_LSC)
|
||||
|
||||
/* Interrupt Mask Set */
|
||||
#define E1000_IMS_TXDW E1000_ICR_TXDW /* Tx desc written back */
|
||||
#define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */
|
||||
#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */
|
||||
#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */
|
||||
#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */
|
||||
#define E1000_IMS_ECCER E1000_ICR_ECCER /* Uncorrectable ECC Error */
|
||||
#define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */
|
||||
#define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */
|
||||
#define E1000_IMS_TXQ0 E1000_ICR_TXQ0 /* Tx Queue 0 Interrupt */
|
||||
#define E1000_IMS_TXQ1 E1000_ICR_TXQ1 /* Tx Queue 1 Interrupt */
|
||||
#define E1000_IMS_OTHER E1000_ICR_OTHER /* Other Interrupts */
|
||||
|
||||
/* Interrupt Cause Set */
|
||||
#define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */
|
||||
#define E1000_ICS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */
|
||||
#define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */
|
||||
|
||||
/* Transmit Descriptor Control */
|
||||
#define E1000_TXDCTL_PTHRESH 0x0000003F /* TXDCTL Prefetch Threshold */
|
||||
#define E1000_TXDCTL_HTHRESH 0x00003F00 /* TXDCTL Host Threshold */
|
||||
#define E1000_TXDCTL_WTHRESH 0x003F0000 /* TXDCTL Writeback Threshold */
|
||||
#define E1000_TXDCTL_GRAN 0x01000000 /* TXDCTL Granularity */
|
||||
#define E1000_TXDCTL_FULL_TX_DESC_WB 0x01010000 /* GRAN=1, WTHRESH=1 */
|
||||
#define E1000_TXDCTL_MAX_TX_DESC_PREFETCH 0x0100001F /* GRAN=1, PTHRESH=31 */
|
||||
/* Enable the counting of descriptors still to be processed. */
|
||||
#define E1000_TXDCTL_COUNT_DESC 0x00400000
|
||||
|
||||
/* Flow Control Constants */
|
||||
#define FLOW_CONTROL_ADDRESS_LOW 0x00C28001
|
||||
#define FLOW_CONTROL_ADDRESS_HIGH 0x00000100
|
||||
#define FLOW_CONTROL_TYPE 0x8808
|
||||
|
||||
/* 802.1q VLAN Packet Size */
|
||||
#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */
|
||||
|
||||
/* Receive Address
|
||||
* Number of high/low register pairs in the RAR. The RAR (Receive Address
|
||||
* Registers) holds the directed and multicast addresses that we monitor.
|
||||
* Technically, we have 16 spots. However, we reserve one of these spots
|
||||
* (RAR[15]) for our directed address used by controllers with
|
||||
* manageability enabled, allowing us room for 15 multicast addresses.
|
||||
*/
|
||||
#define E1000_RAR_ENTRIES 15
|
||||
#define E1000_RAH_AV 0x80000000 /* Receive descriptor valid */
|
||||
#define E1000_RAL_MAC_ADDR_LEN 4
|
||||
#define E1000_RAH_MAC_ADDR_LEN 2
|
||||
|
||||
/* Error Codes */
|
||||
#define E1000_ERR_NVM 1
|
||||
#define E1000_ERR_PHY 2
|
||||
#define E1000_ERR_CONFIG 3
|
||||
#define E1000_ERR_PARAM 4
|
||||
#define E1000_ERR_MAC_INIT 5
|
||||
#define E1000_ERR_PHY_TYPE 6
|
||||
#define E1000_ERR_RESET 9
|
||||
#define E1000_ERR_MASTER_REQUESTS_PENDING 10
|
||||
#define E1000_ERR_HOST_INTERFACE_COMMAND 11
|
||||
#define E1000_BLK_PHY_RESET 12
|
||||
#define E1000_ERR_SWFW_SYNC 13
|
||||
#define E1000_NOT_IMPLEMENTED 14
|
||||
#define E1000_ERR_INVALID_ARGUMENT 16
|
||||
#define E1000_ERR_NO_SPACE 17
|
||||
#define E1000_ERR_NVM_PBA_SECTION 18
|
||||
|
||||
/* Loop limit on how long we wait for auto-negotiation to complete */
|
||||
#define FIBER_LINK_UP_LIMIT 50
|
||||
#define COPPER_LINK_UP_LIMIT 10
|
||||
#define PHY_AUTO_NEG_LIMIT 45
|
||||
#define PHY_FORCE_LIMIT 20
|
||||
/* Number of 100 microseconds we wait for PCI Express master disable */
|
||||
#define MASTER_DISABLE_TIMEOUT 800
|
||||
/* Number of milliseconds we wait for PHY configuration done after MAC reset */
|
||||
#define PHY_CFG_TIMEOUT 100
|
||||
/* Number of 2 milliseconds we wait for acquiring MDIO ownership. */
|
||||
#define MDIO_OWNERSHIP_TIMEOUT 10
|
||||
/* Number of milliseconds for NVM auto read done after MAC reset. */
|
||||
#define AUTO_READ_DONE_TIMEOUT 10
|
||||
|
||||
/* Flow Control */
|
||||
#define E1000_FCRTH_RTH 0x0000FFF8 /* Mask Bits[15:3] for RTH */
|
||||
#define E1000_FCRTL_RTL 0x0000FFF8 /* Mask Bits[15:3] for RTL */
|
||||
#define E1000_FCRTL_XONE 0x80000000 /* Enable XON frame transmission */
|
||||
|
||||
/* Transmit Configuration Word */
|
||||
#define E1000_TXCW_FD 0x00000020 /* TXCW full duplex */
|
||||
#define E1000_TXCW_PAUSE 0x00000080 /* TXCW sym pause request */
|
||||
#define E1000_TXCW_ASM_DIR 0x00000100 /* TXCW astm pause direction */
|
||||
#define E1000_TXCW_PAUSE_MASK 0x00000180 /* TXCW pause request mask */
|
||||
#define E1000_TXCW_ANE 0x80000000 /* Auto-neg enable */
|
||||
|
||||
/* Receive Configuration Word */
|
||||
#define E1000_RXCW_CW 0x0000ffff /* RxConfigWord mask */
|
||||
#define E1000_RXCW_IV 0x08000000 /* Receive config invalid */
|
||||
#define E1000_RXCW_C 0x20000000 /* Receive config */
|
||||
#define E1000_RXCW_SYNCH 0x40000000 /* Receive config synch */
|
||||
|
||||
#define E1000_TSYNCTXCTL_VALID 0x00000001 /* Tx timestamp valid */
|
||||
#define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable Tx timestamping */
|
||||
|
||||
/* HH Time Sync */
|
||||
#define E1000_TSYNCTXCTL_MAX_ALLOWED_DLY_MASK 0x0000F000 /* max delay */
|
||||
#define E1000_TSYNCTXCTL_SYNC_COMP_ERR 0x20000000 /* sync err */
|
||||
#define E1000_TSYNCTXCTL_SYNC_COMP 0x40000000 /* sync complete */
|
||||
#define E1000_TSYNCTXCTL_START_SYNC 0x80000000 /* initiate sync */
|
||||
|
||||
#define E1000_TSYNCRXCTL_VALID 0x00000001 /* Rx timestamp valid */
|
||||
#define E1000_TSYNCRXCTL_TYPE_MASK 0x0000000E /* Rx type mask */
|
||||
#define E1000_TSYNCRXCTL_TYPE_L2_V2 0x00
|
||||
#define E1000_TSYNCRXCTL_TYPE_L4_V1 0x02
|
||||
#define E1000_TSYNCRXCTL_TYPE_L2_L4_V2 0x04
|
||||
#define E1000_TSYNCRXCTL_TYPE_ALL 0x08
|
||||
#define E1000_TSYNCRXCTL_TYPE_EVENT_V2 0x0A
|
||||
#define E1000_TSYNCRXCTL_ENABLED 0x00000010 /* enable Rx timestamping */
|
||||
#define E1000_TSYNCRXCTL_SYSCFI 0x00000020 /* Sys clock frequency */
|
||||
|
||||
#define E1000_RXMTRL_PTP_V1_SYNC_MESSAGE 0x00000000
|
||||
#define E1000_RXMTRL_PTP_V1_DELAY_REQ_MESSAGE 0x00010000
|
||||
|
||||
#define E1000_RXMTRL_PTP_V2_SYNC_MESSAGE 0x00000000
|
||||
#define E1000_RXMTRL_PTP_V2_DELAY_REQ_MESSAGE 0x01000000
|
||||
|
||||
#define E1000_TIMINCA_INCPERIOD_SHIFT 24
|
||||
#define E1000_TIMINCA_INCVALUE_MASK 0x00FFFFFF
|
||||
|
||||
/* PCI Express Control */
|
||||
#define E1000_GCR_RXD_NO_SNOOP 0x00000001
|
||||
#define E1000_GCR_RXDSCW_NO_SNOOP 0x00000002
|
||||
#define E1000_GCR_RXDSCR_NO_SNOOP 0x00000004
|
||||
#define E1000_GCR_TXD_NO_SNOOP 0x00000008
|
||||
#define E1000_GCR_TXDSCW_NO_SNOOP 0x00000010
|
||||
#define E1000_GCR_TXDSCR_NO_SNOOP 0x00000020
|
||||
|
||||
#define PCIE_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP | \
|
||||
E1000_GCR_RXDSCW_NO_SNOOP | \
|
||||
E1000_GCR_RXDSCR_NO_SNOOP | \
|
||||
E1000_GCR_TXD_NO_SNOOP | \
|
||||
E1000_GCR_TXDSCW_NO_SNOOP | \
|
||||
E1000_GCR_TXDSCR_NO_SNOOP)
|
||||
|
||||
/* NVM Control */
|
||||
#define E1000_EECD_SK 0x00000001 /* NVM Clock */
|
||||
#define E1000_EECD_CS 0x00000002 /* NVM Chip Select */
|
||||
#define E1000_EECD_DI 0x00000004 /* NVM Data In */
|
||||
#define E1000_EECD_DO 0x00000008 /* NVM Data Out */
|
||||
#define E1000_EECD_REQ 0x00000040 /* NVM Access Request */
|
||||
#define E1000_EECD_GNT 0x00000080 /* NVM Access Grant */
|
||||
#define E1000_EECD_PRES 0x00000100 /* NVM Present */
|
||||
#define E1000_EECD_SIZE 0x00000200 /* NVM Size (0=64 word 1=256 word) */
|
||||
/* NVM Addressing bits based on type 0=small, 1=large */
|
||||
#define E1000_EECD_ADDR_BITS 0x00000400
|
||||
#define E1000_NVM_GRANT_ATTEMPTS 1000 /* NVM # attempts to gain grant */
|
||||
#define E1000_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */
|
||||
#define E1000_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */
|
||||
#define E1000_EECD_SIZE_EX_SHIFT 11
|
||||
#define E1000_EECD_FLUPD 0x00080000 /* Update FLASH */
|
||||
#define E1000_EECD_AUPDEN 0x00100000 /* Ena Auto FLASH update */
|
||||
#define E1000_EECD_SEC1VAL 0x00400000 /* Sector One Valid */
|
||||
#define E1000_EECD_SEC1VAL_VALID_MASK (E1000_EECD_AUTO_RD | E1000_EECD_PRES)
|
||||
|
||||
#define E1000_NVM_RW_REG_DATA 16 /* Offset to data in NVM read/write regs */
|
||||
#define E1000_NVM_RW_REG_DONE 2 /* Offset to READ/WRITE done bit */
|
||||
#define E1000_NVM_RW_REG_START 1 /* Start operation */
|
||||
#define E1000_NVM_RW_ADDR_SHIFT 2 /* Shift to the address bits */
|
||||
#define E1000_NVM_POLL_WRITE 1 /* Flag for polling for write complete */
|
||||
#define E1000_NVM_POLL_READ 0 /* Flag for polling for read complete */
|
||||
#define E1000_FLASH_UPDATES 2000
|
||||
|
||||
/* NVM Word Offsets */
|
||||
#define NVM_COMPAT 0x0003
|
||||
#define NVM_ID_LED_SETTINGS 0x0004
|
||||
#define NVM_FUTURE_INIT_WORD1 0x0019
|
||||
#define NVM_COMPAT_VALID_CSUM 0x0001
|
||||
#define NVM_FUTURE_INIT_WORD1_VALID_CSUM 0x0040
|
||||
|
||||
#define NVM_INIT_CONTROL2_REG 0x000F
|
||||
#define NVM_INIT_CONTROL3_PORT_B 0x0014
|
||||
#define NVM_INIT_3GIO_3 0x001A
|
||||
#define NVM_INIT_CONTROL3_PORT_A 0x0024
|
||||
#define NVM_CFG 0x0012
|
||||
#define NVM_ALT_MAC_ADDR_PTR 0x0037
|
||||
#define NVM_CHECKSUM_REG 0x003F
|
||||
|
||||
#define E1000_NVM_CFG_DONE_PORT_0 0x040000 /* MNG config cycle done */
|
||||
#define E1000_NVM_CFG_DONE_PORT_1 0x080000 /* ...for second port */
|
||||
|
||||
/* Mask bits for fields in Word 0x0f of the NVM */
|
||||
#define NVM_WORD0F_PAUSE_MASK 0x3000
|
||||
#define NVM_WORD0F_PAUSE 0x1000
|
||||
#define NVM_WORD0F_ASM_DIR 0x2000
|
||||
|
||||
/* Mask bits for fields in Word 0x1a of the NVM */
|
||||
#define NVM_WORD1A_ASPM_MASK 0x000C
|
||||
|
||||
/* Mask bits for fields in Word 0x03 of the EEPROM */
|
||||
#define NVM_COMPAT_LOM 0x0800
|
||||
|
||||
/* length of string needed to store PBA number */
|
||||
#define E1000_PBANUM_LENGTH 11
|
||||
|
||||
/* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
|
||||
#define NVM_SUM 0xBABA
|
||||
|
||||
/* PBA (printed board assembly) number words */
|
||||
#define NVM_PBA_OFFSET_0 8
|
||||
#define NVM_PBA_OFFSET_1 9
|
||||
#define NVM_PBA_PTR_GUARD 0xFAFA
|
||||
#define NVM_WORD_SIZE_BASE_SHIFT 6
|
||||
|
||||
/* NVM Commands - SPI */
|
||||
#define NVM_MAX_RETRY_SPI 5000 /* Max wait of 5ms, for RDY signal */
|
||||
#define NVM_READ_OPCODE_SPI 0x03 /* NVM read opcode */
|
||||
#define NVM_WRITE_OPCODE_SPI 0x02 /* NVM write opcode */
|
||||
#define NVM_A8_OPCODE_SPI 0x08 /* opcode bit-3 = address bit-8 */
|
||||
#define NVM_WREN_OPCODE_SPI 0x06 /* NVM set Write Enable latch */
|
||||
#define NVM_RDSR_OPCODE_SPI 0x05 /* NVM read Status register */
|
||||
|
||||
/* SPI NVM Status Register */
|
||||
#define NVM_STATUS_RDY_SPI 0x01
|
||||
|
||||
/* Word definitions for ID LED Settings */
|
||||
#define ID_LED_RESERVED_0000 0x0000
|
||||
#define ID_LED_RESERVED_FFFF 0xFFFF
|
||||
#define ID_LED_DEFAULT ((ID_LED_OFF1_ON2 << 12) | \
|
||||
(ID_LED_OFF1_OFF2 << 8) | \
|
||||
(ID_LED_DEF1_DEF2 << 4) | \
|
||||
(ID_LED_DEF1_DEF2))
|
||||
#define ID_LED_DEF1_DEF2 0x1
|
||||
#define ID_LED_DEF1_ON2 0x2
|
||||
#define ID_LED_DEF1_OFF2 0x3
|
||||
#define ID_LED_ON1_DEF2 0x4
|
||||
#define ID_LED_ON1_ON2 0x5
|
||||
#define ID_LED_ON1_OFF2 0x6
|
||||
#define ID_LED_OFF1_DEF2 0x7
|
||||
#define ID_LED_OFF1_ON2 0x8
|
||||
#define ID_LED_OFF1_OFF2 0x9
|
||||
|
||||
#define IGP_ACTIVITY_LED_MASK 0xFFFFF0FF
|
||||
#define IGP_ACTIVITY_LED_ENABLE 0x0300
|
||||
#define IGP_LED3_MODE 0x07000000
|
||||
|
||||
/* PCI/PCI-X/PCI-EX Config space */
|
||||
#define PCI_HEADER_TYPE_REGISTER 0x0E
|
||||
#define PCIE_LINK_STATUS 0x12
|
||||
|
||||
#define PCI_HEADER_TYPE_MULTIFUNC 0x80
|
||||
#define PCIE_LINK_WIDTH_MASK 0x3F0
|
||||
#define PCIE_LINK_WIDTH_SHIFT 4
|
||||
|
||||
#define PHY_REVISION_MASK 0xFFFFFFF0
|
||||
#define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */
|
||||
#define MAX_PHY_MULTI_PAGE_REG 0xF
|
||||
|
||||
/* Bit definitions for valid PHY IDs.
|
||||
* I = Integrated
|
||||
* E = External
|
||||
*/
|
||||
#define M88E1000_E_PHY_ID 0x01410C50
|
||||
#define M88E1000_I_PHY_ID 0x01410C30
|
||||
#define M88E1011_I_PHY_ID 0x01410C20
|
||||
#define IGP01E1000_I_PHY_ID 0x02A80380
|
||||
#define M88E1111_I_PHY_ID 0x01410CC0
|
||||
#define GG82563_E_PHY_ID 0x01410CA0
|
||||
#define IGP03E1000_E_PHY_ID 0x02A80390
|
||||
#define IFE_E_PHY_ID 0x02A80330
|
||||
#define IFE_PLUS_E_PHY_ID 0x02A80320
|
||||
#define IFE_C_E_PHY_ID 0x02A80310
|
||||
#define BME1000_E_PHY_ID 0x01410CB0
|
||||
#define BME1000_E_PHY_ID_R2 0x01410CB1
|
||||
#define I82577_E_PHY_ID 0x01540050
|
||||
#define I82578_E_PHY_ID 0x004DD040
|
||||
#define I82579_E_PHY_ID 0x01540090
|
||||
#define I217_E_PHY_ID 0x015400A0
|
||||
|
||||
/* M88E1000 Specific Registers */
|
||||
#define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Reg */
|
||||
#define M88E1000_PHY_SPEC_STATUS 0x11 /* PHY Specific Status Reg */
|
||||
#define M88E1000_EXT_PHY_SPEC_CTRL 0x14 /* Extended PHY Specific Cntrl */
|
||||
|
||||
#define M88E1000_PHY_PAGE_SELECT 0x1D /* Reg 29 for pg number setting */
|
||||
#define M88E1000_PHY_GEN_CONTROL 0x1E /* meaning depends on reg 29 */
|
||||
|
||||
/* M88E1000 PHY Specific Control Register */
|
||||
#define M88E1000_PSCR_POLARITY_REVERSAL 0x0002 /* 1=Polarity Reverse enabled */
|
||||
/* MDI Crossover Mode bits 6:5 Manual MDI configuration */
|
||||
#define M88E1000_PSCR_MDI_MANUAL_MODE 0x0000
|
||||
#define M88E1000_PSCR_MDIX_MANUAL_MODE 0x0020 /* Manual MDIX configuration */
|
||||
/* 1000BASE-T: Auto crossover, 100BASE-TX/10BASE-T: MDI Mode */
|
||||
#define M88E1000_PSCR_AUTO_X_1000T 0x0040
|
||||
/* Auto crossover enabled all speeds */
|
||||
#define M88E1000_PSCR_AUTO_X_MODE 0x0060
|
||||
#define M88E1000_PSCR_ASSERT_CRS_ON_TX 0x0800 /* 1=Assert CRS on Tx */
|
||||
|
||||
/* M88E1000 PHY Specific Status Register */
|
||||
#define M88E1000_PSSR_REV_POLARITY 0x0002 /* 1=Polarity reversed */
|
||||
#define M88E1000_PSSR_DOWNSHIFT 0x0020 /* 1=Downshifted */
|
||||
#define M88E1000_PSSR_MDIX 0x0040 /* 1=MDIX; 0=MDI */
|
||||
/* 0 = <50M
|
||||
* 1 = 50-80M
|
||||
* 2 = 80-110M
|
||||
* 3 = 110-140M
|
||||
* 4 = >140M
|
||||
*/
|
||||
#define M88E1000_PSSR_CABLE_LENGTH 0x0380
|
||||
#define M88E1000_PSSR_SPEED 0xC000 /* Speed, bits 14:15 */
|
||||
#define M88E1000_PSSR_1000MBS 0x8000 /* 10=1000Mbs */
|
||||
|
||||
#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7
|
||||
|
||||
/* Number of times we will attempt to autonegotiate before downshifting if we
|
||||
* are the master
|
||||
*/
|
||||
#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00
|
||||
#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000
|
||||
/* Number of times we will attempt to autonegotiate before downshifting if we
|
||||
* are the slave
|
||||
*/
|
||||
#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300
|
||||
#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X 0x0100
|
||||
#define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */
|
||||
|
||||
/* M88EC018 Rev 2 specific DownShift settings */
|
||||
#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_MASK 0x0E00
|
||||
#define M88EC018_EPSCR_DOWNSHIFT_COUNTER_5X 0x0800
|
||||
|
||||
#define I82578_EPSCR_DOWNSHIFT_ENABLE 0x0020
|
||||
#define I82578_EPSCR_DOWNSHIFT_COUNTER_MASK 0x001C
|
||||
|
||||
/* BME1000 PHY Specific Control Register */
|
||||
#define BME1000_PSCR_ENABLE_DOWNSHIFT 0x0800 /* 1 = enable downshift */
|
||||
|
||||
/* Bits...
|
||||
* 15-5: page
|
||||
* 4-0: register offset
|
||||
*/
|
||||
#define GG82563_PAGE_SHIFT 5
|
||||
#define GG82563_REG(page, reg) \
|
||||
(((page) << GG82563_PAGE_SHIFT) | ((reg) & MAX_PHY_REG_ADDRESS))
|
||||
#define GG82563_MIN_ALT_REG 30
|
||||
|
||||
/* GG82563 Specific Registers */
|
||||
#define GG82563_PHY_SPEC_CTRL GG82563_REG(0, 16) /* PHY Spec Cntrl */
|
||||
#define GG82563_PHY_PAGE_SELECT GG82563_REG(0, 22) /* Page Select */
|
||||
#define GG82563_PHY_SPEC_CTRL_2 GG82563_REG(0, 26) /* PHY Spec Cntrl2 */
|
||||
#define GG82563_PHY_PAGE_SELECT_ALT GG82563_REG(0, 29) /* Alt Page Select */
|
||||
|
||||
/* MAC Specific Control Register */
|
||||
#define GG82563_PHY_MAC_SPEC_CTRL GG82563_REG(2, 21)
|
||||
|
||||
#define GG82563_PHY_DSP_DISTANCE GG82563_REG(5, 26) /* DSP Distance */
|
||||
|
||||
/* Page 193 - Port Control Registers */
|
||||
/* Kumeran Mode Control */
|
||||
#define GG82563_PHY_KMRN_MODE_CTRL GG82563_REG(193, 16)
|
||||
#define GG82563_PHY_PWR_MGMT_CTRL GG82563_REG(193, 20) /* Pwr Mgt Ctrl */
|
||||
|
||||
/* Page 194 - KMRN Registers */
|
||||
#define GG82563_PHY_INBAND_CTRL GG82563_REG(194, 18) /* Inband Ctrl */
|
||||
|
||||
/* MDI Control */
|
||||
#define E1000_MDIC_REG_MASK 0x001F0000
|
||||
#define E1000_MDIC_REG_SHIFT 16
|
||||
#define E1000_MDIC_PHY_SHIFT 21
|
||||
#define E1000_MDIC_OP_WRITE 0x04000000
|
||||
#define E1000_MDIC_OP_READ 0x08000000
|
||||
#define E1000_MDIC_READY 0x10000000
|
||||
#define E1000_MDIC_ERROR 0x40000000
|
||||
|
||||
/* SerDes Control */
|
||||
#define E1000_GEN_POLL_TIMEOUT 640
|
||||
|
||||
#endif /* _E1000E_DEFINES_H_ */
|
|
@ -1,76 +1,68 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
/* Linux PRO/1000 Ethernet Driver main header file */
|
||||
|
||||
#ifndef _E1000_H_
|
||||
#define _E1000_H_
|
||||
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/timer.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include <linux/if_vlan.h>
|
||||
#include "kcompat.h"
|
||||
#ifdef HAVE_HW_TIME_STAMP
|
||||
#include <linux/clocksource.h>
|
||||
#include <linux/net_tstamp.h>
|
||||
#endif
|
||||
#ifdef HAVE_PTP_1588_CLOCK
|
||||
#include <linux/ptp_clock_kernel.h>
|
||||
#include <linux/ptp_classify.h>
|
||||
#endif
|
||||
#include <linux/mii.h>
|
||||
#ifdef ETHTOOL_GEEE
|
||||
#include <linux/mdio.h>
|
||||
#endif
|
||||
#include "hw.h"
|
||||
|
||||
struct e1000_info;
|
||||
|
||||
#define e_printk(level, adapter, format, arg...) \
|
||||
printk(level "%s: %s: " format, pci_name(adapter->pdev), \
|
||||
(strchr(adapter->netdev->name, '%') ? "" : \
|
||||
adapter->netdev->name), ## arg)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define e_dbg(format, arg...) \
|
||||
e_printk(KERN_DEBUG, hw->adapter, format, ## arg)
|
||||
#else
|
||||
#define e_dbg(format, arg...) do { (void)(hw); } while (0)
|
||||
#endif
|
||||
|
||||
netdev_dbg(hw->adapter->netdev, format, ## arg)
|
||||
#define e_err(format, arg...) \
|
||||
e_printk(KERN_ERR, adapter, format, ## arg)
|
||||
netdev_err(adapter->netdev, format, ## arg)
|
||||
#define e_info(format, arg...) \
|
||||
e_printk(KERN_INFO, adapter, format, ## arg)
|
||||
netdev_info(adapter->netdev, format, ## arg)
|
||||
#define e_warn(format, arg...) \
|
||||
e_printk(KERN_WARNING, adapter, format, ## arg)
|
||||
netdev_warn(adapter->netdev, format, ## arg)
|
||||
#define e_notice(format, arg...) \
|
||||
e_printk(KERN_NOTICE, adapter, format, ## arg)
|
||||
netdev_notice(adapter->netdev, format, ## arg)
|
||||
|
||||
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
/* Interrupt modes, as used by the IntMode paramter */
|
||||
/* Interrupt modes, as used by the IntMode parameter */
|
||||
#define E1000E_INT_MODE_LEGACY 0
|
||||
#define E1000E_INT_MODE_MSI 1
|
||||
#define E1000E_INT_MODE_MSIX 2
|
||||
|
||||
#endif /* CONFIG_E1000E_MSIX */
|
||||
#ifndef CONFIG_E1000E_NAPI
|
||||
#define E1000_MAX_INTR 10
|
||||
|
||||
|
@ -87,9 +79,6 @@ struct e1000_info;
|
|||
#define E1000_MIN_ITR_USECS 10 /* 100000 irq/sec */
|
||||
#define E1000_MAX_ITR_USECS 10000 /* 100 irq/sec */
|
||||
|
||||
/* Early Receive defines */
|
||||
#define E1000_ERT_2048 0x100
|
||||
|
||||
#define E1000_FC_PAUSE_TIME 0x0680 /* 858 usec */
|
||||
|
||||
/* How many Tx Descriptors do we need to call netif_wake_queue ? */
|
||||
|
@ -101,27 +90,56 @@ struct e1000_info;
|
|||
|
||||
#define E1000_MNG_VLAN_NONE (-1)
|
||||
|
||||
/* Number of packet split data buffers (not including the header buffer) */
|
||||
#define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
|
||||
|
||||
#define DEFAULT_JUMBO 9234
|
||||
|
||||
/* Time to wait before putting the device into D3 if there's no link (in ms). */
|
||||
#define LINK_TIMEOUT 100
|
||||
|
||||
/* Count for polling __E1000_RESET condition every 10-20msec.
|
||||
* Experimentation has shown the reset can take approximately 210msec.
|
||||
*/
|
||||
#define E1000_CHECK_RESET_COUNT 25
|
||||
|
||||
#define DEFAULT_RDTR 0
|
||||
#define DEFAULT_RADV 8
|
||||
#define BURST_RDTR 0x20
|
||||
#define BURST_RADV 0x20
|
||||
|
||||
/* in the case of WTHRESH, it appears at least the 82571/2 hardware
|
||||
* writes back 4 descriptors when WTHRESH=5, and 3 descriptors when
|
||||
* WTHRESH=4, so a setting of 5 gives the most efficient bus
|
||||
* utilization but to avoid possible Tx stalls, set it to 1
|
||||
*/
|
||||
#define E1000_TXDCTL_DMA_BURST_ENABLE \
|
||||
(E1000_TXDCTL_GRAN | /* set descriptor granularity */ \
|
||||
E1000_TXDCTL_COUNT_DESC | \
|
||||
(1 << 16) | /* wthresh must be +1 more than desired */\
|
||||
(1 << 8) | /* hthresh */ \
|
||||
0x1f) /* pthresh */
|
||||
|
||||
#define E1000_RXDCTL_DMA_BURST_ENABLE \
|
||||
(0x01000000 | /* set descriptor granularity */ \
|
||||
(4 << 16) | /* set writeback threshold */ \
|
||||
(4 << 8) | /* set prefetch threshold */ \
|
||||
0x20) /* set hthresh */
|
||||
|
||||
#define E1000_TIDV_FPD (1 << 31)
|
||||
#define E1000_RDTR_FPD (1 << 31)
|
||||
|
||||
enum e1000_boards {
|
||||
board_82571,
|
||||
board_82572,
|
||||
board_82573,
|
||||
board_82574,
|
||||
board_82583,
|
||||
board_80003es2lan,
|
||||
board_ich8lan,
|
||||
board_ich9lan,
|
||||
board_ich10lan,
|
||||
board_pchlan,
|
||||
board_82583,
|
||||
};
|
||||
|
||||
struct e1000_queue_stats {
|
||||
u64 packets;
|
||||
u64 bytes;
|
||||
board_pch2lan,
|
||||
board_pch_lpt,
|
||||
board_pch_spt
|
||||
};
|
||||
|
||||
struct e1000_ps_page {
|
||||
|
@ -129,8 +147,7 @@ struct e1000_ps_page {
|
|||
u64 dma; /* must be u64 - written to hw */
|
||||
};
|
||||
|
||||
/*
|
||||
* wrappers around a pointer to a socket buffer,
|
||||
/* wrappers around a pointer to a socket buffer,
|
||||
* so a DMA handle can be stored along with the buffer
|
||||
*/
|
||||
struct e1000_buffer {
|
||||
|
@ -142,15 +159,21 @@ struct e1000_buffer {
|
|||
unsigned long time_stamp;
|
||||
u16 length;
|
||||
u16 next_to_watch;
|
||||
unsigned int segs;
|
||||
unsigned int bytecount;
|
||||
u16 mapped_as_page;
|
||||
};
|
||||
/* Rx */
|
||||
/* arrays of page information for packet split */
|
||||
struct e1000_ps_page *ps_pages;
|
||||
struct {
|
||||
/* arrays of page information for packet split */
|
||||
struct e1000_ps_page *ps_pages;
|
||||
struct page *page;
|
||||
};
|
||||
};
|
||||
struct page *page;
|
||||
};
|
||||
|
||||
struct e1000_ring {
|
||||
struct e1000_adapter *adapter; /* back pointer to adapter */
|
||||
void *desc; /* pointer to ring memory */
|
||||
dma_addr_t dma; /* phys address of ring */
|
||||
unsigned int size; /* length of ring in bytes */
|
||||
|
@ -159,23 +182,19 @@ struct e1000_ring {
|
|||
u16 next_to_use;
|
||||
u16 next_to_clean;
|
||||
|
||||
u16 head;
|
||||
u16 tail;
|
||||
void __iomem *head;
|
||||
void __iomem *tail;
|
||||
|
||||
/* array of buffer information structs */
|
||||
struct e1000_buffer *buffer_info;
|
||||
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
char name[IFNAMSIZ + 5];
|
||||
u32 ims_val;
|
||||
u32 itr_val;
|
||||
u16 itr_register;
|
||||
void __iomem *itr_register;
|
||||
int set_itr;
|
||||
|
||||
#endif /* CONFIG_E1000E_MSIX */
|
||||
struct sk_buff *rx_skb_top;
|
||||
|
||||
struct e1000_queue_stats stats;
|
||||
};
|
||||
|
||||
#ifdef SIOCGMIIPHY
|
||||
|
@ -203,7 +222,11 @@ struct e1000_adapter {
|
|||
|
||||
const struct e1000_info *ei;
|
||||
|
||||
#ifdef HAVE_VLAN_RX_REGISTER
|
||||
struct vlan_group *vlgrp;
|
||||
#else
|
||||
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
|
||||
#endif
|
||||
u32 bd_number;
|
||||
u32 rx_buffer_len;
|
||||
u16 mng_vlan_id;
|
||||
|
@ -220,21 +243,21 @@ struct e1000_adapter {
|
|||
u16 tx_itr;
|
||||
u16 rx_itr;
|
||||
|
||||
/*
|
||||
* Tx
|
||||
*/
|
||||
struct e1000_ring *tx_ring /* One per active queue */
|
||||
____cacheline_aligned_in_smp;
|
||||
/* Tx - one ring per active queue */
|
||||
struct e1000_ring *tx_ring ____cacheline_aligned_in_smp;
|
||||
u32 tx_fifo_limit;
|
||||
|
||||
#ifdef CONFIG_E1000E_NAPI
|
||||
struct napi_struct napi;
|
||||
#endif
|
||||
|
||||
unsigned long tx_queue_len;
|
||||
unsigned int uncorr_errors; /* uncorrectable ECC errors */
|
||||
unsigned int corr_errors; /* correctable ECC errors */
|
||||
unsigned int restart_queue;
|
||||
u32 txd_cmd;
|
||||
|
||||
bool detect_tx_hung;
|
||||
bool tx_hang_recheck;
|
||||
u8 tx_timeout_factor;
|
||||
|
||||
u32 tx_int_delay;
|
||||
|
@ -255,20 +278,17 @@ struct e1000_adapter {
|
|||
u32 tx_head_addr;
|
||||
u32 tx_fifo_size;
|
||||
u32 tx_dma_failed;
|
||||
u32 tx_hwtstamp_timeouts;
|
||||
|
||||
/*
|
||||
* Rx
|
||||
*/
|
||||
/* Rx */
|
||||
#ifdef CONFIG_E1000E_NAPI
|
||||
bool (*clean_rx) (struct e1000_adapter *adapter,
|
||||
int *work_done, int work_to_do)
|
||||
____cacheline_aligned_in_smp;
|
||||
bool (*clean_rx)(struct e1000_ring *ring, int *work_done,
|
||||
int work_to_do) ____cacheline_aligned_in_smp;
|
||||
#else
|
||||
bool (*clean_rx) (struct e1000_adapter *adapter)
|
||||
____cacheline_aligned_in_smp;
|
||||
bool (*clean_rx)(struct e1000_ring *ring) ____cacheline_aligned_in_smp;
|
||||
#endif
|
||||
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
|
||||
int cleaned_count);
|
||||
void (*alloc_rx_buf)(struct e1000_ring *ring, int cleaned_count,
|
||||
gfp_t gfp);
|
||||
struct e1000_ring *rx_ring;
|
||||
|
||||
u32 rx_int_delay;
|
||||
|
@ -282,6 +302,15 @@ struct e1000_adapter {
|
|||
u64 gorc_old;
|
||||
u32 alloc_rx_buff_failed;
|
||||
u32 rx_dma_failed;
|
||||
#ifdef HAVE_HW_TIME_STAMP
|
||||
u32 rx_hwtstamp_cleared;
|
||||
#endif
|
||||
#ifdef DYNAMIC_LTR_SUPPORT
|
||||
u64 c10_mpc_count; /* frequently updated MPC count */
|
||||
u64 c10_rx_bytes; /* frequently updated RX bytes count */
|
||||
u32 c10_pba_bytes; /* current PBA RXA converted to bytes*/
|
||||
bool c10_demote_ltr; /* is/should LTR be demoted */
|
||||
#endif /* DYNAMIC_LTR_SUPPORT */
|
||||
|
||||
unsigned int rx_ps_pages;
|
||||
u16 rx_ps_bsize0;
|
||||
|
@ -294,11 +323,16 @@ struct e1000_adapter {
|
|||
/* OS defined structs */
|
||||
struct net_device *netdev;
|
||||
struct pci_dev *pdev;
|
||||
#ifndef HAVE_NETDEV_STATS_IN_NETDEV
|
||||
struct net_device_stats net_stats;
|
||||
#endif
|
||||
|
||||
/* structs defined in e1000_hw.h */
|
||||
struct e1000_hw hw;
|
||||
|
||||
#ifdef HAVE_NDO_GET_STATS64
|
||||
spinlock_t stats64_lock; /* protects statistics counters */
|
||||
#endif
|
||||
struct e1000_hw_stats stats;
|
||||
struct e1000_phy_info phy_info;
|
||||
struct e1000_phy_stats phy_stats;
|
||||
|
@ -313,11 +347,10 @@ struct e1000_adapter {
|
|||
u32 test_icr;
|
||||
|
||||
u32 msg_enable;
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
unsigned int num_vectors;
|
||||
struct msix_entry *msix_entries;
|
||||
int int_mode;
|
||||
u32 eiac_mask;
|
||||
#endif /* CONFIG_E1000E_MSIX */
|
||||
|
||||
u32 eeprom_wol;
|
||||
u32 wol;
|
||||
|
@ -326,20 +359,52 @@ struct e1000_adapter {
|
|||
|
||||
bool fc_autoneg;
|
||||
|
||||
#ifndef HAVE_ETHTOOL_SET_PHYS_ID
|
||||
unsigned long led_status;
|
||||
|
||||
#endif
|
||||
unsigned int flags;
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
unsigned int flags1;
|
||||
enum {
|
||||
hw_hang_on_unknown = 0,
|
||||
hw_hang_on_tso
|
||||
} hw_hang_reason;
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
|
||||
unsigned int flags2;
|
||||
struct work_struct downshift_task;
|
||||
struct work_struct update_phy_task;
|
||||
#ifndef HAVE_ETHTOOL_SET_PHYS_ID
|
||||
struct work_struct led_blink_task;
|
||||
#endif
|
||||
struct work_struct print_hang_task;
|
||||
u32 *config_space;
|
||||
|
||||
bool discarding;
|
||||
int node; /* store the node to allocate memory on */
|
||||
int phy_hang_count;
|
||||
|
||||
u16 tx_ring_count;
|
||||
u16 rx_ring_count;
|
||||
u8 revision_id;
|
||||
|
||||
#ifdef HAVE_HW_TIME_STAMP
|
||||
struct hwtstamp_config hwtstamp_config;
|
||||
struct delayed_work systim_overflow_work;
|
||||
struct sk_buff *tx_hwtstamp_skb;
|
||||
unsigned long tx_hwtstamp_start;
|
||||
struct work_struct tx_hwtstamp_work;
|
||||
spinlock_t systim_lock; /* protects SYSTIML/H regsters */
|
||||
struct cyclecounter cc;
|
||||
struct timecounter tc;
|
||||
#endif
|
||||
#ifdef HAVE_PTP_1588_CLOCK
|
||||
struct ptp_clock *ptp_clock;
|
||||
struct ptp_clock_info ptp_clock_info;
|
||||
#endif
|
||||
|
||||
u16 eee_advert;
|
||||
};
|
||||
|
||||
struct e1000_info {
|
||||
|
@ -349,26 +414,67 @@ struct e1000_info {
|
|||
u32 pba;
|
||||
u32 max_hw_frame_size;
|
||||
s32 (*get_variants)(struct e1000_adapter *);
|
||||
void (*init_ops)(struct e1000_hw *);
|
||||
const struct e1000_mac_operations *mac_ops;
|
||||
const struct e1000_phy_operations *phy_ops;
|
||||
const struct e1000_nvm_operations *nvm_ops;
|
||||
};
|
||||
|
||||
#ifdef HAVE_HW_TIME_STAMP
|
||||
#ifdef HAVE_PTP_1588_CLOCK
|
||||
s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca);
|
||||
#endif
|
||||
|
||||
/* The system time is maintained by a 64-bit counter comprised of the 32-bit
|
||||
* SYSTIMH and SYSTIML registers. How the counter increments (and therefore
|
||||
* its resolution) is based on the contents of the TIMINCA register - it
|
||||
* increments every incperiod (bits 31:24) clock ticks by incvalue (bits 23:0).
|
||||
* For the best accuracy, the incperiod should be as small as possible. The
|
||||
* incvalue is scaled by a factor as large as possible (while still fitting
|
||||
* in bits 23:0) so that relatively small clock corrections can be made.
|
||||
*
|
||||
* As a result, a shift of INCVALUE_SHIFT_n is used to fit a value of
|
||||
* INCVALUE_n into the TIMINCA register allowing 32+8+(24-INCVALUE_SHIFT_n)
|
||||
* bits to count nanoseconds leaving the rest for fractional nonseconds.
|
||||
*/
|
||||
#define INCVALUE_96MHz 125
|
||||
#define INCVALUE_SHIFT_96MHz 17
|
||||
#define INCPERIOD_SHIFT_96MHz 2
|
||||
#define INCPERIOD_96MHz (12 >> INCPERIOD_SHIFT_96MHz)
|
||||
|
||||
#define INCVALUE_25MHz 40
|
||||
#define INCVALUE_SHIFT_25MHz 18
|
||||
#define INCPERIOD_25MHz 1
|
||||
|
||||
/* Another drawback of scaling the incvalue by a large factor is the
|
||||
* 64-bit SYSTIM register overflows more quickly. This is dealt with
|
||||
* by simply reading the clock before it overflows.
|
||||
*
|
||||
* Clock ns bits Overflows after
|
||||
* ~~~~~~ ~~~~~~~ ~~~~~~~~~~~~~~~
|
||||
* 96MHz 47-bit 2^(47-INCPERIOD_SHIFT_96MHz) / 10^9 / 3600 = 9.77 hrs
|
||||
* 25MHz 46-bit 2^46 / 10^9 / 3600 = 19.55 hours
|
||||
*/
|
||||
#define E1000_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 60 * 4)
|
||||
#define E1000_MAX_82574_SYSTIM_REREADS 50
|
||||
#define E1000_82574_SYSTIM_EPSILON (1ULL << 35ULL)
|
||||
#endif /* HAVE_HW_TIME_STAMP */
|
||||
|
||||
/* hardware capability, feature, and workaround flags */
|
||||
#define FLAG_HAS_AMT (1 << 0)
|
||||
#define FLAG_HAS_FLASH (1 << 1)
|
||||
#define FLAG_HAS_HW_VLAN_FILTER (1 << 2)
|
||||
#define FLAG_HAS_WOL (1 << 3)
|
||||
#define FLAG_HAS_ERT (1 << 4)
|
||||
/* reserved bit4 */
|
||||
#define FLAG_HAS_CTRLEXT_ON_LOAD (1 << 5)
|
||||
#define FLAG_HAS_SWSM_ON_LOAD (1 << 6)
|
||||
#define FLAG_HAS_JUMBO_FRAMES (1 << 7)
|
||||
/* reserved bit8 */
|
||||
#define FLAG_IS_ICH (1 << 9)
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
#define FLAG_HAS_MSIX (1 << 10)
|
||||
#endif
|
||||
#define FLAG_HAS_SMART_POWER_DOWN (1 << 11)
|
||||
#define FLAG_IS_QUAD_PORT_A (1 << 12)
|
||||
#define FLAG_IS_QUAD_PORT (1 << 13)
|
||||
#define FLAG_TIPG_MEDIUM_FOR_80003ESLAN (1 << 14)
|
||||
#define FLAG_HAS_HW_TIMESTAMP (1 << 14)
|
||||
#define FLAG_APME_IN_WUC (1 << 15)
|
||||
#define FLAG_APME_IN_CTRL3 (1 << 16)
|
||||
#define FLAG_APME_CHECK_PORT_B (1 << 17)
|
||||
|
@ -382,29 +488,55 @@ struct e1000_info {
|
|||
#define FLAG_LSC_GIG_SPEED_DROP (1 << 25)
|
||||
#define FLAG_SMART_POWER_DOWN (1 << 26)
|
||||
#define FLAG_MSI_ENABLED (1 << 27)
|
||||
#ifndef HAVE_NDO_SET_FEATURES
|
||||
#define FLAG_RX_CSUM_ENABLED (1 << 28)
|
||||
#else
|
||||
/* reserved (1 << 28) */
|
||||
#endif
|
||||
#define FLAG_TSO_FORCE (1 << 29)
|
||||
#define FLAG_RX_RESTART_NOW (1 << 30)
|
||||
#define FLAG_RESTART_NOW (1 << 30)
|
||||
#define FLAG_MSI_TEST_FAILED (1 << 31)
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
#define FLAG_READ_ONLY_NVM (1 << 0)
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
|
||||
/* CRC Stripping defines */
|
||||
#define FLAG2_CRC_STRIPPING (1 << 0)
|
||||
#define FLAG2_HAS_PHY_WAKEUP (1 << 1)
|
||||
#define FLAG2_IS_DISCARDING (1 << 2)
|
||||
#define FLAG2_DISABLE_ASPM_L1 (1 << 3)
|
||||
#define FLAG2_HAS_PHY_STATS (1 << 4)
|
||||
#define FLAG2_HAS_EEE (1 << 5)
|
||||
#ifdef __VMKLNX__
|
||||
/* DMA burst in VMKlinux always introduce performance issue, even if
|
||||
* it's threshold is reduced to 1 a slight performance regression is
|
||||
* still observed. Disable it totally in VMKLinux.
|
||||
*/
|
||||
#define FLAG2_DMA_BURST 0
|
||||
#else
|
||||
#define FLAG2_DMA_BURST (1 << 6)
|
||||
#endif /* __VMKLNX__ */
|
||||
#define FLAG2_DISABLE_ASPM_L0S (1 << 7)
|
||||
#define FLAG2_DISABLE_AIM (1 << 8)
|
||||
#define FLAG2_CHECK_PHY_HANG (1 << 9)
|
||||
#define FLAG2_NO_DISABLE_RX (1 << 10)
|
||||
#define FLAG2_PCIM2PCI_ARBITER_WA (1 << 11)
|
||||
#define FLAG2_DFLT_CRC_STRIPPING (1 << 12)
|
||||
#define FLAG2_CHECK_RX_HWTSTAMP (1 << 13)
|
||||
|
||||
#define E1000_RX_DESC_PS(R, i) \
|
||||
(&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
|
||||
#define E1000_RX_DESC_EXT(R, i) \
|
||||
(&(((union e1000_rx_desc_extended *)((R).desc))[i]))
|
||||
#define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
|
||||
#define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc)
|
||||
#define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc)
|
||||
#define E1000_CONTEXT_DESC(R, i) E1000_GET_DESC(R, i, e1000_context_desc)
|
||||
|
||||
enum e1000_state_t {
|
||||
__E1000_OBFF_DISABLED,
|
||||
__E1000_TESTING,
|
||||
__E1000_RESETTING,
|
||||
__E1000_ACCESS_SHARED_RESOURCE,
|
||||
__E1000_DOWN
|
||||
};
|
||||
|
||||
|
@ -420,184 +552,95 @@ extern const char e1000e_driver_version[];
|
|||
|
||||
extern void e1000e_check_options(struct e1000_adapter *adapter);
|
||||
extern void e1000e_set_ethtool_ops(struct net_device *netdev);
|
||||
#ifndef HAVE_ETHTOOL_SET_PHYS_ID
|
||||
extern void e1000e_led_blink_task(struct work_struct *work);
|
||||
#endif
|
||||
#ifdef ETHTOOL_OPS_COMPAT
|
||||
extern int ethtool_ioctl(struct ifreq *ifr);
|
||||
#endif
|
||||
|
||||
extern int e1000e_up(struct e1000_adapter *adapter);
|
||||
extern void e1000e_down(struct e1000_adapter *adapter);
|
||||
extern void e1000e_down(struct e1000_adapter *adapter, bool reset);
|
||||
extern void e1000e_reinit_locked(struct e1000_adapter *adapter);
|
||||
extern void e1000e_reset(struct e1000_adapter *adapter);
|
||||
extern void e1000e_power_up_phy(struct e1000_adapter *adapter);
|
||||
extern int e1000e_setup_rx_resources(struct e1000_adapter *adapter);
|
||||
extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
|
||||
extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
|
||||
extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
|
||||
extern int e1000e_setup_rx_resources(struct e1000_ring *ring);
|
||||
extern int e1000e_setup_tx_resources(struct e1000_ring *ring);
|
||||
extern void e1000e_free_rx_resources(struct e1000_ring *ring);
|
||||
extern void e1000e_free_tx_resources(struct e1000_ring *ring);
|
||||
#ifdef HAVE_NDO_GET_STATS64
|
||||
extern struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
|
||||
struct rtnl_link_stats64
|
||||
*stats);
|
||||
#else /* HAVE_NDO_GET_STATS64 */
|
||||
extern void e1000e_update_stats(struct e1000_adapter *adapter);
|
||||
extern bool e1000_has_link(struct e1000_adapter *adapter);
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
#endif /* HAVE_NDO_GET_STATS64 */
|
||||
extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
|
||||
extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
|
||||
#endif
|
||||
extern void e1000e_get_hw_control(struct e1000_adapter *adapter);
|
||||
extern void e1000e_release_hw_control(struct e1000_adapter *adapter);
|
||||
extern void e1000e_write_itr(struct e1000_adapter *adapter, u32 itr);
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
#ifdef __VMKLNX__
|
||||
extern void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw);
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
#endif /* __VMKLNX__ */
|
||||
extern unsigned int copybreak;
|
||||
|
||||
extern void e1000_init_function_pointers_82571(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw);
|
||||
extern const struct e1000_info e1000_82571_info;
|
||||
extern const struct e1000_info e1000_82572_info;
|
||||
extern const struct e1000_info e1000_82573_info;
|
||||
extern const struct e1000_info e1000_82574_info;
|
||||
extern const struct e1000_info e1000_82583_info;
|
||||
extern const struct e1000_info e1000_ich8_info;
|
||||
extern const struct e1000_info e1000_ich9_info;
|
||||
extern const struct e1000_info e1000_ich10_info;
|
||||
extern const struct e1000_info e1000_pch_info;
|
||||
extern const struct e1000_info e1000_pch2_info;
|
||||
extern const struct e1000_info e1000_pch_lpt_info;
|
||||
extern const struct e1000_info e1000_pch_spt_info;
|
||||
extern const struct e1000_info e1000_es2_info;
|
||||
|
||||
extern s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num);
|
||||
|
||||
static inline s32 e1000e_commit_phy(struct e1000_hw *hw)
|
||||
{
|
||||
if (hw->phy.ops.commit)
|
||||
return hw->phy.ops.commit(hw);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw);
|
||||
|
||||
extern bool e1000e_get_laa_state_82571(struct e1000_hw *hw);
|
||||
extern void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state);
|
||||
|
||||
extern void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
|
||||
bool state);
|
||||
extern void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
|
||||
extern void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
|
||||
extern void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw);
|
||||
|
||||
extern s32 e1000e_check_for_copper_link(struct e1000_hw *hw);
|
||||
extern s32 e1000e_check_for_fiber_link(struct e1000_hw *hw);
|
||||
extern s32 e1000e_check_for_serdes_link(struct e1000_hw *hw);
|
||||
extern s32 e1000e_cleanup_led_generic(struct e1000_hw *hw);
|
||||
extern s32 e1000e_led_on_generic(struct e1000_hw *hw);
|
||||
extern s32 e1000e_led_off_generic(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex);
|
||||
extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
|
||||
extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_auto_rd_done(struct e1000_hw *hw);
|
||||
extern s32 e1000e_id_led_init(struct e1000_hw *hw);
|
||||
extern void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
|
||||
extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
|
||||
extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
|
||||
extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
|
||||
extern s32 e1000e_setup_link(struct e1000_hw *hw);
|
||||
static inline void e1000e_clear_vfta(struct e1000_hw *hw)
|
||||
{
|
||||
hw->mac.ops.clear_vfta(hw);
|
||||
}
|
||||
extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
|
||||
extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list,
|
||||
u32 mc_addr_count);
|
||||
extern void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
|
||||
extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
|
||||
extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
|
||||
extern s32 e1000e_get_hw_semaphore(struct e1000_hw *hw);
|
||||
extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
|
||||
extern void e1000e_config_collision_dist(struct e1000_hw *hw);
|
||||
extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
|
||||
extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
|
||||
extern s32 e1000e_blink_led(struct e1000_hw *hw);
|
||||
extern void e1000e_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
|
||||
static inline void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
|
||||
{
|
||||
if (hw->mac.ops.write_vfta)
|
||||
hw->mac.ops.write_vfta(hw, offset, value);
|
||||
}
|
||||
extern void e1000e_reset_adaptive(struct e1000_hw *hw);
|
||||
extern void e1000e_update_adaptive(struct e1000_hw *hw);
|
||||
|
||||
extern s32 e1000e_setup_copper_link(struct e1000_hw *hw);
|
||||
extern void e1000e_put_hw_semaphore(struct e1000_hw *hw);
|
||||
extern s32 e1000e_check_reset_block_generic(struct e1000_hw *hw);
|
||||
extern s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_phy_info_igp(struct e1000_hw *hw);
|
||||
extern s32 e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
extern s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw);
|
||||
extern s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active);
|
||||
extern s32 e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
extern s32 e1000e_phy_sw_reset(struct e1000_hw *hw);
|
||||
extern s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_cfg_done(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_cable_length_m88(struct e1000_hw *hw);
|
||||
extern s32 e1000e_get_phy_info_m88(struct e1000_hw *hw);
|
||||
extern s32 e1000e_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
extern s32 e1000e_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
extern enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id);
|
||||
extern s32 e1000e_determine_phy_address(struct e1000_hw *hw);
|
||||
extern s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
extern s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
extern void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
|
||||
extern s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
extern s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
|
||||
u32 usec_interval, bool *success);
|
||||
extern s32 e1000e_phy_reset_dsp(struct e1000_hw *hw);
|
||||
extern s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
extern s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
extern s32 e1000e_check_downshift(struct e1000_hw *hw);
|
||||
#ifdef HAVE_PTP_1588_CLOCK
|
||||
extern void e1000e_ptp_init(struct e1000_adapter *adapter);
|
||||
extern void e1000e_ptp_remove(struct e1000_adapter *adapter);
|
||||
#else
|
||||
#define e1000e_ptp_init(adapter) do {} while (0)
|
||||
#define e1000e_ptp_remove(adapter) do {} while (0)
|
||||
#endif
|
||||
|
||||
static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
|
||||
{
|
||||
if (hw->phy.ops.reset)
|
||||
return hw->phy.ops.reset(hw);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
|
||||
{
|
||||
if (hw->phy.ops.check_reset_block)
|
||||
return hw->phy.ops.check_reset_block(hw);
|
||||
|
||||
return 0;
|
||||
return hw->phy.ops.reset(hw);
|
||||
}
|
||||
|
||||
static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
{
|
||||
if (hw->phy.ops.read_reg)
|
||||
return hw->phy.ops.read_reg(hw, offset, data);
|
||||
return hw->phy.ops.read_reg(hw, offset, data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
static inline s32 e1e_rphy_locked(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
{
|
||||
return hw->phy.ops.read_reg_locked(hw, offset, data);
|
||||
}
|
||||
|
||||
static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
{
|
||||
if (hw->phy.ops.write_reg)
|
||||
return hw->phy.ops.write_reg(hw, offset, data);
|
||||
|
||||
return 0;
|
||||
return hw->phy.ops.write_reg(hw, offset, data);
|
||||
}
|
||||
|
||||
static inline s32 e1000_get_cable_length(struct e1000_hw *hw)
|
||||
static inline s32 e1e_wphy_locked(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
{
|
||||
if (hw->phy.ops.get_cable_length)
|
||||
return hw->phy.ops.get_cable_length(hw);
|
||||
|
||||
return 0;
|
||||
return hw->phy.ops.write_reg_locked(hw, offset, data);
|
||||
}
|
||||
|
||||
extern s32 e1000e_acquire_nvm(struct e1000_hw *hw);
|
||||
extern s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
extern s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
extern s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
|
||||
extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
extern void e1000e_release_nvm(struct e1000_hw *hw);
|
||||
extern void e1000e_reload_nvm_generic(struct e1000_hw *hw);
|
||||
|
||||
static inline s32 e1000e_read_mac_addr(struct e1000_hw *hw)
|
||||
{
|
||||
if (hw->mac.ops.read_mac_addr)
|
||||
return hw->mac.ops.read_mac_addr(hw);
|
||||
if (hw->mac.ops.read_mac_addr)
|
||||
return hw->mac.ops.read_mac_addr(hw);
|
||||
|
||||
return e1000e_read_mac_addr_generic(hw);
|
||||
return e1000_read_mac_addr_generic(hw);
|
||||
}
|
||||
|
||||
static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
|
||||
|
@ -610,78 +653,68 @@ static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw)
|
|||
return hw->nvm.ops.update(hw);
|
||||
}
|
||||
|
||||
static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data)
|
||||
{
|
||||
return hw->nvm.ops.read(hw, offset, words, data);
|
||||
}
|
||||
|
||||
static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data)
|
||||
{
|
||||
return hw->nvm.ops.write(hw, offset, words, data);
|
||||
}
|
||||
|
||||
static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
|
||||
{
|
||||
if (hw->phy.ops.get_info)
|
||||
return hw->phy.ops.get_info(hw);
|
||||
|
||||
return 0;
|
||||
return hw->phy.ops.get_info(hw);
|
||||
}
|
||||
|
||||
extern bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
||||
extern s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
|
||||
|
||||
static inline u32 __er32(struct e1000_hw *hw, unsigned long reg)
|
||||
{
|
||||
return readl(hw->hw_addr + reg);
|
||||
}
|
||||
|
||||
#define er32(reg) __er32(hw, E1000_##reg)
|
||||
|
||||
/**
|
||||
* __ew32_prepare - prepare to write to MAC CSR register on certain parts
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* When updating the MAC CSR registers, the Manageability Engine (ME) could
|
||||
* be accessing the registers at the same time. Normally, this is handled in
|
||||
* h/w by an arbiter but on some parts there is a bug that acknowledges Host
|
||||
* accesses later than it should which could result in the register to have
|
||||
* an incorrect value. Workaround this by checking the FWSM register which
|
||||
* has bit 24 set while ME is accessing MAC CSR registers, wait if it is set
|
||||
* and try again a number of times.
|
||||
**/
|
||||
static inline s32 __ew32_prepare(struct e1000_hw *hw)
|
||||
{
|
||||
s32 i = E1000_ICH_FWSM_PCIM2PCI_COUNT;
|
||||
|
||||
while ((er32(FWSM) & E1000_ICH_FWSM_PCIM2PCI) && --i)
|
||||
udelay(50);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static inline void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val)
|
||||
{
|
||||
if (hw->adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
|
||||
__ew32_prepare(hw);
|
||||
|
||||
writel(val, hw->hw_addr + reg);
|
||||
}
|
||||
|
||||
#define er32(reg) __er32(hw, E1000_##reg)
|
||||
#define ew32(reg, val) __ew32(hw, E1000_##reg, (val))
|
||||
|
||||
#define e1e_flush() er32(STATUS)
|
||||
|
||||
#define E1000_WRITE_REG(a, reg, value) ( \
|
||||
writel((value), ((a)->hw_addr + reg)))
|
||||
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \
|
||||
(__ew32((a), (reg + ((offset) << 2)), (value)))
|
||||
|
||||
#define E1000_READ_REG(a, reg) (readl((a)->hw_addr + reg))
|
||||
|
||||
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
|
||||
writel((value), ((a)->hw_addr + reg + ((offset) << 2))))
|
||||
|
||||
#define E1000_READ_REG_ARRAY(a, reg, offset) ( \
|
||||
readl((a)->hw_addr + reg + ((offset) << 2)))
|
||||
|
||||
#define E1000_READ_REG_ARRAY_DWORD E1000_READ_REG_ARRAY
|
||||
#define E1000_WRITE_REG_ARRAY_DWORD E1000_WRITE_REG_ARRAY
|
||||
|
||||
static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
|
||||
{
|
||||
return readw(hw->flash_address + reg);
|
||||
}
|
||||
|
||||
static inline u32 __er32flash(struct e1000_hw *hw, unsigned long reg)
|
||||
{
|
||||
return readl(hw->flash_address + reg);
|
||||
}
|
||||
|
||||
static inline void __ew16flash(struct e1000_hw *hw, unsigned long reg, u16 val)
|
||||
{
|
||||
writew(val, hw->flash_address + reg);
|
||||
}
|
||||
|
||||
static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
|
||||
{
|
||||
writel(val, hw->flash_address + reg);
|
||||
}
|
||||
|
||||
#define er16flash(reg) __er16flash(hw, (reg))
|
||||
#define er32flash(reg) __er32flash(hw, (reg))
|
||||
#define ew16flash(reg, val) __ew16flash(hw, (reg), (val))
|
||||
#define ew32flash(reg, val) __ew32flash(hw, (reg), (val))
|
||||
#define E1000_READ_REG_ARRAY(a, reg, offset) \
|
||||
(readl((a)->hw_addr + reg + ((offset) << 2)))
|
||||
|
||||
#endif /* _E1000_H_ */
|
||||
|
|
|
@ -1,98 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_80003ES2LAN_H_
|
||||
#define _E1000_80003ES2LAN_H_
|
||||
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL 0x02
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL 0x10
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE 0x1F
|
||||
|
||||
#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS 0x0008
|
||||
#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS 0x0800
|
||||
#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING 0x0010
|
||||
|
||||
#define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT 0x0004
|
||||
#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000
|
||||
#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000
|
||||
|
||||
#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C
|
||||
#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004
|
||||
|
||||
#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */
|
||||
#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000
|
||||
|
||||
#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8
|
||||
#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN 0x9
|
||||
|
||||
/* GG82563 PHY Specific Status Register (Page 0, Register 16 */
|
||||
#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE 0x0002 /* 1=Reversal Disabled */
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_MASK 0x0060
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_MDI 0x0000 /* 00=Manual MDI */
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_MDIX 0x0020 /* 01=Manual MDIX */
|
||||
#define GG82563_PSCR_CROSSOVER_MODE_AUTO 0x0060 /* 11=Auto crossover */
|
||||
|
||||
/* PHY Specific Control Register 2 (Page 0, Register 26) */
|
||||
#define GG82563_PSCR2_REVERSE_AUTO_NEG 0x2000
|
||||
/* 1=Reverse Auto-Negotiation */
|
||||
|
||||
/* MAC Specific Control Register (Page 2, Register 21) */
|
||||
/* Tx clock speed for Link Down and 1000BASE-T for the following speeds */
|
||||
#define GG82563_MSCR_TX_CLK_MASK 0x0007
|
||||
#define GG82563_MSCR_TX_CLK_10MBPS_2_5 0x0004
|
||||
#define GG82563_MSCR_TX_CLK_100MBPS_25 0x0005
|
||||
#define GG82563_MSCR_TX_CLK_1000MBPS_2_5 0x0006
|
||||
#define GG82563_MSCR_TX_CLK_1000MBPS_25 0x0007
|
||||
|
||||
#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */
|
||||
|
||||
/* DSP Distance Register (Page 5, Register 26) */
|
||||
/*
|
||||
* 0 = <50M
|
||||
* 1 = 50-80M
|
||||
* 2 = 80-100M
|
||||
* 3 = 110-140M
|
||||
* 4 = >140M
|
||||
*/
|
||||
#define GG82563_DSPD_CABLE_LENGTH 0x0007
|
||||
|
||||
/* Kumeran Mode Control Register (Page 193, Register 16) */
|
||||
#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
|
||||
|
||||
/* Max number of times Kumeran read/write should be validated */
|
||||
#define GG82563_MAX_KMRN_RETRY 0x5
|
||||
|
||||
/* Power Management Control Register (Page 193, Register 20) */
|
||||
#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE 0x0001
|
||||
/* 1=Enable SERDES Electrical Idle */
|
||||
|
||||
/* In-Band Control Register (Page 194, Register 18) */
|
||||
#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */
|
||||
|
||||
#endif
|
|
@ -1,53 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_82571_H_
|
||||
#define _E1000_82571_H_
|
||||
|
||||
#define ID_LED_RESERVED_F746 0xF746
|
||||
#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \
|
||||
(ID_LED_OFF1_ON2 << 8) | \
|
||||
(ID_LED_DEF1_DEF2 << 4) | \
|
||||
(ID_LED_DEF1_DEF2))
|
||||
|
||||
#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
|
||||
|
||||
/* Intr Throttling - RW */
|
||||
#define E1000_EITR_82574(_n) (0x000E8 + (0x4 * (_n)))
|
||||
|
||||
#define E1000_EIAC_82574 0x000DC /* Ext. Interrupt Auto Clear - RW */
|
||||
#define E1000_EIAC_MASK_82574 0x01F00000
|
||||
|
||||
#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
|
||||
|
||||
#define E1000_RXCFGL 0x0B634 /* TimeSync Rx EtherType & Msg Type Reg - RW */
|
||||
|
||||
bool e1000e_get_laa_state_82571(struct e1000_hw *hw);
|
||||
void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state);
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,197 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_ICH8LAN_H_
|
||||
#define _E1000_ICH8LAN_H_
|
||||
|
||||
#define ICH_FLASH_GFPREG 0x0000
|
||||
#define ICH_FLASH_HSFSTS 0x0004
|
||||
#define ICH_FLASH_HSFCTL 0x0006
|
||||
#define ICH_FLASH_FADDR 0x0008
|
||||
#define ICH_FLASH_FDATA0 0x0010
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
#define ICH_FLASH_PR0 0x0074
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
|
||||
/* Requires up to 10 seconds when MNG might be accessing part. */
|
||||
#define ICH_FLASH_READ_COMMAND_TIMEOUT 10000000
|
||||
#define ICH_FLASH_WRITE_COMMAND_TIMEOUT 10000000
|
||||
#define ICH_FLASH_ERASE_COMMAND_TIMEOUT 10000000
|
||||
#define ICH_FLASH_LINEAR_ADDR_MASK 0x00FFFFFF
|
||||
#define ICH_FLASH_CYCLE_REPEAT_COUNT 10
|
||||
|
||||
#define ICH_CYCLE_READ 0
|
||||
#define ICH_CYCLE_WRITE 2
|
||||
#define ICH_CYCLE_ERASE 3
|
||||
|
||||
#define FLASH_GFPREG_BASE_MASK 0x1FFF
|
||||
#define FLASH_SECTOR_ADDR_SHIFT 12
|
||||
|
||||
#define ICH_FLASH_SEG_SIZE_256 256
|
||||
#define ICH_FLASH_SEG_SIZE_4K 4096
|
||||
#define ICH_FLASH_SEG_SIZE_8K 8192
|
||||
#define ICH_FLASH_SEG_SIZE_64K 65536
|
||||
#define ICH_FLASH_SECTOR_SIZE 4096
|
||||
|
||||
#define ICH_FLASH_REG_MAPSIZE 0x00A0
|
||||
|
||||
#define E1000_ICH_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI Reset */
|
||||
#define E1000_ICH_FWSM_DISSW 0x10000000 /* FW Disables SW Writes */
|
||||
/* FW established a valid mode */
|
||||
#define E1000_ICH_FWSM_FW_VALID 0x00008000
|
||||
|
||||
#define E1000_ICH_MNG_IAMT_MODE 0x2
|
||||
|
||||
#define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \
|
||||
(ID_LED_OFF1_OFF2 << 8) | \
|
||||
(ID_LED_OFF1_ON2 << 4) | \
|
||||
(ID_LED_DEF1_DEF2))
|
||||
|
||||
#define E1000_ICH_NVM_SIG_WORD 0x13
|
||||
#define E1000_ICH_NVM_SIG_MASK 0xC000
|
||||
#define E1000_ICH_NVM_VALID_SIG_MASK 0xC0
|
||||
#define E1000_ICH_NVM_SIG_VALUE 0x80
|
||||
|
||||
#define E1000_ICH8_LAN_INIT_TIMEOUT 1500
|
||||
|
||||
#define E1000_FEXTNVM_SW_CONFIG 1
|
||||
#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M */
|
||||
|
||||
#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
|
||||
|
||||
#define E1000_ICH_RAR_ENTRIES 7
|
||||
|
||||
#define PHY_PAGE_SHIFT 5
|
||||
#define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \
|
||||
((reg) & MAX_PHY_REG_ADDRESS))
|
||||
#define IGP3_KMRN_DIAG PHY_REG(770, 19) /* KMRN Diagnostic */
|
||||
#define IGP3_VR_CTRL PHY_REG(776, 18) /* Voltage Regulator Control */
|
||||
#define IGP3_CAPABILITY PHY_REG(776, 19) /* Capability */
|
||||
#define IGP3_PM_CTRL PHY_REG(769, 20) /* Power Management Control */
|
||||
|
||||
#define IGP3_KMRN_DIAG_PCS_LOCK_LOSS 0x0002
|
||||
#define IGP3_VR_CTRL_DEV_POWERDOWN_MODE_MASK 0x0300
|
||||
#define IGP3_VR_CTRL_MODE_SHUTDOWN 0x0200
|
||||
#define IGP3_PM_CTRL_FORCE_PWR_DOWN 0x0020
|
||||
|
||||
/* PHY Wakeup Registers and defines */
|
||||
#define BM_RCTL PHY_REG(BM_WUC_PAGE, 0)
|
||||
#define BM_WUC PHY_REG(BM_WUC_PAGE, 1)
|
||||
#define BM_WUFC PHY_REG(BM_WUC_PAGE, 2)
|
||||
#define BM_WUS PHY_REG(BM_WUC_PAGE, 3)
|
||||
#define BM_RAR_L(_i) (BM_PHY_REG(BM_WUC_PAGE, 16 + ((_i) << 2)))
|
||||
#define BM_RAR_M(_i) (BM_PHY_REG(BM_WUC_PAGE, 17 + ((_i) << 2)))
|
||||
#define BM_RAR_H(_i) (BM_PHY_REG(BM_WUC_PAGE, 18 + ((_i) << 2)))
|
||||
#define BM_RAR_CTRL(_i) (BM_PHY_REG(BM_WUC_PAGE, 19 + ((_i) << 2)))
|
||||
#define BM_MTA(_i) (BM_PHY_REG(BM_WUC_PAGE, 128 + ((_i) << 1)))
|
||||
|
||||
#define BM_RCTL_UPE 0x0001 /* Unicast Promiscuous Mode */
|
||||
#define BM_RCTL_MPE 0x0002 /* Multicast Promiscuous Mode */
|
||||
#define BM_RCTL_MO_SHIFT 3 /* Multicast Offset Shift */
|
||||
#define BM_RCTL_MO_MASK (3 << 3) /* Multicast Offset Mask */
|
||||
#define BM_RCTL_BAM 0x0020 /* Broadcast Accept Mode */
|
||||
#define BM_RCTL_PMCF 0x0040 /* Pass MAC Control Frames */
|
||||
#define BM_RCTL_RFCE 0x0080 /* Rx Flow Control Enable */
|
||||
|
||||
#define HV_LED_CONFIG PHY_REG(768, 30) /* LED Configuration */
|
||||
#define HV_MUX_DATA_CTRL PHY_REG(776, 16)
|
||||
#define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400
|
||||
#define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004
|
||||
#define HV_SCC_UPPER PHY_REG(778, 16) /* Single Collision Count */
|
||||
#define HV_SCC_LOWER PHY_REG(778, 17)
|
||||
#define HV_ECOL_UPPER PHY_REG(778, 18) /* Excessive Collision Count */
|
||||
#define HV_ECOL_LOWER PHY_REG(778, 19)
|
||||
#define HV_MCC_UPPER PHY_REG(778, 20) /* Multiple Collision Count */
|
||||
#define HV_MCC_LOWER PHY_REG(778, 21)
|
||||
#define HV_LATECOL_UPPER PHY_REG(778, 23) /* Late Collision Count */
|
||||
#define HV_LATECOL_LOWER PHY_REG(778, 24)
|
||||
#define HV_COLC_UPPER PHY_REG(778, 25) /* Collision Count */
|
||||
#define HV_COLC_LOWER PHY_REG(778, 26)
|
||||
#define HV_DC_UPPER PHY_REG(778, 27) /* Defer Count */
|
||||
#define HV_DC_LOWER PHY_REG(778, 28)
|
||||
#define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */
|
||||
#define HV_TNCRS_LOWER PHY_REG(778, 30)
|
||||
|
||||
#define E1000_FCRTV_PCH 0x05F40 /* PCH Flow Control Refresh Timer Value */
|
||||
|
||||
#define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */
|
||||
#define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */
|
||||
|
||||
/* SMBus Address Phy Register */
|
||||
#define HV_SMB_ADDR PHY_REG(768, 26)
|
||||
#define HV_SMB_ADDR_PEC_EN 0x0200
|
||||
#define HV_SMB_ADDR_VALID 0x0080
|
||||
|
||||
/* Strapping Option Register - RO */
|
||||
#define E1000_STRAP 0x0000C
|
||||
#define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000
|
||||
#define E1000_STRAP_SMBUS_ADDRESS_SHIFT 17
|
||||
|
||||
/* OEM Bits Phy Register */
|
||||
#define HV_OEM_BITS PHY_REG(768, 25)
|
||||
#define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */
|
||||
#define HV_OEM_BITS_GBE_DIS 0x0040 /* Gigabit Disable */
|
||||
#define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */
|
||||
|
||||
#define LCD_CFG_PHY_ADDR_BIT 0x0020 /* Phy address bit from LCD Config word */
|
||||
|
||||
#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */
|
||||
|
||||
/*
|
||||
* Additional interrupts need to be handled for ICH family:
|
||||
* DSW = The FW changed the status of the DISSW bit in FWSM
|
||||
* PHYINT = The LAN connected device generates an interrupt
|
||||
* EPRST = Manageability reset event
|
||||
*/
|
||||
#define IMS_ICH_ENABLE_MASK (\
|
||||
E1000_IMS_DSW | \
|
||||
E1000_IMS_PHYINT | \
|
||||
E1000_IMS_EPRST)
|
||||
|
||||
/* Additional interrupt register bit definitions */
|
||||
#define E1000_ICR_LSECPNC 0x00004000 /* PN threshold - client */
|
||||
#define E1000_IMS_LSECPNC E1000_ICR_LSECPNC /* PN threshold - client */
|
||||
#define E1000_ICS_LSECPNC E1000_ICR_LSECPNC /* PN threshold - client */
|
||||
|
||||
/* Security Processing bit Indication */
|
||||
#define E1000_RXDEXT_LINKSEC_STATUS_LSECH 0x01000000
|
||||
#define E1000_RXDEXT_LINKSEC_ERROR_BIT_MASK 0x60000000
|
||||
#define E1000_RXDEXT_LINKSEC_ERROR_NO_SA_MATCH 0x20000000
|
||||
#define E1000_RXDEXT_LINKSEC_ERROR_REPLAY_ERROR 0x40000000
|
||||
#define E1000_RXDEXT_LINKSEC_ERROR_BAD_SIG 0x60000000
|
||||
|
||||
|
||||
void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
|
||||
bool state);
|
||||
void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw);
|
||||
s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
|
||||
s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_config);
|
||||
#endif
|
|
@ -1,77 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_MAC_H_
|
||||
#define _E1000_MAC_H_
|
||||
|
||||
/*
|
||||
* Functions that should not be called directly from drivers but can be used
|
||||
* by other files in this 'shared code'
|
||||
*/
|
||||
void e1000_init_mac_ops_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_blink_led(struct e1000_hw *hw);
|
||||
s32 e1000e_check_for_copper_link(struct e1000_hw *hw);
|
||||
s32 e1000e_check_for_fiber_link(struct e1000_hw *hw);
|
||||
s32 e1000e_check_for_serdes_link(struct e1000_hw *hw);
|
||||
s32 e1000e_cleanup_led_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
|
||||
s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
|
||||
s32 e1000e_force_mac_fc(struct e1000_hw *hw);
|
||||
s32 e1000e_get_auto_rd_done(struct e1000_hw *hw);
|
||||
s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw);
|
||||
void e1000_set_lan_id_single_port(struct e1000_hw *hw);
|
||||
s32 e1000e_get_hw_semaphore(struct e1000_hw *hw);
|
||||
s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex);
|
||||
s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw,
|
||||
u16 *speed, u16 *duplex);
|
||||
s32 e1000e_id_led_init(struct e1000_hw *hw);
|
||||
s32 e1000e_led_on_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_led_off_generic(struct e1000_hw *hw);
|
||||
void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list, u32 mc_addr_count);
|
||||
s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
|
||||
s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
|
||||
s32 e1000_setup_led_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_setup_link(struct e1000_hw *hw);
|
||||
|
||||
void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
|
||||
void e1000e_clear_vfta_generic(struct e1000_hw *hw);
|
||||
void e1000e_config_collision_dist(struct e1000_hw *hw);
|
||||
void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
|
||||
void e1000_mta_set_generic(struct e1000_hw *hw, u32 hash_value);
|
||||
void e1000_pcix_mmrbc_workaround_generic(struct e1000_hw *hw);
|
||||
void e1000e_put_hw_semaphore(struct e1000_hw *hw);
|
||||
void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
|
||||
s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw);
|
||||
void e1000e_reset_adaptive(struct e1000_hw *hw);
|
||||
void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
|
||||
void e1000e_update_adaptive(struct e1000_hw *hw);
|
||||
void e1000e_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
|
||||
|
||||
#endif
|
|
@ -1,82 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_MANAGE_H_
|
||||
#define _E1000_MANAGE_H_
|
||||
|
||||
bool e1000_check_mng_mode_generic(struct e1000_hw *hw);
|
||||
bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
||||
s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw);
|
||||
s32 e1000_mng_host_if_write_generic(struct e1000_hw *hw, u8 *buffer,
|
||||
u16 length, u16 offset, u8 *sum);
|
||||
s32 e1000_mng_write_cmd_header_generic(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header *hdr);
|
||||
s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw,
|
||||
u8 *buffer, u16 length);
|
||||
bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw);
|
||||
|
||||
enum e1000_mng_mode {
|
||||
e1000_mng_mode_none = 0,
|
||||
e1000_mng_mode_asf,
|
||||
e1000_mng_mode_pt,
|
||||
e1000_mng_mode_ipmi,
|
||||
e1000_mng_mode_host_if_only
|
||||
};
|
||||
|
||||
#define E1000_FACTPS_MNGCG 0x20000000
|
||||
|
||||
#define E1000_FWSM_MODE_MASK 0xE
|
||||
#define E1000_FWSM_MODE_SHIFT 1
|
||||
|
||||
#define E1000_MNG_IAMT_MODE 0x3
|
||||
#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10
|
||||
#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0
|
||||
#define E1000_MNG_DHCP_COMMAND_TIMEOUT 10
|
||||
#define E1000_MNG_DHCP_TX_PAYLOAD_CMD 64
|
||||
#define E1000_MNG_DHCP_COOKIE_STATUS_PARSING 0x1
|
||||
#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN 0x2
|
||||
|
||||
#define E1000_VFTA_ENTRY_SHIFT 5
|
||||
#define E1000_VFTA_ENTRY_MASK 0x7F
|
||||
#define E1000_VFTA_ENTRY_BIT_SHIFT_MASK 0x1F
|
||||
|
||||
#define E1000_HI_MAX_BLOCK_BYTE_LENGTH 1792 /* Num of bytes in range */
|
||||
#define E1000_HI_MAX_BLOCK_DWORD_LENGTH 448 /* Num of dwords in range */
|
||||
#define E1000_HI_COMMAND_TIMEOUT 500 /* Process HI command limit */
|
||||
|
||||
#define E1000_HICR_EN 0x01 /* Enable bit - RO */
|
||||
/* Driver sets this bit when done to put command in RAM */
|
||||
#define E1000_HICR_C 0x02
|
||||
#define E1000_HICR_SV 0x04 /* Status Validity */
|
||||
#define E1000_HICR_FW_RESET_ENABLE 0x40
|
||||
#define E1000_HICR_FW_RESET 0x80
|
||||
|
||||
/* Intel(R) Active Management Technology signature */
|
||||
#define E1000_IAMT_SIGNATURE 0x544D4149
|
||||
|
||||
#endif
|
|
@ -1,51 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_NVM_H_
|
||||
#define _E1000_NVM_H_
|
||||
|
||||
void e1000_init_nvm_ops_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_acquire_nvm(struct e1000_hw *hw);
|
||||
|
||||
s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
|
||||
s32 e1000e_read_mac_addr_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num);
|
||||
s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data);
|
||||
s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
|
||||
s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
s32 e1000_write_nvm_eewr(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data);
|
||||
s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
void e1000e_release_nvm(struct e1000_hw *hw);
|
||||
|
||||
#define E1000_STM_OPCODE 0xDB00
|
||||
|
||||
#endif
|
|
@ -1,116 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2008 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
/* glue for the OS-dependent part of e1000
|
||||
* includes register access macros
|
||||
*/
|
||||
|
||||
#ifndef _E1000_OSDEP_H_
|
||||
#define _E1000_OSDEP_H_
|
||||
|
||||
#include <linux/pci.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/if_ether.h>
|
||||
|
||||
#include "kcompat.h"
|
||||
|
||||
#define usec_delay(x) udelay(x)
|
||||
#ifndef msec_delay
|
||||
#define msec_delay(x) do { if(in_interrupt()) { \
|
||||
/* Don't sleep in interrupt context! */ \
|
||||
BUG(); \
|
||||
} else { \
|
||||
msleep(x); \
|
||||
} } while (0)
|
||||
|
||||
/* Some workarounds require millisecond delays and are run during interrupt
|
||||
* context. Most notably, when establishing link, the phy may need tweaking
|
||||
* but cannot process phy register reads/writes faster than millisecond
|
||||
* intervals...and we establish link due to a "link status change" interrupt.
|
||||
*/
|
||||
#define msec_delay_irq(x) mdelay(x)
|
||||
#endif
|
||||
|
||||
#define PCI_COMMAND_REGISTER PCI_COMMAND
|
||||
#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
|
||||
#define ETH_ADDR_LEN ETH_ALEN
|
||||
|
||||
|
||||
#define DEBUGOUT(S)
|
||||
#define DEBUGOUT1(S, A...)
|
||||
|
||||
#define DEBUGFUNC(F) DEBUGOUT(F "\n")
|
||||
#define DEBUGOUT2 DEBUGOUT1
|
||||
#define DEBUGOUT3 DEBUGOUT2
|
||||
#define DEBUGOUT7 DEBUGOUT3
|
||||
|
||||
#define E1000_WRITE_REG(a, reg, value) ( \
|
||||
writel((value), ((a)->hw_addr + reg)))
|
||||
|
||||
#define E1000_READ_REG(a, reg) (readl((a)->hw_addr + reg))
|
||||
|
||||
#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) ( \
|
||||
writel((value), ((a)->hw_addr + reg + ((offset) << 2))))
|
||||
|
||||
#define E1000_READ_REG_ARRAY(a, reg, offset) ( \
|
||||
readl((a)->hw_addr + reg + ((offset) << 2)))
|
||||
|
||||
#define E1000_READ_REG_ARRAY_DWORD E1000_READ_REG_ARRAY
|
||||
#define E1000_WRITE_REG_ARRAY_DWORD E1000_WRITE_REG_ARRAY
|
||||
|
||||
#define E1000_WRITE_REG_ARRAY_WORD(a, reg, offset, value) ( \
|
||||
writew((value), ((a)->hw_addr + reg + ((offset) << 1))))
|
||||
|
||||
#define E1000_READ_REG_ARRAY_WORD(a, reg, offset) ( \
|
||||
readw((a)->hw_addr + reg + ((offset) << 1)))
|
||||
|
||||
#define E1000_WRITE_REG_ARRAY_BYTE(a, reg, offset, value) ( \
|
||||
writeb((value), ((a)->hw_addr + reg + (offset))))
|
||||
|
||||
#define E1000_READ_REG_ARRAY_BYTE(a, reg, offset) ( \
|
||||
readb((a)->hw_addr + reg + (offset)))
|
||||
|
||||
#define E1000_WRITE_REG_IO(a, reg, offset) do { \
|
||||
outl(reg, ((a)->io_base)); \
|
||||
outl(offset, ((a)->io_base + 4)); } while(0)
|
||||
|
||||
#define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, E1000_STATUS)
|
||||
|
||||
#define E1000_WRITE_FLASH_REG(a, reg, value) ( \
|
||||
writel((value), ((a)->flash_address + reg)))
|
||||
|
||||
#define E1000_WRITE_FLASH_REG16(a, reg, value) ( \
|
||||
writew((value), ((a)->flash_address + reg)))
|
||||
|
||||
#define E1000_READ_FLASH_REG(a, reg) (readl((a)->flash_address + reg))
|
||||
|
||||
#define E1000_READ_FLASH_REG16(a, reg) (readw((a)->flash_address + reg))
|
||||
|
||||
#endif /* _E1000_OSDEP_H_ */
|
|
@ -1,249 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_PHY_H_
|
||||
#define _E1000_PHY_H_
|
||||
|
||||
void e1000_init_phy_ops_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_check_downshift(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_m88(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_igp(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_ife(struct e1000_hw *hw);
|
||||
s32 e1000e_check_reset_block_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
|
||||
s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw);
|
||||
s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
|
||||
s32 e1000e_get_cable_length_m88(struct e1000_hw *hw);
|
||||
s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw);
|
||||
s32 e1000e_get_cfg_done(struct e1000_hw *hw);
|
||||
s32 e1000e_get_phy_id(struct e1000_hw *hw);
|
||||
s32 e1000e_get_phy_info_igp(struct e1000_hw *hw);
|
||||
s32 e1000e_get_phy_info_m88(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_sw_reset(struct e1000_hw *hw);
|
||||
void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
|
||||
s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_reset_dsp(struct e1000_hw *hw);
|
||||
s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active);
|
||||
s32 e1000e_setup_copper_link(struct e1000_hw *hw);
|
||||
s32 e1000_wait_autoneg(struct e1000_hw *hw);
|
||||
s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_phy_reset_dsp(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
|
||||
u32 usec_interval, bool *success);
|
||||
s32 e1000_phy_init_script_igp3(struct e1000_hw *hw);
|
||||
enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id);
|
||||
s32 e1000e_determine_phy_address(struct e1000_hw *hw);
|
||||
s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
void e1000_power_up_phy_copper(struct e1000_hw *hw);
|
||||
void e1000_power_down_phy_copper(struct e1000_hw *hw);
|
||||
s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow);
|
||||
s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw);
|
||||
s32 e1000_copper_link_setup_82577(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_82577(struct e1000_hw *hw);
|
||||
s32 e1000_get_phy_info_82577(struct e1000_hw *hw);
|
||||
s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw);
|
||||
s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
|
||||
|
||||
#define E1000_MAX_PHY_ADDR 4
|
||||
|
||||
/* IGP01E1000 Specific Registers */
|
||||
#define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
|
||||
#define IGP01E1000_PHY_PORT_STATUS 0x11 /* Status */
|
||||
#define IGP01E1000_PHY_PORT_CTRL 0x12 /* Control */
|
||||
#define IGP01E1000_PHY_LINK_HEALTH 0x13 /* PHY Link Health */
|
||||
#define IGP01E1000_GMII_FIFO 0x14 /* GMII FIFO */
|
||||
#define IGP01E1000_PHY_CHANNEL_QUALITY 0x15 /* PHY Channel Quality */
|
||||
#define IGP02E1000_PHY_POWER_MGMT 0x19 /* Power Management */
|
||||
#define IGP01E1000_PHY_PAGE_SELECT 0x1F /* Page Select */
|
||||
#define BM_PHY_PAGE_SELECT 22 /* Page Select for BM */
|
||||
#define IGP_PAGE_SHIFT 5
|
||||
#define PHY_REG_MASK 0x1F
|
||||
|
||||
/* BM/HV Specific Registers */
|
||||
#define BM_PORT_CTRL_PAGE 769
|
||||
#define BM_PCIE_PAGE 770
|
||||
#define BM_WUC_PAGE 800
|
||||
#define BM_WUC_ADDRESS_OPCODE 0x11
|
||||
#define BM_WUC_DATA_OPCODE 0x12
|
||||
#define BM_WUC_ENABLE_PAGE BM_PORT_CTRL_PAGE
|
||||
#define BM_WUC_ENABLE_REG 17
|
||||
#define BM_WUC_ENABLE_BIT (1 << 2)
|
||||
#define BM_WUC_HOST_WU_BIT (1 << 4)
|
||||
|
||||
#define PHY_UPPER_SHIFT 21
|
||||
#define BM_PHY_REG(page, reg) \
|
||||
(((reg) & MAX_PHY_REG_ADDRESS) |\
|
||||
(((page) & 0xFFFF) << PHY_PAGE_SHIFT) |\
|
||||
(((reg) & ~MAX_PHY_REG_ADDRESS) << (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT)))
|
||||
#define BM_PHY_REG_PAGE(offset) \
|
||||
((u16)(((offset) >> PHY_PAGE_SHIFT) & 0xFFFF))
|
||||
#define BM_PHY_REG_NUM(offset) \
|
||||
((u16)(((offset) & MAX_PHY_REG_ADDRESS) |\
|
||||
(((offset) >> (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT)) &\
|
||||
~MAX_PHY_REG_ADDRESS)))
|
||||
|
||||
#define HV_INTC_FC_PAGE_START 768
|
||||
#define I82578_ADDR_REG 29
|
||||
#define I82577_ADDR_REG 16
|
||||
#define I82577_CFG_REG 22
|
||||
#define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15)
|
||||
#define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */
|
||||
#define I82577_CTRL_REG 23
|
||||
|
||||
/* 82577 specific PHY registers */
|
||||
#define I82577_PHY_CTRL_2 18
|
||||
#define I82577_PHY_LBK_CTRL 19
|
||||
#define I82577_PHY_STATUS_2 26
|
||||
#define I82577_PHY_DIAG_STATUS 31
|
||||
|
||||
/* I82577 PHY Status 2 */
|
||||
#define I82577_PHY_STATUS2_REV_POLARITY 0x0400
|
||||
#define I82577_PHY_STATUS2_MDIX 0x0800
|
||||
#define I82577_PHY_STATUS2_SPEED_MASK 0x0300
|
||||
#define I82577_PHY_STATUS2_SPEED_1000MBPS 0x0200
|
||||
#define I82577_PHY_STATUS2_SPEED_100MBPS 0x0100
|
||||
|
||||
/* I82577 PHY Control 2 */
|
||||
#define I82577_PHY_CTRL2_AUTO_MDIX 0x0400
|
||||
#define I82577_PHY_CTRL2_FORCE_MDI_MDIX 0x0200
|
||||
|
||||
/* I82577 PHY Diagnostics Status */
|
||||
#define I82577_DSTATUS_CABLE_LENGTH 0x03FC
|
||||
#define I82577_DSTATUS_CABLE_LENGTH_SHIFT 2
|
||||
|
||||
/* BM PHY Copper Specific Control 1 */
|
||||
#define BM_CS_CTRL1 16
|
||||
#define BM_CS_CTRL1_ENERGY_DETECT 0x0300 /* Enable Energy Detect */
|
||||
|
||||
/* BM PHY Copper Specific Status */
|
||||
#define BM_CS_STATUS 17
|
||||
#define BM_CS_STATUS_ENERGY_DETECT 0x0010 /* Energy Detect Status */
|
||||
#define BM_CS_STATUS_LINK_UP 0x0400
|
||||
#define BM_CS_STATUS_RESOLVED 0x0800
|
||||
#define BM_CS_STATUS_SPEED_MASK 0xC000
|
||||
#define BM_CS_STATUS_SPEED_1000 0x8000
|
||||
|
||||
/* 82577 Mobile Phy Status Register */
|
||||
#define HV_M_STATUS 26
|
||||
#define HV_M_STATUS_AUTONEG_COMPLETE 0x1000
|
||||
#define HV_M_STATUS_SPEED_MASK 0x0300
|
||||
#define HV_M_STATUS_SPEED_1000 0x0200
|
||||
#define HV_M_STATUS_LINK_UP 0x0040
|
||||
|
||||
#define IGP01E1000_PHY_PCS_INIT_REG 0x00B4
|
||||
#define IGP01E1000_PHY_POLARITY_MASK 0x0078
|
||||
|
||||
#define IGP01E1000_PSCR_AUTO_MDIX 0x1000
|
||||
#define IGP01E1000_PSCR_FORCE_MDI_MDIX 0x2000 /* 0=MDI, 1=MDIX */
|
||||
|
||||
#define IGP01E1000_PSCFR_SMART_SPEED 0x0080
|
||||
|
||||
/* Enable flexible speed on link-up */
|
||||
#define IGP01E1000_GMII_FLEX_SPD 0x0010
|
||||
#define IGP01E1000_GMII_SPD 0x0020 /* Enable SPD */
|
||||
|
||||
#define IGP02E1000_PM_SPD 0x0001 /* Smart Power Down */
|
||||
#define IGP02E1000_PM_D0_LPLU 0x0002 /* For D0a states */
|
||||
#define IGP02E1000_PM_D3_LPLU 0x0004 /* For all other states */
|
||||
|
||||
#define IGP01E1000_PLHR_SS_DOWNGRADE 0x8000
|
||||
|
||||
#define IGP01E1000_PSSR_POLARITY_REVERSED 0x0002
|
||||
#define IGP01E1000_PSSR_MDIX 0x0800
|
||||
#define IGP01E1000_PSSR_SPEED_MASK 0xC000
|
||||
#define IGP01E1000_PSSR_SPEED_1000MBPS 0xC000
|
||||
|
||||
#define IGP02E1000_PHY_CHANNEL_NUM 4
|
||||
#define IGP02E1000_PHY_AGC_A 0x11B1
|
||||
#define IGP02E1000_PHY_AGC_B 0x12B1
|
||||
#define IGP02E1000_PHY_AGC_C 0x14B1
|
||||
#define IGP02E1000_PHY_AGC_D 0x18B1
|
||||
|
||||
#define IGP02E1000_AGC_LENGTH_SHIFT 9 /* Course - 15:13, Fine - 12:9 */
|
||||
#define IGP02E1000_AGC_LENGTH_MASK 0x7F
|
||||
#define IGP02E1000_AGC_RANGE 15
|
||||
|
||||
#define IGP03E1000_PHY_MISC_CTRL 0x1B
|
||||
#define IGP03E1000_PHY_MISC_DUPLEX_MANUAL_SET 0x1000 /* Manually Set Duplex */
|
||||
|
||||
#define E1000_CABLE_LENGTH_UNDEFINED 0xFF
|
||||
|
||||
#define E1000_KMRNCTRLSTA_OFFSET 0x001F0000
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_SHIFT 16
|
||||
#define E1000_KMRNCTRLSTA_REN 0x00200000
|
||||
#define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */
|
||||
#define E1000_KMRNCTRLSTA_TIMEOUTS 0x4 /* Kumeran Timeouts */
|
||||
#define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */
|
||||
#define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
|
||||
#define E1000_KMRNCTRLSTA_K1_CONFIG 0x7
|
||||
#define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002
|
||||
|
||||
#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
|
||||
#define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Control */
|
||||
#define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY Special and LED Control */
|
||||
#define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control */
|
||||
|
||||
/* IFE PHY Extended Status Control */
|
||||
#define IFE_PESC_POLARITY_REVERSED 0x0100
|
||||
|
||||
/* IFE PHY Special Control */
|
||||
#define IFE_PSC_AUTO_POLARITY_DISABLE 0x0010
|
||||
#define IFE_PSC_FORCE_POLARITY 0x0020
|
||||
#define IFE_PSC_DISABLE_DYNAMIC_POWER_DOWN 0x0100
|
||||
|
||||
/* IFE PHY Special Control and LED Control */
|
||||
#define IFE_PSCL_PROBE_MODE 0x0020
|
||||
#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */
|
||||
#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */
|
||||
|
||||
/* IFE PHY MDIX Control */
|
||||
#define IFE_PMC_MDIX_STATUS 0x0020 /* 1=MDI-X, 0=MDI */
|
||||
#define IFE_PMC_FORCE_MDIX 0x0040 /* 1=force MDI-X, 0=force MDI */
|
||||
#define IFE_PMC_AUTO_MDIX 0x0080 /* 1=enable auto MDI/MDI-X, 0=disable */
|
||||
|
||||
#endif
|
|
@ -1,338 +0,0 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_REGS_H_
|
||||
#define _E1000_REGS_H_
|
||||
|
||||
#define E1000_CTRL 0x00000 /* Device Control - RW */
|
||||
#define E1000_CTRL_DUP 0x00004 /* Device Control Duplicate (Shadow) - RW */
|
||||
#define E1000_STATUS 0x00008 /* Device Status - RO */
|
||||
#define E1000_EECD 0x00010 /* EEPROM/Flash Control - RW */
|
||||
#define E1000_EERD 0x00014 /* EEPROM Read - RW */
|
||||
#define E1000_CTRL_EXT 0x00018 /* Extended Device Control - RW */
|
||||
#define E1000_FLA 0x0001C /* Flash Access - RW */
|
||||
#define E1000_MDIC 0x00020 /* MDI Control - RW */
|
||||
#define E1000_SCTL 0x00024 /* SerDes Control - RW */
|
||||
#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */
|
||||
#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */
|
||||
#define E1000_FEXT 0x0002C /* Future Extended - RW */
|
||||
#define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */
|
||||
#define E1000_FCT 0x00030 /* Flow Control Type - RW */
|
||||
#define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */
|
||||
#define E1000_VET 0x00038 /* VLAN Ether Type - RW */
|
||||
#define E1000_ICR 0x000C0 /* Interrupt Cause Read - R/clr */
|
||||
#define E1000_ITR 0x000C4 /* Interrupt Throttling Rate - RW */
|
||||
#define E1000_ICS 0x000C8 /* Interrupt Cause Set - WO */
|
||||
#define E1000_IMS 0x000D0 /* Interrupt Mask Set - RW */
|
||||
#define E1000_IMC 0x000D8 /* Interrupt Mask Clear - WO */
|
||||
#define E1000_IAM 0x000E0 /* Interrupt Acknowledge Auto Mask */
|
||||
#define E1000_IVAR 0x000E4 /* Interrupt Vector Allocation Register - RW */
|
||||
#define E1000_SVCR 0x000F0
|
||||
#define E1000_SVT 0x000F4
|
||||
#define E1000_RCTL 0x00100 /* Rx Control - RW */
|
||||
#define E1000_FCTTV 0x00170 /* Flow Control Transmit Timer Value - RW */
|
||||
#define E1000_TXCW 0x00178 /* Tx Configuration Word - RW */
|
||||
#define E1000_RXCW 0x00180 /* Rx Configuration Word - RO */
|
||||
#define E1000_PBA_ECC 0x01100 /* PBA ECC Register */
|
||||
#define E1000_TCTL 0x00400 /* Tx Control - RW */
|
||||
#define E1000_TCTL_EXT 0x00404 /* Extended Tx Control - RW */
|
||||
#define E1000_TIPG 0x00410 /* Tx Inter-packet gap -RW */
|
||||
#define E1000_TBT 0x00448 /* Tx Burst Timer - RW */
|
||||
#define E1000_AIT 0x00458 /* Adaptive Interframe Spacing Throttle - RW */
|
||||
#define E1000_LEDCTL 0x00E00 /* LED Control - RW */
|
||||
#define E1000_EXTCNF_CTRL 0x00F00 /* Extended Configuration Control */
|
||||
#define E1000_EXTCNF_SIZE 0x00F08 /* Extended Configuration Size */
|
||||
#define E1000_PHY_CTRL 0x00F10 /* PHY Control Register in CSR */
|
||||
#define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */
|
||||
#define E1000_PBS 0x01008 /* Packet Buffer Size */
|
||||
#define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */
|
||||
#define E1000_EEARBC 0x01024 /* EEPROM Auto Read Bus Control */
|
||||
#define E1000_FLASHT 0x01028 /* FLASH Timer Register */
|
||||
#define E1000_EEWR 0x0102C /* EEPROM Write Register - RW */
|
||||
#define E1000_FLSWCTL 0x01030 /* FLASH control register */
|
||||
#define E1000_FLSWDATA 0x01034 /* FLASH data register */
|
||||
#define E1000_FLSWCNT 0x01038 /* FLASH Access Counter */
|
||||
#define E1000_FLOP 0x0103C /* FLASH Opcode Register */
|
||||
#define E1000_I2CCMD 0x01028 /* SFPI2C Command Register - RW */
|
||||
#define E1000_I2CPARAMS 0x0102C /* SFPI2C Parameters Register - RW */
|
||||
#define E1000_WDSTP 0x01040 /* Watchdog Setup - RW */
|
||||
#define E1000_SWDSTS 0x01044 /* SW Device Status - RW */
|
||||
#define E1000_FRTIMER 0x01048 /* Free Running Timer - RW */
|
||||
#define E1000_ERT 0x02008 /* Early Rx Threshold - RW */
|
||||
#define E1000_FCRTL 0x02160 /* Flow Control Receive Threshold Low - RW */
|
||||
#define E1000_FCRTH 0x02168 /* Flow Control Receive Threshold High - RW */
|
||||
#define E1000_PSRCTL 0x02170 /* Packet Split Receive Control - RW */
|
||||
#define E1000_RDFPCQ(_n) (0x02430 + (0x4 * (_n)))
|
||||
#define E1000_PBRTH 0x02458 /* PB Rx Arbitration Threshold - RW */
|
||||
#define E1000_FCRTV 0x02460 /* Flow Control Refresh Timer Value - RW */
|
||||
/* Split and Replication Rx Control - RW */
|
||||
#define E1000_RDPUMB 0x025CC /* DMA Rx Descriptor uC Mailbox - RW */
|
||||
#define E1000_RDPUAD 0x025D0 /* DMA Rx Descriptor uC Addr Command - RW */
|
||||
#define E1000_RDPUWD 0x025D4 /* DMA Rx Descriptor uC Data Write - RW */
|
||||
#define E1000_RDPURD 0x025D8 /* DMA Rx Descriptor uC Data Read - RW */
|
||||
#define E1000_RDPUCTL 0x025DC /* DMA Rx Descriptor uC Control - RW */
|
||||
#define E1000_RDTR 0x02820 /* Rx Delay Timer - RW */
|
||||
#define E1000_RADV 0x0282C /* Rx Interrupt Absolute Delay Timer - RW */
|
||||
/*
|
||||
* Convenience macros
|
||||
*
|
||||
* Note: "_n" is the queue number of the register to be written to.
|
||||
*
|
||||
* Example usage:
|
||||
* E1000_RDBAL_REG(current_rx_queue)
|
||||
*/
|
||||
#define E1000_RDBAL(_n) ((_n) < 4 ? (0x02800 + ((_n) * 0x100)) : \
|
||||
(0x0C000 + ((_n) * 0x40)))
|
||||
#define E1000_RDBAH(_n) ((_n) < 4 ? (0x02804 + ((_n) * 0x100)) : \
|
||||
(0x0C004 + ((_n) * 0x40)))
|
||||
#define E1000_RDLEN(_n) ((_n) < 4 ? (0x02808 + ((_n) * 0x100)) : \
|
||||
(0x0C008 + ((_n) * 0x40)))
|
||||
#define E1000_SRRCTL(_n) ((_n) < 4 ? (0x0280C + ((_n) * 0x100)) : \
|
||||
(0x0C00C + ((_n) * 0x40)))
|
||||
#define E1000_RDH(_n) ((_n) < 4 ? (0x02810 + ((_n) * 0x100)) : \
|
||||
(0x0C010 + ((_n) * 0x40)))
|
||||
#define E1000_RXCTL(_n) ((_n) < 4 ? (0x02814 + ((_n) * 0x100)) : \
|
||||
(0x0C014 + ((_n) * 0x40)))
|
||||
#define E1000_DCA_RXCTRL(_n) E1000_RXCTL(_n)
|
||||
#define E1000_RDT(_n) ((_n) < 4 ? (0x02818 + ((_n) * 0x100)) : \
|
||||
(0x0C018 + ((_n) * 0x40)))
|
||||
#define E1000_RXDCTL(_n) ((_n) < 4 ? (0x02828 + ((_n) * 0x100)) : \
|
||||
(0x0C028 + ((_n) * 0x40)))
|
||||
#define E1000_RQDPC(_n) ((_n) < 4 ? (0x02830 + ((_n) * 0x100)) : \
|
||||
(0x0C030 + ((_n) * 0x40)))
|
||||
#define E1000_TDBAL(_n) ((_n) < 4 ? (0x03800 + ((_n) * 0x100)) : \
|
||||
(0x0E000 + ((_n) * 0x40)))
|
||||
#define E1000_TDBAH(_n) ((_n) < 4 ? (0x03804 + ((_n) * 0x100)) : \
|
||||
(0x0E004 + ((_n) * 0x40)))
|
||||
#define E1000_TDLEN(_n) ((_n) < 4 ? (0x03808 + ((_n) * 0x100)) : \
|
||||
(0x0E008 + ((_n) * 0x40)))
|
||||
#define E1000_TDH(_n) ((_n) < 4 ? (0x03810 + ((_n) * 0x100)) : \
|
||||
(0x0E010 + ((_n) * 0x40)))
|
||||
#define E1000_TXCTL(_n) ((_n) < 4 ? (0x03814 + ((_n) * 0x100)) : \
|
||||
(0x0E014 + ((_n) * 0x40)))
|
||||
#define E1000_DCA_TXCTRL(_n) E1000_TXCTL(_n)
|
||||
#define E1000_TDT(_n) ((_n) < 4 ? (0x03818 + ((_n) * 0x100)) : \
|
||||
(0x0E018 + ((_n) * 0x40)))
|
||||
#define E1000_TXDCTL(_n) ((_n) < 4 ? (0x03828 + ((_n) * 0x100)) : \
|
||||
(0x0E028 + ((_n) * 0x40)))
|
||||
#define E1000_TDWBAL(_n) ((_n) < 4 ? (0x03838 + ((_n) * 0x100)) : \
|
||||
(0x0E038 + ((_n) * 0x40)))
|
||||
#define E1000_TDWBAH(_n) ((_n) < 4 ? (0x0383C + ((_n) * 0x100)) : \
|
||||
(0x0E03C + ((_n) * 0x40)))
|
||||
#define E1000_TARC(_n) (0x03840 + ((_n) * 0x100))
|
||||
#define E1000_RSRPD 0x02C00 /* Rx Small Packet Detect - RW */
|
||||
#define E1000_RAID 0x02C08 /* Receive Ack Interrupt Delay - RW */
|
||||
#define E1000_TXDMAC 0x03000 /* Tx DMA Control - RW */
|
||||
#define E1000_KABGTXD 0x03004 /* AFE Band Gap Transmit Ref Data */
|
||||
#define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4))
|
||||
#define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \
|
||||
(0x054E0 + ((_i - 16) * 8)))
|
||||
#define E1000_RAH(_i) (((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
|
||||
(0x054E4 + ((_i - 16) * 8)))
|
||||
#define E1000_IP4AT_REG(_i) (0x05840 + ((_i) * 8))
|
||||
#define E1000_IP6AT_REG(_i) (0x05880 + ((_i) * 4))
|
||||
#define E1000_WUPM_REG(_i) (0x05A00 + ((_i) * 4))
|
||||
#define E1000_FFMT_REG(_i) (0x09000 + ((_i) * 8))
|
||||
#define E1000_FFVT_REG(_i) (0x09800 + ((_i) * 8))
|
||||
#define E1000_FFLT_REG(_i) (0x05F00 + ((_i) * 8))
|
||||
#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 E1000_TDPUMB 0x0357C /* DMA Tx Descriptor uC Mail Box - RW */
|
||||
#define E1000_TDPUAD 0x03580 /* DMA Tx Descriptor uC Addr Command - RW */
|
||||
#define E1000_TDPUWD 0x03584 /* DMA Tx Descriptor uC Data Write - RW */
|
||||
#define E1000_TDPURD 0x03588 /* DMA Tx Descriptor uC Data Read - RW */
|
||||
#define E1000_TDPUCTL 0x0358C /* DMA Tx Descriptor uC Control - RW */
|
||||
#define E1000_DTXCTL 0x03590 /* DMA Tx Control - RW */
|
||||
#define E1000_TIDV 0x03820 /* Tx Interrupt Delay Value - RW */
|
||||
#define E1000_TADV 0x0382C /* Tx Interrupt Absolute Delay Val - RW */
|
||||
#define E1000_TSPMT 0x03830 /* TCP Segmentation PAD & Min Threshold - RW */
|
||||
#define E1000_CRCERRS 0x04000 /* CRC Error Count - R/clr */
|
||||
#define E1000_ALGNERRC 0x04004 /* Alignment Error Count - R/clr */
|
||||
#define E1000_SYMERRS 0x04008 /* Symbol Error Count - R/clr */
|
||||
#define E1000_RXERRC 0x0400C /* Receive Error Count - R/clr */
|
||||
#define E1000_MPC 0x04010 /* Missed Packet Count - R/clr */
|
||||
#define E1000_SCC 0x04014 /* Single Collision Count - R/clr */
|
||||
#define E1000_ECOL 0x04018 /* Excessive Collision Count - R/clr */
|
||||
#define E1000_MCC 0x0401C /* Multiple Collision Count - R/clr */
|
||||
#define E1000_LATECOL 0x04020 /* Late Collision Count - R/clr */
|
||||
#define E1000_COLC 0x04028 /* Collision Count - R/clr */
|
||||
#define E1000_DC 0x04030 /* Defer Count - R/clr */
|
||||
#define E1000_TNCRS 0x04034 /* Tx-No CRS - R/clr */
|
||||
#define E1000_SEC 0x04038 /* Sequence Error Count - R/clr */
|
||||
#define E1000_CEXTERR 0x0403C /* Carrier Extension Error Count - R/clr */
|
||||
#define E1000_RLEC 0x04040 /* Receive Length Error Count - R/clr */
|
||||
#define E1000_XONRXC 0x04048 /* XON Rx Count - R/clr */
|
||||
#define E1000_XONTXC 0x0404C /* XON Tx Count - R/clr */
|
||||
#define E1000_XOFFRXC 0x04050 /* XOFF Rx Count - R/clr */
|
||||
#define E1000_XOFFTXC 0x04054 /* XOFF Tx Count - R/clr */
|
||||
#define E1000_FCRUC 0x04058 /* Flow Control Rx Unsupported Count- R/clr */
|
||||
#define E1000_PRC64 0x0405C /* Packets Rx (64 bytes) - R/clr */
|
||||
#define E1000_PRC127 0x04060 /* Packets Rx (65-127 bytes) - R/clr */
|
||||
#define E1000_PRC255 0x04064 /* Packets Rx (128-255 bytes) - R/clr */
|
||||
#define E1000_PRC511 0x04068 /* Packets Rx (255-511 bytes) - R/clr */
|
||||
#define E1000_PRC1023 0x0406C /* Packets Rx (512-1023 bytes) - R/clr */
|
||||
#define E1000_PRC1522 0x04070 /* Packets Rx (1024-1522 bytes) - R/clr */
|
||||
#define E1000_GPRC 0x04074 /* Good Packets Rx Count - R/clr */
|
||||
#define E1000_BPRC 0x04078 /* Broadcast Packets Rx Count - R/clr */
|
||||
#define E1000_MPRC 0x0407C /* Multicast Packets Rx Count - R/clr */
|
||||
#define E1000_GPTC 0x04080 /* Good Packets Tx Count - R/clr */
|
||||
#define E1000_GORCL 0x04088 /* Good Octets Rx Count Low - R/clr */
|
||||
#define E1000_GORCH 0x0408C /* Good Octets Rx Count High - R/clr */
|
||||
#define E1000_GOTCL 0x04090 /* Good Octets Tx Count Low - R/clr */
|
||||
#define E1000_GOTCH 0x04094 /* Good Octets Tx Count High - R/clr */
|
||||
#define E1000_RNBC 0x040A0 /* Rx No Buffers Count - R/clr */
|
||||
#define E1000_RUC 0x040A4 /* Rx Undersize Count - R/clr */
|
||||
#define E1000_RFC 0x040A8 /* Rx Fragment Count - R/clr */
|
||||
#define E1000_ROC 0x040AC /* Rx Oversize Count - R/clr */
|
||||
#define E1000_RJC 0x040B0 /* Rx Jabber Count - R/clr */
|
||||
#define E1000_MGTPRC 0x040B4 /* Management Packets Rx Count - R/clr */
|
||||
#define E1000_MGTPDC 0x040B8 /* Management Packets Dropped Count - R/clr */
|
||||
#define E1000_MGTPTC 0x040BC /* Management Packets Tx Count - R/clr */
|
||||
#define E1000_TORL 0x040C0 /* Total Octets Rx Low - R/clr */
|
||||
#define E1000_TORH 0x040C4 /* Total Octets Rx High - R/clr */
|
||||
#define E1000_TOTL 0x040C8 /* Total Octets Tx Low - R/clr */
|
||||
#define E1000_TOTH 0x040CC /* Total Octets Tx High - R/clr */
|
||||
#define E1000_TPR 0x040D0 /* Total Packets Rx - R/clr */
|
||||
#define E1000_TPT 0x040D4 /* Total Packets Tx - R/clr */
|
||||
#define E1000_PTC64 0x040D8 /* Packets Tx (64 bytes) - R/clr */
|
||||
#define E1000_PTC127 0x040DC /* Packets Tx (65-127 bytes) - R/clr */
|
||||
#define E1000_PTC255 0x040E0 /* Packets Tx (128-255 bytes) - R/clr */
|
||||
#define E1000_PTC511 0x040E4 /* Packets Tx (256-511 bytes) - R/clr */
|
||||
#define E1000_PTC1023 0x040E8 /* Packets Tx (512-1023 bytes) - R/clr */
|
||||
#define E1000_PTC1522 0x040EC /* Packets Tx (1024-1522 Bytes) - R/clr */
|
||||
#define E1000_MPTC 0x040F0 /* Multicast Packets Tx Count - R/clr */
|
||||
#define E1000_BPTC 0x040F4 /* Broadcast Packets Tx Count - R/clr */
|
||||
#define E1000_TSCTC 0x040F8 /* TCP Segmentation Context Tx - R/clr */
|
||||
#define E1000_TSCTFC 0x040FC /* TCP Segmentation Context Tx Fail - R/clr */
|
||||
#define E1000_IAC 0x04100 /* Interrupt Assertion Count */
|
||||
#define E1000_ICRXPTC 0x04104 /* Interrupt Cause Rx Pkt Timer Expire Count */
|
||||
#define E1000_ICRXATC 0x04108 /* Interrupt Cause Rx Abs Timer Expire Count */
|
||||
#define E1000_ICTXPTC 0x0410C /* Interrupt Cause Tx Pkt Timer Expire Count */
|
||||
#define E1000_ICTXATC 0x04110 /* Interrupt Cause Tx Abs Timer Expire Count */
|
||||
#define E1000_ICTXQEC 0x04118 /* Interrupt Cause Tx Queue Empty Count */
|
||||
#define E1000_ICTXQMTC 0x0411C /* Interrupt Cause Tx Queue Min Thresh Count */
|
||||
#define E1000_ICRXDMTC 0x04120 /* Interrupt Cause Rx Desc Min Thresh Count */
|
||||
#define E1000_ICRXOC 0x04124 /* Interrupt Cause Receiver Overrun Count */
|
||||
#define E1000_CRC_OFFSET 0x05F50 /* CRC Offset register */
|
||||
|
||||
#define E1000_PCS_CFG0 0x04200 /* PCS Configuration 0 - RW */
|
||||
#define E1000_PCS_LCTL 0x04208 /* PCS Link Control - RW */
|
||||
#define E1000_PCS_LSTAT 0x0420C /* PCS Link Status - RO */
|
||||
#define E1000_CBTMPC 0x0402C /* Circuit Breaker Tx Packet Count */
|
||||
#define E1000_HTDPMC 0x0403C /* Host Transmit Discarded Packets */
|
||||
#define E1000_CBRDPC 0x04044 /* Circuit Breaker Rx Dropped Count */
|
||||
#define E1000_CBRMPC 0x040FC /* Circuit Breaker Rx Packet Count */
|
||||
#define E1000_RPTHC 0x04104 /* Rx Packets To Host */
|
||||
#define E1000_HGPTC 0x04118 /* Host Good Packets Tx Count */
|
||||
#define E1000_HTCBDPC 0x04124 /* Host Tx Circuit Breaker Dropped Count */
|
||||
#define E1000_HGORCL 0x04128 /* Host Good Octets Received Count Low */
|
||||
#define E1000_HGORCH 0x0412C /* Host Good Octets Received Count High */
|
||||
#define E1000_HGOTCL 0x04130 /* Host Good Octets Transmit Count Low */
|
||||
#define E1000_HGOTCH 0x04134 /* Host Good Octets Transmit Count High */
|
||||
#define E1000_LENERRS 0x04138 /* Length Errors Count */
|
||||
#define E1000_SCVPC 0x04228 /* SerDes/SGMII Code Violation Pkt Count */
|
||||
#define E1000_HRMPC 0x0A018 /* Header Redirection Missed Packet Count */
|
||||
#define E1000_PCS_ANADV 0x04218 /* AN advertisement - RW */
|
||||
#define E1000_PCS_LPAB 0x0421C /* Link Partner Ability - RW */
|
||||
#define E1000_PCS_NPTX 0x04220 /* AN Next Page Transmit - RW */
|
||||
#define E1000_PCS_LPABNP 0x04224 /* Link Partner Ability Next Page - RW */
|
||||
#define E1000_1GSTAT_RCV 0x04228 /* 1GSTAT Code Violation Packet Count - RW */
|
||||
#define E1000_RXCSUM 0x05000 /* Rx Checksum Control - RW */
|
||||
#define E1000_RLPML 0x05004 /* Rx Long Packet Max Length */
|
||||
#define E1000_RFCTL 0x05008 /* Receive Filter Control*/
|
||||
#define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */
|
||||
#define E1000_RA 0x05400 /* Receive Address - RW Array */
|
||||
#define E1000_VFTA 0x05600 /* VLAN Filter Table Array - RW Array */
|
||||
#define E1000_VT_CTL 0x0581C /* VMDq Control - RW */
|
||||
#define E1000_VFQA0 0x0B000 /* VLAN Filter Queue Array 0 - RW Array */
|
||||
#define E1000_VFQA1 0x0B200 /* VLAN Filter Queue Array 1 - RW Array */
|
||||
#define E1000_WUC 0x05800 /* Wakeup Control - RW */
|
||||
#define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */
|
||||
#define E1000_WUS 0x05810 /* Wakeup Status - RO */
|
||||
#define E1000_MANC 0x05820 /* Management Control - RW */
|
||||
#define E1000_IPAV 0x05838 /* IP Address Valid - RW */
|
||||
#define E1000_IP4AT 0x05840 /* IPv4 Address Table - RW Array */
|
||||
#define E1000_IP6AT 0x05880 /* IPv6 Address Table - RW Array */
|
||||
#define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */
|
||||
#define E1000_WUPM 0x05A00 /* Wakeup Packet Memory - RO A */
|
||||
#define E1000_PBACL 0x05B68 /* MSIx PBA Clear - Read/Write 1's to clear */
|
||||
#define E1000_FFLT 0x05F00 /* Flexible Filter Length Table - RW Array */
|
||||
#define E1000_HOST_IF 0x08800 /* Host Interface */
|
||||
#define E1000_FFMT 0x09000 /* Flexible Filter Mask Table - RW Array */
|
||||
#define E1000_FFVT 0x09800 /* Flexible Filter Value Table - RW Array */
|
||||
|
||||
#define E1000_KMRNCTRLSTA 0x00034 /* MAC-PHY interface - RW */
|
||||
#define E1000_MDPHYA 0x0003C /* PHY address - RW */
|
||||
#define E1000_MANC2H 0x05860 /* Management Control To Host - RW */
|
||||
#define E1000_SW_FW_SYNC 0x05B5C /* Software-Firmware Synchronization - RW */
|
||||
#define E1000_CCMCTL 0x05B48 /* CCM Control Register */
|
||||
#define E1000_GIOCTL 0x05B44 /* GIO Analog Control Register */
|
||||
#define E1000_SCCTL 0x05B4C /* PCIc PLL Configuration Register */
|
||||
#define E1000_GCR 0x05B00 /* PCI-Ex Control */
|
||||
#define E1000_GCR2 0x05B64 /* PCI-Ex Control #2 */
|
||||
#define E1000_GSCL_1 0x05B10 /* PCI-Ex Statistic Control #1 */
|
||||
#define E1000_GSCL_2 0x05B14 /* PCI-Ex Statistic Control #2 */
|
||||
#define E1000_GSCL_3 0x05B18 /* PCI-Ex Statistic Control #3 */
|
||||
#define E1000_GSCL_4 0x05B1C /* PCI-Ex Statistic Control #4 */
|
||||
#define E1000_FACTPS 0x05B30 /* Function Active and Power State to MNG */
|
||||
#define E1000_SWSM 0x05B50 /* SW Semaphore */
|
||||
#define E1000_FWSM 0x05B54 /* FW Semaphore */
|
||||
#define E1000_SWSM2 0x05B58 /* Driver-only SW semaphore (not used by BOOT agents) */
|
||||
#define E1000_DCA_ID 0x05B70 /* DCA Requester ID Information - RO */
|
||||
#define E1000_DCA_CTRL 0x05B74 /* DCA Control - RW */
|
||||
#define E1000_FFLT_DBG 0x05F04 /* Debug Register */
|
||||
#define E1000_HICR 0x08F00 /* Host Interface Control */
|
||||
|
||||
/* RSS registers */
|
||||
#define E1000_CPUVEC 0x02C10 /* CPU Vector Register - RW */
|
||||
#define E1000_MRQC 0x05818 /* Multiple Receive Control - RW */
|
||||
#define E1000_IMIR(_i) (0x05A80 + ((_i) * 4)) /* Immediate Interrupt */
|
||||
#define E1000_IMIREXT(_i) (0x05AA0 + ((_i) * 4)) /* Immediate Interrupt Ext*/
|
||||
#define E1000_IMIRVP 0x05AC0 /* Immediate Interrupt Rx VLAN Priority - RW */
|
||||
#define E1000_MSIXBM(_i) (0x01600 + ((_i) * 4)) /* MSI-X Allocation Register
|
||||
* (_i) - RW */
|
||||
#define E1000_MSIXTADD(_i) (0x0C000 + ((_i) * 0x10)) /* MSI-X Table entry addr
|
||||
* low reg - RW */
|
||||
#define E1000_MSIXTUADD(_i) (0x0C004 + ((_i) * 0x10)) /* MSI-X Table entry addr
|
||||
* upper reg - RW */
|
||||
#define E1000_MSIXTMSG(_i) (0x0C008 + ((_i) * 0x10)) /* MSI-X Table entry
|
||||
* message reg - RW */
|
||||
#define E1000_MSIXVCTRL(_i) (0x0C00C + ((_i) * 0x10)) /* MSI-X Table entry
|
||||
* vector ctrl reg - RW */
|
||||
#define E1000_MSIXPBA 0x0E000 /* MSI-X Pending bit array */
|
||||
#define E1000_RETA(_i) (0x05C00 + ((_i) * 4)) /* Redirection Table - RW */
|
||||
#define E1000_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* RSS Random Key - RW */
|
||||
#define E1000_RSSIM 0x05864 /* RSS Interrupt Mask */
|
||||
#define E1000_RSSIR 0x05868 /* RSS Interrupt Request */
|
||||
#define E1000_RXMTRL 0x0B634 /* Time sync Rx EtherType and Msg Type - RW */
|
||||
#define E1000_RXUDP 0x0B638 /* Time Sync Rx UDP Port - RW */
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,105 +1,106 @@
|
|||
/*******************************************************************************
|
||||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
#ifndef _E1000E_HW_H_
|
||||
#define _E1000E_HW_H_
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _E1000_HW_H_
|
||||
#define _E1000_HW_H_
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
#include "e1000_osdep.h"
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
#include "e1000_regs.h"
|
||||
#include "e1000_defines.h"
|
||||
#include "regs.h"
|
||||
#include "defines.h"
|
||||
|
||||
struct e1000_hw;
|
||||
|
||||
#define E1000_DEV_ID_82571EB_COPPER 0x105E
|
||||
#define E1000_DEV_ID_82571EB_FIBER 0x105F
|
||||
#define E1000_DEV_ID_82571EB_SERDES 0x1060
|
||||
#define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9
|
||||
#define E1000_DEV_ID_82571EB_SERDES_QUAD 0x10DA
|
||||
#define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4
|
||||
#define E1000_DEV_ID_82571PT_QUAD_COPPER 0x10D5
|
||||
#define E1000_DEV_ID_82571EB_QUAD_FIBER 0x10A5
|
||||
#define E1000_DEV_ID_82571EB_QUAD_COPPER_LP 0x10BC
|
||||
#define E1000_DEV_ID_82572EI_COPPER 0x107D
|
||||
#define E1000_DEV_ID_82572EI_FIBER 0x107E
|
||||
#define E1000_DEV_ID_82572EI_SERDES 0x107F
|
||||
#define E1000_DEV_ID_82572EI 0x10B9
|
||||
#define E1000_DEV_ID_82573E 0x108B
|
||||
#define E1000_DEV_ID_82573E_IAMT 0x108C
|
||||
#define E1000_DEV_ID_82573L 0x109A
|
||||
#define E1000_DEV_ID_82574L 0x10D3
|
||||
#define E1000_DEV_ID_82574LA 0x10F6
|
||||
#define E1000_DEV_ID_82583V 0x150C
|
||||
#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096
|
||||
#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
|
||||
#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT 0x10BA
|
||||
#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT 0x10BB
|
||||
#define E1000_DEV_ID_ICH8_82567V_3 0x1501
|
||||
#define E1000_DEV_ID_ICH8_IGP_M_AMT 0x1049
|
||||
#define E1000_DEV_ID_ICH8_IGP_AMT 0x104A
|
||||
#define E1000_DEV_ID_ICH8_IGP_C 0x104B
|
||||
#define E1000_DEV_ID_ICH8_IFE 0x104C
|
||||
#define E1000_DEV_ID_ICH8_IFE_GT 0x10C4
|
||||
#define E1000_DEV_ID_ICH8_IFE_G 0x10C5
|
||||
#define E1000_DEV_ID_ICH8_IGP_M 0x104D
|
||||
#define E1000_DEV_ID_ICH9_IGP_M 0x10BF
|
||||
#define E1000_DEV_ID_ICH9_IGP_M_AMT 0x10F5
|
||||
#define E1000_DEV_ID_ICH9_IGP_M_V 0x10CB
|
||||
#define E1000_DEV_ID_ICH9_IGP_AMT 0x10BD
|
||||
#define E1000_DEV_ID_ICH9_BM 0x10E5
|
||||
#define E1000_DEV_ID_ICH9_IGP_C 0x294C
|
||||
#define E1000_DEV_ID_ICH9_IFE 0x10C0
|
||||
#define E1000_DEV_ID_ICH9_IFE_GT 0x10C3
|
||||
#define E1000_DEV_ID_ICH9_IFE_G 0x10C2
|
||||
#define E1000_DEV_ID_ICH10_R_BM_LM 0x10CC
|
||||
#define E1000_DEV_ID_ICH10_R_BM_LF 0x10CD
|
||||
#define E1000_DEV_ID_ICH10_R_BM_V 0x10CE
|
||||
#define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE
|
||||
#define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF
|
||||
#define E1000_DEV_ID_PCH_M_HV_LM 0x10EA
|
||||
#define E1000_DEV_ID_PCH_M_HV_LC 0x10EB
|
||||
#define E1000_DEV_ID_PCH_D_HV_DM 0x10EF
|
||||
#define E1000_DEV_ID_PCH_D_HV_DC 0x10F0
|
||||
#define E1000_REVISION_0 0
|
||||
#define E1000_REVISION_1 1
|
||||
#define E1000_REVISION_2 2
|
||||
#define E1000_REVISION_3 3
|
||||
#define E1000_REVISION_4 4
|
||||
#define E1000_DEV_ID_82571EB_COPPER 0x105E
|
||||
#define E1000_DEV_ID_82571EB_FIBER 0x105F
|
||||
#define E1000_DEV_ID_82571EB_SERDES 0x1060
|
||||
#define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4
|
||||
#define E1000_DEV_ID_82571PT_QUAD_COPPER 0x10D5
|
||||
#define E1000_DEV_ID_82571EB_QUAD_FIBER 0x10A5
|
||||
#define E1000_DEV_ID_82571EB_QUAD_COPPER_LP 0x10BC
|
||||
#define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9
|
||||
#define E1000_DEV_ID_82571EB_SERDES_QUAD 0x10DA
|
||||
#define E1000_DEV_ID_82572EI_COPPER 0x107D
|
||||
#define E1000_DEV_ID_82572EI_FIBER 0x107E
|
||||
#define E1000_DEV_ID_82572EI_SERDES 0x107F
|
||||
#define E1000_DEV_ID_82572EI 0x10B9
|
||||
#define E1000_DEV_ID_82573E 0x108B
|
||||
#define E1000_DEV_ID_82573E_IAMT 0x108C
|
||||
#define E1000_DEV_ID_82573L 0x109A
|
||||
#define E1000_DEV_ID_82574L 0x10D3
|
||||
#define E1000_DEV_ID_82574LA 0x10F6
|
||||
#define E1000_DEV_ID_82583V 0x150C
|
||||
#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096
|
||||
#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
|
||||
#define E1000_DEV_ID_80003ES2LAN_COPPER_SPT 0x10BA
|
||||
#define E1000_DEV_ID_80003ES2LAN_SERDES_SPT 0x10BB
|
||||
#define E1000_DEV_ID_ICH8_82567V_3 0x1501
|
||||
#define E1000_DEV_ID_ICH8_IGP_M_AMT 0x1049
|
||||
#define E1000_DEV_ID_ICH8_IGP_AMT 0x104A
|
||||
#define E1000_DEV_ID_ICH8_IGP_C 0x104B
|
||||
#define E1000_DEV_ID_ICH8_IFE 0x104C
|
||||
#define E1000_DEV_ID_ICH8_IFE_GT 0x10C4
|
||||
#define E1000_DEV_ID_ICH8_IFE_G 0x10C5
|
||||
#define E1000_DEV_ID_ICH8_IGP_M 0x104D
|
||||
#define E1000_DEV_ID_ICH9_IGP_AMT 0x10BD
|
||||
#define E1000_DEV_ID_ICH9_BM 0x10E5
|
||||
#define E1000_DEV_ID_ICH9_IGP_M_AMT 0x10F5
|
||||
#define E1000_DEV_ID_ICH9_IGP_M 0x10BF
|
||||
#define E1000_DEV_ID_ICH9_IGP_M_V 0x10CB
|
||||
#define E1000_DEV_ID_ICH9_IGP_C 0x294C
|
||||
#define E1000_DEV_ID_ICH9_IFE 0x10C0
|
||||
#define E1000_DEV_ID_ICH9_IFE_GT 0x10C3
|
||||
#define E1000_DEV_ID_ICH9_IFE_G 0x10C2
|
||||
#define E1000_DEV_ID_ICH10_R_BM_LM 0x10CC
|
||||
#define E1000_DEV_ID_ICH10_R_BM_LF 0x10CD
|
||||
#define E1000_DEV_ID_ICH10_R_BM_V 0x10CE
|
||||
#define E1000_DEV_ID_ICH10_D_BM_LM 0x10DE
|
||||
#define E1000_DEV_ID_ICH10_D_BM_LF 0x10DF
|
||||
#define E1000_DEV_ID_ICH10_D_BM_V 0x1525
|
||||
#define E1000_DEV_ID_PCH_M_HV_LM 0x10EA
|
||||
#define E1000_DEV_ID_PCH_M_HV_LC 0x10EB
|
||||
#define E1000_DEV_ID_PCH_D_HV_DM 0x10EF
|
||||
#define E1000_DEV_ID_PCH_D_HV_DC 0x10F0
|
||||
#define E1000_DEV_ID_PCH2_LV_LM 0x1502
|
||||
#define E1000_DEV_ID_PCH2_LV_V 0x1503
|
||||
#define E1000_DEV_ID_PCH_LPT_I217_LM 0x153A
|
||||
#define E1000_DEV_ID_PCH_LPT_I217_V 0x153B
|
||||
#define E1000_DEV_ID_PCH_LPTLP_I218_LM 0x155A
|
||||
#define E1000_DEV_ID_PCH_LPTLP_I218_V 0x1559
|
||||
#define E1000_DEV_ID_PCH_I218_LM2 0x15A0
|
||||
#define E1000_DEV_ID_PCH_I218_V2 0x15A1
|
||||
#define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */
|
||||
#define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */
|
||||
#define E1000_DEV_ID_PCH_SPT_I219_LM 0x156F /* Sunrise Point PCH */
|
||||
#define E1000_DEV_ID_PCH_SPT_I219_V 0x1570 /* Sunrise Point PCH */
|
||||
#define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B8 /* Sunrise Point-H PCH */
|
||||
#define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B7 /* Sunrise Point-H PCH */
|
||||
|
||||
#define E1000_FUNC_0 0
|
||||
#define E1000_FUNC_1 1
|
||||
#define E1000_REVISION_4 4
|
||||
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
|
||||
#define E1000_FUNC_1 1
|
||||
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
|
||||
|
||||
enum e1000_mac_type {
|
||||
e1000_undefined = 0,
|
||||
e1000_82571,
|
||||
e1000_82572,
|
||||
e1000_82573,
|
||||
|
@ -110,7 +111,9 @@ enum e1000_mac_type {
|
|||
e1000_ich9lan,
|
||||
e1000_ich10lan,
|
||||
e1000_pchlan,
|
||||
e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
|
||||
e1000_pch2lan,
|
||||
e1000_pch_lpt,
|
||||
e1000_pch_spt,
|
||||
};
|
||||
|
||||
enum e1000_media_type {
|
||||
|
@ -132,7 +135,7 @@ enum e1000_nvm_type {
|
|||
enum e1000_nvm_override {
|
||||
e1000_nvm_override_none = 0,
|
||||
e1000_nvm_override_spi_small,
|
||||
e1000_nvm_override_spi_large,
|
||||
e1000_nvm_override_spi_large
|
||||
};
|
||||
|
||||
enum e1000_phy_type {
|
||||
|
@ -147,26 +150,8 @@ enum e1000_phy_type {
|
|||
e1000_phy_bm,
|
||||
e1000_phy_82578,
|
||||
e1000_phy_82577,
|
||||
};
|
||||
|
||||
enum e1000_bus_type {
|
||||
e1000_bus_type_unknown = 0,
|
||||
e1000_bus_type_pci,
|
||||
e1000_bus_type_pcix,
|
||||
e1000_bus_type_pci_express,
|
||||
e1000_bus_type_reserved
|
||||
};
|
||||
|
||||
enum e1000_bus_speed {
|
||||
e1000_bus_speed_unknown = 0,
|
||||
e1000_bus_speed_33,
|
||||
e1000_bus_speed_66,
|
||||
e1000_bus_speed_100,
|
||||
e1000_bus_speed_120,
|
||||
e1000_bus_speed_133,
|
||||
e1000_bus_speed_2500,
|
||||
e1000_bus_speed_5000,
|
||||
e1000_bus_speed_reserved
|
||||
e1000_phy_82579,
|
||||
e1000_phy_i217,
|
||||
};
|
||||
|
||||
enum e1000_bus_width {
|
||||
|
@ -220,16 +205,15 @@ enum e1000_serdes_link_state {
|
|||
e1000_serdes_link_forced_up
|
||||
};
|
||||
|
||||
/* Receive Descriptor */
|
||||
struct e1000_rx_desc {
|
||||
__le64 buffer_addr; /* Address of the descriptor's data buffer */
|
||||
__le16 length; /* Length of data DMAed into data buffer */
|
||||
__le16 csum; /* Packet checksum */
|
||||
u8 status; /* Descriptor status */
|
||||
u8 errors; /* Descriptor Errors */
|
||||
__le16 special;
|
||||
};
|
||||
|
||||
#ifndef __le16
|
||||
#define __le16 u16
|
||||
#endif
|
||||
#ifndef __le32
|
||||
#define __le32 u32
|
||||
#endif
|
||||
#ifndef __le64
|
||||
#define __le64 u64
|
||||
#endif
|
||||
/* Receive Descriptor - Extended */
|
||||
union e1000_rx_desc_extended {
|
||||
struct {
|
||||
|
@ -238,24 +222,28 @@ union e1000_rx_desc_extended {
|
|||
} read;
|
||||
struct {
|
||||
struct {
|
||||
__le32 mrq; /* Multiple Rx Queues */
|
||||
__le32 mrq; /* Multiple Rx Queues */
|
||||
union {
|
||||
__le32 rss; /* RSS Hash */
|
||||
__le32 rss; /* RSS Hash */
|
||||
struct {
|
||||
__le16 ip_id; /* IP id */
|
||||
__le16 csum; /* Packet Checksum */
|
||||
__le16 ip_id; /* IP id */
|
||||
__le16 csum; /* Packet Checksum */
|
||||
} csum_ip;
|
||||
} hi_dword;
|
||||
} lower;
|
||||
struct {
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le16 length;
|
||||
__le16 vlan; /* VLAN tag */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
} upper;
|
||||
} wb; /* writeback */
|
||||
} wb; /* writeback */
|
||||
};
|
||||
|
||||
#define MAX_PS_BUFFERS 4
|
||||
|
||||
/* Number of packet split data buffers (not including the header buffer) */
|
||||
#define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
|
||||
|
||||
/* Receive Descriptor - Packet Split */
|
||||
union e1000_rx_desc_packet_split {
|
||||
struct {
|
||||
|
@ -264,44 +252,45 @@ union e1000_rx_desc_packet_split {
|
|||
} read;
|
||||
struct {
|
||||
struct {
|
||||
__le32 mrq; /* Multiple Rx Queues */
|
||||
__le32 mrq; /* Multiple Rx Queues */
|
||||
union {
|
||||
__le32 rss; /* RSS Hash */
|
||||
__le32 rss; /* RSS Hash */
|
||||
struct {
|
||||
__le16 ip_id; /* IP id */
|
||||
__le16 csum; /* Packet Checksum */
|
||||
__le16 ip_id; /* IP id */
|
||||
__le16 csum; /* Packet Checksum */
|
||||
} csum_ip;
|
||||
} hi_dword;
|
||||
} lower;
|
||||
struct {
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le16 length0; /* length of buffer 0 */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le16 length0; /* length of buffer 0 */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
} middle;
|
||||
struct {
|
||||
__le16 header_status;
|
||||
__le16 length[3]; /* length of buffers 1-3 */
|
||||
/* length of buffers 1-3 */
|
||||
__le16 length[PS_PAGE_BUFFERS];
|
||||
} upper;
|
||||
__le64 reserved;
|
||||
} wb; /* writeback */
|
||||
} wb; /* writeback */
|
||||
};
|
||||
|
||||
/* Transmit Descriptor */
|
||||
struct e1000_tx_desc {
|
||||
__le64 buffer_addr; /* Address of the descriptor's data buffer */
|
||||
__le64 buffer_addr; /* Address of the descriptor's data buffer */
|
||||
union {
|
||||
__le32 data;
|
||||
struct {
|
||||
__le16 length; /* Data buffer length */
|
||||
u8 cso; /* Checksum offset */
|
||||
u8 cmd; /* Descriptor control */
|
||||
__le16 length; /* Data buffer length */
|
||||
u8 cso; /* Checksum offset */
|
||||
u8 cmd; /* Descriptor control */
|
||||
} flags;
|
||||
} lower;
|
||||
union {
|
||||
__le32 data;
|
||||
struct {
|
||||
u8 status; /* Descriptor status */
|
||||
u8 css; /* Checksum start */
|
||||
u8 status; /* Descriptor status */
|
||||
u8 css; /* Checksum start */
|
||||
__le16 special;
|
||||
} fields;
|
||||
} upper;
|
||||
|
@ -312,37 +301,37 @@ struct e1000_context_desc {
|
|||
union {
|
||||
__le32 ip_config;
|
||||
struct {
|
||||
u8 ipcss; /* IP checksum start */
|
||||
u8 ipcso; /* IP checksum offset */
|
||||
__le16 ipcse; /* IP checksum end */
|
||||
u8 ipcss; /* IP checksum start */
|
||||
u8 ipcso; /* IP checksum offset */
|
||||
__le16 ipcse; /* IP checksum end */
|
||||
} ip_fields;
|
||||
} lower_setup;
|
||||
union {
|
||||
__le32 tcp_config;
|
||||
struct {
|
||||
u8 tucss; /* TCP checksum start */
|
||||
u8 tucso; /* TCP checksum offset */
|
||||
__le16 tucse; /* TCP checksum end */
|
||||
u8 tucss; /* TCP checksum start */
|
||||
u8 tucso; /* TCP checksum offset */
|
||||
__le16 tucse; /* TCP checksum end */
|
||||
} tcp_fields;
|
||||
} upper_setup;
|
||||
__le32 cmd_and_length;
|
||||
union {
|
||||
__le32 data;
|
||||
struct {
|
||||
u8 status; /* Descriptor status */
|
||||
u8 hdr_len; /* Header length */
|
||||
__le16 mss; /* Maximum segment size */
|
||||
u8 status; /* Descriptor status */
|
||||
u8 hdr_len; /* Header length */
|
||||
__le16 mss; /* Maximum segment size */
|
||||
} fields;
|
||||
} tcp_seg_setup;
|
||||
};
|
||||
|
||||
/* Offload data descriptor */
|
||||
struct e1000_data_desc {
|
||||
__le64 buffer_addr; /* Address of the descriptor's buffer address */
|
||||
__le64 buffer_addr; /* Address of the descriptor's buffer address */
|
||||
union {
|
||||
__le32 data;
|
||||
struct {
|
||||
__le16 length; /* Data buffer length */
|
||||
__le16 length; /* Data buffer length */
|
||||
u8 typ_len_ext;
|
||||
u8 cmd;
|
||||
} flags;
|
||||
|
@ -350,8 +339,8 @@ struct e1000_data_desc {
|
|||
union {
|
||||
__le32 data;
|
||||
struct {
|
||||
u8 status; /* Descriptor status */
|
||||
u8 popts; /* Packet Options */
|
||||
u8 status; /* Descriptor status */
|
||||
u8 popts; /* Packet Options */
|
||||
__le16 special;
|
||||
} fields;
|
||||
} upper;
|
||||
|
@ -422,10 +411,8 @@ struct e1000_hw_stats {
|
|||
u64 ictxqmtc;
|
||||
u64 icrxdmtc;
|
||||
u64 icrxoc;
|
||||
u64 doosync;
|
||||
};
|
||||
|
||||
|
||||
struct e1000_phy_stats {
|
||||
u32 idle_errors;
|
||||
u32 receive_errors;
|
||||
|
@ -433,13 +420,13 @@ struct e1000_phy_stats {
|
|||
|
||||
struct e1000_host_mng_dhcp_cookie {
|
||||
u32 signature;
|
||||
u8 status;
|
||||
u8 reserved0;
|
||||
u8 status;
|
||||
u8 reserved0;
|
||||
u16 vlan_id;
|
||||
u32 reserved1;
|
||||
u16 reserved2;
|
||||
u8 reserved3;
|
||||
u8 checksum;
|
||||
u8 reserved3;
|
||||
u8 checksum;
|
||||
};
|
||||
|
||||
/* Host Interface "Rev 1" */
|
||||
|
@ -450,7 +437,7 @@ struct e1000_host_command_header {
|
|||
u8 checksum;
|
||||
};
|
||||
|
||||
#define E1000_HI_MAX_DATA_LENGTH 252
|
||||
#define E1000_HI_MAX_DATA_LENGTH 252
|
||||
struct e1000_host_command_info {
|
||||
struct e1000_host_command_header command_header;
|
||||
u8 command_data[E1000_HI_MAX_DATA_LENGTH];
|
||||
|
@ -458,97 +445,107 @@ struct e1000_host_command_info {
|
|||
|
||||
/* Host Interface "Rev 2" */
|
||||
struct e1000_host_mng_command_header {
|
||||
u8 command_id;
|
||||
u8 checksum;
|
||||
u8 command_id;
|
||||
u8 checksum;
|
||||
u16 reserved1;
|
||||
u16 reserved2;
|
||||
u16 command_length;
|
||||
};
|
||||
|
||||
#define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8
|
||||
#define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8
|
||||
struct e1000_host_mng_command_info {
|
||||
struct e1000_host_mng_command_header command_header;
|
||||
u8 command_data[E1000_HI_MAX_MNG_DATA_LENGTH];
|
||||
};
|
||||
|
||||
#include "e1000_mac.h"
|
||||
#include "e1000_phy.h"
|
||||
#include "e1000_nvm.h"
|
||||
#include "e1000_manage.h"
|
||||
#include "mac.h"
|
||||
#include "phy.h"
|
||||
#include "nvm.h"
|
||||
#include "manage.h"
|
||||
|
||||
/* Function pointers for the MAC. */
|
||||
struct e1000_mac_operations {
|
||||
/* Function pointers for the MAC. */
|
||||
s32 (*init_params)(struct e1000_hw *);
|
||||
s32 (*id_led_init)(struct e1000_hw *);
|
||||
s32 (*blink_led)(struct e1000_hw *);
|
||||
s32 (*check_for_link)(struct e1000_hw *);
|
||||
bool (*check_mng_mode)(struct e1000_hw *hw);
|
||||
s32 (*cleanup_led)(struct e1000_hw *);
|
||||
void (*clear_hw_cntrs)(struct e1000_hw *);
|
||||
void (*clear_vfta)(struct e1000_hw *);
|
||||
s32 (*get_bus_info)(struct e1000_hw *);
|
||||
void (*set_lan_id)(struct e1000_hw *);
|
||||
s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
|
||||
s32 (*led_on)(struct e1000_hw *);
|
||||
s32 (*led_off)(struct e1000_hw *);
|
||||
void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
|
||||
s32 (*reset_hw)(struct e1000_hw *);
|
||||
s32 (*init_hw)(struct e1000_hw *);
|
||||
s32 (*setup_link)(struct e1000_hw *);
|
||||
s32 (*setup_physical_interface)(struct e1000_hw *);
|
||||
s32 (*setup_led)(struct e1000_hw *);
|
||||
void (*write_vfta)(struct e1000_hw *, u32, u32);
|
||||
void (*mta_set)(struct e1000_hw *, u32);
|
||||
void (*config_collision_dist)(struct e1000_hw *);
|
||||
void (*rar_set)(struct e1000_hw *, u8*, u32);
|
||||
s32 (*read_mac_addr)(struct e1000_hw *);
|
||||
s32 (*validate_mdi_setting)(struct e1000_hw *);
|
||||
s32 (*mng_host_if_write)(struct e1000_hw *, u8*, u16, u16, u8*);
|
||||
s32 (*mng_write_cmd_header)(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header*);
|
||||
s32 (*mng_enable_host_if)(struct e1000_hw *);
|
||||
s32 (*wait_autoneg)(struct e1000_hw *);
|
||||
s32 (*id_led_init) (struct e1000_hw *);
|
||||
s32 (*blink_led) (struct e1000_hw *);
|
||||
bool (*check_mng_mode) (struct e1000_hw *);
|
||||
s32 (*check_for_link) (struct e1000_hw *);
|
||||
s32 (*cleanup_led) (struct e1000_hw *);
|
||||
void (*clear_hw_cntrs) (struct e1000_hw *);
|
||||
void (*clear_vfta) (struct e1000_hw *);
|
||||
s32 (*get_bus_info) (struct e1000_hw *);
|
||||
void (*set_lan_id) (struct e1000_hw *);
|
||||
s32 (*get_link_up_info) (struct e1000_hw *, u16 *, u16 *);
|
||||
s32 (*led_on) (struct e1000_hw *);
|
||||
s32 (*led_off) (struct e1000_hw *);
|
||||
void (*update_mc_addr_list) (struct e1000_hw *, u8 *, u32);
|
||||
s32 (*reset_hw) (struct e1000_hw *);
|
||||
s32 (*init_hw) (struct e1000_hw *);
|
||||
s32 (*setup_link) (struct e1000_hw *);
|
||||
s32 (*setup_physical_interface) (struct e1000_hw *);
|
||||
s32 (*setup_led) (struct e1000_hw *);
|
||||
void (*write_vfta) (struct e1000_hw *, u32, u32);
|
||||
void (*config_collision_dist) (struct e1000_hw *);
|
||||
int (*rar_set) (struct e1000_hw *, u8 *, u32);
|
||||
u32 (*rar_get_count) (struct e1000_hw *);
|
||||
s32 (*read_mac_addr) (struct e1000_hw *);
|
||||
s32 (*validate_mdi_setting) (struct e1000_hw *);
|
||||
};
|
||||
|
||||
/* When to use various PHY register access functions:
|
||||
*
|
||||
* Func Caller
|
||||
* Function Does Does When to use
|
||||
* ~~~~~~~~~~~~ ~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* X_reg L,P,A n/a for simple PHY reg accesses
|
||||
* X_reg_locked P,A L for multiple accesses of different regs
|
||||
* on different pages
|
||||
* X_reg_page A L,P for multiple accesses of different regs
|
||||
* on the same page
|
||||
*
|
||||
* Where X=[read|write], L=locking, P=sets page, A=register access
|
||||
*
|
||||
*/
|
||||
struct e1000_phy_operations {
|
||||
s32 (*init_params)(struct e1000_hw *);
|
||||
s32 (*acquire)(struct e1000_hw *);
|
||||
s32 (*cfg_on_link_up)(struct e1000_hw *);
|
||||
s32 (*check_polarity)(struct e1000_hw *);
|
||||
s32 (*check_reset_block)(struct e1000_hw *);
|
||||
s32 (*commit)(struct e1000_hw *);
|
||||
s32 (*force_speed_duplex)(struct e1000_hw *);
|
||||
s32 (*get_cfg_done)(struct e1000_hw *hw);
|
||||
s32 (*get_cable_length)(struct e1000_hw *);
|
||||
s32 (*get_info)(struct e1000_hw *);
|
||||
s32 (*read_reg)(struct e1000_hw *, u32, u16 *);
|
||||
s32 (*read_reg_locked)(struct e1000_hw *, u32, u16 *);
|
||||
void (*release)(struct e1000_hw *);
|
||||
s32 (*reset)(struct e1000_hw *);
|
||||
s32 (*set_d0_lplu_state)(struct e1000_hw *, bool);
|
||||
s32 (*set_d3_lplu_state)(struct e1000_hw *, bool);
|
||||
s32 (*write_reg)(struct e1000_hw *, u32, u16);
|
||||
s32 (*write_reg_locked)(struct e1000_hw *, u32, u16);
|
||||
void (*power_up)(struct e1000_hw *);
|
||||
void (*power_down)(struct e1000_hw *);
|
||||
s32 (*acquire) (struct e1000_hw *);
|
||||
s32 (*cfg_on_link_up) (struct e1000_hw *);
|
||||
s32 (*check_polarity) (struct e1000_hw *);
|
||||
s32 (*check_reset_block) (struct e1000_hw *);
|
||||
s32 (*commit) (struct e1000_hw *);
|
||||
s32 (*force_speed_duplex) (struct e1000_hw *);
|
||||
s32 (*get_cfg_done) (struct e1000_hw *hw);
|
||||
s32 (*get_cable_length) (struct e1000_hw *);
|
||||
s32 (*get_info) (struct e1000_hw *);
|
||||
s32 (*set_page) (struct e1000_hw *, u16);
|
||||
s32 (*read_reg) (struct e1000_hw *, u32, u16 *);
|
||||
s32 (*read_reg_locked) (struct e1000_hw *, u32, u16 *);
|
||||
s32 (*read_reg_page) (struct e1000_hw *, u32, u16 *);
|
||||
void (*release) (struct e1000_hw *);
|
||||
s32 (*reset) (struct e1000_hw *);
|
||||
s32 (*set_d0_lplu_state) (struct e1000_hw *, bool);
|
||||
s32 (*set_d3_lplu_state) (struct e1000_hw *, bool);
|
||||
s32 (*write_reg) (struct e1000_hw *, u32, u16);
|
||||
s32 (*write_reg_locked) (struct e1000_hw *, u32, u16);
|
||||
s32 (*write_reg_page) (struct e1000_hw *, u32, u16);
|
||||
void (*power_up) (struct e1000_hw *);
|
||||
void (*power_down) (struct e1000_hw *);
|
||||
};
|
||||
|
||||
/* Function pointers for the NVM. */
|
||||
struct e1000_nvm_operations {
|
||||
s32 (*init_params)(struct e1000_hw *);
|
||||
s32 (*acquire)(struct e1000_hw *);
|
||||
s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
|
||||
void (*release)(struct e1000_hw *);
|
||||
void (*reload)(struct e1000_hw *);
|
||||
s32 (*update)(struct e1000_hw *);
|
||||
s32 (*valid_led_default)(struct e1000_hw *, u16 *);
|
||||
s32 (*validate)(struct e1000_hw *);
|
||||
s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
|
||||
s32 (*acquire) (struct e1000_hw *);
|
||||
s32 (*read) (struct e1000_hw *, u16, u16, u16 *);
|
||||
void (*release) (struct e1000_hw *);
|
||||
void (*reload) (struct e1000_hw *);
|
||||
s32 (*update) (struct e1000_hw *);
|
||||
s32 (*valid_led_default) (struct e1000_hw *, u16 *);
|
||||
s32 (*validate) (struct e1000_hw *);
|
||||
s32 (*write) (struct e1000_hw *, u16, u16, u16 *);
|
||||
};
|
||||
|
||||
struct e1000_mac_info {
|
||||
struct e1000_mac_operations ops;
|
||||
u8 addr[6];
|
||||
u8 perm_addr[6];
|
||||
u8 addr[ETH_ALEN];
|
||||
u8 perm_addr[ETH_ALEN];
|
||||
|
||||
enum e1000_mac_type type;
|
||||
|
||||
|
@ -568,26 +565,27 @@ struct e1000_mac_info {
|
|||
u16 mta_reg_count;
|
||||
|
||||
/* Maximum size of the MTA register table in all supported adapters */
|
||||
#define MAX_MTA_REG 128
|
||||
#define MAX_MTA_REG 128
|
||||
u32 mta_shadow[MAX_MTA_REG];
|
||||
u16 rar_entry_count;
|
||||
|
||||
u8 forced_speed_duplex;
|
||||
u8 forced_speed_duplex;
|
||||
|
||||
bool adaptive_ifs;
|
||||
bool has_fwsm;
|
||||
bool arc_subsystem_valid;
|
||||
bool asf_firmware_present;
|
||||
bool autoneg;
|
||||
bool autoneg_failed;
|
||||
bool get_link_status;
|
||||
bool in_ifs_mode;
|
||||
enum e1000_serdes_link_state serdes_link_state;
|
||||
bool serdes_has_link;
|
||||
bool tx_pkt_filtering;
|
||||
enum e1000_serdes_link_state serdes_link_state;
|
||||
};
|
||||
|
||||
struct e1000_phy_info {
|
||||
struct e1000_phy_operations ops;
|
||||
|
||||
enum e1000_phy_type type;
|
||||
|
||||
enum e1000_1000t_rx_status local_rx;
|
||||
|
@ -599,7 +597,7 @@ struct e1000_phy_info {
|
|||
|
||||
u32 addr;
|
||||
u32 id;
|
||||
u32 reset_delay_us; /* in usec */
|
||||
u32 reset_delay_us; /* in usec */
|
||||
u32 revision;
|
||||
|
||||
enum e1000_media_type media_type;
|
||||
|
@ -615,13 +613,13 @@ struct e1000_phy_info {
|
|||
bool disable_polarity_correction;
|
||||
bool is_mdix;
|
||||
bool polarity_correction;
|
||||
bool reset_disable;
|
||||
bool speed_downgraded;
|
||||
bool autoneg_wait_to_complete;
|
||||
};
|
||||
|
||||
struct e1000_nvm_info {
|
||||
struct e1000_nvm_operations ops;
|
||||
|
||||
enum e1000_nvm_type type;
|
||||
enum e1000_nvm_override override;
|
||||
|
||||
|
@ -636,22 +634,20 @@ struct e1000_nvm_info {
|
|||
};
|
||||
|
||||
struct e1000_bus_info {
|
||||
enum e1000_bus_type type;
|
||||
enum e1000_bus_speed speed;
|
||||
enum e1000_bus_width width;
|
||||
|
||||
u16 func;
|
||||
u16 pci_cmd_word;
|
||||
};
|
||||
|
||||
struct e1000_fc_info {
|
||||
u32 high_water; /* Flow control high-water mark */
|
||||
u32 low_water; /* Flow control low-water mark */
|
||||
u16 pause_time; /* Flow control pause timer */
|
||||
bool send_xon; /* Flow control send XON */
|
||||
bool strict_ieee; /* Strict IEEE mode */
|
||||
enum e1000_fc_mode current_mode; /* FC mode in effect */
|
||||
enum e1000_fc_mode requested_mode; /* FC mode requested by caller */
|
||||
u32 high_water; /* Flow control high-water mark */
|
||||
u32 low_water; /* Flow control low-water mark */
|
||||
u16 pause_time; /* Flow control pause timer */
|
||||
u16 refresh_time; /* Flow control refresh timer */
|
||||
bool send_xon; /* Flow control send XON */
|
||||
bool strict_ieee; /* Strict IEEE mode */
|
||||
enum e1000_fc_mode current_mode; /* FC mode in effect */
|
||||
enum e1000_fc_mode requested_mode; /* FC mode requested by caller */
|
||||
};
|
||||
|
||||
struct e1000_dev_spec_82571 {
|
||||
|
@ -660,54 +656,58 @@ struct e1000_dev_spec_82571 {
|
|||
};
|
||||
|
||||
struct e1000_dev_spec_80003es2lan {
|
||||
bool mdic_wa_enable;
|
||||
bool mdic_wa_enable;
|
||||
};
|
||||
|
||||
struct e1000_shadow_ram {
|
||||
u16 value;
|
||||
u16 value;
|
||||
bool modified;
|
||||
};
|
||||
|
||||
#define E1000_ICH8_SHADOW_RAM_WORDS 2048
|
||||
|
||||
/* I218 PHY Ultra Low Power (ULP) states */
|
||||
enum e1000_ulp_state {
|
||||
e1000_ulp_state_unknown,
|
||||
e1000_ulp_state_off,
|
||||
e1000_ulp_state_on,
|
||||
};
|
||||
|
||||
struct e1000_dev_spec_ich8lan {
|
||||
bool kmrn_lock_loss_workaround_enabled;
|
||||
struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
|
||||
bool nvm_k1_enabled;
|
||||
bool eee_disable;
|
||||
u16 eee_lp_ability;
|
||||
enum e1000_ulp_state ulp_state;
|
||||
#ifdef DYNAMIC_LTR_SUPPORT
|
||||
u16 lat_enc;
|
||||
u16 max_ltr_enc;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct e1000_hw {
|
||||
struct e1000_adapter *adapter;
|
||||
|
||||
u8 __iomem *hw_addr;
|
||||
u8 __iomem *flash_address;
|
||||
void __iomem *hw_addr;
|
||||
void __iomem *flash_address;
|
||||
|
||||
struct e1000_mac_info mac;
|
||||
struct e1000_fc_info fc;
|
||||
struct e1000_phy_info phy;
|
||||
struct e1000_nvm_info nvm;
|
||||
struct e1000_bus_info bus;
|
||||
struct e1000_mac_info mac;
|
||||
struct e1000_fc_info fc;
|
||||
struct e1000_phy_info phy;
|
||||
struct e1000_nvm_info nvm;
|
||||
struct e1000_bus_info bus;
|
||||
struct e1000_host_mng_dhcp_cookie mng_cookie;
|
||||
|
||||
union {
|
||||
struct e1000_dev_spec_82571 _82571;
|
||||
struct e1000_dev_spec_80003es2lan _80003es2lan;
|
||||
struct e1000_dev_spec_ich8lan ich8lan;
|
||||
struct e1000_dev_spec_82571 e82571;
|
||||
struct e1000_dev_spec_80003es2lan e80003es2lan;
|
||||
struct e1000_dev_spec_ich8lan ich8lan;
|
||||
} dev_spec;
|
||||
|
||||
u16 device_id;
|
||||
u16 subsystem_vendor_id;
|
||||
u16 subsystem_device_id;
|
||||
u16 vendor_id;
|
||||
|
||||
u8 revision_id;
|
||||
};
|
||||
|
||||
#include "e1000_82571.h"
|
||||
#include "e1000_80003es2lan.h"
|
||||
#include "e1000_ich8lan.h"
|
||||
|
||||
/* These functions must be implemented by drivers */
|
||||
s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
|
||||
#include "82571.h"
|
||||
#include "80003es2lan.h"
|
||||
#include "ich8lan.h"
|
||||
|
||||
#endif
|
||||
|
|
5855
vmkdrivers/src_9/drivers/net/e1000e/ich8lan.c
Normal file
5855
vmkdrivers/src_9/drivers/net/e1000e/ich8lan.c
Normal file
File diff suppressed because it is too large
Load diff
308
vmkdrivers/src_9/drivers/net/e1000e/ich8lan.h
Normal file
308
vmkdrivers/src_9/drivers/net/e1000e/ich8lan.h
Normal file
|
@ -0,0 +1,308 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_ICH8LAN_H_
|
||||
#define _E1000E_ICH8LAN_H_
|
||||
|
||||
#define ICH_FLASH_GFPREG 0x0000
|
||||
#define ICH_FLASH_HSFSTS 0x0004
|
||||
#define ICH_FLASH_HSFCTL 0x0006
|
||||
#define ICH_FLASH_FADDR 0x0008
|
||||
#define ICH_FLASH_FDATA0 0x0010
|
||||
|
||||
#ifdef __VMKLNX__
|
||||
#define ICH_FLASH_PR0 0x0074
|
||||
#endif /* __VMKLNX__ */
|
||||
|
||||
/* Requires up to 10 seconds when MNG might be accessing part. */
|
||||
#define ICH_FLASH_READ_COMMAND_TIMEOUT 10000000
|
||||
#define ICH_FLASH_WRITE_COMMAND_TIMEOUT 10000000
|
||||
#define ICH_FLASH_ERASE_COMMAND_TIMEOUT 10000000
|
||||
#define ICH_FLASH_LINEAR_ADDR_MASK 0x00FFFFFF
|
||||
#define ICH_FLASH_CYCLE_REPEAT_COUNT 10
|
||||
|
||||
#define ICH_CYCLE_READ 0
|
||||
#define ICH_CYCLE_WRITE 2
|
||||
#define ICH_CYCLE_ERASE 3
|
||||
|
||||
#define FLASH_GFPREG_BASE_MASK 0x1FFF
|
||||
#define FLASH_SECTOR_ADDR_SHIFT 12
|
||||
|
||||
#define ICH_FLASH_SEG_SIZE_256 256
|
||||
#define ICH_FLASH_SEG_SIZE_4K 4096
|
||||
#define ICH_FLASH_SEG_SIZE_8K 8192
|
||||
#define ICH_FLASH_SEG_SIZE_64K 65536
|
||||
|
||||
#define E1000_ICH_FWSM_RSPCIPHY 0x00000040 /* Reset PHY on PCI Reset */
|
||||
/* FW established a valid mode */
|
||||
#define E1000_ICH_FWSM_FW_VALID 0x00008000
|
||||
#define E1000_ICH_FWSM_PCIM2PCI 0x01000000 /* ME PCIm-to-PCI active */
|
||||
#define E1000_ICH_FWSM_PCIM2PCI_COUNT 2000
|
||||
|
||||
#define E1000_ICH_MNG_IAMT_MODE 0x2
|
||||
|
||||
#define E1000_FWSM_WLOCK_MAC_MASK 0x0380
|
||||
#define E1000_FWSM_WLOCK_MAC_SHIFT 7
|
||||
#define E1000_FWSM_ULP_CFG_DONE 0x00000400 /* Low power cfg done */
|
||||
|
||||
/* Shared Receive Address Registers */
|
||||
#define E1000_SHRAL_PCH_LPT(_i) (0x05408 + ((_i) * 8))
|
||||
#define E1000_SHRAH_PCH_LPT(_i) (0x0540C + ((_i) * 8))
|
||||
|
||||
#define E1000_H2ME 0x05B50 /* Host to ME */
|
||||
#define E1000_H2ME_ULP 0x00000800 /* ULP Indication Bit */
|
||||
#define E1000_H2ME_ENFORCE_SETTINGS 0x00001000 /* Enforce Settings */
|
||||
|
||||
#define ID_LED_DEFAULT_ICH8LAN ((ID_LED_DEF1_DEF2 << 12) | \
|
||||
(ID_LED_OFF1_OFF2 << 8) | \
|
||||
(ID_LED_OFF1_ON2 << 4) | \
|
||||
(ID_LED_DEF1_DEF2))
|
||||
|
||||
#define E1000_ICH_NVM_SIG_WORD 0x13
|
||||
#define E1000_ICH_NVM_SIG_MASK 0xC000
|
||||
#define E1000_ICH_NVM_VALID_SIG_MASK 0xC0
|
||||
#define E1000_ICH_NVM_SIG_VALUE 0x80
|
||||
|
||||
#define E1000_ICH8_LAN_INIT_TIMEOUT 1500
|
||||
|
||||
/* FEXT register bit definition */
|
||||
#define E1000_FEXT_PHY_CABLE_DISCONNECTED 0x00000004
|
||||
|
||||
#define E1000_FEXTNVM_SW_CONFIG 1
|
||||
#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* different on ICH8M */
|
||||
|
||||
#define E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK 0x0C000000
|
||||
#define E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC 0x08000000
|
||||
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3
|
||||
|
||||
#define E1000_FEXTNVM6_REQ_PLL_CLK 0x00000100
|
||||
#define E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION 0x00000200
|
||||
|
||||
#define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020
|
||||
|
||||
#define NVM_SIZE_MULTIPLIER 4096 /*multiplier for NVMS field */
|
||||
#define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs */
|
||||
#define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
|
||||
|
||||
#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
|
||||
|
||||
#define E1000_ICH_RAR_ENTRIES 7
|
||||
#define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */
|
||||
#define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */
|
||||
|
||||
#define PHY_PAGE_SHIFT 5
|
||||
#define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \
|
||||
((reg) & MAX_PHY_REG_ADDRESS))
|
||||
#define IGP3_KMRN_DIAG PHY_REG(770, 19) /* KMRN Diagnostic */
|
||||
#define IGP3_VR_CTRL PHY_REG(776, 18) /* Voltage Regulator Control */
|
||||
|
||||
#define IGP3_KMRN_DIAG_PCS_LOCK_LOSS 0x0002
|
||||
#define IGP3_VR_CTRL_DEV_POWERDOWN_MODE_MASK 0x0300
|
||||
#define IGP3_VR_CTRL_MODE_SHUTDOWN 0x0200
|
||||
|
||||
/* PHY Wakeup Registers and defines */
|
||||
#define BM_PORT_GEN_CFG PHY_REG(BM_PORT_CTRL_PAGE, 17)
|
||||
#define BM_RCTL PHY_REG(BM_WUC_PAGE, 0)
|
||||
#define BM_WUC PHY_REG(BM_WUC_PAGE, 1)
|
||||
#define BM_WUFC PHY_REG(BM_WUC_PAGE, 2)
|
||||
#define BM_WUS PHY_REG(BM_WUC_PAGE, 3)
|
||||
#define BM_RAR_L(_i) (BM_PHY_REG(BM_WUC_PAGE, 16 + ((_i) << 2)))
|
||||
#define BM_RAR_M(_i) (BM_PHY_REG(BM_WUC_PAGE, 17 + ((_i) << 2)))
|
||||
#define BM_RAR_H(_i) (BM_PHY_REG(BM_WUC_PAGE, 18 + ((_i) << 2)))
|
||||
#define BM_RAR_CTRL(_i) (BM_PHY_REG(BM_WUC_PAGE, 19 + ((_i) << 2)))
|
||||
#define BM_MTA(_i) (BM_PHY_REG(BM_WUC_PAGE, 128 + ((_i) << 1)))
|
||||
|
||||
#define BM_RCTL_UPE 0x0001 /* Unicast Promiscuous Mode */
|
||||
#define BM_RCTL_MPE 0x0002 /* Multicast Promiscuous Mode */
|
||||
#define BM_RCTL_MO_SHIFT 3 /* Multicast Offset Shift */
|
||||
#define BM_RCTL_MO_MASK (3 << 3) /* Multicast Offset Mask */
|
||||
#define BM_RCTL_BAM 0x0020 /* Broadcast Accept Mode */
|
||||
#define BM_RCTL_PMCF 0x0040 /* Pass MAC Control Frames */
|
||||
#define BM_RCTL_RFCE 0x0080 /* Rx Flow Control Enable */
|
||||
|
||||
#define HV_LED_CONFIG PHY_REG(768, 30) /* LED Configuration */
|
||||
#define HV_MUX_DATA_CTRL PHY_REG(776, 16)
|
||||
#define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400
|
||||
#define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004
|
||||
#define HV_STATS_PAGE 778
|
||||
/* Half-duplex collision counts */
|
||||
#define HV_SCC_UPPER PHY_REG(HV_STATS_PAGE, 16) /* Single Collision */
|
||||
#define HV_SCC_LOWER PHY_REG(HV_STATS_PAGE, 17)
|
||||
#define HV_ECOL_UPPER PHY_REG(HV_STATS_PAGE, 18) /* Excessive Coll. */
|
||||
#define HV_ECOL_LOWER PHY_REG(HV_STATS_PAGE, 19)
|
||||
#define HV_MCC_UPPER PHY_REG(HV_STATS_PAGE, 20) /* Multiple Collision */
|
||||
#define HV_MCC_LOWER PHY_REG(HV_STATS_PAGE, 21)
|
||||
#define HV_LATECOL_UPPER PHY_REG(HV_STATS_PAGE, 23) /* Late Collision */
|
||||
#define HV_LATECOL_LOWER PHY_REG(HV_STATS_PAGE, 24)
|
||||
#define HV_COLC_UPPER PHY_REG(HV_STATS_PAGE, 25) /* Collision */
|
||||
#define HV_COLC_LOWER PHY_REG(HV_STATS_PAGE, 26)
|
||||
#define HV_DC_UPPER PHY_REG(HV_STATS_PAGE, 27) /* Defer Count */
|
||||
#define HV_DC_LOWER PHY_REG(HV_STATS_PAGE, 28)
|
||||
#define HV_TNCRS_UPPER PHY_REG(HV_STATS_PAGE, 29) /* Tx with no CRS */
|
||||
#define HV_TNCRS_LOWER PHY_REG(HV_STATS_PAGE, 30)
|
||||
|
||||
#define E1000_FCRTV_PCH 0x05F40 /* PCH Flow Control Refresh Timer Value */
|
||||
|
||||
#define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */
|
||||
#define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */
|
||||
|
||||
/* SMBus Control Phy Register */
|
||||
#define CV_SMB_CTRL PHY_REG(769, 23)
|
||||
#define CV_SMB_CTRL_FORCE_SMBUS 0x0001
|
||||
|
||||
/* I218 Ultra Low Power Configuration 1 Register */
|
||||
#define I218_ULP_CONFIG1 PHY_REG(779, 16)
|
||||
#define I218_ULP_CONFIG1_START 0x0001 /* Start auto ULP config */
|
||||
#define I218_ULP_CONFIG1_IND 0x0004 /* Pwr up from ULP indication */
|
||||
#define I218_ULP_CONFIG1_STICKY_ULP 0x0010 /* Set sticky ULP mode */
|
||||
#define I218_ULP_CONFIG1_INBAND_EXIT 0x0020 /* Inband on ULP exit */
|
||||
#define I218_ULP_CONFIG1_WOL_HOST 0x0040 /* WoL Host on ULP exit */
|
||||
#define I218_ULP_CONFIG1_RESET_TO_SMBUS 0x0100 /* Reset to SMBus mode */
|
||||
#define I218_ULP_CONFIG1_DISABLE_SMB_PERST 0x1000 /* Disable on PERST# */
|
||||
|
||||
/* SMBus Address Phy Register */
|
||||
#define HV_SMB_ADDR PHY_REG(768, 26)
|
||||
#define HV_SMB_ADDR_MASK 0x007F
|
||||
#define HV_SMB_ADDR_PEC_EN 0x0200
|
||||
#define HV_SMB_ADDR_VALID 0x0080
|
||||
#define HV_SMB_ADDR_FREQ_MASK 0x1100
|
||||
#define HV_SMB_ADDR_FREQ_LOW_SHIFT 8
|
||||
#define HV_SMB_ADDR_FREQ_HIGH_SHIFT 12
|
||||
|
||||
/* Strapping Option Register - RO */
|
||||
#define E1000_STRAP 0x0000C
|
||||
#define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000
|
||||
#define E1000_STRAP_SMBUS_ADDRESS_SHIFT 17
|
||||
#define E1000_STRAP_SMT_FREQ_MASK 0x00003000
|
||||
#define E1000_STRAP_SMT_FREQ_SHIFT 12
|
||||
|
||||
/* OEM Bits Phy Register */
|
||||
#define HV_OEM_BITS PHY_REG(768, 25)
|
||||
#define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */
|
||||
#define HV_OEM_BITS_GBE_DIS 0x0040 /* Gigabit Disable */
|
||||
#define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */
|
||||
|
||||
/* KMRN Mode Control */
|
||||
#define HV_KMRN_MODE_CTRL PHY_REG(769, 16)
|
||||
#define HV_KMRN_MDIO_SLOW 0x0400
|
||||
|
||||
/* KMRN FIFO Control and Status */
|
||||
#define HV_KMRN_FIFO_CTRLSTA PHY_REG(770, 16)
|
||||
#define HV_KMRN_FIFO_CTRLSTA_PREAMBLE_MASK 0x7000
|
||||
#define HV_KMRN_FIFO_CTRLSTA_PREAMBLE_SHIFT 12
|
||||
|
||||
/* PHY Power Management Control */
|
||||
#define HV_PM_CTRL PHY_REG(770, 17)
|
||||
#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100
|
||||
#define HV_PM_CTRL_K1_ENABLE 0x4000
|
||||
|
||||
#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */
|
||||
|
||||
/* Inband Control */
|
||||
#define I217_INBAND_CTRL PHY_REG(770, 18)
|
||||
#define I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_MASK 0x3F00
|
||||
#define I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_SHIFT 8
|
||||
|
||||
/* Low Power Idle GPIO Control */
|
||||
#define I217_LPI_GPIO_CTRL PHY_REG(772, 18)
|
||||
#define I217_LPI_GPIO_CTRL_AUTO_EN_LPI 0x0800
|
||||
|
||||
/* PHY Low Power Idle Control */
|
||||
#define I82579_LPI_CTRL PHY_REG(772, 20)
|
||||
#define I82579_LPI_CTRL_100_ENABLE 0x2000
|
||||
#define I82579_LPI_CTRL_1000_ENABLE 0x4000
|
||||
#define I82579_LPI_CTRL_ENABLE_MASK 0x6000
|
||||
|
||||
/* 82579 DFT Control */
|
||||
#define I82579_DFT_CTRL PHY_REG(769, 20)
|
||||
#define I82579_DFT_CTRL_GATE_PHY_RESET 0x0040 /* Gate PHY Reset on MAC Reset */
|
||||
|
||||
/* Extended Management Interface (EMI) Registers */
|
||||
#define I82579_EMI_ADDR 0x10
|
||||
#define I82579_EMI_DATA 0x11
|
||||
#define I82579_LPI_UPDATE_TIMER 0x4805 /* in 40ns units + 40 ns base value */
|
||||
#define I82579_MSE_THRESHOLD 0x084F /* 82579 Mean Square Error Threshold */
|
||||
#define I82577_MSE_THRESHOLD 0x0887 /* 82577 Mean Square Error Threshold */
|
||||
#define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */
|
||||
#define I82579_RX_CONFIG 0x3412 /* Receive configuration */
|
||||
#define I82579_LPI_PLL_SHUT 0x4412 /* LPI PLL Shut Enable */
|
||||
#define I82579_EEE_PCS_STATUS 0x182E /* IEEE MMD Register 3.1 >> 8 */
|
||||
#define I82579_EEE_CAPABILITY 0x0410 /* IEEE MMD Register 3.20 */
|
||||
#define I82579_EEE_ADVERTISEMENT 0x040E /* IEEE MMD Register 7.60 */
|
||||
#define I82579_EEE_LP_ABILITY 0x040F /* IEEE MMD Register 7.61 */
|
||||
#define I82579_EEE_100_SUPPORTED (1 << 1) /* 100BaseTx EEE */
|
||||
#define I82579_EEE_1000_SUPPORTED (1 << 2) /* 1000BaseTx EEE */
|
||||
#define I82579_LPI_100_PLL_SHUT (1 << 2) /* 100M LPI PLL Shut Enabled */
|
||||
#define I217_EEE_PCS_STATUS 0x9401 /* IEEE MMD Register 3.1 */
|
||||
#define I217_EEE_CAPABILITY 0x8000 /* IEEE MMD Register 3.20 */
|
||||
#define I217_EEE_ADVERTISEMENT 0x8001 /* IEEE MMD Register 7.60 */
|
||||
#define I217_EEE_LP_ABILITY 0x8002 /* IEEE MMD Register 7.61 */
|
||||
#define I217_RX_CONFIG 0xB20C /* Receive configuration */
|
||||
|
||||
#define E1000_EEE_RX_LPI_RCVD 0x0400 /* Tx LP idle received */
|
||||
#define E1000_EEE_TX_LPI_RCVD 0x0800 /* Rx LP idle received */
|
||||
|
||||
/* Intel Rapid Start Technology Support */
|
||||
#define I217_PROXY_CTRL BM_PHY_REG(BM_WUC_PAGE, 70)
|
||||
#define I217_PROXY_CTRL_AUTO_DISABLE 0x0080
|
||||
#define I217_SxCTRL PHY_REG(BM_PORT_CTRL_PAGE, 28)
|
||||
#define I217_SxCTRL_ENABLE_LPI_RESET 0x1000
|
||||
#define I217_CGFREG PHY_REG(772, 29)
|
||||
#define I217_CGFREG_ENABLE_MTA_RESET 0x0002
|
||||
#define I217_MEMPWR PHY_REG(772, 26)
|
||||
#define I217_MEMPWR_DISABLE_SMB_RELEASE 0x0010
|
||||
|
||||
/* Receive Address Initial CRC Calculation */
|
||||
#define E1000_PCH_RAICC(_n) (0x05F50 + ((_n) * 4))
|
||||
|
||||
/* Latency Tolerance Reporting */
|
||||
#define E1000_LTRV 0x000F8
|
||||
#define E1000_LTRV_SCALE_MAX 5
|
||||
#define E1000_LTRV_SCALE_FACTOR 5
|
||||
#define E1000_LTRV_REQ_SHIFT 15
|
||||
#define E1000_LTRV_NOSNOOP_SHIFT 16
|
||||
#define E1000_LTRV_SEND (1 << 30)
|
||||
|
||||
/* Proprietary Latency Tolerance Reporting PCI Capability */
|
||||
#define E1000_PCI_LTR_CAP_LPT 0xA8
|
||||
|
||||
#define E1000_PCI_REVISION_ID_REG 0x08
|
||||
void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
|
||||
bool state);
|
||||
void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw);
|
||||
void e1000_resume_workarounds_pchlan(struct e1000_hw *hw);
|
||||
s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
|
||||
void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
|
||||
s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
|
||||
s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
|
||||
s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
|
||||
s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
|
||||
s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx);
|
||||
#endif /* _E1000E_ICH8LAN_H_ */
|
||||
#ifdef DYNAMIC_LTR_SUPPORT
|
||||
void e1000_demote_ltr(struct e1000_hw *hw, bool demote, bool link);
|
||||
#endif /* DYNAMIC_LTR_SUPPORT */
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,30 +1,24 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
/*
|
||||
* net/core/ethtool.c - Ethtool ioctl handler
|
||||
|
@ -62,49 +56,48 @@
|
|||
#undef ADVERTISED_10000baseT_Full
|
||||
#define ADVERTISED_10000baseT_Full (1 << 12)
|
||||
#undef SPEED_10000
|
||||
#define SPEED_10000 10000
|
||||
|
||||
#undef ethtool_ops
|
||||
#define ethtool_ops _kc_ethtool_ops
|
||||
|
||||
struct _kc_ethtool_ops {
|
||||
int (*get_settings)(struct net_device *, struct ethtool_cmd *);
|
||||
int (*set_settings)(struct net_device *, struct ethtool_cmd *);
|
||||
void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);
|
||||
int (*get_regs_len)(struct net_device *);
|
||||
void (*get_regs)(struct net_device *, struct ethtool_regs *, void *);
|
||||
void (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
|
||||
int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
|
||||
u32 (*get_msglevel)(struct net_device *);
|
||||
void (*set_msglevel)(struct net_device *, u32);
|
||||
int (*nway_reset)(struct net_device *);
|
||||
u32 (*get_link)(struct net_device *);
|
||||
int (*get_eeprom_len)(struct net_device *);
|
||||
int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
|
||||
int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *);
|
||||
int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);
|
||||
int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);
|
||||
void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *);
|
||||
int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *);
|
||||
void (*get_pauseparam)(struct net_device *,
|
||||
struct ethtool_pauseparam*);
|
||||
int (*set_pauseparam)(struct net_device *,
|
||||
struct ethtool_pauseparam*);
|
||||
u32 (*get_rx_csum)(struct net_device *);
|
||||
int (*set_rx_csum)(struct net_device *, u32);
|
||||
u32 (*get_tx_csum)(struct net_device *);
|
||||
int (*set_tx_csum)(struct net_device *, u32);
|
||||
u32 (*get_sg)(struct net_device *);
|
||||
int (*set_sg)(struct net_device *, u32);
|
||||
u32 (*get_tso)(struct net_device *);
|
||||
int (*set_tso)(struct net_device *, u32);
|
||||
int (*self_test_count)(struct net_device *);
|
||||
void (*self_test)(struct net_device *, struct ethtool_test *, u64 *);
|
||||
void (*get_strings)(struct net_device *, u32 stringset, u8 *);
|
||||
int (*phys_id)(struct net_device *, u32);
|
||||
int (*get_stats_count)(struct net_device *);
|
||||
void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *,
|
||||
u64 *);
|
||||
int (*get_settings) (struct net_device *, struct ethtool_cmd *);
|
||||
int (*set_settings) (struct net_device *, struct ethtool_cmd *);
|
||||
void (*get_drvinfo) (struct net_device *, struct ethtool_drvinfo *);
|
||||
int (*get_regs_len) (struct net_device *);
|
||||
void (*get_regs) (struct net_device *, struct ethtool_regs *, void *);
|
||||
void (*get_wol) (struct net_device *, struct ethtool_wolinfo *);
|
||||
int (*set_wol) (struct net_device *, struct ethtool_wolinfo *);
|
||||
u32 (*get_msglevel) (struct net_device *);
|
||||
void (*set_msglevel) (struct net_device *, u32);
|
||||
int (*nway_reset) (struct net_device *);
|
||||
u32 (*get_link) (struct net_device *);
|
||||
int (*get_eeprom_len) (struct net_device *);
|
||||
int (*get_eeprom) (struct net_device *, struct ethtool_eeprom *, u8 *);
|
||||
int (*set_eeprom) (struct net_device *, struct ethtool_eeprom *, u8 *);
|
||||
int (*get_coalesce) (struct net_device *, struct ethtool_coalesce *);
|
||||
int (*set_coalesce) (struct net_device *, struct ethtool_coalesce *);
|
||||
void (*get_ringparam) (struct net_device *, struct ethtool_ringparam *);
|
||||
int (*set_ringparam) (struct net_device *, struct ethtool_ringparam *);
|
||||
void (*get_pauseparam) (struct net_device *,
|
||||
struct ethtool_pauseparam *);
|
||||
int (*set_pauseparam) (struct net_device *,
|
||||
struct ethtool_pauseparam *);
|
||||
u32 (*get_rx_csum) (struct net_device *);
|
||||
int (*set_rx_csum) (struct net_device *, u32);
|
||||
u32 (*get_tx_csum) (struct net_device *);
|
||||
int (*set_tx_csum) (struct net_device *, u32);
|
||||
u32 (*get_sg) (struct net_device *);
|
||||
int (*set_sg) (struct net_device *, u32);
|
||||
u32 (*get_tso) (struct net_device *);
|
||||
int (*set_tso) (struct net_device *, u32);
|
||||
int (*self_test_count) (struct net_device *);
|
||||
void (*self_test) (struct net_device *, struct ethtool_test *, u64 *);
|
||||
void (*get_strings) (struct net_device *, u32 stringset, u8 *);
|
||||
int (*phys_id) (struct net_device *, u32);
|
||||
int (*get_stats_count) (struct net_device *);
|
||||
void (*get_ethtool_stats) (struct net_device *, struct ethtool_stats *,
|
||||
u64 *);
|
||||
} *ethtool_ops = NULL;
|
||||
|
||||
#undef SET_ETHTOOL_OPS
|
||||
|
@ -783,7 +776,7 @@ out:
|
|||
int ethtool_ioctl(struct ifreq *ifr)
|
||||
{
|
||||
struct net_device *dev = __dev_get_by_name(ifr->ifr_name);
|
||||
void *useraddr = (void *) ifr->ifr_data;
|
||||
void *useraddr = (void *)ifr->ifr_data;
|
||||
u32 ethcmd;
|
||||
|
||||
/*
|
||||
|
@ -796,7 +789,7 @@ int ethtool_ioctl(struct ifreq *ifr)
|
|||
if (!dev || !netif_device_present(dev))
|
||||
return -ENODEV;
|
||||
|
||||
if (copy_from_user(ðcmd, useraddr, sizeof (ethcmd)))
|
||||
if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd)))
|
||||
return -EFAULT;
|
||||
|
||||
switch (ethcmd) {
|
||||
|
@ -874,12 +867,13 @@ struct _kc_mii_if_info {
|
|||
int phy_id_mask;
|
||||
int reg_num_mask;
|
||||
|
||||
unsigned int full_duplex : 1; /* is full duplex? */
|
||||
unsigned int force_media : 1; /* is autoneg. disabled? */
|
||||
unsigned int full_duplex:1; /* is full duplex? */
|
||||
unsigned int force_media:1; /* is autoneg. disabled? */
|
||||
|
||||
struct net_device *dev;
|
||||
int (*mdio_read) (struct net_device *dev, int phy_id, int location);
|
||||
void (*mdio_write) (struct net_device *dev, int phy_id, int location, int val);
|
||||
int (*mdio_read) (struct net_device * dev, int phy_id, int location);
|
||||
void (*mdio_write) (struct net_device * dev, int phy_id, int location,
|
||||
int val);
|
||||
};
|
||||
|
||||
struct ethtool_cmd;
|
||||
|
@ -895,19 +889,20 @@ struct mii_ioctl_data;
|
|||
#define mii_ethtool_sset _kc_mii_ethtool_sset
|
||||
#undef mii_check_link
|
||||
#define mii_check_link _kc_mii_check_link
|
||||
extern int _kc_mii_link_ok(struct mii_if_info *mii);
|
||||
extern int _kc_mii_nway_restart(struct mii_if_info *mii);
|
||||
extern int _kc_mii_ethtool_gset(struct mii_if_info *mii,
|
||||
struct ethtool_cmd *ecmd);
|
||||
extern int _kc_mii_ethtool_sset(struct mii_if_info *mii,
|
||||
struct ethtool_cmd *ecmd);
|
||||
extern void _kc_mii_check_link(struct mii_if_info *mii);
|
||||
#if ( LINUX_VERSION_CODE > KERNEL_VERSION(2,4,6) )
|
||||
#undef generic_mii_ioctl
|
||||
#define generic_mii_ioctl _kc_generic_mii_ioctl
|
||||
extern int _kc_mii_link_ok (struct mii_if_info *mii);
|
||||
extern int _kc_mii_nway_restart (struct mii_if_info *mii);
|
||||
extern int _kc_mii_ethtool_gset(struct mii_if_info *mii,
|
||||
struct ethtool_cmd *ecmd);
|
||||
extern int _kc_mii_ethtool_sset(struct mii_if_info *mii,
|
||||
struct ethtool_cmd *ecmd);
|
||||
extern void _kc_mii_check_link (struct mii_if_info *mii);
|
||||
extern int _kc_generic_mii_ioctl(struct mii_if_info *mii_if,
|
||||
struct mii_ioctl_data *mii_data, int cmd,
|
||||
unsigned int *duplex_changed);
|
||||
|
||||
struct mii_ioctl_data *mii_data, int cmd,
|
||||
unsigned int *duplex_changed);
|
||||
#endif /* > 2.4.6 */
|
||||
|
||||
struct _kc_pci_dev_ext {
|
||||
struct pci_dev *dev;
|
||||
|
@ -920,7 +915,6 @@ struct _kc_net_dev_ext {
|
|||
unsigned int carrier;
|
||||
};
|
||||
|
||||
|
||||
/**************************************/
|
||||
/* mii support */
|
||||
|
||||
|
@ -976,7 +970,8 @@ int _kc_mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
|
|||
ecmd->autoneg = AUTONEG_DISABLE;
|
||||
|
||||
ecmd->speed = (bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10;
|
||||
ecmd->duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
ecmd->duplex =
|
||||
(bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
}
|
||||
|
||||
/* ignore maxtxpkt, maxrxpkt for now */
|
||||
|
@ -1055,7 +1050,7 @@ int _kc_mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int _kc_mii_link_ok (struct mii_if_info *mii)
|
||||
int _kc_mii_link_ok(struct mii_if_info *mii)
|
||||
{
|
||||
/* first, a dummy read, needed to latch some MII phys */
|
||||
mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
|
||||
|
@ -1064,7 +1059,7 @@ int _kc_mii_link_ok (struct mii_if_info *mii)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int _kc_mii_nway_restart (struct mii_if_info *mii)
|
||||
int _kc_mii_nway_restart(struct mii_if_info *mii)
|
||||
{
|
||||
int bmcr;
|
||||
int r = -EINVAL;
|
||||
|
@ -1081,7 +1076,7 @@ int _kc_mii_nway_restart (struct mii_if_info *mii)
|
|||
return r;
|
||||
}
|
||||
|
||||
void _kc_mii_check_link (struct mii_if_info *mii)
|
||||
void _kc_mii_check_link(struct mii_if_info *mii)
|
||||
{
|
||||
int cur_link = mii_link_ok(mii);
|
||||
int prev_link = netif_carrier_ok(mii->dev);
|
||||
|
@ -1092,9 +1087,10 @@ void _kc_mii_check_link (struct mii_if_info *mii)
|
|||
netif_carrier_off(mii->dev);
|
||||
}
|
||||
|
||||
#if ( LINUX_VERSION_CODE > KERNEL_VERSION(2,4,6) )
|
||||
int _kc_generic_mii_ioctl(struct mii_if_info *mii_if,
|
||||
struct mii_ioctl_data *mii_data, int cmd,
|
||||
unsigned int *duplex_chg_out)
|
||||
struct mii_ioctl_data *mii_data, int cmd,
|
||||
unsigned int *duplex_chg_out)
|
||||
{
|
||||
int rc = 0;
|
||||
unsigned int duplex_changed = 0;
|
||||
|
@ -1105,56 +1101,60 @@ int _kc_generic_mii_ioctl(struct mii_if_info *mii_if,
|
|||
mii_data->phy_id &= mii_if->phy_id_mask;
|
||||
mii_data->reg_num &= mii_if->reg_num_mask;
|
||||
|
||||
switch(cmd) {
|
||||
switch (cmd) {
|
||||
case SIOCDEVPRIVATE: /* binary compat, remove in 2.5 */
|
||||
case SIOCGMIIPHY:
|
||||
mii_data->phy_id = mii_if->phy_id;
|
||||
/* fall through */
|
||||
|
||||
case SIOCDEVPRIVATE + 1:/* binary compat, remove in 2.5 */
|
||||
case SIOCDEVPRIVATE + 1: /* binary compat, remove in 2.5 */
|
||||
case SIOCGMIIREG:
|
||||
mii_data->val_out =
|
||||
mii_if->mdio_read(mii_if->dev, mii_data->phy_id,
|
||||
mii_data->reg_num);
|
||||
mii_if->mdio_read(mii_if->dev, mii_data->phy_id,
|
||||
mii_data->reg_num);
|
||||
break;
|
||||
|
||||
case SIOCDEVPRIVATE + 2:/* binary compat, remove in 2.5 */
|
||||
case SIOCSMIIREG: {
|
||||
u16 val = mii_data->val_in;
|
||||
case SIOCDEVPRIVATE + 2: /* binary compat, remove in 2.5 */
|
||||
case SIOCSMIIREG:{
|
||||
u16 val = mii_data->val_in;
|
||||
|
||||
if (!capable(CAP_NET_ADMIN))
|
||||
return -EPERM;
|
||||
if (!capable(CAP_NET_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
if (mii_data->phy_id == mii_if->phy_id) {
|
||||
switch(mii_data->reg_num) {
|
||||
case MII_BMCR: {
|
||||
unsigned int new_duplex = 0;
|
||||
if (val & (BMCR_RESET|BMCR_ANENABLE))
|
||||
mii_if->force_media = 0;
|
||||
else
|
||||
mii_if->force_media = 1;
|
||||
if (mii_if->force_media &&
|
||||
(val & BMCR_FULLDPLX))
|
||||
new_duplex = 1;
|
||||
if (mii_if->full_duplex != new_duplex) {
|
||||
duplex_changed = 1;
|
||||
mii_if->full_duplex = new_duplex;
|
||||
if (mii_data->phy_id == mii_if->phy_id) {
|
||||
switch (mii_data->reg_num) {
|
||||
case MII_BMCR:{
|
||||
unsigned int new_duplex = 0;
|
||||
if (val &
|
||||
(BMCR_RESET |
|
||||
BMCR_ANENABLE))
|
||||
mii_if->force_media = 0;
|
||||
else
|
||||
mii_if->force_media = 1;
|
||||
if (mii_if->force_media &&
|
||||
(val & BMCR_FULLDPLX))
|
||||
new_duplex = 1;
|
||||
if (mii_if->full_duplex !=
|
||||
new_duplex) {
|
||||
duplex_changed = 1;
|
||||
mii_if->full_duplex =
|
||||
new_duplex;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MII_ADVERTISE:
|
||||
mii_if->advertising = val;
|
||||
break;
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MII_ADVERTISE:
|
||||
mii_if->advertising = val;
|
||||
break;
|
||||
default:
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mii_if->mdio_write(mii_if->dev, mii_data->phy_id,
|
||||
mii_data->reg_num, val);
|
||||
break;
|
||||
}
|
||||
mii_if->mdio_write(mii_if->dev, mii_data->phy_id,
|
||||
mii_data->reg_num, val);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
rc = -EOPNOTSUPP;
|
||||
|
@ -1166,4 +1166,4 @@ int _kc_generic_mii_ioctl(struct mii_if_info *mii_if,
|
|||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* > 2.4.6 */
|
||||
|
|
File diff suppressed because it is too large
Load diff
69
vmkdrivers/src_9/drivers/net/e1000e/mac.h
Normal file
69
vmkdrivers/src_9/drivers/net/e1000e/mac.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_MAC_H_
|
||||
#define _E1000E_MAC_H_
|
||||
|
||||
s32 e1000e_blink_led_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_check_for_copper_link(struct e1000_hw *hw);
|
||||
s32 e1000e_check_for_fiber_link(struct e1000_hw *hw);
|
||||
s32 e1000e_check_for_serdes_link(struct e1000_hw *hw);
|
||||
s32 e1000e_cleanup_led_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
|
||||
s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
|
||||
s32 e1000e_force_mac_fc(struct e1000_hw *hw);
|
||||
s32 e1000e_get_auto_rd_done(struct e1000_hw *hw);
|
||||
s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw);
|
||||
void e1000_set_lan_id_single_port(struct e1000_hw *hw);
|
||||
s32 e1000e_get_hw_semaphore(struct e1000_hw *hw);
|
||||
s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex);
|
||||
s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw,
|
||||
u16 *speed, u16 *duplex);
|
||||
s32 e1000e_id_led_init_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_led_on_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_led_off_generic(struct e1000_hw *hw);
|
||||
void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list, u32 mc_addr_count);
|
||||
s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
|
||||
s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
|
||||
s32 e1000e_setup_led_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_setup_link_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_validate_mdi_setting_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_validate_mdi_setting_crossover_generic(struct e1000_hw *hw);
|
||||
|
||||
void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
|
||||
void e1000_clear_vfta_generic(struct e1000_hw *hw);
|
||||
void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
|
||||
void e1000e_put_hw_semaphore(struct e1000_hw *hw);
|
||||
s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw);
|
||||
void e1000e_reset_adaptive(struct e1000_hw *hw);
|
||||
void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
|
||||
void e1000e_update_adaptive(struct e1000_hw *hw);
|
||||
void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
|
||||
|
||||
void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw);
|
||||
int e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index);
|
||||
u32 e1000e_rar_get_count_generic(struct e1000_hw *hw);
|
||||
void e1000e_config_collision_dist_generic(struct e1000_hw *hw);
|
||||
|
||||
#endif
|
|
@ -1,35 +1,27 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#include "e1000.h"
|
||||
|
||||
static u8 e1000_calculate_checksum(u8 *buffer, u32 length);
|
||||
|
||||
/**
|
||||
* e1000_calculate_checksum - Calculate checksum for buffer
|
||||
* @buffer: pointer to EEPROM
|
||||
|
@ -41,18 +33,18 @@ static u8 e1000_calculate_checksum(u8 *buffer, u32 length);
|
|||
static u8 e1000_calculate_checksum(u8 *buffer, u32 length)
|
||||
{
|
||||
u32 i;
|
||||
u8 sum = 0;
|
||||
u8 sum = 0;
|
||||
|
||||
if (!buffer)
|
||||
return 0;
|
||||
for (i = 0; i < length; i++)
|
||||
sum += buffer[i];
|
||||
|
||||
return (u8) (0 - sum);
|
||||
return (u8)(0 - sum);
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_mng_enable_host_if_generic - Checks host interface is enabled
|
||||
* e1000_mng_enable_host_if - Checks host interface is enabled
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
|
||||
|
@ -61,18 +53,21 @@ static u8 e1000_calculate_checksum(u8 *buffer, u32 length)
|
|||
* and also checks whether the previous command is completed. It busy waits
|
||||
* in case of previous command is not completed.
|
||||
**/
|
||||
s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw)
|
||||
static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
|
||||
{
|
||||
u32 hicr;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
u8 i;
|
||||
u8 i;
|
||||
|
||||
if (!hw->mac.arc_subsystem_valid) {
|
||||
e_dbg("ARC subsystem not valid.\n");
|
||||
return -E1000_ERR_HOST_INTERFACE_COMMAND;
|
||||
}
|
||||
|
||||
/* Check that the host interface is enabled. */
|
||||
hicr = er32(HICR);
|
||||
if ((hicr & E1000_HICR_EN) == 0) {
|
||||
if (!(hicr & E1000_HICR_EN)) {
|
||||
e_dbg("E1000_HOST_EN bit disabled.\n");
|
||||
ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
|
||||
goto out;
|
||||
return -E1000_ERR_HOST_INTERFACE_COMMAND;
|
||||
}
|
||||
/* check the previous command is completed */
|
||||
for (i = 0; i < E1000_MNG_DHCP_COMMAND_TIMEOUT; i++) {
|
||||
|
@ -84,31 +79,29 @@ s32 e1000_mng_enable_host_if_generic(struct e1000_hw *hw)
|
|||
|
||||
if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
|
||||
e_dbg("Previous command timeout failed .\n");
|
||||
ret_val = -E1000_ERR_HOST_INTERFACE_COMMAND;
|
||||
goto out;
|
||||
return -E1000_ERR_HOST_INTERFACE_COMMAND;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_check_mng_mode_generic - Generic check management mode
|
||||
* e1000e_check_mng_mode_generic - Generic check management mode
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Reads the firmware semaphore register and returns true (>0) if
|
||||
* manageability is enabled, else false (0).
|
||||
**/
|
||||
bool e1000_check_mng_mode_generic(struct e1000_hw *hw)
|
||||
bool e1000e_check_mng_mode_generic(struct e1000_hw *hw)
|
||||
{
|
||||
u32 fwsm;
|
||||
u32 fwsm = er32(FWSM);
|
||||
|
||||
fwsm = er32(FWSM);
|
||||
return (fwsm & E1000_FWSM_MODE_MASK) ==
|
||||
(E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
|
||||
(E1000_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_enable_tx_pkt_filtering - Enable packet filtering on TX
|
||||
* e1000e_enable_tx_pkt_filtering - Enable packet filtering on Tx
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Enables packet filtering on transmit packets if manageability is enabled
|
||||
|
@ -121,53 +114,146 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
|
|||
u32 offset;
|
||||
s32 ret_val, hdr_csum, csum;
|
||||
u8 i, len;
|
||||
bool tx_filter = true;
|
||||
|
||||
hw->mac.tx_pkt_filtering = true;
|
||||
|
||||
/* No manageability, no filtering */
|
||||
if (!hw->mac.ops.check_mng_mode(hw)) {
|
||||
tx_filter = false;
|
||||
goto out;
|
||||
hw->mac.tx_pkt_filtering = false;
|
||||
return hw->mac.tx_pkt_filtering;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we can't read from the host interface for whatever
|
||||
/* If we can't read from the host interface for whatever
|
||||
* reason, disable filtering.
|
||||
*/
|
||||
ret_val = hw->mac.ops.mng_enable_host_if(hw);
|
||||
if (ret_val != E1000_SUCCESS) {
|
||||
tx_filter = false;
|
||||
goto out;
|
||||
ret_val = e1000_mng_enable_host_if(hw);
|
||||
if (ret_val) {
|
||||
hw->mac.tx_pkt_filtering = false;
|
||||
return hw->mac.tx_pkt_filtering;
|
||||
}
|
||||
|
||||
/* Read in the header. Length and offset are in dwords. */
|
||||
len = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
|
||||
len = E1000_MNG_DHCP_COOKIE_LENGTH >> 2;
|
||||
offset = E1000_MNG_DHCP_COOKIE_OFFSET >> 2;
|
||||
for (i = 0; i < len; i++) {
|
||||
*(buffer + i) = E1000_READ_REG_ARRAY_DWORD(hw,
|
||||
E1000_HOST_IF,
|
||||
offset + i);
|
||||
}
|
||||
for (i = 0; i < len; i++)
|
||||
*(buffer + i) = E1000_READ_REG_ARRAY(hw, E1000_HOST_IF,
|
||||
offset + i);
|
||||
hdr_csum = hdr->checksum;
|
||||
hdr->checksum = 0;
|
||||
csum = e1000_calculate_checksum((u8 *)hdr,
|
||||
E1000_MNG_DHCP_COOKIE_LENGTH);
|
||||
/*
|
||||
* If either the checksums or signature don't match, then
|
||||
E1000_MNG_DHCP_COOKIE_LENGTH);
|
||||
/* If either the checksums or signature don't match, then
|
||||
* the cookie area isn't considered valid, in which case we
|
||||
* take the safe route of assuming Tx filtering is enabled.
|
||||
*/
|
||||
if (hdr_csum != csum)
|
||||
goto out;
|
||||
if (hdr->signature != E1000_IAMT_SIGNATURE)
|
||||
goto out;
|
||||
if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) {
|
||||
hw->mac.tx_pkt_filtering = true;
|
||||
return hw->mac.tx_pkt_filtering;
|
||||
}
|
||||
|
||||
/* Cookie area is valid, make the final check for filtering. */
|
||||
if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING))
|
||||
tx_filter = false;
|
||||
hw->mac.tx_pkt_filtering = false;
|
||||
|
||||
out:
|
||||
hw->mac.tx_pkt_filtering = tx_filter;
|
||||
return tx_filter;
|
||||
return hw->mac.tx_pkt_filtering;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_mng_write_cmd_header - Writes manageability command header
|
||||
* @hw: pointer to the HW structure
|
||||
* @hdr: pointer to the host interface command header
|
||||
*
|
||||
* Writes the command header after does the checksum calculation.
|
||||
**/
|
||||
static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header *hdr)
|
||||
{
|
||||
u16 i, length = sizeof(struct e1000_host_mng_command_header);
|
||||
|
||||
/* Write the whole command header structure with new checksum. */
|
||||
|
||||
hdr->checksum = e1000_calculate_checksum((u8 *)hdr, length);
|
||||
|
||||
length >>= 2;
|
||||
/* Write the relevant command block into the ram area. */
|
||||
for (i = 0; i < length; i++) {
|
||||
E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, i, *((u32 *)hdr + i));
|
||||
e1e_flush();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_mng_host_if_write - Write to the manageability host interface
|
||||
* @hw: pointer to the HW structure
|
||||
* @buffer: pointer to the host interface buffer
|
||||
* @length: size of the buffer
|
||||
* @offset: location in the buffer to write to
|
||||
* @sum: sum of the data (not checksum)
|
||||
*
|
||||
* This function writes the buffer content at the offset given on the host if.
|
||||
* It also does alignment considerations to do the writes in most efficient
|
||||
* way. Also fills up the sum of the buffer in *buffer parameter.
|
||||
**/
|
||||
static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer,
|
||||
u16 length, u16 offset, u8 *sum)
|
||||
{
|
||||
u8 *tmp;
|
||||
u8 *bufptr = buffer;
|
||||
u32 data = 0;
|
||||
u16 remaining, i, j, prev_bytes;
|
||||
|
||||
/* sum = only sum of the data and it is not checksum */
|
||||
|
||||
if (length == 0 || offset + length > E1000_HI_MAX_MNG_DATA_LENGTH)
|
||||
return -E1000_ERR_PARAM;
|
||||
|
||||
tmp = (u8 *)&data;
|
||||
prev_bytes = offset & 0x3;
|
||||
offset >>= 2;
|
||||
|
||||
if (prev_bytes) {
|
||||
data = E1000_READ_REG_ARRAY(hw, E1000_HOST_IF, offset);
|
||||
for (j = prev_bytes; j < sizeof(u32); j++) {
|
||||
*(tmp + j) = *bufptr++;
|
||||
*sum += *(tmp + j);
|
||||
}
|
||||
E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset, data);
|
||||
length -= j - prev_bytes;
|
||||
offset++;
|
||||
}
|
||||
|
||||
remaining = length & 0x3;
|
||||
length -= remaining;
|
||||
|
||||
/* Calculate length in DWORDs */
|
||||
length >>= 2;
|
||||
|
||||
/* The device driver writes the relevant command block into the
|
||||
* ram area.
|
||||
*/
|
||||
for (i = 0; i < length; i++) {
|
||||
for (j = 0; j < sizeof(u32); j++) {
|
||||
*(tmp + j) = *bufptr++;
|
||||
*sum += *(tmp + j);
|
||||
}
|
||||
|
||||
E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset + i, data);
|
||||
}
|
||||
if (remaining) {
|
||||
for (j = 0; j < sizeof(u32); j++) {
|
||||
if (j < remaining)
|
||||
*(tmp + j) = *bufptr++;
|
||||
else
|
||||
*(tmp + j) = 0;
|
||||
|
||||
*sum += *(tmp + j);
|
||||
}
|
||||
E1000_WRITE_REG_ARRAY(hw, E1000_HOST_IF, offset + i, data);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -178,8 +264,7 @@ out:
|
|||
*
|
||||
* Writes the DHCP information to the host interface.
|
||||
**/
|
||||
s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer,
|
||||
u16 length)
|
||||
s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
|
||||
{
|
||||
struct e1000_host_mng_command_header hdr;
|
||||
s32 ret_val;
|
||||
|
@ -192,174 +277,71 @@ s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer,
|
|||
hdr.checksum = 0;
|
||||
|
||||
/* Enable the host interface */
|
||||
ret_val = hw->mac.ops.mng_enable_host_if(hw);
|
||||
ret_val = e1000_mng_enable_host_if(hw);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
return ret_val;
|
||||
|
||||
/* Populate the host interface with the contents of "buffer". */
|
||||
ret_val = hw->mac.ops.mng_host_if_write(hw, buffer, length,
|
||||
sizeof(hdr), &(hdr.checksum));
|
||||
ret_val = e1000_mng_host_if_write(hw, buffer, length,
|
||||
sizeof(hdr), &(hdr.checksum));
|
||||
if (ret_val)
|
||||
goto out;
|
||||
return ret_val;
|
||||
|
||||
/* Write the manageability command header */
|
||||
ret_val = hw->mac.ops.mng_write_cmd_header(hw, &hdr);
|
||||
ret_val = e1000_mng_write_cmd_header(hw, &hdr);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
return ret_val;
|
||||
|
||||
/* Tell the ARC a new command is pending. */
|
||||
hicr = er32(HICR);
|
||||
ew32(HICR, hicr | E1000_HICR_C);
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_mng_write_cmd_header_generic - Writes manageability command header
|
||||
* @hw: pointer to the HW structure
|
||||
* @hdr: pointer to the host interface command header
|
||||
*
|
||||
* Writes the command header after does the checksum calculation.
|
||||
**/
|
||||
s32 e1000_mng_write_cmd_header_generic(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header *hdr)
|
||||
{
|
||||
u16 i, length = sizeof(struct e1000_host_mng_command_header);
|
||||
|
||||
/* Write the whole command header structure with new checksum. */
|
||||
|
||||
hdr->checksum = e1000_calculate_checksum((u8 *)hdr, length);
|
||||
|
||||
length >>= 2;
|
||||
/* Write the relevant command block into the ram area. */
|
||||
for (i = 0; i < length; i++) {
|
||||
E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, i,
|
||||
*((u32 *) hdr + i));
|
||||
e1e_flush();
|
||||
}
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_mng_host_if_write_generic - Write to the manageability host interface
|
||||
* @hw: pointer to the HW structure
|
||||
* @buffer: pointer to the host interface buffer
|
||||
* @length: size of the buffer
|
||||
* @offset: location in the buffer to write to
|
||||
* @sum: sum of the data (not checksum)
|
||||
*
|
||||
* This function writes the buffer content at the offset given on the host if.
|
||||
* It also does alignment considerations to do the writes in most efficient
|
||||
* way. Also fills up the sum of the buffer in *buffer parameter.
|
||||
**/
|
||||
s32 e1000_mng_host_if_write_generic(struct e1000_hw *hw, u8 *buffer,
|
||||
u16 length, u16 offset, u8 *sum)
|
||||
{
|
||||
u8 *tmp;
|
||||
u8 *bufptr = buffer;
|
||||
u32 data = 0;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
u16 remaining, i, j, prev_bytes;
|
||||
|
||||
/* sum = only sum of the data and it is not checksum */
|
||||
|
||||
if (length == 0 || offset + length > E1000_HI_MAX_MNG_DATA_LENGTH) {
|
||||
ret_val = -E1000_ERR_PARAM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
tmp = (u8 *)&data;
|
||||
prev_bytes = offset & 0x3;
|
||||
offset >>= 2;
|
||||
|
||||
if (prev_bytes) {
|
||||
data = E1000_READ_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset);
|
||||
for (j = prev_bytes; j < sizeof(u32); j++) {
|
||||
*(tmp + j) = *bufptr++;
|
||||
*sum += *(tmp + j);
|
||||
}
|
||||
E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset, data);
|
||||
length -= j - prev_bytes;
|
||||
offset++;
|
||||
}
|
||||
|
||||
remaining = length & 0x3;
|
||||
length -= remaining;
|
||||
|
||||
/* Calculate length in DWORDs */
|
||||
length >>= 2;
|
||||
|
||||
/*
|
||||
* The device driver writes the relevant command block into the
|
||||
* ram area.
|
||||
*/
|
||||
for (i = 0; i < length; i++) {
|
||||
for (j = 0; j < sizeof(u32); j++) {
|
||||
*(tmp + j) = *bufptr++;
|
||||
*sum += *(tmp + j);
|
||||
}
|
||||
|
||||
E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset + i,
|
||||
data);
|
||||
}
|
||||
if (remaining) {
|
||||
for (j = 0; j < sizeof(u32); j++) {
|
||||
if (j < remaining)
|
||||
*(tmp + j) = *bufptr++;
|
||||
else
|
||||
*(tmp + j) = 0;
|
||||
|
||||
*sum += *(tmp + j);
|
||||
}
|
||||
E1000_WRITE_REG_ARRAY_DWORD(hw, E1000_HOST_IF, offset + i, data);
|
||||
}
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_enable_mng_pass_thru - Enable processing of ARP's
|
||||
* e1000e_enable_mng_pass_thru - Check if management passthrough is needed
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Verifies the hardware needs to allow ARPs to be processed by the host.
|
||||
* Verifies the hardware needs to leave interface enabled so that frames can
|
||||
* be directed to and from the management interface.
|
||||
**/
|
||||
bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
|
||||
{
|
||||
u32 manc;
|
||||
u32 fwsm, factps;
|
||||
bool ret_val = false;
|
||||
|
||||
if (!hw->mac.asf_firmware_present)
|
||||
goto out;
|
||||
|
||||
manc = er32(MANC);
|
||||
|
||||
if (!(manc & E1000_MANC_RCV_TCO_EN) ||
|
||||
!(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
|
||||
goto out;
|
||||
if (!(manc & E1000_MANC_RCV_TCO_EN))
|
||||
return false;
|
||||
|
||||
if (hw->mac.arc_subsystem_valid) {
|
||||
if (hw->mac.has_fwsm) {
|
||||
fwsm = er32(FWSM);
|
||||
factps = er32(FACTPS);
|
||||
|
||||
if (!(factps & E1000_FACTPS_MNGCG) &&
|
||||
((fwsm & E1000_FWSM_MODE_MASK) ==
|
||||
(e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
|
||||
ret_val = true;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
if ((manc & E1000_MANC_SMBUS_EN) &&
|
||||
!(manc & E1000_MANC_ASF_EN)) {
|
||||
ret_val = true;
|
||||
goto out;
|
||||
}
|
||||
(e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT)))
|
||||
return true;
|
||||
} else if ((hw->mac.type == e1000_82574) ||
|
||||
(hw->mac.type == e1000_82583)) {
|
||||
u16 data;
|
||||
s32 ret_val;
|
||||
|
||||
factps = er32(FACTPS);
|
||||
ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
|
||||
if (ret_val)
|
||||
return false;
|
||||
|
||||
if (!(factps & E1000_FACTPS_MNGCG) &&
|
||||
((data & E1000_NVM_INIT_CTRL2_MNGM) ==
|
||||
(e1000_mng_mode_pt << 13)))
|
||||
return true;
|
||||
} else if ((manc & E1000_MANC_SMBUS_EN) &&
|
||||
!(manc & E1000_MANC_ASF_EN)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
return false;
|
||||
}
|
||||
|
66
vmkdrivers/src_9/drivers/net/e1000e/manage.h
Normal file
66
vmkdrivers/src_9/drivers/net/e1000e/manage.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_MANAGE_H_
|
||||
#define _E1000E_MANAGE_H_
|
||||
|
||||
bool e1000e_check_mng_mode_generic(struct e1000_hw *hw);
|
||||
bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
||||
s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
|
||||
bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw);
|
||||
|
||||
enum e1000_mng_mode {
|
||||
e1000_mng_mode_none = 0,
|
||||
e1000_mng_mode_asf,
|
||||
e1000_mng_mode_pt,
|
||||
e1000_mng_mode_ipmi,
|
||||
e1000_mng_mode_host_if_only
|
||||
};
|
||||
|
||||
#define E1000_FACTPS_MNGCG 0x20000000
|
||||
|
||||
#define E1000_FWSM_MODE_MASK 0xE
|
||||
#define E1000_FWSM_MODE_SHIFT 1
|
||||
|
||||
#define E1000_MNG_IAMT_MODE 0x3
|
||||
#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10
|
||||
#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0
|
||||
#define E1000_MNG_DHCP_COMMAND_TIMEOUT 10
|
||||
#define E1000_MNG_DHCP_TX_PAYLOAD_CMD 64
|
||||
#define E1000_MNG_DHCP_COOKIE_STATUS_PARSING 0x1
|
||||
#define E1000_MNG_DHCP_COOKIE_STATUS_VLAN 0x2
|
||||
|
||||
#define E1000_VFTA_ENTRY_SHIFT 5
|
||||
#define E1000_VFTA_ENTRY_MASK 0x7F
|
||||
#define E1000_VFTA_ENTRY_BIT_SHIFT_MASK 0x1F
|
||||
|
||||
#define E1000_HICR_EN 0x01 /* Enable bit - RO */
|
||||
/* Driver sets this bit when done to put command in RAM */
|
||||
#define E1000_HICR_C 0x02
|
||||
#define E1000_HICR_SV 0x04 /* Status Validity */
|
||||
#define E1000_HICR_FW_RESET_ENABLE 0x40
|
||||
#define E1000_HICR_FW_RESET 0x80
|
||||
|
||||
/* Intel(R) Active Management Technology signature */
|
||||
#define E1000_IAMT_SIGNATURE 0x544D4149
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load diff
|
@ -1,49 +1,27 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#include "e1000.h"
|
||||
|
||||
static void e1000_stop_nvm(struct e1000_hw *hw);
|
||||
static void e1000e_reload_nvm(struct e1000_hw *hw);
|
||||
|
||||
/**
|
||||
* e1000_init_nvm_ops_generic - Initialize NVM function pointers
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Setups up the function pointers to no-op functions
|
||||
**/
|
||||
void e1000_init_nvm_ops_generic(struct e1000_hw *hw)
|
||||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
/* Initialize function pointers */
|
||||
nvm->ops.reload = e1000e_reload_nvm;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_raise_eec_clk - Raise EEPROM clock
|
||||
* @hw: pointer to the HW structure
|
||||
|
@ -164,7 +142,6 @@ s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
|
|||
{
|
||||
u32 attempts = 100000;
|
||||
u32 i, reg = 0;
|
||||
s32 ret_val = -E1000_ERR_NVM;
|
||||
|
||||
for (i = 0; i < attempts; i++) {
|
||||
if (ee_reg == E1000_NVM_POLL_READ)
|
||||
|
@ -172,15 +149,13 @@ s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg)
|
|||
else
|
||||
reg = er32(EEWR);
|
||||
|
||||
if (reg & E1000_NVM_RW_REG_DONE) {
|
||||
ret_val = E1000_SUCCESS;
|
||||
break;
|
||||
}
|
||||
if (reg & E1000_NVM_RW_REG_DONE)
|
||||
return 0;
|
||||
|
||||
udelay(5);
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
return -E1000_ERR_NVM;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +170,6 @@ s32 e1000e_acquire_nvm(struct e1000_hw *hw)
|
|||
{
|
||||
u32 eecd = er32(EECD);
|
||||
s32 timeout = E1000_NVM_GRANT_ATTEMPTS;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
ew32(EECD, eecd | E1000_EECD_REQ);
|
||||
eecd = er32(EECD);
|
||||
|
@ -211,10 +185,10 @@ s32 e1000e_acquire_nvm(struct e1000_hw *hw)
|
|||
eecd &= ~E1000_EECD_REQ;
|
||||
ew32(EECD, eecd);
|
||||
e_dbg("Could not acquire NVM grant\n");
|
||||
ret_val = -E1000_ERR_NVM;
|
||||
return -E1000_ERR_NVM;
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,26 +260,25 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
|
|||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
u32 eecd = er32(EECD);
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
u16 timeout = 0;
|
||||
u8 spi_stat_reg;
|
||||
|
||||
if (nvm->type == e1000_nvm_eeprom_spi) {
|
||||
u16 timeout = NVM_MAX_RETRY_SPI;
|
||||
|
||||
/* Clear SK and CS */
|
||||
eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
|
||||
ew32(EECD, eecd);
|
||||
e1e_flush();
|
||||
udelay(1);
|
||||
timeout = NVM_MAX_RETRY_SPI;
|
||||
|
||||
/*
|
||||
* Read "Status Register" repeatedly until the LSB is cleared.
|
||||
/* Read "Status Register" repeatedly until the LSB is cleared.
|
||||
* The EEPROM will signal that the command has been completed
|
||||
* by clearing bit 0 of the internal status register. If it's
|
||||
* not cleared within 'timeout', then error out.
|
||||
*/
|
||||
while (timeout) {
|
||||
e1000_shift_out_eec_bits(hw, NVM_RDSR_OPCODE_SPI,
|
||||
hw->nvm.opcode_bits);
|
||||
hw->nvm.opcode_bits);
|
||||
spi_stat_reg = (u8)e1000_shift_in_eec_bits(hw, 8);
|
||||
if (!(spi_stat_reg & NVM_STATUS_RDY_SPI))
|
||||
break;
|
||||
|
@ -317,13 +290,11 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
|
|||
|
||||
if (!timeout) {
|
||||
e_dbg("SPI NVM Status error\n");
|
||||
ret_val = -E1000_ERR_NVM;
|
||||
goto out;
|
||||
return -E1000_ERR_NVM;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -339,33 +310,32 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
|||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
u32 i, eerd = 0;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
s32 ret_val = 0;
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* too many words for the offset, and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
(words == 0)) {
|
||||
e_dbg("nvm parameter(s) out of bounds\n");
|
||||
ret_val = -E1000_ERR_NVM;
|
||||
goto out;
|
||||
return -E1000_ERR_NVM;
|
||||
}
|
||||
|
||||
for (i = 0; i < words; i++) {
|
||||
eerd = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) +
|
||||
E1000_NVM_RW_REG_START;
|
||||
eerd = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) +
|
||||
E1000_NVM_RW_REG_START;
|
||||
|
||||
ew32(EERD, eerd);
|
||||
ret_val = e1000e_poll_eerd_eewr_done(hw, E1000_NVM_POLL_READ);
|
||||
if (ret_val)
|
||||
break;
|
||||
|
||||
data[i] = (er32(EERD) >>
|
||||
E1000_NVM_RW_REG_DATA);
|
||||
data[i] = (er32(EERD) >> E1000_NVM_RW_REG_DATA);
|
||||
}
|
||||
|
||||
out:
|
||||
if (ret_val)
|
||||
e_dbg("NVM read error: %d\n", ret_val);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
|
@ -378,47 +348,46 @@ out:
|
|||
*
|
||||
* Writes data to EEPROM at offset using SPI interface.
|
||||
*
|
||||
* If e1000_update_nvm_checksum is not called after this function , the
|
||||
* If e1000e_update_nvm_checksum is not called after this function , the
|
||||
* EEPROM will most likely contain an invalid checksum.
|
||||
**/
|
||||
s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
s32 ret_val;
|
||||
s32 ret_val = -E1000_ERR_NVM;
|
||||
u16 widx = 0;
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
(words == 0)) {
|
||||
e_dbg("nvm parameter(s) out of bounds\n");
|
||||
ret_val = -E1000_ERR_NVM;
|
||||
goto out;
|
||||
return -E1000_ERR_NVM;
|
||||
}
|
||||
|
||||
ret_val = nvm->ops.acquire(hw);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
while (widx < words) {
|
||||
u8 write_opcode = NVM_WRITE_OPCODE_SPI;
|
||||
|
||||
ret_val = e1000_ready_nvm_eeprom(hw);
|
||||
ret_val = nvm->ops.acquire(hw);
|
||||
if (ret_val)
|
||||
goto release;
|
||||
return ret_val;
|
||||
|
||||
ret_val = e1000_ready_nvm_eeprom(hw);
|
||||
if (ret_val) {
|
||||
nvm->ops.release(hw);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
e1000_standby_nvm(hw);
|
||||
|
||||
/* Send the WRITE ENABLE command (8 bit opcode) */
|
||||
e1000_shift_out_eec_bits(hw, NVM_WREN_OPCODE_SPI,
|
||||
nvm->opcode_bits);
|
||||
nvm->opcode_bits);
|
||||
|
||||
e1000_standby_nvm(hw);
|
||||
|
||||
/*
|
||||
* Some SPI eeproms use the 8th address bit embedded in the
|
||||
/* Some SPI eeproms use the 8th address bit embedded in the
|
||||
* opcode
|
||||
*/
|
||||
if ((nvm->address_bits == 8) && (offset >= 128))
|
||||
|
@ -427,7 +396,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
|||
/* Send the Write command (8-bit opcode + addr) */
|
||||
e1000_shift_out_eec_bits(hw, write_opcode, nvm->opcode_bits);
|
||||
e1000_shift_out_eec_bits(hw, (u16)((offset + widx) * 2),
|
||||
nvm->address_bits);
|
||||
nvm->address_bits);
|
||||
|
||||
/* Loop to allow for up to whole page write of eeprom */
|
||||
while (widx < words) {
|
||||
|
@ -441,56 +410,130 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
|||
break;
|
||||
}
|
||||
}
|
||||
usleep_range(10000, 20000);
|
||||
nvm->ops.release(hw);
|
||||
}
|
||||
|
||||
msleep(10);
|
||||
release:
|
||||
nvm->ops.release(hw);
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_read_pba_num - Read device part number
|
||||
* e1000_read_pba_string_generic - Read device part number
|
||||
* @hw: pointer to the HW structure
|
||||
* @pba_num: pointer to device part number
|
||||
* @pba_num_size: size of part number buffer
|
||||
*
|
||||
* Reads the product board assembly (PBA) number from the EEPROM and stores
|
||||
* the value in pba_num.
|
||||
**/
|
||||
s32 e1000e_read_pba_num(struct e1000_hw *hw, u32 *pba_num)
|
||||
s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
|
||||
u32 pba_num_size)
|
||||
{
|
||||
s32 ret_val;
|
||||
s32 ret_val;
|
||||
u16 nvm_data;
|
||||
u16 pba_ptr;
|
||||
u16 offset;
|
||||
u16 length;
|
||||
|
||||
if (pba_num == NULL) {
|
||||
e_dbg("PBA string buffer was null\n");
|
||||
return -E1000_ERR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
|
||||
if (ret_val) {
|
||||
e_dbg("NVM Read Error\n");
|
||||
goto out;
|
||||
return ret_val;
|
||||
}
|
||||
*pba_num = (u32)(nvm_data << 16);
|
||||
|
||||
ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
|
||||
ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &pba_ptr);
|
||||
if (ret_val) {
|
||||
e_dbg("NVM Read Error\n");
|
||||
goto out;
|
||||
return ret_val;
|
||||
}
|
||||
*pba_num |= nvm_data;
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
/* if nvm_data is not ptr guard the PBA must be in legacy format which
|
||||
* means pba_ptr is actually our second data word for the PBA number
|
||||
* and we can decode it into an ascii string
|
||||
*/
|
||||
if (nvm_data != NVM_PBA_PTR_GUARD) {
|
||||
e_dbg("NVM PBA number is not stored as string\n");
|
||||
|
||||
/* make sure callers buffer is big enough to store the PBA */
|
||||
if (pba_num_size < E1000_PBANUM_LENGTH) {
|
||||
e_dbg("PBA string buffer too small\n");
|
||||
return E1000_ERR_NO_SPACE;
|
||||
}
|
||||
|
||||
/* extract hex string from data and pba_ptr */
|
||||
pba_num[0] = (nvm_data >> 12) & 0xF;
|
||||
pba_num[1] = (nvm_data >> 8) & 0xF;
|
||||
pba_num[2] = (nvm_data >> 4) & 0xF;
|
||||
pba_num[3] = nvm_data & 0xF;
|
||||
pba_num[4] = (pba_ptr >> 12) & 0xF;
|
||||
pba_num[5] = (pba_ptr >> 8) & 0xF;
|
||||
pba_num[6] = '-';
|
||||
pba_num[7] = 0;
|
||||
pba_num[8] = (pba_ptr >> 4) & 0xF;
|
||||
pba_num[9] = pba_ptr & 0xF;
|
||||
|
||||
/* put a null character on the end of our string */
|
||||
pba_num[10] = '\0';
|
||||
|
||||
/* switch all the data but the '-' to hex char */
|
||||
for (offset = 0; offset < 10; offset++) {
|
||||
if (pba_num[offset] < 0xA)
|
||||
pba_num[offset] += '0';
|
||||
else if (pba_num[offset] < 0x10)
|
||||
pba_num[offset] += 'A' - 0xA;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret_val = e1000_read_nvm(hw, pba_ptr, 1, &length);
|
||||
if (ret_val) {
|
||||
e_dbg("NVM Read Error\n");
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
if (length == 0xFFFF || length == 0) {
|
||||
e_dbg("NVM PBA number section invalid length\n");
|
||||
return -E1000_ERR_NVM_PBA_SECTION;
|
||||
}
|
||||
/* check if pba_num buffer is big enough */
|
||||
if (pba_num_size < (((u32)length * 2) - 1)) {
|
||||
e_dbg("PBA string buffer too small\n");
|
||||
return -E1000_ERR_NO_SPACE;
|
||||
}
|
||||
|
||||
/* trim pba length from start of string */
|
||||
pba_ptr++;
|
||||
length--;
|
||||
|
||||
for (offset = 0; offset < length; offset++) {
|
||||
ret_val = e1000_read_nvm(hw, pba_ptr + offset, 1, &nvm_data);
|
||||
if (ret_val) {
|
||||
e_dbg("NVM Read Error\n");
|
||||
return ret_val;
|
||||
}
|
||||
pba_num[offset * 2] = (u8)(nvm_data >> 8);
|
||||
pba_num[(offset * 2) + 1] = (u8)(nvm_data & 0xFF);
|
||||
}
|
||||
pba_num[offset * 2] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_read_mac_addr_generic - Read device MAC address
|
||||
* e1000_read_mac_addr_generic - Read device MAC address
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Reads the device MAC address from the EEPROM and stores the value.
|
||||
* Since devices with two ports use the same EEPROM, we increment the
|
||||
* last bit in the MAC address for the second port.
|
||||
**/
|
||||
s32 e1000e_read_mac_addr_generic(struct e1000_hw *hw)
|
||||
s32 e1000_read_mac_addr_generic(struct e1000_hw *hw)
|
||||
{
|
||||
u32 rar_high;
|
||||
u32 rar_low;
|
||||
|
@ -500,15 +543,15 @@ s32 e1000e_read_mac_addr_generic(struct e1000_hw *hw)
|
|||
rar_low = er32(RAL(0));
|
||||
|
||||
for (i = 0; i < E1000_RAL_MAC_ADDR_LEN; i++)
|
||||
hw->mac.perm_addr[i] = (u8)(rar_low >> (i*8));
|
||||
hw->mac.perm_addr[i] = (u8)(rar_low >> (i * 8));
|
||||
|
||||
for (i = 0; i < E1000_RAH_MAC_ADDR_LEN; i++)
|
||||
hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8));
|
||||
hw->mac.perm_addr[i + 4] = (u8)(rar_high >> (i * 8));
|
||||
|
||||
for (i = 0; i < ETH_ADDR_LEN; i++)
|
||||
for (i = 0; i < ETH_ALEN; i++)
|
||||
hw->mac.addr[i] = hw->mac.perm_addr[i];
|
||||
|
||||
return E1000_SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -520,7 +563,7 @@ s32 e1000e_read_mac_addr_generic(struct e1000_hw *hw)
|
|||
**/
|
||||
s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
|
||||
{
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
s32 ret_val;
|
||||
u16 checksum = 0;
|
||||
u16 i, nvm_data;
|
||||
|
||||
|
@ -528,19 +571,17 @@ s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
|
|||
ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
|
||||
if (ret_val) {
|
||||
e_dbg("NVM Read Error\n");
|
||||
goto out;
|
||||
return ret_val;
|
||||
}
|
||||
checksum += nvm_data;
|
||||
}
|
||||
|
||||
if (checksum != (u16) NVM_SUM) {
|
||||
if (checksum != (u16)NVM_SUM) {
|
||||
e_dbg("NVM Checksum Invalid\n");
|
||||
ret_val = -E1000_ERR_NVM;
|
||||
goto out;
|
||||
return -E1000_ERR_NVM;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -553,7 +594,7 @@ out:
|
|||
**/
|
||||
s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
|
||||
{
|
||||
s32 ret_val;
|
||||
s32 ret_val;
|
||||
u16 checksum = 0;
|
||||
u16 i, nvm_data;
|
||||
|
||||
|
@ -561,34 +602,32 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
|
|||
ret_val = e1000_read_nvm(hw, i, 1, &nvm_data);
|
||||
if (ret_val) {
|
||||
e_dbg("NVM Read Error while updating checksum.\n");
|
||||
goto out;
|
||||
return ret_val;
|
||||
}
|
||||
checksum += nvm_data;
|
||||
}
|
||||
checksum = (u16) NVM_SUM - checksum;
|
||||
checksum = (u16)NVM_SUM - checksum;
|
||||
ret_val = e1000_write_nvm(hw, NVM_CHECKSUM_REG, 1, &checksum);
|
||||
if (ret_val)
|
||||
e_dbg("NVM Write Error while updating checksum.\n");
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_reload_nvm - Reloads EEPROM
|
||||
* e1000e_reload_nvm_generic - Reloads EEPROM
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
|
||||
* extended control register.
|
||||
**/
|
||||
static void e1000e_reload_nvm(struct e1000_hw *hw)
|
||||
void e1000e_reload_nvm_generic(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl_ext;
|
||||
|
||||
udelay(10);
|
||||
usleep_range(10, 20);
|
||||
ctrl_ext = er32(CTRL_EXT);
|
||||
ctrl_ext |= E1000_CTRL_EXT_EE_RST;
|
||||
ew32(CTRL_EXT, ctrl_ext);
|
||||
e1e_flush();
|
||||
}
|
||||
|
41
vmkdrivers/src_9/drivers/net/e1000e/nvm.h
Normal file
41
vmkdrivers/src_9/drivers/net/e1000e/nvm.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_NVM_H_
|
||||
#define _E1000E_NVM_H_
|
||||
|
||||
s32 e1000e_acquire_nvm(struct e1000_hw *hw);
|
||||
|
||||
s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
|
||||
s32 e1000_read_mac_addr_generic(struct e1000_hw *hw);
|
||||
s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
|
||||
u32 pba_num_size);
|
||||
s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
|
||||
s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
void e1000e_release_nvm(struct e1000_hw *hw);
|
||||
|
||||
#define E1000_STM_OPCODE 0xDB00
|
||||
|
||||
#endif
|
|
@ -1,40 +1,34 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Intel PRO/1000 Linux driver
|
||||
Copyright(c) 1999 - 2009 Intel Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms and conditions of the GNU General Public License,
|
||||
version 2, as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
The full GNU General Public License is included in this distribution in
|
||||
the file called "COPYING".
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include "e1000.h"
|
||||
|
||||
/*
|
||||
* This is the only thing that needs to be changed to adjust the
|
||||
/* This is the only thing that needs to be changed to adjust the
|
||||
* maximum number of ports that the driver can manage.
|
||||
*/
|
||||
|
||||
#define E1000_MAX_NIC 32
|
||||
|
||||
#define OPTION_UNSET -1
|
||||
|
@ -45,14 +39,12 @@
|
|||
unsigned int copybreak = COPYBREAK_DEFAULT;
|
||||
module_param(copybreak, uint, 0644);
|
||||
MODULE_PARM_DESC(copybreak,
|
||||
"Maximum size of packet that is copied to a new buffer on receive");
|
||||
"Maximum size of packet that is copied to a new buffer on receive");
|
||||
|
||||
/*
|
||||
* All parameters are treated the same, as an integer array of values.
|
||||
/* All parameters are treated the same, as an integer array of values.
|
||||
* This macro just reduces the need to repeat the same declaration code
|
||||
* over and over (plus this helps to avoid typo bugs).
|
||||
*/
|
||||
|
||||
#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
|
||||
#ifndef module_param_array
|
||||
/* Module Parameters are always initialized to -1, so that the driver
|
||||
|
@ -65,23 +57,27 @@ MODULE_PARM_DESC(copybreak,
|
|||
* "Extensions to the C Language Family" of the GCC documentation.
|
||||
*/
|
||||
#define E1000_PARAM(X, desc) \
|
||||
static const int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
|
||||
static const int X[E1000_MAX_NIC+1] __devinitconst = E1000_PARAM_INIT; \
|
||||
static unsigned int num_##X; \
|
||||
MODULE_PARM(X, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); \
|
||||
MODULE_PARM_DESC(X, desc);
|
||||
#elif defined(HAVE_CONFIG_HOTPLUG)
|
||||
#define E1000_PARAM(X, desc) \
|
||||
static int X[E1000_MAX_NIC+1] __devinitdata \
|
||||
= E1000_PARAM_INIT; \
|
||||
static unsigned int num_##X; \
|
||||
module_param_array_named(X, X, int, &num_##X, 0); \
|
||||
MODULE_PARM_DESC(X, desc);
|
||||
#else
|
||||
#define E1000_PARAM(X, desc) \
|
||||
static int __devinitdata X[E1000_MAX_NIC+1] \
|
||||
= E1000_PARAM_INIT; \
|
||||
static int X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
|
||||
static unsigned int num_##X; \
|
||||
module_param_array_named(X, X, int, &num_##X, 0); \
|
||||
MODULE_PARM_DESC(X, desc);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Transmit Interrupt Delay in units of 1.024 microseconds
|
||||
* Tx interrupt delay needs to typically be set to something non zero
|
||||
/* Transmit Interrupt Delay in units of 1.024 microseconds
|
||||
* Tx interrupt delay needs to typically be set to something non-zero
|
||||
*
|
||||
* Valid Range: 0-65535
|
||||
*/
|
||||
|
@ -90,8 +86,7 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
|
|||
#define MAX_TXDELAY 0xFFFF
|
||||
#define MIN_TXDELAY 0
|
||||
|
||||
/*
|
||||
* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
|
||||
/* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
|
||||
*
|
||||
* Valid Range: 0-65535
|
||||
*/
|
||||
|
@ -100,51 +95,51 @@ E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
|
|||
#define MAX_TXABSDELAY 0xFFFF
|
||||
#define MIN_TXABSDELAY 0
|
||||
|
||||
/*
|
||||
* Receive Interrupt Delay in units of 1.024 microseconds
|
||||
/* Receive Interrupt Delay in units of 1.024 microseconds
|
||||
* hardware will likely hang if you set this to anything but zero.
|
||||
*
|
||||
* Valid Range: 0-65535
|
||||
*/
|
||||
E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
|
||||
#define DEFAULT_RDTR 0
|
||||
#define MAX_RXDELAY 0xFFFF
|
||||
#define MIN_RXDELAY 0
|
||||
|
||||
/*
|
||||
* Receive Absolute Interrupt Delay in units of 1.024 microseconds
|
||||
/* Receive Absolute Interrupt Delay in units of 1.024 microseconds
|
||||
*
|
||||
* Valid Range: 0-65535
|
||||
*/
|
||||
E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
|
||||
#define DEFAULT_RADV 8
|
||||
#define MAX_RXABSDELAY 0xFFFF
|
||||
#define MIN_RXABSDELAY 0
|
||||
|
||||
/*
|
||||
* Interrupt Throttle Rate (interrupts/sec)
|
||||
/* Interrupt Throttle Rate (interrupts/sec)
|
||||
*
|
||||
* Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
|
||||
* Valid Range: 100-100000 or one of: 0=off, 1=dynamic, 3=dynamic conservative
|
||||
*/
|
||||
E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
|
||||
#define DEFAULT_ITR 3
|
||||
#define MAX_ITR 100000
|
||||
#define MIN_ITR 100
|
||||
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
/* IntMode (Interrupt Mode)
|
||||
*
|
||||
* Valid Range: 0 - 2
|
||||
* Valid Range: varies depending on kernel configuration & hardware support
|
||||
*
|
||||
* Default Value: 2 (MSI-X)
|
||||
* legacy=0, MSI=1, MSI-X=2
|
||||
*
|
||||
* When MSI/MSI-X support is enabled in kernel-
|
||||
* Default Value: 2 (MSI-X) when supported by hardware, 1 (MSI) otherwise
|
||||
* When MSI/MSI-X support is not enabled in kernel-
|
||||
* Default Value: 0 (legacy)
|
||||
*
|
||||
* When a mode is specified that is not allowed/supported, it will be
|
||||
* demoted to the most advanced interrupt mode available.
|
||||
*/
|
||||
E1000_PARAM(IntMode, "Interrupt Mode");
|
||||
#define MAX_INTMODE 2
|
||||
#define MIN_INTMODE 0
|
||||
|
||||
#endif /* CONFIG_E1000E_MSIX */
|
||||
/*
|
||||
* Enable Smart Power Down of the PHY
|
||||
/* Enable Smart Power Down of the PHY
|
||||
*
|
||||
* Valid Range: 0, 1
|
||||
*
|
||||
|
@ -152,8 +147,7 @@ E1000_PARAM(IntMode, "Interrupt Mode");
|
|||
*/
|
||||
E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
|
||||
|
||||
/*
|
||||
* Enable Kumeran Lock Loss workaround
|
||||
/* Enable Kumeran Lock Loss workaround
|
||||
*
|
||||
* Valid Range: 0, 1
|
||||
*
|
||||
|
@ -161,17 +155,16 @@ E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
|
|||
*/
|
||||
E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
|
||||
|
||||
/*
|
||||
* Enable CRC Stripping
|
||||
/* Enable CRC Stripping
|
||||
*
|
||||
* Valid Range: 0, 1
|
||||
*
|
||||
* Default Value: 1 (enabled)
|
||||
*/
|
||||
E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \
|
||||
"the CRC");
|
||||
E1000_PARAM(CrcStripping,
|
||||
"Enable CRC Stripping, disable if your BMC needs the CRC");
|
||||
|
||||
#if defined(__VMKLNX__)
|
||||
#ifdef __VMKLNX__
|
||||
/*
|
||||
* Write Protect NVM
|
||||
*
|
||||
|
@ -180,7 +173,26 @@ E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \
|
|||
* Default Value: 1 (enabled)
|
||||
*/
|
||||
E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]");
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
#endif /* __VMKLNX__ */
|
||||
|
||||
/* Enable/disable EEE (a.k.a. IEEE802.3az)
|
||||
*
|
||||
* Valid Range: 0, 1
|
||||
*
|
||||
* Default Value: 1
|
||||
*/
|
||||
E1000_PARAM(EEE, "Enable/disable on parts that support the feature");
|
||||
|
||||
/* Enable node specific allocation of all data structures, typically
|
||||
* specific to routing setups, not generally useful.
|
||||
*
|
||||
* Depends on: NUMA configuration
|
||||
*
|
||||
* Valid Range: -1, 0-32768
|
||||
*
|
||||
* Default Value: -1 (disabled, default to kernel choice of node)
|
||||
*/
|
||||
E1000_PARAM(Node, "[ROUTING] Node to allocate memory on, default -1");
|
||||
|
||||
struct e1000_option {
|
||||
enum { enable_option, range_option, list_option } type;
|
||||
|
@ -188,20 +200,31 @@ struct e1000_option {
|
|||
const char *err;
|
||||
int def;
|
||||
union {
|
||||
struct { /* range_option info */
|
||||
/* range_option info */
|
||||
struct {
|
||||
int min;
|
||||
int max;
|
||||
} r;
|
||||
struct { /* list_option info */
|
||||
/* list_option info */
|
||||
struct {
|
||||
int nr;
|
||||
struct e1000_opt_list { int i; char *str; } *p;
|
||||
struct e1000_opt_list {
|
||||
int i;
|
||||
char *str;
|
||||
} *p;
|
||||
} l;
|
||||
} arg;
|
||||
};
|
||||
|
||||
#ifdef HAVE_CONFIG_HOTPLUG
|
||||
static int __devinit e1000_validate_option(unsigned int *value,
|
||||
const struct e1000_option *opt,
|
||||
struct e1000_adapter *adapter)
|
||||
#else
|
||||
static int e1000_validate_option(unsigned int *value,
|
||||
const struct e1000_option *opt,
|
||||
struct e1000_adapter *adapter)
|
||||
#endif
|
||||
{
|
||||
if (*value == OPTION_UNSET) {
|
||||
*value = opt->def;
|
||||
|
@ -212,16 +235,19 @@ static int __devinit e1000_validate_option(unsigned int *value,
|
|||
case enable_option:
|
||||
switch (*value) {
|
||||
case OPTION_ENABLED:
|
||||
e_info("%s Enabled\n", opt->name);
|
||||
dev_info(pci_dev_to_dev(adapter->pdev), "%s Enabled\n",
|
||||
opt->name);
|
||||
return 0;
|
||||
case OPTION_DISABLED:
|
||||
e_info("%s Disabled\n", opt->name);
|
||||
dev_info(pci_dev_to_dev(adapter->pdev), "%s Disabled\n",
|
||||
opt->name);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case range_option:
|
||||
if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
|
||||
e_info("%s set to %i\n", opt->name, *value);
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s set to %i\n", opt->name, *value);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
@ -233,7 +259,8 @@ static int __devinit e1000_validate_option(unsigned int *value,
|
|||
ent = &opt->arg.l.p[i];
|
||||
if (*value == ent->i) {
|
||||
if (ent->str[0] != '\0')
|
||||
e_info("%s\n", ent->str);
|
||||
dev_info(pci_dev_to_dev(adapter->pdev), "%s\n",
|
||||
ent->str);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -243,8 +270,9 @@ static int __devinit e1000_validate_option(unsigned int *value,
|
|||
BUG();
|
||||
}
|
||||
|
||||
e_info("Invalid %s value specified (%i) %s\n", opt->name, *value,
|
||||
opt->err);
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"Invalid %s value specified (%i) %s\n", opt->name, *value,
|
||||
opt->err);
|
||||
*value = opt->def;
|
||||
return -1;
|
||||
}
|
||||
|
@ -258,18 +286,25 @@ static int __devinit e1000_validate_option(unsigned int *value,
|
|||
* value exists, a default value is used. The final value is stored
|
||||
* in a variable in the adapter structure.
|
||||
**/
|
||||
#ifdef HAVE_CONFIG_HOTPLUG
|
||||
void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
||||
#else
|
||||
void e1000e_check_options(struct e1000_adapter *adapter)
|
||||
#endif
|
||||
{
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
int bd = adapter->bd_number;
|
||||
|
||||
if (bd >= E1000_MAX_NIC) {
|
||||
e_notice("Warning: no configuration for board #%i\n", bd);
|
||||
e_notice("Using defaults for all values\n");
|
||||
dev_notice(pci_dev_to_dev(adapter->pdev),
|
||||
"Warning: no configuration for board #%i\n", bd);
|
||||
dev_notice(pci_dev_to_dev(adapter->pdev),
|
||||
"Using defaults for all values\n");
|
||||
}
|
||||
|
||||
{ /* Transmit Interrupt Delay */
|
||||
const struct e1000_option opt = {
|
||||
/* Transmit Interrupt Delay */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Transmit Interrupt Delay",
|
||||
.err = "using default of "
|
||||
|
@ -287,8 +322,9 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
adapter->tx_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Transmit Absolute Interrupt Delay */
|
||||
const struct e1000_option opt = {
|
||||
/* Transmit Absolute Interrupt Delay */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Transmit Absolute Interrupt Delay",
|
||||
.err = "using default of "
|
||||
|
@ -306,8 +342,9 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
adapter->tx_abs_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Receive Interrupt Delay */
|
||||
struct e1000_option opt = {
|
||||
/* Receive Interrupt Delay */
|
||||
{
|
||||
static struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Receive Interrupt Delay",
|
||||
.err = "using default of "
|
||||
|
@ -325,8 +362,9 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
adapter->rx_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Receive Absolute Interrupt Delay */
|
||||
const struct e1000_option opt = {
|
||||
/* Receive Absolute Interrupt Delay */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Receive Absolute Interrupt Delay",
|
||||
.err = "using default of "
|
||||
|
@ -344,8 +382,9 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
adapter->rx_abs_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Interrupt Throttling Rate */
|
||||
const struct e1000_option opt = {
|
||||
/* Interrupt Throttling Rate */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Interrupt Throttling Rate (ints/sec)",
|
||||
.err = "using default of "
|
||||
|
@ -357,61 +396,101 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
|
||||
if (num_InterruptThrottleRate > bd) {
|
||||
adapter->itr = InterruptThrottleRate[bd];
|
||||
switch (adapter->itr) {
|
||||
case 0:
|
||||
e_info("%s turned off\n", opt.name);
|
||||
break;
|
||||
case 1:
|
||||
e_info("%s set to dynamic mode\n", opt.name);
|
||||
adapter->itr_setting = adapter->itr;
|
||||
adapter->itr = 20000;
|
||||
break;
|
||||
case 3:
|
||||
e_info("%s set to dynamic conservative mode\n",
|
||||
opt.name);
|
||||
adapter->itr_setting = adapter->itr;
|
||||
adapter->itr = 20000;
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* Save the setting, because the dynamic bits
|
||||
* change itr.
|
||||
*/
|
||||
if (e1000_validate_option(&adapter->itr, &opt,
|
||||
adapter) &&
|
||||
(adapter->itr == 3)) {
|
||||
/*
|
||||
* In case of invalid user value,
|
||||
* default to conservative mode.
|
||||
*/
|
||||
adapter->itr_setting = adapter->itr;
|
||||
adapter->itr = 20000;
|
||||
} else {
|
||||
/*
|
||||
* Clear the lower two bits because
|
||||
* they are used as control.
|
||||
*/
|
||||
adapter->itr_setting =
|
||||
adapter->itr & ~3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make sure a message is printed for non-special
|
||||
* values. And in case of an invalid option, display
|
||||
* warning, use default and go through itr/itr_setting
|
||||
* adjustment logic below
|
||||
*/
|
||||
if ((adapter->itr > 4) &&
|
||||
e1000_validate_option(&adapter->itr, &opt, adapter))
|
||||
adapter->itr = opt.def;
|
||||
} else {
|
||||
adapter->itr_setting = opt.def;
|
||||
/* If no option specified, use default value and go
|
||||
* through the logic below to adjust itr/itr_setting
|
||||
*/
|
||||
adapter->itr = opt.def;
|
||||
|
||||
/* Make sure a message is printed for non-special
|
||||
* default values
|
||||
*/
|
||||
if (adapter->itr > 4)
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s set to default %d\n", opt.name,
|
||||
adapter->itr);
|
||||
}
|
||||
|
||||
adapter->itr_setting = adapter->itr;
|
||||
switch (adapter->itr) {
|
||||
case 0:
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s turned off\n", opt.name);
|
||||
break;
|
||||
case 1:
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s set to dynamic mode\n", opt.name);
|
||||
adapter->itr = 20000;
|
||||
break;
|
||||
case 2:
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s Invalid mode - setting default\n",
|
||||
opt.name);
|
||||
adapter->itr_setting = opt.def;
|
||||
/* fall-through */
|
||||
case 3:
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s set to dynamic conservative mode\n",
|
||||
opt.name);
|
||||
adapter->itr = 20000;
|
||||
break;
|
||||
case 4:
|
||||
dev_info(pci_dev_to_dev(adapter->pdev),
|
||||
"%s set to simplified (2000-8000 ints) mode\n",
|
||||
opt.name);
|
||||
break;
|
||||
default:
|
||||
/* Save the setting, because the dynamic bits
|
||||
* change itr.
|
||||
*
|
||||
* Clear the lower two bits because
|
||||
* they are used as control.
|
||||
*/
|
||||
adapter->itr_setting &= ~3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_E1000E_MSIX
|
||||
{ /* Interrupt Mode */
|
||||
struct e1000_option opt = {
|
||||
/* Interrupt Mode */
|
||||
{
|
||||
static struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Interrupt Mode",
|
||||
.err = "defaulting to 2 (MSI-X)",
|
||||
.def = E1000E_INT_MODE_MSIX,
|
||||
.arg = { .r = { .min = MIN_INTMODE,
|
||||
.max = MAX_INTMODE } }
|
||||
#ifndef CONFIG_PCI_MSI
|
||||
.err = "defaulting to 0 (legacy)",
|
||||
.def = E1000E_INT_MODE_LEGACY,
|
||||
.arg = { .r = { .min = 0,
|
||||
.max = 0 } }
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
if (adapter->flags & FLAG_HAS_MSIX) {
|
||||
opt.err = kstrdup("defaulting to 2 (MSI-X)",
|
||||
GFP_KERNEL);
|
||||
opt.def = E1000E_INT_MODE_MSIX;
|
||||
opt.arg.r.max = E1000E_INT_MODE_MSIX;
|
||||
} else {
|
||||
opt.err = kstrdup("defaulting to 1 (MSI)", GFP_KERNEL);
|
||||
opt.def = E1000E_INT_MODE_MSI;
|
||||
opt.arg.r.max = E1000E_INT_MODE_MSI;
|
||||
}
|
||||
|
||||
if (!opt.err) {
|
||||
dev_err(pci_dev_to_dev(adapter->pdev),
|
||||
"Failed to allocate memory\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (num_IntMode > bd) {
|
||||
unsigned int int_mode = IntMode[bd];
|
||||
e1000_validate_option(&int_mode, &opt, adapter);
|
||||
|
@ -419,10 +498,14 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
} else {
|
||||
adapter->int_mode = opt.def;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
kfree(opt.err);
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_E1000E_MSIX */
|
||||
{ /* Smart Power Down */
|
||||
const struct e1000_option opt = {
|
||||
/* Smart Power Down */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = enable_option,
|
||||
.name = "PHY Smart Power Down",
|
||||
.err = "defaulting to Disabled",
|
||||
|
@ -432,13 +515,13 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
if (num_SmartPowerDownEnable > bd) {
|
||||
unsigned int spd = SmartPowerDownEnable[bd];
|
||||
e1000_validate_option(&spd, &opt, adapter);
|
||||
if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN)
|
||||
&& spd)
|
||||
if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) && spd)
|
||||
adapter->flags |= FLAG_SMART_POWER_DOWN;
|
||||
}
|
||||
}
|
||||
{ /* CRC Stripping */
|
||||
const struct e1000_option opt = {
|
||||
/* CRC Stripping */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = enable_option,
|
||||
.name = "CRC Stripping",
|
||||
.err = "defaulting to Enabled",
|
||||
|
@ -448,33 +531,99 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
if (num_CrcStripping > bd) {
|
||||
unsigned int crc_stripping = CrcStripping[bd];
|
||||
e1000_validate_option(&crc_stripping, &opt, adapter);
|
||||
if (crc_stripping == OPTION_ENABLED)
|
||||
if (crc_stripping == OPTION_ENABLED) {
|
||||
adapter->flags2 |= FLAG2_CRC_STRIPPING;
|
||||
adapter->flags2 |= FLAG2_DFLT_CRC_STRIPPING;
|
||||
}
|
||||
} else {
|
||||
adapter->flags2 |= FLAG2_CRC_STRIPPING;
|
||||
adapter->flags2 |= FLAG2_DFLT_CRC_STRIPPING;
|
||||
}
|
||||
}
|
||||
{ /* Kumeran Lock Loss Workaround */
|
||||
const struct e1000_option opt = {
|
||||
/* Kumeran Lock Loss Workaround */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = enable_option,
|
||||
.name = "Kumeran Lock Loss Workaround",
|
||||
.err = "defaulting to Enabled",
|
||||
.def = OPTION_ENABLED
|
||||
};
|
||||
bool enabled = opt.def;
|
||||
|
||||
if (num_KumeranLockLoss > bd) {
|
||||
unsigned int kmrn_lock_loss = KumeranLockLoss[bd];
|
||||
e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
|
||||
kmrn_lock_loss);
|
||||
} else {
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
|
||||
opt.def);
|
||||
enabled = kmrn_lock_loss;
|
||||
}
|
||||
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,
|
||||
enabled);
|
||||
}
|
||||
/* EEE for parts supporting the feature */
|
||||
{
|
||||
static const struct e1000_option opt = {
|
||||
.type = enable_option,
|
||||
.name = "EEE Support",
|
||||
.err = "defaulting to Enabled (100T/1000T full)",
|
||||
.def = OPTION_ENABLED
|
||||
};
|
||||
|
||||
if (adapter->flags2 & FLAG2_HAS_EEE) {
|
||||
/* Currently only supported on 82579 and newer */
|
||||
if (num_EEE > bd) {
|
||||
unsigned int eee = EEE[bd];
|
||||
e1000_validate_option(&eee, &opt, adapter);
|
||||
hw->dev_spec.ich8lan.eee_disable = !eee;
|
||||
} else {
|
||||
hw->dev_spec.ich8lan.eee_disable = !opt.def;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(__VMKLNX__)
|
||||
/* configure node specific allocation */
|
||||
{
|
||||
static struct e1000_option opt = {
|
||||
.type = range_option,
|
||||
.name = "Node used to allocate memory",
|
||||
.err = "defaulting to -1 (disabled)",
|
||||
#ifdef HAVE_EARLY_VMALLOC_NODE
|
||||
.def = 0,
|
||||
#else
|
||||
.def = -1,
|
||||
#endif
|
||||
.arg = { .r = { .min = 0,
|
||||
.max = MAX_NUMNODES - 1 } }
|
||||
};
|
||||
int node = opt.def;
|
||||
|
||||
/* if the default was zero then we need to set the
|
||||
* default value to an online node, which is not
|
||||
* necessarily zero, and the constant initializer
|
||||
* above can't take first_online_node
|
||||
*/
|
||||
if (node == 0) {
|
||||
/* must set opt.def for validate */
|
||||
node = first_online_node;
|
||||
opt.def = node;
|
||||
}
|
||||
|
||||
if (num_Node > bd) {
|
||||
node = Node[bd];
|
||||
e1000_validate_option((unsigned int *)&node, &opt,
|
||||
adapter);
|
||||
if (node != OPTION_UNSET)
|
||||
e_info("node used for allocation: %d\n", node);
|
||||
}
|
||||
|
||||
/* check sanity of the value */
|
||||
if ((node != -1) && !node_online(node)) {
|
||||
e_info("ignoring node set to invalid value %d\n", node);
|
||||
node = opt.def;
|
||||
}
|
||||
|
||||
adapter->node = node;
|
||||
}
|
||||
#ifdef __VMKLNX__
|
||||
{ /* Write-protect NVM */
|
||||
const struct e1000_option opt = {
|
||||
.type = enable_option,
|
||||
|
@ -496,5 +645,5 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif /* defined(__VMKLNX__) */
|
||||
#endif /* __VMKLNX__ */
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
237
vmkdrivers/src_9/drivers/net/e1000e/phy.h
Normal file
237
vmkdrivers/src_9/drivers/net/e1000e/phy.h
Normal file
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_PHY_H_
|
||||
#define _E1000E_PHY_H_
|
||||
|
||||
s32 e1000e_check_downshift(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_m88(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_igp(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_ife(struct e1000_hw *hw);
|
||||
s32 e1000e_check_reset_block_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
|
||||
s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw);
|
||||
s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
|
||||
s32 e1000e_get_cable_length_m88(struct e1000_hw *hw);
|
||||
s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw);
|
||||
s32 e1000e_get_cfg_done_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_get_phy_id(struct e1000_hw *hw);
|
||||
s32 e1000e_get_phy_info_igp(struct e1000_hw *hw);
|
||||
s32 e1000e_get_phy_info_m88(struct e1000_hw *hw);
|
||||
s32 e1000_get_phy_info_ife(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_sw_reset(struct e1000_hw *hw);
|
||||
void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl);
|
||||
s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw);
|
||||
s32 e1000e_phy_reset_dsp(struct e1000_hw *hw);
|
||||
s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page);
|
||||
s32 e1000e_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active);
|
||||
s32 e1000e_setup_copper_link(struct e1000_hw *hw);
|
||||
s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
|
||||
u32 usec_interval, bool *success);
|
||||
s32 e1000e_phy_init_script_igp3(struct e1000_hw *hw);
|
||||
enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id);
|
||||
s32 e1000e_determine_phy_address(struct e1000_hw *hw);
|
||||
s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg);
|
||||
s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg);
|
||||
s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
void e1000_power_up_phy_copper(struct e1000_hw *hw);
|
||||
void e1000_power_down_phy_copper(struct e1000_hw *hw);
|
||||
s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_read_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw);
|
||||
s32 e1000_copper_link_setup_82577(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_82577(struct e1000_hw *hw);
|
||||
s32 e1000_get_phy_info_82577(struct e1000_hw *hw);
|
||||
s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw);
|
||||
s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
|
||||
|
||||
#define E1000_MAX_PHY_ADDR 8
|
||||
|
||||
/* IGP01E1000 Specific Registers */
|
||||
#define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
|
||||
#define IGP01E1000_PHY_PORT_STATUS 0x11 /* Status */
|
||||
#define IGP01E1000_PHY_PORT_CTRL 0x12 /* Control */
|
||||
#define IGP01E1000_PHY_LINK_HEALTH 0x13 /* PHY Link Health */
|
||||
#define IGP02E1000_PHY_POWER_MGMT 0x19 /* Power Management */
|
||||
#define IGP01E1000_PHY_PAGE_SELECT 0x1F /* Page Select */
|
||||
#define BM_PHY_PAGE_SELECT 22 /* Page Select for BM */
|
||||
#define IGP_PAGE_SHIFT 5
|
||||
#define PHY_REG_MASK 0x1F
|
||||
|
||||
/* BM/HV Specific Registers */
|
||||
#define BM_PORT_CTRL_PAGE 769
|
||||
#define BM_WUC_PAGE 800
|
||||
#define BM_WUC_ADDRESS_OPCODE 0x11
|
||||
#define BM_WUC_DATA_OPCODE 0x12
|
||||
#define BM_WUC_ENABLE_PAGE BM_PORT_CTRL_PAGE
|
||||
#define BM_WUC_ENABLE_REG 17
|
||||
#define BM_WUC_ENABLE_BIT (1 << 2)
|
||||
#define BM_WUC_HOST_WU_BIT (1 << 4)
|
||||
#define BM_WUC_ME_WU_BIT (1 << 5)
|
||||
|
||||
#define PHY_UPPER_SHIFT 21
|
||||
#define BM_PHY_REG(page, reg) \
|
||||
(((reg) & MAX_PHY_REG_ADDRESS) |\
|
||||
(((page) & 0xFFFF) << PHY_PAGE_SHIFT) |\
|
||||
(((reg) & ~MAX_PHY_REG_ADDRESS) << (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT)))
|
||||
#define BM_PHY_REG_PAGE(offset) \
|
||||
((u16)(((offset) >> PHY_PAGE_SHIFT) & 0xFFFF))
|
||||
#define BM_PHY_REG_NUM(offset) \
|
||||
((u16)(((offset) & MAX_PHY_REG_ADDRESS) |\
|
||||
(((offset) >> (PHY_UPPER_SHIFT - PHY_PAGE_SHIFT)) &\
|
||||
~MAX_PHY_REG_ADDRESS)))
|
||||
|
||||
#define HV_INTC_FC_PAGE_START 768
|
||||
#define I82578_ADDR_REG 29
|
||||
#define I82577_ADDR_REG 16
|
||||
#define I82577_CFG_REG 22
|
||||
#define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15)
|
||||
#define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift */
|
||||
#define I82577_CTRL_REG 23
|
||||
|
||||
/* 82577 specific PHY registers */
|
||||
#define I82577_PHY_CTRL_2 18
|
||||
#define I82577_PHY_LBK_CTRL 19
|
||||
#define I82577_PHY_STATUS_2 26
|
||||
#define I82577_PHY_DIAG_STATUS 31
|
||||
|
||||
/* I82577 PHY Status 2 */
|
||||
#define I82577_PHY_STATUS2_REV_POLARITY 0x0400
|
||||
#define I82577_PHY_STATUS2_MDIX 0x0800
|
||||
#define I82577_PHY_STATUS2_SPEED_MASK 0x0300
|
||||
#define I82577_PHY_STATUS2_SPEED_1000MBPS 0x0200
|
||||
|
||||
/* I82577 PHY Control 2 */
|
||||
#define I82577_PHY_CTRL2_MANUAL_MDIX 0x0200
|
||||
#define I82577_PHY_CTRL2_AUTO_MDI_MDIX 0x0400
|
||||
#define I82577_PHY_CTRL2_MDIX_CFG_MASK 0x0600
|
||||
|
||||
/* I82577 PHY Diagnostics Status */
|
||||
#define I82577_DSTATUS_CABLE_LENGTH 0x03FC
|
||||
#define I82577_DSTATUS_CABLE_LENGTH_SHIFT 2
|
||||
|
||||
/* BM PHY Copper Specific Control 1 */
|
||||
#define BM_CS_CTRL1 16
|
||||
|
||||
/* BM PHY Copper Specific Status */
|
||||
#define BM_CS_STATUS 17
|
||||
#define BM_CS_STATUS_LINK_UP 0x0400
|
||||
#define BM_CS_STATUS_RESOLVED 0x0800
|
||||
#define BM_CS_STATUS_SPEED_MASK 0xC000
|
||||
#define BM_CS_STATUS_SPEED_1000 0x8000
|
||||
|
||||
/* 82577 Mobile Phy Status Register */
|
||||
#define HV_M_STATUS 26
|
||||
#define HV_M_STATUS_AUTONEG_COMPLETE 0x1000
|
||||
#define HV_M_STATUS_SPEED_MASK 0x0300
|
||||
#define HV_M_STATUS_SPEED_1000 0x0200
|
||||
#define HV_M_STATUS_SPEED_100 0x0100
|
||||
#define HV_M_STATUS_LINK_UP 0x0040
|
||||
|
||||
#define IGP01E1000_PHY_PCS_INIT_REG 0x00B4
|
||||
#define IGP01E1000_PHY_POLARITY_MASK 0x0078
|
||||
|
||||
#define IGP01E1000_PSCR_AUTO_MDIX 0x1000
|
||||
#define IGP01E1000_PSCR_FORCE_MDI_MDIX 0x2000 /* 0=MDI, 1=MDIX */
|
||||
|
||||
#define IGP01E1000_PSCFR_SMART_SPEED 0x0080
|
||||
|
||||
#define IGP02E1000_PM_SPD 0x0001 /* Smart Power Down */
|
||||
#define IGP02E1000_PM_D0_LPLU 0x0002 /* For D0a states */
|
||||
#define IGP02E1000_PM_D3_LPLU 0x0004 /* For all other states */
|
||||
|
||||
#define IGP01E1000_PLHR_SS_DOWNGRADE 0x8000
|
||||
|
||||
#define IGP01E1000_PSSR_POLARITY_REVERSED 0x0002
|
||||
#define IGP01E1000_PSSR_MDIX 0x0800
|
||||
#define IGP01E1000_PSSR_SPEED_MASK 0xC000
|
||||
#define IGP01E1000_PSSR_SPEED_1000MBPS 0xC000
|
||||
|
||||
#define IGP02E1000_PHY_CHANNEL_NUM 4
|
||||
#define IGP02E1000_PHY_AGC_A 0x11B1
|
||||
#define IGP02E1000_PHY_AGC_B 0x12B1
|
||||
#define IGP02E1000_PHY_AGC_C 0x14B1
|
||||
#define IGP02E1000_PHY_AGC_D 0x18B1
|
||||
|
||||
#define IGP02E1000_AGC_LENGTH_SHIFT 9 /* Course=15:13, Fine=12:9 */
|
||||
#define IGP02E1000_AGC_LENGTH_MASK 0x7F
|
||||
#define IGP02E1000_AGC_RANGE 15
|
||||
|
||||
#define E1000_CABLE_LENGTH_UNDEFINED 0xFF
|
||||
|
||||
#define E1000_KMRNCTRLSTA_OFFSET 0x001F0000
|
||||
#define E1000_KMRNCTRLSTA_OFFSET_SHIFT 16
|
||||
#define E1000_KMRNCTRLSTA_REN 0x00200000
|
||||
#define E1000_KMRNCTRLSTA_CTRL_OFFSET 0x1 /* Kumeran Control */
|
||||
#define E1000_KMRNCTRLSTA_DIAG_OFFSET 0x3 /* Kumeran Diagnostic */
|
||||
#define E1000_KMRNCTRLSTA_TIMEOUTS 0x4 /* Kumeran Timeouts */
|
||||
#define E1000_KMRNCTRLSTA_INBAND_PARAM 0x9 /* Kumeran InBand Parameters */
|
||||
#define E1000_KMRNCTRLSTA_IBIST_DISABLE 0x0200 /* Kumeran IBIST Disable */
|
||||
#define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
|
||||
#define E1000_KMRNCTRLSTA_K1_CONFIG 0x7
|
||||
#define E1000_KMRNCTRLSTA_K1_ENABLE 0x0002 /* enable K1 */
|
||||
#define E1000_KMRNCTRLSTA_HD_CTRL 0x10 /* Kumeran HD Control */
|
||||
|
||||
#define IFE_PHY_EXTENDED_STATUS_CONTROL 0x10
|
||||
#define IFE_PHY_SPECIAL_CONTROL 0x11 /* 100BaseTx PHY Special Ctrl */
|
||||
#define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY Special and LED Ctrl */
|
||||
#define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control */
|
||||
|
||||
/* IFE PHY Extended Status Control */
|
||||
#define IFE_PESC_POLARITY_REVERSED 0x0100
|
||||
|
||||
/* IFE PHY Special Control */
|
||||
#define IFE_PSC_AUTO_POLARITY_DISABLE 0x0010
|
||||
#define IFE_PSC_FORCE_POLARITY 0x0020
|
||||
|
||||
/* IFE PHY Special Control and LED Control */
|
||||
#define IFE_PSCL_PROBE_MODE 0x0020
|
||||
#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */
|
||||
#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */
|
||||
|
||||
/* IFE PHY MDIX Control */
|
||||
#define IFE_PMC_MDIX_STATUS 0x0020 /* 1=MDI-X, 0=MDI */
|
||||
#define IFE_PMC_FORCE_MDIX 0x0040 /* 1=force MDI-X, 0=force MDI */
|
||||
#define IFE_PMC_AUTO_MDIX 0x0080 /* 1=enable auto, 0=disable */
|
||||
|
||||
#endif
|
277
vmkdrivers/src_9/drivers/net/e1000e/ptp.c
Normal file
277
vmkdrivers/src_9/drivers/net/e1000e/ptp.c
Normal file
|
@ -0,0 +1,277 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
/* PTP 1588 Hardware Clock (PHC)
|
||||
* Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb)
|
||||
* Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com>
|
||||
*/
|
||||
|
||||
#include "e1000.h"
|
||||
|
||||
/**
|
||||
* e1000e_phc_adjfreq - adjust the frequency of the hardware clock
|
||||
* @ptp: ptp clock structure
|
||||
* @delta: Desired frequency change in parts per billion
|
||||
*
|
||||
* Adjust the frequency of the PHC cycle counter by the indicated delta from
|
||||
* the base frequency.
|
||||
**/
|
||||
static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
|
||||
{
|
||||
struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
|
||||
ptp_clock_info);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
bool neg_adj = false;
|
||||
unsigned long flags;
|
||||
u64 adjustment;
|
||||
u32 timinca, incvalue;
|
||||
s32 ret_val;
|
||||
|
||||
if ((delta > ptp->max_adj) || (delta <= -1000000000))
|
||||
return -EINVAL;
|
||||
|
||||
if (delta < 0) {
|
||||
neg_adj = true;
|
||||
delta = -delta;
|
||||
}
|
||||
|
||||
/* Get the System Time Register SYSTIM base frequency */
|
||||
ret_val = e1000e_get_base_timinca(adapter, &timinca);
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
spin_lock_irqsave(&adapter->systim_lock, flags);
|
||||
|
||||
incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK;
|
||||
|
||||
adjustment = incvalue;
|
||||
adjustment *= delta;
|
||||
adjustment = div_u64(adjustment, 1000000000);
|
||||
|
||||
incvalue = neg_adj ? (incvalue - adjustment) : (incvalue + adjustment);
|
||||
|
||||
timinca &= ~E1000_TIMINCA_INCVALUE_MASK;
|
||||
timinca |= incvalue;
|
||||
|
||||
ew32(TIMINCA, timinca);
|
||||
|
||||
spin_unlock_irqrestore(&adapter->systim_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_phc_adjtime - Shift the time of the hardware clock
|
||||
* @ptp: ptp clock structure
|
||||
* @delta: Desired change in nanoseconds
|
||||
*
|
||||
* Adjust the timer by resetting the timecounter structure.
|
||||
**/
|
||||
static int e1000e_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
|
||||
{
|
||||
struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
|
||||
ptp_clock_info);
|
||||
unsigned long flags;
|
||||
s64 now;
|
||||
|
||||
spin_lock_irqsave(&adapter->systim_lock, flags);
|
||||
now = timecounter_read(&adapter->tc);
|
||||
now += delta;
|
||||
timecounter_init(&adapter->tc, &adapter->cc, now);
|
||||
spin_unlock_irqrestore(&adapter->systim_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_phc_gettime - Reads the current time from the hardware clock
|
||||
* @ptp: ptp clock structure
|
||||
* @ts: timespec structure to hold the current time value
|
||||
*
|
||||
* Read the timecounter and return the correct value in ns after converting
|
||||
* it into a struct timespec.
|
||||
**/
|
||||
static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
|
||||
{
|
||||
struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
|
||||
ptp_clock_info);
|
||||
unsigned long flags;
|
||||
u32 remainder;
|
||||
u64 ns;
|
||||
|
||||
spin_lock_irqsave(&adapter->systim_lock, flags);
|
||||
ns = timecounter_read(&adapter->tc);
|
||||
spin_unlock_irqrestore(&adapter->systim_lock, flags);
|
||||
|
||||
ts->tv_sec = div_u64_rem(ns, NSEC_PER_SEC, &remainder);
|
||||
ts->tv_nsec = remainder;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_phc_settime - Set the current time on the hardware clock
|
||||
* @ptp: ptp clock structure
|
||||
* @ts: timespec containing the new time for the cycle counter
|
||||
*
|
||||
* Reset the timecounter to use a new base value instead of the kernel
|
||||
* wall timer value.
|
||||
**/
|
||||
static int e1000e_phc_settime(struct ptp_clock_info *ptp,
|
||||
const struct timespec *ts)
|
||||
{
|
||||
struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
|
||||
ptp_clock_info);
|
||||
unsigned long flags;
|
||||
u64 ns;
|
||||
|
||||
ns = timespec_to_ns(ts);
|
||||
|
||||
/* reset the timecounter */
|
||||
spin_lock_irqsave(&adapter->systim_lock, flags);
|
||||
timecounter_init(&adapter->tc, &adapter->cc, ns);
|
||||
spin_unlock_irqrestore(&adapter->systim_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_phc_enable - enable or disable an ancillary feature
|
||||
* @ptp: ptp clock structure
|
||||
* @request: Desired resource to enable or disable
|
||||
* @on: Caller passes one to enable or zero to disable
|
||||
*
|
||||
* Enable (or disable) ancillary features of the PHC subsystem.
|
||||
* Currently, no ancillary features are supported.
|
||||
**/
|
||||
static int e1000e_phc_enable(struct ptp_clock_info __always_unused *ptp,
|
||||
struct ptp_clock_request __always_unused *request,
|
||||
int __always_unused on)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static void e1000e_systim_overflow_work(struct work_struct *work)
|
||||
{
|
||||
struct e1000_adapter *adapter = container_of(work, struct e1000_adapter,
|
||||
systim_overflow_work.work);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
struct timespec ts;
|
||||
|
||||
adapter->ptp_clock_info.gettime(&adapter->ptp_clock_info, &ts);
|
||||
|
||||
e_dbg("SYSTIM overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec);
|
||||
|
||||
schedule_delayed_work(&adapter->systim_overflow_work,
|
||||
E1000_SYSTIM_OVERFLOW_PERIOD);
|
||||
}
|
||||
|
||||
static const struct ptp_clock_info e1000e_ptp_clock_info = {
|
||||
.owner = THIS_MODULE,
|
||||
.n_alarm = 0,
|
||||
.n_ext_ts = 0,
|
||||
.n_per_out = 0,
|
||||
.pps = 0,
|
||||
.adjfreq = e1000e_phc_adjfreq,
|
||||
.adjtime = e1000e_phc_adjtime,
|
||||
.gettime = e1000e_phc_gettime,
|
||||
.settime = e1000e_phc_settime,
|
||||
.enable = e1000e_phc_enable,
|
||||
};
|
||||
|
||||
/**
|
||||
* e1000e_ptp_init - initialize PTP for devices which support it
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* This function performs the required steps for enabling PTP support.
|
||||
* If PTP support has already been loaded it simply calls the cyclecounter
|
||||
* init routine and exits.
|
||||
**/
|
||||
void e1000e_ptp_init(struct e1000_adapter *adapter)
|
||||
{
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
|
||||
adapter->ptp_clock = NULL;
|
||||
|
||||
if (!(adapter->flags & FLAG_HAS_HW_TIMESTAMP))
|
||||
return;
|
||||
|
||||
adapter->ptp_clock_info = e1000e_ptp_clock_info;
|
||||
|
||||
snprintf(adapter->ptp_clock_info.name,
|
||||
sizeof(adapter->ptp_clock_info.name), "%pm",
|
||||
adapter->netdev->perm_addr);
|
||||
|
||||
switch (hw->mac.type) {
|
||||
case e1000_pch2lan:
|
||||
case e1000_pch_lpt:
|
||||
case e1000_pch_spt:
|
||||
if (((hw->mac.type != e1000_pch_lpt) &&
|
||||
(hw->mac.type != e1000_pch_spt)) ||
|
||||
(er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) {
|
||||
adapter->ptp_clock_info.max_adj = 24000000 - 1;
|
||||
break;
|
||||
}
|
||||
/* fall-through */
|
||||
case e1000_82574:
|
||||
case e1000_82583:
|
||||
adapter->ptp_clock_info.max_adj = 600000000 - 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
INIT_DELAYED_WORK(&adapter->systim_overflow_work,
|
||||
e1000e_systim_overflow_work);
|
||||
|
||||
schedule_delayed_work(&adapter->systim_overflow_work,
|
||||
E1000_SYSTIM_OVERFLOW_PERIOD);
|
||||
|
||||
adapter->ptp_clock = ptp_clock_register(&adapter->ptp_clock_info,
|
||||
pci_dev_to_dev(adapter->pdev));
|
||||
if (IS_ERR(adapter->ptp_clock)) {
|
||||
adapter->ptp_clock = NULL;
|
||||
e_err("ptp_clock_register failed\n");
|
||||
} else {
|
||||
e_info("registered PHC clock\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000e_ptp_remove - disable PTP device and stop the overflow check
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* Stop the PTP support, and cancel the delayed work.
|
||||
**/
|
||||
void e1000e_ptp_remove(struct e1000_adapter *adapter)
|
||||
{
|
||||
if (!(adapter->flags & FLAG_HAS_HW_TIMESTAMP))
|
||||
return;
|
||||
|
||||
cancel_delayed_work_sync(&adapter->systim_overflow_work);
|
||||
|
||||
if (adapter->ptp_clock) {
|
||||
ptp_clock_unregister(adapter->ptp_clock);
|
||||
adapter->ptp_clock = NULL;
|
||||
e_info("removed PHC\n");
|
||||
}
|
||||
}
|
254
vmkdrivers/src_9/drivers/net/e1000e/regs.h
Normal file
254
vmkdrivers/src_9/drivers/net/e1000e/regs.h
Normal file
|
@ -0,0 +1,254 @@
|
|||
/*
|
||||
* Intel PRO/1000 Linux driver
|
||||
* Copyright(c) 1999 - 2014 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution in
|
||||
* the file called "COPYING".
|
||||
*
|
||||
* Contact Information:
|
||||
* Linux NICS <linux.nics@intel.com>
|
||||
* e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*/
|
||||
|
||||
#ifndef _E1000E_REGS_H_
|
||||
#define _E1000E_REGS_H_
|
||||
|
||||
#define E1000_CTRL 0x00000 /* Device Control - RW */
|
||||
#define E1000_STATUS 0x00008 /* Device Status - RO */
|
||||
#define E1000_EECD 0x00010 /* EEPROM/Flash Control - RW */
|
||||
#define E1000_EERD 0x00014 /* EEPROM Read - RW */
|
||||
#define E1000_CTRL_EXT 0x00018 /* Extended Device Control - RW */
|
||||
#define E1000_FLA 0x0001C /* Flash Access - RW */
|
||||
#define E1000_MDIC 0x00020 /* MDI Control - RW */
|
||||
#define E1000_SCTL 0x00024 /* SerDes Control - RW */
|
||||
#define E1000_FCAL 0x00028 /* Flow Control Address Low - RW */
|
||||
#define E1000_FCAH 0x0002C /* Flow Control Address High -RW */
|
||||
#define E1000_FEXT 0x0002C /* Future Extended - RW */
|
||||
#define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */
|
||||
#define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */
|
||||
#define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */
|
||||
#define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */
|
||||
#define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */
|
||||
#define E1000_FCT 0x00030 /* Flow Control Type - RW */
|
||||
#define E1000_VET 0x00038 /* VLAN Ether Type - RW */
|
||||
#define E1000_ICR 0x000C0 /* Interrupt Cause Read - R/clr */
|
||||
#define E1000_ITR 0x000C4 /* Interrupt Throttling Rate - RW */
|
||||
#define E1000_ICS 0x000C8 /* Interrupt Cause Set - WO */
|
||||
#define E1000_IMS 0x000D0 /* Interrupt Mask Set - RW */
|
||||
#define E1000_IMC 0x000D8 /* Interrupt Mask Clear - WO */
|
||||
#define E1000_IAM 0x000E0 /* Interrupt Acknowledge Auto Mask */
|
||||
#define E1000_IVAR 0x000E4 /* Interrupt Vector Allocation Register - RW */
|
||||
#define E1000_SVCR 0x000F0
|
||||
#define E1000_SVT 0x000F4
|
||||
#define E1000_LPIC 0x000FC /* Low Power IDLE control */
|
||||
#define E1000_RCTL 0x00100 /* Rx Control - RW */
|
||||
#define E1000_FCTTV 0x00170 /* Flow Control Transmit Timer Value - RW */
|
||||
#define E1000_TXCW 0x00178 /* Tx Configuration Word - RW */
|
||||
# |