aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_hw.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000/e1000_hw.h')
-rw-r--r--drivers/net/e1000/e1000_hw.h86
1 files changed, 50 insertions, 36 deletions
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 4020acb55005..112447fd8bf2 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1,25 +1,24 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3 Intel PRO/1000 Linux driver
4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms and conditions of the GNU General Public License,
8 Software Foundation; either version 2 of the License, or (at your option) 8 version 2, as published by the Free Software Foundation.
9 any later version. 9
10 10 This program is distributed in the hope it will be useful, but WITHOUT
11 This program is distributed in the hope that it will be useful, but WITHOUT 11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details. 13 more details.
15 14
16 You should have received a copy of the GNU General Public License along with 15 You should have received a copy of the GNU General Public License along with
17 this program; if not, write to the Free Software Foundation, Inc., 59 16 this program; if not, write to the Free Software Foundation, Inc.,
18 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 18
20 The full GNU General Public License is included in this distribution in the 19 The full GNU General Public License is included in this distribution in
21 file called LICENSE. 20 the file called "COPYING".
22 21
23 Contact Information: 22 Contact Information:
24 Linux NICS <linux.nics@intel.com> 23 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
@@ -93,11 +92,11 @@ typedef enum {
93 92
94/* Flow Control Settings */ 93/* Flow Control Settings */
95typedef enum { 94typedef enum {
96 e1000_fc_none = 0, 95 E1000_FC_NONE = 0,
97 e1000_fc_rx_pause = 1, 96 E1000_FC_RX_PAUSE = 1,
98 e1000_fc_tx_pause = 2, 97 E1000_FC_TX_PAUSE = 2,
99 e1000_fc_full = 3, 98 E1000_FC_FULL = 3,
100 e1000_fc_default = 0xFF 99 E1000_FC_DEFAULT = 0xFF
101} e1000_fc_type; 100} e1000_fc_type;
102 101
103struct e1000_shadow_ram { 102struct e1000_shadow_ram {
@@ -302,6 +301,9 @@ typedef enum {
302#define E1000_BLK_PHY_RESET 12 301#define E1000_BLK_PHY_RESET 12
303#define E1000_ERR_SWFW_SYNC 13 302#define E1000_ERR_SWFW_SYNC 13
304 303
304#define E1000_BYTE_SWAP_WORD(_value) ((((_value) & 0x00ff) << 8) | \
305 (((_value) & 0xff00) >> 8))
306
305/* Function prototypes */ 307/* Function prototypes */
306/* Initialization */ 308/* Initialization */
307int32_t e1000_reset_hw(struct e1000_hw *hw); 309int32_t e1000_reset_hw(struct e1000_hw *hw);
@@ -314,7 +316,7 @@ int32_t e1000_setup_link(struct e1000_hw *hw);
314int32_t e1000_phy_setup_autoneg(struct e1000_hw *hw); 316int32_t e1000_phy_setup_autoneg(struct e1000_hw *hw);
315void e1000_config_collision_dist(struct e1000_hw *hw); 317void e1000_config_collision_dist(struct e1000_hw *hw);
316int32_t e1000_check_for_link(struct e1000_hw *hw); 318int32_t e1000_check_for_link(struct e1000_hw *hw);
317int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex); 319int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t *speed, uint16_t *duplex);
318int32_t e1000_force_mac_fc(struct e1000_hw *hw); 320int32_t e1000_force_mac_fc(struct e1000_hw *hw);
319 321
320/* PHY */ 322/* PHY */
@@ -322,9 +324,9 @@ int32_t e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *phy
322int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data); 324int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data);
323int32_t e1000_phy_hw_reset(struct e1000_hw *hw); 325int32_t e1000_phy_hw_reset(struct e1000_hw *hw);
324int32_t e1000_phy_reset(struct e1000_hw *hw); 326int32_t e1000_phy_reset(struct e1000_hw *hw);
325void e1000_phy_powerdown_workaround(struct e1000_hw *hw);
326int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); 327int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);
327int32_t e1000_validate_mdi_setting(struct e1000_hw *hw); 328int32_t e1000_validate_mdi_setting(struct e1000_hw *hw);
329void e1000_phy_powerdown_workaround(struct e1000_hw *hw);
328 330
329/* EEPROM Functions */ 331/* EEPROM Functions */
330int32_t e1000_init_eeprom_params(struct e1000_hw *hw); 332int32_t e1000_init_eeprom_params(struct e1000_hw *hw);
@@ -393,7 +395,6 @@ int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uin
393int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw); 395int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw);
394int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw); 396int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw);
395int32_t e1000_write_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data); 397int32_t e1000_write_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);
396int32_t e1000_read_part_num(struct e1000_hw *hw, uint32_t * part_num);
397int32_t e1000_read_mac_addr(struct e1000_hw * hw); 398int32_t e1000_read_mac_addr(struct e1000_hw * hw);
398 399
399/* Filters (multicast, vlan, receive) */ 400/* Filters (multicast, vlan, receive) */
@@ -420,6 +421,7 @@ void e1000_pci_set_mwi(struct e1000_hw *hw);
420void e1000_pci_clear_mwi(struct e1000_hw *hw); 421void e1000_pci_clear_mwi(struct e1000_hw *hw);
421void e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value); 422void e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
422void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value); 423void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
424int32_t e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value);
423/* Port I/O is only supported on 82544 and newer */ 425/* Port I/O is only supported on 82544 and newer */
424void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value); 426void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value);
425int32_t e1000_disable_pciex_master(struct e1000_hw *hw); 427int32_t e1000_disable_pciex_master(struct e1000_hw *hw);
@@ -574,10 +576,10 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
574 * E1000_RAR_ENTRIES - 1 multicast addresses. 576 * E1000_RAR_ENTRIES - 1 multicast addresses.
575 */ 577 */
576#define E1000_RAR_ENTRIES 15 578#define E1000_RAR_ENTRIES 15
577#define E1000_RAR_ENTRIES_ICH8LAN 7 579#define E1000_RAR_ENTRIES_ICH8LAN 6
578 580
579#define MIN_NUMBER_OF_DESCRIPTORS 8 581#define MIN_NUMBER_OF_DESCRIPTORS 8
580#define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8 582#define MAX_NUMBER_OF_DESCRIPTORS 0xFFF8
581 583
582/* Receive Descriptor */ 584/* Receive Descriptor */
583struct e1000_rx_desc { 585struct e1000_rx_desc {
@@ -1300,6 +1302,7 @@ struct e1000_hw_stats {
1300 uint64_t algnerrc; 1302 uint64_t algnerrc;
1301 uint64_t symerrs; 1303 uint64_t symerrs;
1302 uint64_t rxerrc; 1304 uint64_t rxerrc;
1305 uint64_t txerrc;
1303 uint64_t mpc; 1306 uint64_t mpc;
1304 uint64_t scc; 1307 uint64_t scc;
1305 uint64_t ecol; 1308 uint64_t ecol;
@@ -1332,8 +1335,9 @@ struct e1000_hw_stats {
1332 uint64_t gotch; 1335 uint64_t gotch;
1333 uint64_t rnbc; 1336 uint64_t rnbc;
1334 uint64_t ruc; 1337 uint64_t ruc;
1335 uint64_t rfc;
1336 uint64_t roc; 1338 uint64_t roc;
1339 uint64_t rlerrc;
1340 uint64_t rfc;
1337 uint64_t rjc; 1341 uint64_t rjc;
1338 uint64_t mgprc; 1342 uint64_t mgprc;
1339 uint64_t mgpdc; 1343 uint64_t mgpdc;
@@ -1440,6 +1444,7 @@ struct e1000_hw {
1440 boolean_t tbi_compatibility_on; 1444 boolean_t tbi_compatibility_on;
1441 boolean_t laa_is_present; 1445 boolean_t laa_is_present;
1442 boolean_t phy_reset_disable; 1446 boolean_t phy_reset_disable;
1447 boolean_t initialize_hw_bits_disable;
1443 boolean_t fc_send_xon; 1448 boolean_t fc_send_xon;
1444 boolean_t fc_strict_ieee; 1449 boolean_t fc_strict_ieee;
1445 boolean_t report_tx_early; 1450 boolean_t report_tx_early;
@@ -1613,16 +1618,17 @@ struct e1000_hw {
1613#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 1618#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
1614#define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000 1619#define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000
1615#define E1000_CTRL_EXT_LINK_MODE_TBI 0x00C00000 1620#define E1000_CTRL_EXT_LINK_MODE_TBI 0x00C00000
1616#define E1000_CTRL_EXT_LINK_MODE_KMRN 0x00000000 1621#define E1000_CTRL_EXT_LINK_MODE_KMRN 0x00000000
1617#define E1000_CTRL_EXT_LINK_MODE_SERDES 0x00C00000 1622#define E1000_CTRL_EXT_LINK_MODE_SERDES 0x00C00000
1623#define E1000_CTRL_EXT_LINK_MODE_SGMII 0x00800000
1618#define E1000_CTRL_EXT_WR_WMARK_MASK 0x03000000 1624#define E1000_CTRL_EXT_WR_WMARK_MASK 0x03000000
1619#define E1000_CTRL_EXT_WR_WMARK_256 0x00000000 1625#define E1000_CTRL_EXT_WR_WMARK_256 0x00000000
1620#define E1000_CTRL_EXT_WR_WMARK_320 0x01000000 1626#define E1000_CTRL_EXT_WR_WMARK_320 0x01000000
1621#define E1000_CTRL_EXT_WR_WMARK_384 0x02000000 1627#define E1000_CTRL_EXT_WR_WMARK_384 0x02000000
1622#define E1000_CTRL_EXT_WR_WMARK_448 0x03000000 1628#define E1000_CTRL_EXT_WR_WMARK_448 0x03000000
1623#define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Driver loaded bit for FW */ 1629#define E1000_CTRL_EXT_DRV_LOAD 0x10000000 /* Driver loaded bit for FW */
1624#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */ 1630#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */
1625#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */ 1631#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */
1626#define E1000_CRTL_EXT_PB_PAREN 0x01000000 /* packet buffer parity error detection enabled */ 1632#define E1000_CRTL_EXT_PB_PAREN 0x01000000 /* packet buffer parity error detection enabled */
1627#define E1000_CTRL_EXT_DF_PAREN 0x02000000 /* descriptor FIFO parity error detection enable */ 1633#define E1000_CTRL_EXT_DF_PAREN 0x02000000 /* descriptor FIFO parity error detection enable */
1628#define E1000_CTRL_EXT_GHOST_PAREN 0x40000000 1634#define E1000_CTRL_EXT_GHOST_PAREN 0x40000000
@@ -2218,6 +2224,11 @@ struct e1000_host_command_info {
2218#define E1000_FACTPS_LAN_FUNC_SEL 0x40000000 2224#define E1000_FACTPS_LAN_FUNC_SEL 0x40000000
2219#define E1000_FACTPS_PM_STATE_CHANGED 0x80000000 2225#define E1000_FACTPS_PM_STATE_CHANGED 0x80000000
2220 2226
2227/* PCI-Ex Config Space */
2228#define PCI_EX_LINK_STATUS 0x12
2229#define PCI_EX_LINK_WIDTH_MASK 0x3F0
2230#define PCI_EX_LINK_WIDTH_SHIFT 4
2231
2221/* EEPROM Commands - Microwire */ 2232/* EEPROM Commands - Microwire */
2222#define EEPROM_READ_OPCODE_MICROWIRE 0x6 /* EEPROM read opcode */ 2233#define EEPROM_READ_OPCODE_MICROWIRE 0x6 /* EEPROM read opcode */
2223#define EEPROM_WRITE_OPCODE_MICROWIRE 0x5 /* EEPROM write opcode */ 2234#define EEPROM_WRITE_OPCODE_MICROWIRE 0x5 /* EEPROM write opcode */
@@ -3120,6 +3131,7 @@ struct e1000_host_command_info {
3120/* I = Integrated 3131/* I = Integrated
3121 * E = External 3132 * E = External
3122 */ 3133 */
3134#define M88_VENDOR 0x0141
3123#define M88E1000_E_PHY_ID 0x01410C50 3135#define M88E1000_E_PHY_ID 0x01410C50
3124#define M88E1000_I_PHY_ID 0x01410C30 3136#define M88E1000_I_PHY_ID 0x01410C30
3125#define M88E1011_I_PHY_ID 0x01410C20 3137#define M88E1011_I_PHY_ID 0x01410C20
@@ -3244,10 +3256,12 @@ struct e1000_host_command_info {
3244#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */ 3256#define IFE_PSCL_PROBE_LEDS_OFF 0x0006 /* Force LEDs 0 and 2 off */
3245#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */ 3257#define IFE_PSCL_PROBE_LEDS_ON 0x0007 /* Force LEDs 0 and 2 on */
3246 3258
3247#define ICH8_FLASH_COMMAND_TIMEOUT 500 /* 500 ms , should be adjusted */ 3259#define ICH8_FLASH_COMMAND_TIMEOUT 5000 /* 5000 uSecs - adjusted */
3248#define ICH8_FLASH_CYCLE_REPEAT_COUNT 10 /* 10 cycles , should be adjusted */ 3260#define ICH8_FLASH_ERASE_TIMEOUT 3000000 /* Up to 3 seconds - worst case */
3261#define ICH8_FLASH_CYCLE_REPEAT_COUNT 10 /* 10 cycles */
3249#define ICH8_FLASH_SEG_SIZE_256 256 3262#define ICH8_FLASH_SEG_SIZE_256 256
3250#define ICH8_FLASH_SEG_SIZE_4K 4096 3263#define ICH8_FLASH_SEG_SIZE_4K 4096
3264#define ICH9_FLASH_SEG_SIZE_8K 8192
3251#define ICH8_FLASH_SEG_SIZE_64K 65536 3265#define ICH8_FLASH_SEG_SIZE_64K 65536
3252 3266
3253#define ICH8_CYCLE_READ 0x0 3267#define ICH8_CYCLE_READ 0x0