mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Part 1 of two parts, this is the shared code changes in
support of new deltas for both em and igb drivers. Note that I am not able to track all the bugs fixed in this code, I am a consumer of it as a component of my core drivers. It is important to keep the FreeBSD drivers up to date with it however. One important note is there is a key fix for 82574 in this update. Also, there are lots of white space changes, I am not happy about them but have no control over it :)
This commit is contained in:
parent
4125bad6b4
commit
4dab5c3769
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -47,18 +47,18 @@ static void e1000_release_phy_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw);
|
||||
static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
u32 offset,
|
||||
u16 *data);
|
||||
u32 offset,
|
||||
u16 *data);
|
||||
static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
u32 offset,
|
||||
u16 data);
|
||||
u32 offset,
|
||||
u16 data);
|
||||
static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
u16 words, u16 *data);
|
||||
static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex);
|
||||
u16 *duplex);
|
||||
static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
|
||||
@ -68,9 +68,9 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
|
||||
static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
|
||||
static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
|
||||
u16 *data);
|
||||
u16 *data);
|
||||
static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
|
||||
u16 data);
|
||||
u16 data);
|
||||
static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw);
|
||||
static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
|
||||
static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
|
||||
@ -85,8 +85,8 @@ static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
|
||||
static const u16 e1000_gg82563_cable_length_table[] = {
|
||||
0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
|
||||
#define GG82563_CABLE_LENGTH_TABLE_SIZE \
|
||||
(sizeof(e1000_gg82563_cable_length_table) / \
|
||||
sizeof(e1000_gg82563_cable_length_table[0]))
|
||||
(sizeof(e1000_gg82563_cable_length_table) / \
|
||||
sizeof(e1000_gg82563_cable_length_table[0]))
|
||||
|
||||
/**
|
||||
* e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
|
||||
@ -100,34 +100,34 @@ static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
|
||||
DEBUGFUNC("e1000_init_phy_params_80003es2lan");
|
||||
|
||||
if (hw->phy.media_type != e1000_media_type_copper) {
|
||||
phy->type = e1000_phy_none;
|
||||
phy->type = e1000_phy_none;
|
||||
goto out;
|
||||
} else {
|
||||
phy->ops.power_up = e1000_power_up_phy_copper;
|
||||
phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan;
|
||||
}
|
||||
|
||||
phy->addr = 1;
|
||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
|
||||
phy->reset_delay_us = 100;
|
||||
phy->type = e1000_phy_gg82563;
|
||||
phy->addr = 1;
|
||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
|
||||
phy->reset_delay_us = 100;
|
||||
phy->type = e1000_phy_gg82563;
|
||||
|
||||
phy->ops.acquire = e1000_acquire_phy_80003es2lan;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.check_reset_block = e1000_check_reset_block_generic;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_80003es2lan;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.release = e1000_release_phy_80003es2lan;
|
||||
phy->ops.reset = e1000_phy_hw_reset_generic;
|
||||
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic;
|
||||
phy->ops.acquire = e1000_acquire_phy_80003es2lan;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.check_reset_block = e1000_check_reset_block_generic;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_80003es2lan;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.release = e1000_release_phy_80003es2lan;
|
||||
phy->ops.reset = e1000_phy_hw_reset_generic;
|
||||
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic;
|
||||
|
||||
phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_80003es2lan;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_gg82563_80003es2lan;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_gg82563_80003es2lan;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_80003es2lan;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_gg82563_80003es2lan;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_gg82563_80003es2lan;
|
||||
|
||||
phy->ops.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan;
|
||||
phy->ops.cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan;
|
||||
|
||||
/* This can only be done after all function pointers are setup. */
|
||||
ret_val = e1000_get_phy_id(hw);
|
||||
@ -154,19 +154,19 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_init_nvm_params_80003es2lan");
|
||||
|
||||
nvm->opcode_bits = 8;
|
||||
nvm->delay_usec = 1;
|
||||
nvm->opcode_bits = 8;
|
||||
nvm->delay_usec = 1;
|
||||
switch (nvm->override) {
|
||||
case e1000_nvm_override_spi_large:
|
||||
nvm->page_size = 32;
|
||||
nvm->page_size = 32;
|
||||
nvm->address_bits = 16;
|
||||
break;
|
||||
case e1000_nvm_override_spi_small:
|
||||
nvm->page_size = 8;
|
||||
nvm->page_size = 8;
|
||||
nvm->address_bits = 8;
|
||||
break;
|
||||
default:
|
||||
nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
|
||||
nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
|
||||
nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
|
||||
break;
|
||||
}
|
||||
@ -174,7 +174,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
|
||||
nvm->type = e1000_nvm_eeprom_spi;
|
||||
|
||||
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
|
||||
E1000_EECD_SIZE_EX_SHIFT);
|
||||
E1000_EECD_SIZE_EX_SHIFT);
|
||||
|
||||
/*
|
||||
* Added to a constant, "size" becomes the left-shift value
|
||||
@ -185,16 +185,16 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
|
||||
/* EEPROM access above 16k is unsupported */
|
||||
if (size > 14)
|
||||
size = 14;
|
||||
nvm->word_size = 1 << size;
|
||||
nvm->word_size = 1 << size;
|
||||
|
||||
/* Function Pointers */
|
||||
nvm->ops.acquire = e1000_acquire_nvm_80003es2lan;
|
||||
nvm->ops.read = e1000_read_nvm_eerd;
|
||||
nvm->ops.release = e1000_release_nvm_80003es2lan;
|
||||
nvm->ops.update = e1000_update_nvm_checksum_generic;
|
||||
nvm->ops.acquire = e1000_acquire_nvm_80003es2lan;
|
||||
nvm->ops.read = e1000_read_nvm_eerd;
|
||||
nvm->ops.release = e1000_release_nvm_80003es2lan;
|
||||
nvm->ops.update = e1000_update_nvm_checksum_generic;
|
||||
nvm->ops.valid_led_default = e1000_valid_led_default_generic;
|
||||
nvm->ops.validate = e1000_validate_nvm_checksum_generic;
|
||||
nvm->ops.write = e1000_write_nvm_80003es2lan;
|
||||
nvm->ops.validate = e1000_validate_nvm_checksum_generic;
|
||||
nvm->ops.write = e1000_write_nvm_80003es2lan;
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
@ -215,13 +215,13 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
|
||||
hw->phy.media_type = e1000_media_type_internal_serdes;
|
||||
mac->ops.check_for_link = e1000_check_for_serdes_link_generic;
|
||||
mac->ops.setup_physical_interface =
|
||||
e1000_setup_fiber_serdes_link_generic;
|
||||
e1000_setup_fiber_serdes_link_generic;
|
||||
break;
|
||||
default:
|
||||
hw->phy.media_type = e1000_media_type_copper;
|
||||
mac->ops.check_for_link = e1000_check_for_copper_link_generic;
|
||||
mac->ops.setup_physical_interface =
|
||||
e1000_setup_copper_link_80003es2lan;
|
||||
e1000_setup_copper_link_80003es2lan;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -234,9 +234,8 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
|
||||
/* FWSM register */
|
||||
mac->has_fwsm = TRUE;
|
||||
/* ARC supported; valid only if manageability features are enabled. */
|
||||
mac->arc_subsystem_valid =
|
||||
(E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK)
|
||||
? TRUE : FALSE;
|
||||
mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) &
|
||||
E1000_FWSM_MODE_MASK) ? TRUE : FALSE;
|
||||
/* Adaptive IFS not supported */
|
||||
mac->adaptive_ifs = FALSE;
|
||||
|
||||
@ -330,7 +329,7 @@ static void e1000_release_phy_80003es2lan(struct e1000_hw *hw)
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register
|
||||
* e1000_acquire_mac_csr_80003es2lan - Acquire right to access Kumeran register
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Acquire the semaphore to access the Kumeran interface.
|
||||
@ -348,7 +347,7 @@ static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw)
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_release_mac_csr_80003es2lan - Release rights to access Kumeran Register
|
||||
* e1000_release_mac_csr_80003es2lan - Release right to access Kumeran Register
|
||||
* @hw: pointer to the HW structure
|
||||
*
|
||||
* Release the semaphore used to access the Kumeran interface
|
||||
@ -488,7 +487,7 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
|
||||
* Read the GG82563 PHY register.
|
||||
**/
|
||||
static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
u32 offset, u16 *data)
|
||||
u32 offset, u16 *data)
|
||||
{
|
||||
s32 ret_val;
|
||||
u32 page_select;
|
||||
@ -538,14 +537,14 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
usec_delay(200);
|
||||
|
||||
ret_val = e1000_read_phy_reg_mdic(hw,
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
|
||||
usec_delay(200);
|
||||
} else {
|
||||
ret_val = e1000_read_phy_reg_mdic(hw,
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
}
|
||||
|
||||
e1000_release_phy_80003es2lan(hw);
|
||||
@ -563,7 +562,7 @@ out:
|
||||
* Write to the GG82563 PHY register.
|
||||
**/
|
||||
static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
u32 offset, u16 data)
|
||||
u32 offset, u16 data)
|
||||
{
|
||||
s32 ret_val;
|
||||
u32 page_select;
|
||||
@ -613,14 +612,14 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
usec_delay(200);
|
||||
|
||||
ret_val = e1000_write_phy_reg_mdic(hw,
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
|
||||
usec_delay(200);
|
||||
} else {
|
||||
ret_val = e1000_write_phy_reg_mdic(hw,
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
MAX_PHY_REG_ADDRESS & offset,
|
||||
data);
|
||||
}
|
||||
|
||||
e1000_release_phy_80003es2lan(hw);
|
||||
@ -639,7 +638,7 @@ out:
|
||||
* Write "words" of data to the ESB2 NVM.
|
||||
**/
|
||||
static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data)
|
||||
u16 words, u16 *data)
|
||||
{
|
||||
DEBUGFUNC("e1000_write_nvm_80003es2lan");
|
||||
|
||||
@ -729,11 +728,10 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
usec_delay(1);
|
||||
|
||||
if (hw->phy.autoneg_wait_to_complete) {
|
||||
DEBUGOUT("Waiting for forced speed/duplex link "
|
||||
"on GG82563 phy.\n");
|
||||
DEBUGOUT("Waiting for forced speed/duplex link on GG82563 phy.\n");
|
||||
|
||||
ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
|
||||
100000, &link);
|
||||
100000, &link);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -749,12 +747,13 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
/* Try once more */
|
||||
ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
|
||||
100000, &link);
|
||||
100000, &link);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data);
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
|
||||
&phy_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -773,7 +772,8 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
* duplex.
|
||||
*/
|
||||
phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data);
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
|
||||
phy_data);
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
@ -826,21 +826,20 @@ out:
|
||||
* Retrieve the current speed and duplex configuration.
|
||||
**/
|
||||
static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex)
|
||||
u16 *duplex)
|
||||
{
|
||||
s32 ret_val;
|
||||
|
||||
DEBUGFUNC("e1000_get_link_up_info_80003es2lan");
|
||||
|
||||
if (hw->phy.media_type == e1000_media_type_copper) {
|
||||
ret_val = e1000_get_speed_and_duplex_copper_generic(hw,
|
||||
speed,
|
||||
duplex);
|
||||
ret_val = e1000_get_speed_and_duplex_copper_generic(hw, speed,
|
||||
duplex);
|
||||
hw->phy.ops.cfg_on_link_up(hw);
|
||||
} else {
|
||||
ret_val = e1000_get_speed_and_duplex_fiber_serdes_generic(hw,
|
||||
speed,
|
||||
duplex);
|
||||
speed,
|
||||
duplex);
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
@ -939,21 +938,21 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
/* Disable IBIST slave mode (far-end loopback) */
|
||||
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
&kum_reg_data);
|
||||
&kum_reg_data);
|
||||
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
|
||||
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
|
||||
kum_reg_data);
|
||||
kum_reg_data);
|
||||
|
||||
/* Set the transmit descriptor write-back policy */
|
||||
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));
|
||||
reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data);
|
||||
|
||||
/* ...for both queues. */
|
||||
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1));
|
||||
reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data);
|
||||
|
||||
/* Enable retransmit on late collisions */
|
||||
@ -981,9 +980,9 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
|
||||
hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE;
|
||||
|
||||
ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET >>
|
||||
E1000_KMRNCTRLSTA_OFFSET_SHIFT,
|
||||
&i);
|
||||
E1000_KMRNCTRLSTA_OFFSET >>
|
||||
E1000_KMRNCTRLSTA_OFFSET_SHIFT,
|
||||
&i);
|
||||
if (!ret_val) {
|
||||
if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) ==
|
||||
E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO)
|
||||
@ -1056,11 +1055,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan");
|
||||
|
||||
if (phy->reset_disable)
|
||||
goto skip_reset;
|
||||
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
|
||||
&data);
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1068,8 +1063,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
/* Use 25MHz for both link down and 1000Base-T for Tx clock. */
|
||||
data |= GG82563_MSCR_TX_CLK_1000MBPS_25;
|
||||
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
|
||||
data);
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1122,7 +1116,6 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
goto out;
|
||||
}
|
||||
|
||||
skip_reset:
|
||||
/* Bypass Rx and Tx FIFO's */
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
|
||||
@ -1132,14 +1125,12 @@ skip_reset:
|
||||
goto out;
|
||||
|
||||
ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE,
|
||||
&data);
|
||||
E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, &data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE,
|
||||
data);
|
||||
E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1169,18 +1160,18 @@ skip_reset:
|
||||
/* Enable Electrical Idle on the PHY */
|
||||
data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_PWR_MGMT_CTRL,
|
||||
data);
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
&data);
|
||||
&data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
data);
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
}
|
||||
@ -1228,27 +1219,25 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
|
||||
* polling the phy; this fixes erroneous timeouts at 10Mbps.
|
||||
*/
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4),
|
||||
0xFFFF);
|
||||
0xFFFF);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
|
||||
®_data);
|
||||
®_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
reg_data |= 0x3F;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
|
||||
reg_data);
|
||||
reg_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
|
||||
®_data);
|
||||
E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, ®_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
|
||||
reg_data);
|
||||
E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, reg_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1279,9 +1268,8 @@ static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)
|
||||
DEBUGFUNC("e1000_configure_on_link_up");
|
||||
|
||||
if (hw->phy.media_type == e1000_media_type_copper) {
|
||||
ret_val = e1000_get_speed_and_duplex_copper_generic(hw,
|
||||
&speed,
|
||||
&duplex);
|
||||
ret_val = e1000_get_speed_and_duplex_copper_generic(hw, &speed,
|
||||
&duplex);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1314,8 +1302,8 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
|
||||
|
||||
reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
|
||||
reg_data);
|
||||
E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
|
||||
reg_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1327,12 +1315,12 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
|
||||
|
||||
do {
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
®_data);
|
||||
®_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
®_data2);
|
||||
®_data2);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
i++;
|
||||
@ -1343,7 +1331,8 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
|
||||
else
|
||||
reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
|
||||
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
reg_data);
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
@ -1367,8 +1356,7 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT;
|
||||
ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
|
||||
E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
|
||||
reg_data);
|
||||
E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, reg_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1380,19 +1368,20 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
do {
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
®_data);
|
||||
®_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
®_data2);
|
||||
®_data2);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
i++;
|
||||
} while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY));
|
||||
|
||||
reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
|
||||
ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
|
||||
reg_data);
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
@ -1409,7 +1398,7 @@ out:
|
||||
* Release the semaphore before exiting.
|
||||
**/
|
||||
static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
|
||||
u16 *data)
|
||||
u16 *data)
|
||||
{
|
||||
u32 kmrnctrlsta;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
@ -1421,8 +1410,9 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
|
||||
goto out;
|
||||
|
||||
kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
|
||||
E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
|
||||
E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
|
||||
E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta);
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
|
||||
usec_delay(2);
|
||||
|
||||
@ -1446,7 +1436,7 @@ out:
|
||||
* before exiting.
|
||||
**/
|
||||
static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
|
||||
u16 data)
|
||||
u16 data)
|
||||
{
|
||||
u32 kmrnctrlsta;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
@ -1458,8 +1448,9 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
|
||||
goto out;
|
||||
|
||||
kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
|
||||
E1000_KMRNCTRLSTA_OFFSET) | data;
|
||||
E1000_KMRNCTRLSTA_OFFSET) | data;
|
||||
E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta);
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
|
||||
usec_delay(2);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -35,48 +35,47 @@
|
||||
#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_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_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_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_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_TCTL_EXT_GCEX_80003ES2LAN 0x00010000
|
||||
|
||||
#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8
|
||||
#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN 0x9
|
||||
#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 */
|
||||
#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 */
|
||||
#define GG82563_PSCR2_REVERSE_AUTO_NEG 0x2000 /* 1=Reverse Auto-Nego */
|
||||
|
||||
/* 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_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 */
|
||||
#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */
|
||||
|
||||
/* DSP Distance Register (Page 5, Register 26) */
|
||||
/*
|
||||
@ -86,19 +85,19 @@
|
||||
* 3 = 110-140M
|
||||
* 4 = >140M
|
||||
*/
|
||||
#define GG82563_DSPD_CABLE_LENGTH 0x0007
|
||||
#define GG82563_DSPD_CABLE_LENGTH 0x0007
|
||||
|
||||
/* Kumeran Mode Control Register (Page 193, Register 16) */
|
||||
#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
|
||||
#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
|
||||
|
||||
/* Max number of times Kumeran read/write should be validated */
|
||||
#define GG82563_MAX_KMRN_RETRY 0x5
|
||||
#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 */
|
||||
/* 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 */
|
||||
#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -68,23 +68,23 @@ static s32 e1000_init_phy_params_82540(struct e1000_hw *hw)
|
||||
struct e1000_phy_info *phy = &hw->phy;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
phy->addr = 1;
|
||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
|
||||
phy->reset_delay_us = 10000;
|
||||
phy->type = e1000_phy_m88;
|
||||
phy->addr = 1;
|
||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
|
||||
phy->reset_delay_us = 10000;
|
||||
phy->type = e1000_phy_m88;
|
||||
|
||||
/* Function Pointers */
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_m88;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_m88;
|
||||
phy->ops.reset = e1000_phy_hw_reset_generic;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_m88;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.power_up = e1000_power_up_phy_copper;
|
||||
phy->ops.power_down = e1000_power_down_phy_copper_82540;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_m88;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_m88;
|
||||
phy->ops.reset = e1000_phy_hw_reset_generic;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_m88;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.power_up = e1000_power_up_phy_copper;
|
||||
phy->ops.power_down = e1000_power_down_phy_copper_82540;
|
||||
|
||||
ret_val = e1000_get_phy_id(hw);
|
||||
if (ret_val)
|
||||
@ -121,32 +121,32 @@ static s32 e1000_init_nvm_params_82540(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_init_nvm_params_82540");
|
||||
|
||||
nvm->type = e1000_nvm_eeprom_microwire;
|
||||
nvm->delay_usec = 50;
|
||||
nvm->opcode_bits = 3;
|
||||
nvm->type = e1000_nvm_eeprom_microwire;
|
||||
nvm->delay_usec = 50;
|
||||
nvm->opcode_bits = 3;
|
||||
switch (nvm->override) {
|
||||
case e1000_nvm_override_microwire_large:
|
||||
nvm->address_bits = 8;
|
||||
nvm->word_size = 256;
|
||||
nvm->address_bits = 8;
|
||||
nvm->word_size = 256;
|
||||
break;
|
||||
case e1000_nvm_override_microwire_small:
|
||||
nvm->address_bits = 6;
|
||||
nvm->word_size = 64;
|
||||
nvm->address_bits = 6;
|
||||
nvm->word_size = 64;
|
||||
break;
|
||||
default:
|
||||
nvm->address_bits = eecd & E1000_EECD_SIZE ? 8 : 6;
|
||||
nvm->word_size = eecd & E1000_EECD_SIZE ? 256 : 64;
|
||||
nvm->address_bits = eecd & E1000_EECD_SIZE ? 8 : 6;
|
||||
nvm->word_size = eecd & E1000_EECD_SIZE ? 256 : 64;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Function Pointers */
|
||||
nvm->ops.acquire = e1000_acquire_nvm_generic;
|
||||
nvm->ops.read = e1000_read_nvm_microwire;
|
||||
nvm->ops.release = e1000_release_nvm_generic;
|
||||
nvm->ops.update = e1000_update_nvm_checksum_generic;
|
||||
nvm->ops.valid_led_default = e1000_valid_led_default_generic;
|
||||
nvm->ops.validate = e1000_validate_nvm_checksum_generic;
|
||||
nvm->ops.write = e1000_write_nvm_microwire;
|
||||
nvm->ops.acquire = e1000_acquire_nvm_generic;
|
||||
nvm->ops.read = e1000_read_nvm_microwire;
|
||||
nvm->ops.release = e1000_release_nvm_generic;
|
||||
nvm->ops.update = e1000_update_nvm_checksum_generic;
|
||||
nvm->ops.valid_led_default = e1000_valid_led_default_generic;
|
||||
nvm->ops.validate = e1000_validate_nvm_checksum_generic;
|
||||
nvm->ops.write = e1000_write_nvm_microwire;
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
@ -198,9 +198,9 @@ static s32 e1000_init_mac_params_82540(struct e1000_hw *hw)
|
||||
mac->ops.setup_link = e1000_setup_link_generic;
|
||||
/* physical interface setup */
|
||||
mac->ops.setup_physical_interface =
|
||||
(hw->phy.media_type == e1000_media_type_copper)
|
||||
? e1000_setup_copper_link_82540
|
||||
: e1000_setup_fiber_serdes_link_82540;
|
||||
(hw->phy.media_type == e1000_media_type_copper)
|
||||
? e1000_setup_copper_link_82540
|
||||
: e1000_setup_fiber_serdes_link_82540;
|
||||
/* check for link */
|
||||
switch (hw->phy.media_type) {
|
||||
case e1000_media_type_copper:
|
||||
@ -219,9 +219,9 @@ static s32 e1000_init_mac_params_82540(struct e1000_hw *hw)
|
||||
}
|
||||
/* link info */
|
||||
mac->ops.get_link_up_info =
|
||||
(hw->phy.media_type == e1000_media_type_copper)
|
||||
? e1000_get_speed_and_duplex_copper_generic
|
||||
: e1000_get_speed_and_duplex_fiber_serdes_generic;
|
||||
(hw->phy.media_type == e1000_media_type_copper)
|
||||
? e1000_get_speed_and_duplex_copper_generic
|
||||
: e1000_get_speed_and_duplex_fiber_serdes_generic;
|
||||
/* multicast address update */
|
||||
mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic;
|
||||
/* writing VFTA */
|
||||
@ -374,7 +374,7 @@ static s32 e1000_init_hw_82540(struct e1000_hw *hw)
|
||||
|
||||
txdctl = E1000_READ_REG(hw, E1000_TXDCTL(0));
|
||||
txdctl = (txdctl & ~E1000_TXDCTL_WTHRESH) |
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB;
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB;
|
||||
E1000_WRITE_REG(hw, E1000_TXDCTL(0), txdctl);
|
||||
|
||||
/*
|
||||
@ -427,11 +427,13 @@ static s32 e1000_setup_copper_link_82540(struct e1000_hw *hw)
|
||||
|
||||
if (hw->mac.type == e1000_82545_rev_3 ||
|
||||
hw->mac.type == e1000_82546_rev_3) {
|
||||
ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &data);
|
||||
ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL,
|
||||
&data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
data |= 0x00000008;
|
||||
ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, data);
|
||||
ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL,
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
}
|
||||
@ -508,9 +510,8 @@ static s32 e1000_adjust_serdes_amplitude_82540(struct e1000_hw *hw)
|
||||
if (nvm_data != NVM_RESERVED_WORD) {
|
||||
/* Adjust serdes output amplitude only. */
|
||||
nvm_data &= NVM_SERDES_AMPLITUDE_MASK;
|
||||
ret_val = hw->phy.ops.write_reg(hw,
|
||||
M88E1000_PHY_EXT_CTRL,
|
||||
nvm_data);
|
||||
ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_EXT_CTRL,
|
||||
nvm_data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
}
|
||||
@ -535,9 +536,8 @@ static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw)
|
||||
|
||||
/* Set PHY register 30, page 5, bit 8 to 0 */
|
||||
|
||||
ret_val = hw->phy.ops.read_reg(hw,
|
||||
M88E1000_PHY_PAGE_SELECT,
|
||||
&default_page);
|
||||
ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_PAGE_SELECT,
|
||||
&default_page);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -570,7 +570,7 @@ static s32 e1000_set_vco_speed_82540(struct e1000_hw *hw)
|
||||
goto out;
|
||||
|
||||
ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT,
|
||||
default_page);
|
||||
default_page);
|
||||
|
||||
out:
|
||||
return ret_val;
|
||||
@ -587,7 +587,6 @@ out:
|
||||
**/
|
||||
static s32 e1000_set_phy_mode_82540(struct e1000_hw *hw)
|
||||
{
|
||||
struct e1000_phy_info *phy = &hw->phy;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
u16 nvm_data;
|
||||
|
||||
@ -604,20 +603,18 @@ static s32 e1000_set_phy_mode_82540(struct e1000_hw *hw)
|
||||
|
||||
if ((nvm_data != NVM_RESERVED_WORD) && (nvm_data & NVM_PHY_CLASS_A)) {
|
||||
ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT,
|
||||
0x000B);
|
||||
0x000B);
|
||||
if (ret_val) {
|
||||
ret_val = -E1000_ERR_PHY;
|
||||
goto out;
|
||||
}
|
||||
ret_val = hw->phy.ops.write_reg(hw,
|
||||
M88E1000_PHY_GEN_CONTROL,
|
||||
0x8104);
|
||||
ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL,
|
||||
0x8104);
|
||||
if (ret_val) {
|
||||
ret_val = -E1000_ERR_PHY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
phy->reset_disable = FALSE;
|
||||
}
|
||||
|
||||
out:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -300,7 +300,7 @@ void e1000_init_function_pointers_82541(struct e1000_hw *hw)
|
||||
**/
|
||||
static s32 e1000_reset_hw_82541(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ledctl, ctrl, manc;
|
||||
u32 ledctl, ctrl, icr, manc;
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82541");
|
||||
|
||||
@ -364,7 +364,7 @@ static s32 e1000_reset_hw_82541(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xFFFFFFFF);
|
||||
|
||||
/* Clear any pending interrupt events. */
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
@ -390,7 +390,7 @@ static s32 e1000_init_hw_82541(struct e1000_hw *hw)
|
||||
DEBUGOUT("Error initializing identification LED\n");
|
||||
/* This is not fatal and we should not stop init due to this */
|
||||
}
|
||||
|
||||
|
||||
/* Storing the Speed Power Down value for later use */
|
||||
ret_val = hw->phy.ops.read_reg(hw,
|
||||
IGP01E1000_GMII_FIFO,
|
||||
@ -549,8 +549,6 @@ static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw)
|
||||
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
|
||||
E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
|
||||
|
||||
hw->phy.reset_disable = FALSE;
|
||||
|
||||
/* Earlier revs of the IGP phy require us to force MDI. */
|
||||
if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) {
|
||||
dev_spec->dsp_config = e1000_dsp_config_disabled;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -901,7 +901,7 @@ static s32 e1000_phy_hw_reset_82543(struct e1000_hw *hw)
|
||||
**/
|
||||
static s32 e1000_reset_hw_82543(struct e1000_hw *hw)
|
||||
{
|
||||
u32 ctrl;
|
||||
u32 ctrl, icr;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82543");
|
||||
@ -943,7 +943,7 @@ static s32 e1000_reset_hw_82543(struct e1000_hw *hw)
|
||||
|
||||
/* Masking off and clearing any pending interrupts */
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
|
||||
E1000_READ_REG(hw, E1000_ICR);
|
||||
icr = E1000_READ_REG(hw, E1000_ICR);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
@ -1079,7 +1079,6 @@ static s32 e1000_setup_copper_link_82543(struct e1000_hw *hw)
|
||||
ret_val = hw->phy.ops.reset(hw);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
hw->phy.reset_disable = FALSE;
|
||||
} else {
|
||||
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
|
||||
E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -57,12 +57,12 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw);
|
||||
static void e1000_release_nvm_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
u16 words, u16 *data);
|
||||
static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw,
|
||||
bool active);
|
||||
bool active);
|
||||
static s32 e1000_reset_hw_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_init_hw_82571(struct e1000_hw *hw);
|
||||
static void e1000_clear_vfta_82571(struct e1000_hw *hw);
|
||||
@ -83,12 +83,12 @@ static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw);
|
||||
static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw);
|
||||
static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw);
|
||||
static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw,
|
||||
bool active);
|
||||
bool active);
|
||||
static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw,
|
||||
bool active);
|
||||
bool active);
|
||||
static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw);
|
||||
static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
u16 words, u16 *data);
|
||||
static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw);
|
||||
static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw);
|
||||
|
||||
@ -108,61 +108,61 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
|
||||
goto out;
|
||||
}
|
||||
|
||||
phy->addr = 1;
|
||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
|
||||
phy->reset_delay_us = 100;
|
||||
phy->addr = 1;
|
||||
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
|
||||
phy->reset_delay_us = 100;
|
||||
|
||||
phy->ops.check_reset_block = e1000_check_reset_block_generic;
|
||||
phy->ops.reset = e1000_phy_hw_reset_generic;
|
||||
phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82571;
|
||||
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic;
|
||||
phy->ops.power_up = e1000_power_up_phy_copper;
|
||||
phy->ops.power_down = e1000_power_down_phy_copper_82571;
|
||||
phy->ops.check_reset_block = e1000_check_reset_block_generic;
|
||||
phy->ops.reset = e1000_phy_hw_reset_generic;
|
||||
phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82571;
|
||||
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic;
|
||||
phy->ops.power_up = e1000_power_up_phy_copper;
|
||||
phy->ops.power_down = e1000_power_down_phy_copper_82571;
|
||||
|
||||
switch (hw->mac.type) {
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
phy->type = e1000_phy_igp_2;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_82571;
|
||||
phy->ops.get_info = e1000_get_phy_info_igp;
|
||||
phy->ops.check_polarity = e1000_check_polarity_igp;
|
||||
phy->type = e1000_phy_igp_2;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_82571;
|
||||
phy->ops.get_info = e1000_get_phy_info_igp;
|
||||
phy->ops.check_polarity = e1000_check_polarity_igp;
|
||||
phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_igp_2;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_igp;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_igp;
|
||||
phy->ops.acquire = e1000_get_hw_semaphore_82571;
|
||||
phy->ops.release = e1000_put_hw_semaphore_82571;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_igp_2;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_igp;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_igp;
|
||||
phy->ops.acquire = e1000_get_hw_semaphore_82571;
|
||||
phy->ops.release = e1000_put_hw_semaphore_82571;
|
||||
break;
|
||||
case e1000_82573:
|
||||
phy->type = e1000_phy_m88;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->type = e1000_phy_m88;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_m88;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_m88;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_m88;
|
||||
phy->ops.acquire = e1000_get_hw_semaphore_82571;
|
||||
phy->ops.release = e1000_put_hw_semaphore_82571;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_m88;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_m88;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_m88;
|
||||
phy->ops.acquire = e1000_get_hw_semaphore_82571;
|
||||
phy->ops.release = e1000_put_hw_semaphore_82571;
|
||||
break;
|
||||
case e1000_82574:
|
||||
case e1000_82583:
|
||||
E1000_MUTEX_INIT(&hw->dev_spec._82571.swflag_mutex);
|
||||
|
||||
phy->type = e1000_phy_bm;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->type = e1000_phy_bm;
|
||||
phy->ops.get_cfg_done = e1000_get_cfg_done_generic;
|
||||
phy->ops.get_info = e1000_get_phy_info_m88;
|
||||
phy->ops.check_polarity = e1000_check_polarity_m88;
|
||||
phy->ops.commit = e1000_phy_sw_reset_generic;
|
||||
phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_m88;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_bm2;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_bm2;
|
||||
phy->ops.acquire = e1000_get_hw_semaphore_82574;
|
||||
phy->ops.release = e1000_put_hw_semaphore_82574;
|
||||
phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82574;
|
||||
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
|
||||
phy->ops.get_cable_length = e1000_get_cable_length_m88;
|
||||
phy->ops.read_reg = e1000_read_phy_reg_bm2;
|
||||
phy->ops.write_reg = e1000_write_phy_reg_bm2;
|
||||
phy->ops.acquire = e1000_get_hw_semaphore_82574;
|
||||
phy->ops.release = e1000_put_hw_semaphore_82574;
|
||||
phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82574;
|
||||
phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574;
|
||||
break;
|
||||
default:
|
||||
ret_val = -E1000_ERR_PHY;
|
||||
@ -253,7 +253,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
|
||||
default:
|
||||
nvm->type = e1000_nvm_eeprom_spi;
|
||||
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
|
||||
E1000_EECD_SIZE_EX_SHIFT);
|
||||
E1000_EECD_SIZE_EX_SHIFT);
|
||||
/*
|
||||
* Added to a constant, "size" becomes the left-shift value
|
||||
* for setting word_size.
|
||||
@ -263,7 +263,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
|
||||
/* EEPROM access above 16k is unsupported */
|
||||
if (size > 14)
|
||||
size = 14;
|
||||
nvm->word_size = 1 << size;
|
||||
nvm->word_size = 1 << size;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -279,11 +279,11 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
|
||||
nvm->ops.release = e1000_release_nvm_82571;
|
||||
break;
|
||||
}
|
||||
nvm->ops.read = e1000_read_nvm_eerd;
|
||||
nvm->ops.update = e1000_update_nvm_checksum_82571;
|
||||
nvm->ops.validate = e1000_validate_nvm_checksum_82571;
|
||||
nvm->ops.read = e1000_read_nvm_eerd;
|
||||
nvm->ops.update = e1000_update_nvm_checksum_82571;
|
||||
nvm->ops.validate = e1000_validate_nvm_checksum_82571;
|
||||
nvm->ops.valid_led_default = e1000_valid_led_default_82571;
|
||||
nvm->ops.write = e1000_write_nvm_82571;
|
||||
nvm->ops.write = e1000_write_nvm_82571;
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
@ -363,8 +363,6 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
mac->ops.read_mac_addr = e1000_read_mac_addr_82571;
|
||||
/* ID LED init */
|
||||
mac->ops.id_led_init = e1000_id_led_init_generic;
|
||||
/* blink LED */
|
||||
mac->ops.blink_led = e1000_blink_led_generic;
|
||||
/* setup LED */
|
||||
mac->ops.setup_led = e1000_setup_led_generic;
|
||||
/* cleanup LED */
|
||||
@ -380,6 +378,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
mac->ops.set_lan_id = e1000_set_lan_id_single_port;
|
||||
mac->ops.check_mng_mode = e1000_check_mng_mode_generic;
|
||||
mac->ops.led_on = e1000_led_on_generic;
|
||||
mac->ops.blink_led = e1000_blink_led_generic;
|
||||
|
||||
/* FWSM register */
|
||||
mac->has_fwsm = TRUE;
|
||||
@ -387,9 +386,8 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
* ARC supported; valid only if manageability features are
|
||||
* enabled.
|
||||
*/
|
||||
mac->arc_subsystem_valid =
|
||||
(E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK)
|
||||
? TRUE : FALSE;
|
||||
mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) &
|
||||
E1000_FWSM_MODE_MASK) ? TRUE : FALSE;
|
||||
break;
|
||||
case e1000_82574:
|
||||
case e1000_82583:
|
||||
@ -400,6 +398,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
default:
|
||||
mac->ops.check_mng_mode = e1000_check_mng_mode_generic;
|
||||
mac->ops.led_on = e1000_led_on_generic;
|
||||
mac->ops.blink_led = e1000_blink_led_generic;
|
||||
|
||||
/* FWSM register */
|
||||
mac->has_fwsm = TRUE;
|
||||
@ -420,8 +419,8 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
|
||||
if (!(swsm2 & E1000_SWSM2_LOCK)) {
|
||||
/* Only do this for the first interface on this card */
|
||||
E1000_WRITE_REG(hw, E1000_SWSM2,
|
||||
swsm2 | E1000_SWSM2_LOCK);
|
||||
E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 |
|
||||
E1000_SWSM2_LOCK);
|
||||
force_clear_smbi = TRUE;
|
||||
} else
|
||||
force_clear_smbi = FALSE;
|
||||
@ -746,8 +745,8 @@ static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active)
|
||||
if (!active) {
|
||||
data &= ~E1000_PHY_CTRL_NOND0A_LPLU;
|
||||
} else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) ||
|
||||
(hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) ||
|
||||
(hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) {
|
||||
(hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) ||
|
||||
(hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) {
|
||||
data |= E1000_PHY_CTRL_NOND0A_LPLU;
|
||||
}
|
||||
|
||||
@ -816,7 +815,7 @@ static void e1000_release_nvm_82571(struct e1000_hw *hw)
|
||||
* EEPROM will most likely contain an invalid checksum.
|
||||
**/
|
||||
static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data)
|
||||
u16 *data)
|
||||
{
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
@ -941,7 +940,7 @@ static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
|
||||
* EEPROM will most likely contain an invalid checksum.
|
||||
**/
|
||||
static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data)
|
||||
u16 words, u16 *data)
|
||||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
u32 i, eewr = 0;
|
||||
@ -1039,22 +1038,22 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
|
||||
if (active) {
|
||||
data |= IGP02E1000_PM_D0_LPLU;
|
||||
ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
|
||||
data);
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
/* When LPLU is enabled, we should disable SmartSpeed */
|
||||
ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
|
||||
&data);
|
||||
&data);
|
||||
data &= ~IGP01E1000_PSCFR_SMART_SPEED;
|
||||
ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG,
|
||||
data);
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
} else {
|
||||
data &= ~IGP02E1000_PM_D0_LPLU;
|
||||
ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
|
||||
data);
|
||||
data);
|
||||
/*
|
||||
* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
* during Dx states where the power conservation is most
|
||||
@ -1063,28 +1062,28 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
|
||||
*/
|
||||
if (phy->smart_speed == e1000_smart_speed_on) {
|
||||
ret_val = phy->ops.read_reg(hw,
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
&data);
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
&data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
data |= IGP01E1000_PSCFR_SMART_SPEED;
|
||||
ret_val = phy->ops.write_reg(hw,
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
data);
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
} else if (phy->smart_speed == e1000_smart_speed_off) {
|
||||
ret_val = phy->ops.read_reg(hw,
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
&data);
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
&data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
data &= ~IGP01E1000_PSCFR_SMART_SPEED;
|
||||
ret_val = phy->ops.write_reg(hw,
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
data);
|
||||
IGP01E1000_PHY_PORT_CONFIG,
|
||||
data);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
}
|
||||
@ -1255,8 +1254,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
|
||||
/* Set the transmit descriptor write-back policy */
|
||||
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));
|
||||
reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB |
|
||||
E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data);
|
||||
|
||||
/* ...for both queues. */
|
||||
@ -1273,8 +1271,8 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
|
||||
default:
|
||||
reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1));
|
||||
reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB |
|
||||
E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_TXDCTL_FULL_TX_DESC_WB |
|
||||
E1000_TXDCTL_COUNT_DESC;
|
||||
E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data);
|
||||
break;
|
||||
}
|
||||
@ -1320,6 +1318,10 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
|
||||
case e1000_82572:
|
||||
reg |= (1 << 23) | (1 << 24) | (1 << 25) | (1 << 26);
|
||||
break;
|
||||
case e1000_82574:
|
||||
case e1000_82583:
|
||||
reg |= (1 << 26);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1527,12 +1529,12 @@ bool e1000_check_phy_82574(struct e1000_hw *hw)
|
||||
* read the Base1000T status register If both are max then PHY is hung.
|
||||
*/
|
||||
ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER,
|
||||
&receive_errors);
|
||||
&receive_errors);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
if (receive_errors == E1000_RECEIVE_ERROR_MAX) {
|
||||
ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS,
|
||||
&status_1kbt);
|
||||
&status_1kbt);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) ==
|
||||
@ -1640,7 +1642,8 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
|
||||
* mode. This prevents drivers from twiddling their thumbs
|
||||
* if another tool failed to take it out of loopback mode.
|
||||
*/
|
||||
E1000_WRITE_REG(hw, E1000_SCTL, E1000_SCTL_DISABLE_SERDES_LOOPBACK);
|
||||
E1000_WRITE_REG(hw, E1000_SCTL,
|
||||
E1000_SCTL_DISABLE_SERDES_LOOPBACK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -1664,7 +1667,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
|
||||
*
|
||||
* 1) down
|
||||
* 2) autoneg_progress
|
||||
* 3) autoneg_complete (the link sucessfully autonegotiated)
|
||||
* 3) autoneg_complete (the link successfully autonegotiated)
|
||||
* 4) forced_up (the link has been forced up, it did not autonegotiate)
|
||||
*
|
||||
**/
|
||||
@ -1763,7 +1766,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
mac->serdes_link_state =
|
||||
e1000_serdes_link_forced_up;
|
||||
e1000_serdes_link_forced_up;
|
||||
mac->serdes_has_link = TRUE;
|
||||
DEBUGOUT("AN_PROG -> FORCED_UP\n");
|
||||
}
|
||||
@ -1777,10 +1780,10 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
* up.
|
||||
*/
|
||||
E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw);
|
||||
E1000_WRITE_REG(hw, E1000_CTRL,
|
||||
(ctrl & ~E1000_CTRL_SLU));
|
||||
E1000_WRITE_REG(hw, E1000_CTRL, (ctrl &
|
||||
~E1000_CTRL_SLU));
|
||||
mac->serdes_link_state =
|
||||
e1000_serdes_link_autoneg_progress;
|
||||
e1000_serdes_link_autoneg_progress;
|
||||
mac->serdes_has_link = FALSE;
|
||||
DEBUGOUT("DOWN -> AN_PROG\n");
|
||||
break;
|
||||
@ -1804,7 +1807,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
(rxcw & E1000_RXCW_C))) {
|
||||
mac->serdes_has_link = FALSE;
|
||||
mac->serdes_link_state =
|
||||
e1000_serdes_link_down;
|
||||
e1000_serdes_link_down;
|
||||
DEBUGOUT("ANYSTATE -> DOWN\n");
|
||||
break;
|
||||
}
|
||||
@ -1815,7 +1818,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
txcw |= E1000_TXCW_ANE;
|
||||
E1000_WRITE_REG(hw, E1000_TXCW, txcw);
|
||||
mac->serdes_link_state =
|
||||
e1000_serdes_link_autoneg_progress;
|
||||
e1000_serdes_link_autoneg_progress;
|
||||
mac->serdes_has_link = FALSE;
|
||||
DEBUGOUT("ANYSTATE -> AN_PROG\n");
|
||||
}
|
||||
@ -1905,7 +1908,7 @@ void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
|
||||
* Eventually the LAA will be in RAR[0] and RAR[14].
|
||||
*/
|
||||
e1000_rar_set_generic(hw, hw->mac.addr,
|
||||
hw->mac.rar_entry_count - 1);
|
||||
hw->mac.rar_entry_count - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -35,10 +35,10 @@
|
||||
#ifndef _E1000_82575_H_
|
||||
#define _E1000_82575_H_
|
||||
|
||||
#define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
|
||||
(ID_LED_DEF1_DEF2 << 8) | \
|
||||
(ID_LED_DEF1_DEF2 << 4) | \
|
||||
(ID_LED_OFF1_ON2))
|
||||
#define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
|
||||
(ID_LED_DEF1_DEF2 << 8) | \
|
||||
(ID_LED_DEF1_DEF2 << 4) | \
|
||||
(ID_LED_OFF1_ON2))
|
||||
/*
|
||||
* Receive Address Register Count
|
||||
* Number of high/low register pairs in the RAR. The RAR (Receive Address
|
||||
@ -49,13 +49,13 @@
|
||||
* For 82576, there are an additional set of RARs that begin at an offset
|
||||
* separate from the first set of RARs.
|
||||
*/
|
||||
#define E1000_RAR_ENTRIES_82575 16
|
||||
#define E1000_RAR_ENTRIES_82576 24
|
||||
#define E1000_RAR_ENTRIES_82580 24
|
||||
#define E1000_RAR_ENTRIES_I350 32
|
||||
#define E1000_SW_SYNCH_MB 0x00000100
|
||||
#define E1000_STAT_DEV_RST_SET 0x00100000
|
||||
#define E1000_CTRL_DEV_RST 0x20000000
|
||||
#define E1000_RAR_ENTRIES_82575 16
|
||||
#define E1000_RAR_ENTRIES_82576 24
|
||||
#define E1000_RAR_ENTRIES_82580 24
|
||||
#define E1000_RAR_ENTRIES_I350 32
|
||||
#define E1000_SW_SYNCH_MB 0x00000100
|
||||
#define E1000_STAT_DEV_RST_SET 0x00100000
|
||||
#define E1000_CTRL_DEV_RST 0x20000000
|
||||
|
||||
#ifdef E1000_BIT_FIELDS
|
||||
struct e1000_adv_data_desc {
|
||||
@ -63,137 +63,138 @@ struct e1000_adv_data_desc {
|
||||
union {
|
||||
u32 data;
|
||||
struct {
|
||||
u32 datalen :16; /* Data buffer length */
|
||||
u32 rsvd :4;
|
||||
u32 dtyp :4; /* Descriptor type */
|
||||
u32 dcmd :8; /* Descriptor command */
|
||||
u32 datalen:16; /* Data buffer length */
|
||||
u32 rsvd:4;
|
||||
u32 dtyp:4; /* Descriptor type */
|
||||
u32 dcmd:8; /* Descriptor command */
|
||||
} config;
|
||||
} lower;
|
||||
union {
|
||||
u32 data;
|
||||
struct {
|
||||
u32 status :4; /* Descriptor status */
|
||||
u32 idx :4;
|
||||
u32 popts :6; /* Packet Options */
|
||||
u32 paylen :18; /* Payload length */
|
||||
u32 status:4; /* Descriptor status */
|
||||
u32 idx:4;
|
||||
u32 popts:6; /* Packet Options */
|
||||
u32 paylen:18; /* Payload length */
|
||||
} options;
|
||||
} upper;
|
||||
};
|
||||
|
||||
#define E1000_TXD_DTYP_ADV_C 0x2 /* Advanced Context Descriptor */
|
||||
#define E1000_TXD_DTYP_ADV_D 0x3 /* Advanced Data Descriptor */
|
||||
#define E1000_ADV_TXD_CMD_DEXT 0x20 /* Descriptor extension (0 = legacy) */
|
||||
#define E1000_ADV_TUCMD_IPV4 0x2 /* IP Packet Type: 1=IPv4 */
|
||||
#define E1000_ADV_TUCMD_IPV6 0x0 /* IP Packet Type: 0=IPv6 */
|
||||
#define E1000_ADV_TUCMD_L4T_UDP 0x0 /* L4 Packet TYPE of UDP */
|
||||
#define E1000_ADV_TUCMD_L4T_TCP 0x4 /* L4 Packet TYPE of TCP */
|
||||
#define E1000_ADV_TUCMD_MKRREQ 0x10 /* Indicates markers are required */
|
||||
#define E1000_ADV_DCMD_EOP 0x1 /* End of Packet */
|
||||
#define E1000_ADV_DCMD_IFCS 0x2 /* Insert FCS (Ethernet CRC) */
|
||||
#define E1000_ADV_DCMD_RS 0x8 /* Report Status */
|
||||
#define E1000_ADV_DCMD_VLE 0x40 /* Add VLAN tag */
|
||||
#define E1000_ADV_DCMD_TSE 0x80 /* TCP Seg enable */
|
||||
#define E1000_TXD_DTYP_ADV_C 0x2 /* Advanced Context Descriptor */
|
||||
#define E1000_TXD_DTYP_ADV_D 0x3 /* Advanced Data Descriptor */
|
||||
#define E1000_ADV_TXD_CMD_DEXT 0x20 /* Descriptor extension (0 = legacy) */
|
||||
#define E1000_ADV_TUCMD_IPV4 0x2 /* IP Packet Type: 1=IPv4 */
|
||||
#define E1000_ADV_TUCMD_IPV6 0x0 /* IP Packet Type: 0=IPv6 */
|
||||
#define E1000_ADV_TUCMD_L4T_UDP 0x0 /* L4 Packet TYPE of UDP */
|
||||
#define E1000_ADV_TUCMD_L4T_TCP 0x4 /* L4 Packet TYPE of TCP */
|
||||
#define E1000_ADV_TUCMD_MKRREQ 0x10 /* Indicates markers are required */
|
||||
#define E1000_ADV_DCMD_EOP 0x1 /* End of Packet */
|
||||
#define E1000_ADV_DCMD_IFCS 0x2 /* Insert FCS (Ethernet CRC) */
|
||||
#define E1000_ADV_DCMD_RS 0x8 /* Report Status */
|
||||
#define E1000_ADV_DCMD_VLE 0x40 /* Add VLAN tag */
|
||||
#define E1000_ADV_DCMD_TSE 0x80 /* TCP Seg enable */
|
||||
/* Extended Device Control */
|
||||
#define E1000_CTRL_EXT_NSICR 0x00000001 /* Disable Intr Clear all on read */
|
||||
#define E1000_CTRL_EXT_NSICR 0x00000001 /* Disable Intr Clear all on read */
|
||||
|
||||
struct e1000_adv_context_desc {
|
||||
union {
|
||||
u32 ip_config;
|
||||
struct {
|
||||
u32 iplen :9;
|
||||
u32 maclen :7;
|
||||
u32 vlan_tag :16;
|
||||
u32 iplen:9;
|
||||
u32 maclen:7;
|
||||
u32 vlan_tag:16;
|
||||
} fields;
|
||||
} ip_setup;
|
||||
u32 seq_num;
|
||||
union {
|
||||
u64 l4_config;
|
||||
struct {
|
||||
u32 mkrloc :9;
|
||||
u32 tucmd :11;
|
||||
u32 dtyp :4;
|
||||
u32 adv :8;
|
||||
u32 rsvd :4;
|
||||
u32 idx :4;
|
||||
u32 l4len :8;
|
||||
u32 mss :16;
|
||||
u32 mkrloc:9;
|
||||
u32 tucmd:11;
|
||||
u32 dtyp:4;
|
||||
u32 adv:8;
|
||||
u32 rsvd:4;
|
||||
u32 idx:4;
|
||||
u32 l4len:8;
|
||||
u32 mss:16;
|
||||
} fields;
|
||||
} l4_setup;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* SRRCTL bit definitions */
|
||||
#define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
|
||||
#define E1000_SRRCTL_BSIZEHDRSIZE_MASK 0x00000F00
|
||||
#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT 2 /* Shift _left_ */
|
||||
#define E1000_SRRCTL_DESCTYPE_LEGACY 0x00000000
|
||||
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT 0x04000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION 0x06000000
|
||||
#define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
|
||||
#define E1000_SRRCTL_BSIZEHDRSIZE_MASK 0x00000F00
|
||||
#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT 2 /* Shift _left_ */
|
||||
#define E1000_SRRCTL_DESCTYPE_LEGACY 0x00000000
|
||||
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT 0x04000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION 0x06000000
|
||||
#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000
|
||||
#define E1000_SRRCTL_DESCTYPE_MASK 0x0E000000
|
||||
#define E1000_SRRCTL_TIMESTAMP 0x40000000
|
||||
#define E1000_SRRCTL_DROP_EN 0x80000000
|
||||
#define E1000_SRRCTL_DESCTYPE_MASK 0x0E000000
|
||||
#define E1000_SRRCTL_TIMESTAMP 0x40000000
|
||||
#define E1000_SRRCTL_DROP_EN 0x80000000
|
||||
|
||||
#define E1000_SRRCTL_BSIZEPKT_MASK 0x0000007F
|
||||
#define E1000_SRRCTL_BSIZEHDR_MASK 0x00003F00
|
||||
#define E1000_SRRCTL_BSIZEPKT_MASK 0x0000007F
|
||||
#define E1000_SRRCTL_BSIZEHDR_MASK 0x00003F00
|
||||
|
||||
#define E1000_TX_HEAD_WB_ENABLE 0x1
|
||||
#define E1000_TX_SEQNUM_WB_ENABLE 0x2
|
||||
#define E1000_TX_HEAD_WB_ENABLE 0x1
|
||||
#define E1000_TX_SEQNUM_WB_ENABLE 0x2
|
||||
|
||||
#define E1000_MRQC_ENABLE_RSS_4Q 0x00000002
|
||||
#define E1000_MRQC_ENABLE_VMDQ 0x00000003
|
||||
#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q 0x00000005
|
||||
#define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
|
||||
#define E1000_MRQC_ENABLE_RSS_8Q 0x00000002
|
||||
#define E1000_MRQC_ENABLE_RSS_4Q 0x00000002
|
||||
#define E1000_MRQC_ENABLE_VMDQ 0x00000003
|
||||
#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q 0x00000005
|
||||
#define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
|
||||
#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
|
||||
#define E1000_MRQC_ENABLE_RSS_8Q 0x00000002
|
||||
|
||||
#define E1000_VMRCTL_MIRROR_PORT_SHIFT 8
|
||||
#define E1000_VMRCTL_MIRROR_DSTPORT_MASK (7 << E1000_VMRCTL_MIRROR_PORT_SHIFT)
|
||||
#define E1000_VMRCTL_POOL_MIRROR_ENABLE (1 << 0)
|
||||
#define E1000_VMRCTL_UPLINK_MIRROR_ENABLE (1 << 1)
|
||||
#define E1000_VMRCTL_DOWNLINK_MIRROR_ENABLE (1 << 2)
|
||||
#define E1000_VMRCTL_MIRROR_PORT_SHIFT 8
|
||||
#define E1000_VMRCTL_MIRROR_DSTPORT_MASK (7 << \
|
||||
E1000_VMRCTL_MIRROR_PORT_SHIFT)
|
||||
#define E1000_VMRCTL_POOL_MIRROR_ENABLE (1 << 0)
|
||||
#define E1000_VMRCTL_UPLINK_MIRROR_ENABLE (1 << 1)
|
||||
#define E1000_VMRCTL_DOWNLINK_MIRROR_ENABLE (1 << 2)
|
||||
|
||||
#define E1000_EICR_TX_QUEUE ( \
|
||||
E1000_EICR_TX_QUEUE0 | \
|
||||
E1000_EICR_TX_QUEUE1 | \
|
||||
E1000_EICR_TX_QUEUE2 | \
|
||||
E1000_EICR_TX_QUEUE3)
|
||||
E1000_EICR_TX_QUEUE0 | \
|
||||
E1000_EICR_TX_QUEUE1 | \
|
||||
E1000_EICR_TX_QUEUE2 | \
|
||||
E1000_EICR_TX_QUEUE3)
|
||||
|
||||
#define E1000_EICR_RX_QUEUE ( \
|
||||
E1000_EICR_RX_QUEUE0 | \
|
||||
E1000_EICR_RX_QUEUE1 | \
|
||||
E1000_EICR_RX_QUEUE2 | \
|
||||
E1000_EICR_RX_QUEUE3)
|
||||
E1000_EICR_RX_QUEUE0 | \
|
||||
E1000_EICR_RX_QUEUE1 | \
|
||||
E1000_EICR_RX_QUEUE2 | \
|
||||
E1000_EICR_RX_QUEUE3)
|
||||
|
||||
#define E1000_EIMS_RX_QUEUE E1000_EICR_RX_QUEUE
|
||||
#define E1000_EIMS_TX_QUEUE E1000_EICR_TX_QUEUE
|
||||
#define E1000_EIMS_RX_QUEUE E1000_EICR_RX_QUEUE
|
||||
#define E1000_EIMS_TX_QUEUE E1000_EICR_TX_QUEUE
|
||||
|
||||
#define EIMS_ENABLE_MASK ( \
|
||||
E1000_EIMS_RX_QUEUE | \
|
||||
E1000_EIMS_TX_QUEUE | \
|
||||
E1000_EIMS_TCP_TIMER | \
|
||||
E1000_EIMS_OTHER)
|
||||
E1000_EIMS_RX_QUEUE | \
|
||||
E1000_EIMS_TX_QUEUE | \
|
||||
E1000_EIMS_TCP_TIMER | \
|
||||
E1000_EIMS_OTHER)
|
||||
|
||||
/* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
|
||||
#define E1000_IMIR_PORT_IM_EN 0x00010000 /* TCP port enable */
|
||||
#define E1000_IMIR_PORT_BP 0x00020000 /* TCP port check bypass */
|
||||
#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */
|
||||
#define E1000_IMIREXT_CTRL_URG 0x00002000 /* Check URG bit in header */
|
||||
#define E1000_IMIREXT_CTRL_ACK 0x00004000 /* Check ACK bit in header */
|
||||
#define E1000_IMIREXT_CTRL_PSH 0x00008000 /* Check PSH bit in header */
|
||||
#define E1000_IMIREXT_CTRL_RST 0x00010000 /* Check RST bit in header */
|
||||
#define E1000_IMIREXT_CTRL_SYN 0x00020000 /* Check SYN bit in header */
|
||||
#define E1000_IMIREXT_CTRL_FIN 0x00040000 /* Check FIN bit in header */
|
||||
#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */
|
||||
#define E1000_IMIR_PORT_IM_EN 0x00010000 /* TCP port enable */
|
||||
#define E1000_IMIR_PORT_BP 0x00020000 /* TCP port check bypass */
|
||||
#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */
|
||||
#define E1000_IMIREXT_CTRL_URG 0x00002000 /* Check URG bit in header */
|
||||
#define E1000_IMIREXT_CTRL_ACK 0x00004000 /* Check ACK bit in header */
|
||||
#define E1000_IMIREXT_CTRL_PSH 0x00008000 /* Check PSH bit in header */
|
||||
#define E1000_IMIREXT_CTRL_RST 0x00010000 /* Check RST bit in header */
|
||||
#define E1000_IMIREXT_CTRL_SYN 0x00020000 /* Check SYN bit in header */
|
||||
#define E1000_IMIREXT_CTRL_FIN 0x00040000 /* Check FIN bit in header */
|
||||
#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */
|
||||
|
||||
/* Receive Descriptor - Advanced */
|
||||
union e1000_adv_rx_desc {
|
||||
struct {
|
||||
__le64 pkt_addr; /* Packet buffer address */
|
||||
__le64 hdr_addr; /* Header buffer address */
|
||||
__le64 pkt_addr; /* Packet buffer address */
|
||||
__le64 hdr_addr; /* Header buffer address */
|
||||
} read;
|
||||
struct {
|
||||
struct {
|
||||
@ -206,74 +207,74 @@ union e1000_adv_rx_desc {
|
||||
} hs_rss;
|
||||
} lo_dword;
|
||||
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 length; /* Packet length */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le16 length; /* Packet length */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
} upper;
|
||||
} wb; /* writeback */
|
||||
};
|
||||
|
||||
#define E1000_RXDADV_RSSTYPE_MASK 0x0000000F
|
||||
#define E1000_RXDADV_RSSTYPE_SHIFT 12
|
||||
#define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
|
||||
#define E1000_RXDADV_HDRBUFLEN_SHIFT 5
|
||||
#define E1000_RXDADV_SPLITHEADER_EN 0x00001000
|
||||
#define E1000_RXDADV_SPH 0x8000
|
||||
#define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */
|
||||
#define E1000_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */
|
||||
#define E1000_RXDADV_ERR_HBO 0x00800000
|
||||
#define E1000_RXDADV_RSSTYPE_MASK 0x0000000F
|
||||
#define E1000_RXDADV_RSSTYPE_SHIFT 12
|
||||
#define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
|
||||
#define E1000_RXDADV_HDRBUFLEN_SHIFT 5
|
||||
#define E1000_RXDADV_SPLITHEADER_EN 0x00001000
|
||||
#define E1000_RXDADV_SPH 0x8000
|
||||
#define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */
|
||||
#define E1000_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */
|
||||
#define E1000_RXDADV_ERR_HBO 0x00800000
|
||||
|
||||
/* RSS Hash results */
|
||||
#define E1000_RXDADV_RSSTYPE_NONE 0x00000000
|
||||
#define E1000_RXDADV_RSSTYPE_IPV4_TCP 0x00000001
|
||||
#define E1000_RXDADV_RSSTYPE_IPV4 0x00000002
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_TCP 0x00000003
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_EX 0x00000004
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6 0x00000005
|
||||
#define E1000_RXDADV_RSSTYPE_NONE 0x00000000
|
||||
#define E1000_RXDADV_RSSTYPE_IPV4_TCP 0x00000001
|
||||
#define E1000_RXDADV_RSSTYPE_IPV4 0x00000002
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_TCP 0x00000003
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_EX 0x00000004
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6 0x00000005
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_TCP_EX 0x00000006
|
||||
#define E1000_RXDADV_RSSTYPE_IPV4_UDP 0x00000007
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_UDP 0x00000008
|
||||
#define E1000_RXDADV_RSSTYPE_IPV4_UDP 0x00000007
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_UDP 0x00000008
|
||||
#define E1000_RXDADV_RSSTYPE_IPV6_UDP_EX 0x00000009
|
||||
|
||||
/* RSS Packet Types as indicated in the receive descriptor */
|
||||
#define E1000_RXDADV_PKTTYPE_NONE 0x00000000
|
||||
#define E1000_RXDADV_PKTTYPE_IPV4 0x00000010 /* IPV4 hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_IPV4_EX 0x00000020 /* IPV4 hdr + extensions */
|
||||
#define E1000_RXDADV_PKTTYPE_IPV6 0x00000040 /* IPV6 hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_IPV6_EX 0x00000080 /* IPV6 hdr + extensions */
|
||||
#define E1000_RXDADV_PKTTYPE_TCP 0x00000100 /* TCP hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_UDP 0x00000200 /* UDP hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_SCTP 0x00000400 /* SCTP hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_NFS 0x00000800 /* NFS hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_NONE 0x00000000
|
||||
#define E1000_RXDADV_PKTTYPE_IPV4 0x00000010 /* IPV4 hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_IPV4_EX 0x00000020 /* IPV4 hdr + extensions */
|
||||
#define E1000_RXDADV_PKTTYPE_IPV6 0x00000040 /* IPV6 hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_IPV6_EX 0x00000080 /* IPV6 hdr + extensions */
|
||||
#define E1000_RXDADV_PKTTYPE_TCP 0x00000100 /* TCP hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_UDP 0x00000200 /* UDP hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_SCTP 0x00000400 /* SCTP hdr present */
|
||||
#define E1000_RXDADV_PKTTYPE_NFS 0x00000800 /* NFS hdr present */
|
||||
|
||||
#define E1000_RXDADV_PKTTYPE_IPSEC_ESP 0x00001000 /* IPSec ESP */
|
||||
#define E1000_RXDADV_PKTTYPE_IPSEC_AH 0x00002000 /* IPSec AH */
|
||||
#define E1000_RXDADV_PKTTYPE_LINKSEC 0x00004000 /* LinkSec Encap */
|
||||
#define E1000_RXDADV_PKTTYPE_ETQF 0x00008000 /* PKTTYPE is ETQF index */
|
||||
#define E1000_RXDADV_PKTTYPE_ETQF_MASK 0x00000070 /* ETQF has 8 indices */
|
||||
#define E1000_RXDADV_PKTTYPE_ETQF_SHIFT 4 /* Right-shift 4 bits */
|
||||
#define E1000_RXDADV_PKTTYPE_IPSEC_ESP 0x00001000 /* IPSec ESP */
|
||||
#define E1000_RXDADV_PKTTYPE_IPSEC_AH 0x00002000 /* IPSec AH */
|
||||
#define E1000_RXDADV_PKTTYPE_LINKSEC 0x00004000 /* LinkSec Encap */
|
||||
#define E1000_RXDADV_PKTTYPE_ETQF 0x00008000 /* PKTTYPE is ETQF index */
|
||||
#define E1000_RXDADV_PKTTYPE_ETQF_MASK 0x00000070 /* ETQF has 8 indices */
|
||||
#define E1000_RXDADV_PKTTYPE_ETQF_SHIFT 4 /* Right-shift 4 bits */
|
||||
|
||||
/* LinkSec results */
|
||||
/* Security Processing bit Indication */
|
||||
#define E1000_RXDADV_LNKSEC_STATUS_SECP 0x00020000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_BIT_MASK 0x18000000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_NO_SA_MATCH 0x08000000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_REPLAY_ERROR 0x10000000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_BAD_SIG 0x18000000
|
||||
#define E1000_RXDADV_LNKSEC_STATUS_SECP 0x00020000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_BIT_MASK 0x18000000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_NO_SA_MATCH 0x08000000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_REPLAY_ERROR 0x10000000
|
||||
#define E1000_RXDADV_LNKSEC_ERROR_BAD_SIG 0x18000000
|
||||
|
||||
#define E1000_RXDADV_IPSEC_STATUS_SECP 0x00020000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_BIT_MASK 0x18000000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_INVALID_PROTOCOL 0x08000000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000
|
||||
#define E1000_RXDADV_IPSEC_STATUS_SECP 0x00020000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_BIT_MASK 0x18000000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_INVALID_PROTOCOL 0x08000000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000
|
||||
#define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000
|
||||
|
||||
/* Transmit Descriptor - Advanced */
|
||||
union e1000_adv_tx_desc {
|
||||
@ -290,25 +291,26 @@ union e1000_adv_tx_desc {
|
||||
};
|
||||
|
||||
/* Adv Transmit Descriptor Config Masks */
|
||||
#define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */
|
||||
#define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */
|
||||
#define E1000_ADVTXD_DCMD_EOP 0x01000000 /* End of Packet */
|
||||
#define E1000_ADVTXD_DCMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
|
||||
#define E1000_ADVTXD_DCMD_RS 0x08000000 /* Report Status */
|
||||
#define E1000_ADVTXD_DCMD_DDTYP_ISCSI 0x10000000 /* DDP hdr type or iSCSI */
|
||||
#define E1000_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor extension (1=Adv) */
|
||||
#define E1000_ADVTXD_DCMD_VLE 0x40000000 /* VLAN pkt enable */
|
||||
#define E1000_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */
|
||||
#define E1000_ADVTXD_MAC_LINKSEC 0x00040000 /* Apply LinkSec on packet */
|
||||
#define E1000_ADVTXD_MAC_TSTAMP 0x00080000 /* IEEE1588 Timestamp packet */
|
||||
#define E1000_ADVTXD_STAT_SN_CRC 0x00000002 /* NXTSEQ/SEED present in WB */
|
||||
#define E1000_ADVTXD_IDX_SHIFT 4 /* Adv desc Index shift */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_1ST 0x00000000 /* 1st TSO of iSCSI PDU */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_MDL 0x00000800 /* Middle TSO of iSCSI PDU */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_LAST 0x00001000 /* Last TSO of iSCSI PDU */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_FULL 0x00001800 /* 1st&Last TSO-full iSCSI PDU*/
|
||||
#define E1000_ADVTXD_POPTS_IPSEC 0x00000400 /* IPSec offload request */
|
||||
#define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
|
||||
#define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */
|
||||
#define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */
|
||||
#define E1000_ADVTXD_DCMD_EOP 0x01000000 /* End of Packet */
|
||||
#define E1000_ADVTXD_DCMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
|
||||
#define E1000_ADVTXD_DCMD_RS 0x08000000 /* Report Status */
|
||||
#define E1000_ADVTXD_DCMD_DDTYP_ISCSI 0x10000000 /* DDP hdr type or iSCSI */
|
||||
#define E1000_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor extension (1=Adv) */
|
||||
#define E1000_ADVTXD_DCMD_VLE 0x40000000 /* VLAN pkt enable */
|
||||
#define E1000_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */
|
||||
#define E1000_ADVTXD_MAC_LINKSEC 0x00040000 /* Apply LinkSec on pkt */
|
||||
#define E1000_ADVTXD_MAC_TSTAMP 0x00080000 /* IEEE1588 Timestamp pkt */
|
||||
#define E1000_ADVTXD_STAT_SN_CRC 0x00000002 /* NXTSEQ/SEED prsnt in WB */
|
||||
#define E1000_ADVTXD_IDX_SHIFT 4 /* Adv desc Index shift */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_1ST 0x00000000 /* 1st TSO of iSCSI PDU */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_MDL 0x00000800 /* Middle TSO of iSCSI PDU */
|
||||
#define E1000_ADVTXD_POPTS_ISCO_LAST 0x00001000 /* Last TSO of iSCSI PDU */
|
||||
/* 1st & Last TSO-full iSCSI PDU*/
|
||||
#define E1000_ADVTXD_POPTS_ISCO_FULL 0x00001800
|
||||
#define E1000_ADVTXD_POPTS_IPSEC 0x00000400 /* IPSec offload request */
|
||||
#define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
|
||||
|
||||
/* Context descriptors */
|
||||
struct e1000_adv_tx_context_desc {
|
||||
@ -318,65 +320,66 @@ struct e1000_adv_tx_context_desc {
|
||||
__le32 mss_l4len_idx;
|
||||
};
|
||||
|
||||
#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */
|
||||
#define E1000_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */
|
||||
#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */
|
||||
#define E1000_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */
|
||||
#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */
|
||||
#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */
|
||||
#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 Packet TYPE of SCTP */
|
||||
#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP 0x00002000 /* IPSec Type ESP */
|
||||
#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */
|
||||
#define E1000_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */
|
||||
#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */
|
||||
#define E1000_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */
|
||||
#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */
|
||||
#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */
|
||||
#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 Packet TYPE of SCTP */
|
||||
#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP 0x00002000 /* IPSec Type ESP */
|
||||
/* IPSec Encrypt Enable for ESP */
|
||||
#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN 0x00004000
|
||||
#define E1000_ADVTXD_TUCMD_MKRREQ 0x00002000 /* Req requires Markers and CRC */
|
||||
#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */
|
||||
#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */
|
||||
#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN 0x00004000
|
||||
/* Req requires Markers and CRC */
|
||||
#define E1000_ADVTXD_TUCMD_MKRREQ 0x00002000
|
||||
#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */
|
||||
#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */
|
||||
/* Adv ctxt IPSec SA IDX mask */
|
||||
#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK 0x000000FF
|
||||
#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK 0x000000FF
|
||||
/* Adv ctxt IPSec ESP len mask */
|
||||
#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK 0x000000FF
|
||||
#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK 0x000000FF
|
||||
|
||||
/* Additional Transmit Descriptor Control definitions */
|
||||
#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Tx Queue */
|
||||
#define E1000_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. write-back flushing */
|
||||
#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */
|
||||
#define E1000_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. wbk flushing */
|
||||
/* Tx Queue Arbitration Priority 0=low, 1=high */
|
||||
#define E1000_TXDCTL_PRIORITY 0x08000000
|
||||
#define E1000_TXDCTL_PRIORITY 0x08000000
|
||||
|
||||
/* Additional Receive Descriptor Control definitions */
|
||||
#define E1000_RXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Rx Queue */
|
||||
#define E1000_RXDCTL_SWFLSH 0x04000000 /* Rx Desc. write-back flushing */
|
||||
#define E1000_RXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Rx Queue */
|
||||
#define E1000_RXDCTL_SWFLSH 0x04000000 /* Rx Desc. wbk flushing */
|
||||
|
||||
/* Direct Cache Access (DCA) definitions */
|
||||
#define E1000_DCA_CTRL_DCA_ENABLE 0x00000000 /* DCA Enable */
|
||||
#define E1000_DCA_CTRL_DCA_DISABLE 0x00000001 /* DCA Disable */
|
||||
#define E1000_DCA_CTRL_DCA_ENABLE 0x00000000 /* DCA Enable */
|
||||
#define E1000_DCA_CTRL_DCA_DISABLE 0x00000001 /* DCA Disable */
|
||||
|
||||
#define E1000_DCA_CTRL_DCA_MODE_CB1 0x00 /* DCA Mode CB1 */
|
||||
#define E1000_DCA_CTRL_DCA_MODE_CB2 0x02 /* DCA Mode CB2 */
|
||||
#define E1000_DCA_CTRL_DCA_MODE_CB1 0x00 /* DCA Mode CB1 */
|
||||
#define E1000_DCA_CTRL_DCA_MODE_CB2 0x02 /* DCA Mode CB2 */
|
||||
|
||||
#define E1000_DCA_RXCTRL_CPUID_MASK 0x0000001F /* Rx CPUID Mask */
|
||||
#define E1000_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */
|
||||
#define E1000_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */
|
||||
#define E1000_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */
|
||||
#define E1000_DCA_RXCTRL_CPUID_MASK 0x0000001F /* Rx CPUID Mask */
|
||||
#define E1000_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */
|
||||
#define E1000_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header ena */
|
||||
#define E1000_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload ena */
|
||||
|
||||
#define E1000_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */
|
||||
#define E1000_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */
|
||||
#define E1000_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */
|
||||
#define E1000_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */
|
||||
#define E1000_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */
|
||||
#define E1000_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */
|
||||
|
||||
#define E1000_DCA_TXCTRL_CPUID_MASK_82576 0xFF000000 /* Tx CPUID Mask */
|
||||
#define E1000_DCA_RXCTRL_CPUID_MASK_82576 0xFF000000 /* Rx CPUID Mask */
|
||||
#define E1000_DCA_TXCTRL_CPUID_SHIFT_82576 24 /* Tx CPUID */
|
||||
#define E1000_DCA_RXCTRL_CPUID_SHIFT_82576 24 /* Rx CPUID */
|
||||
#define E1000_DCA_TXCTRL_CPUID_MASK_82576 0xFF000000 /* Tx CPUID Mask */
|
||||
#define E1000_DCA_RXCTRL_CPUID_MASK_82576 0xFF000000 /* Rx CPUID Mask */
|
||||
#define E1000_DCA_TXCTRL_CPUID_SHIFT_82576 24 /* Tx CPUID */
|
||||
#define E1000_DCA_RXCTRL_CPUID_SHIFT_82576 24 /* Rx CPUID */
|
||||
|
||||
/* Additional interrupt register bit definitions */
|
||||
#define E1000_ICR_LSECPNS 0x00000020 /* PN threshold - server */
|
||||
#define E1000_IMS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */
|
||||
#define E1000_ICS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */
|
||||
#define E1000_ICR_LSECPNS 0x00000020 /* PN threshold - server */
|
||||
#define E1000_IMS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */
|
||||
#define E1000_ICS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */
|
||||
|
||||
/* ETQF register bit definitions */
|
||||
#define E1000_ETQF_FILTER_ENABLE (1 << 26)
|
||||
#define E1000_ETQF_IMM_INT (1 << 29)
|
||||
#define E1000_ETQF_1588 (1 << 30)
|
||||
#define E1000_ETQF_QUEUE_ENABLE (1 << 31)
|
||||
#define E1000_ETQF_FILTER_ENABLE (1 << 26)
|
||||
#define E1000_ETQF_IMM_INT (1 << 29)
|
||||
#define E1000_ETQF_1588 (1 << 30)
|
||||
#define E1000_ETQF_QUEUE_ENABLE (1 << 31)
|
||||
/*
|
||||
* ETQF filter list: one static filter per filter consumer. This is
|
||||
* to avoid filter collisions later. Add new filters
|
||||
@ -385,87 +388,89 @@ struct e1000_adv_tx_context_desc {
|
||||
* Current filters:
|
||||
* EAPOL 802.1x (0x888e): Filter 0
|
||||
*/
|
||||
#define E1000_ETQF_FILTER_EAPOL 0
|
||||
#define E1000_ETQF_FILTER_EAPOL 0
|
||||
|
||||
#define E1000_FTQF_VF_BP 0x00008000
|
||||
#define E1000_FTQF_1588_TIME_STAMP 0x08000000
|
||||
#define E1000_FTQF_MASK 0xF0000000
|
||||
#define E1000_FTQF_MASK_PROTO_BP 0x10000000
|
||||
#define E1000_FTQF_MASK_SOURCE_ADDR_BP 0x20000000
|
||||
#define E1000_FTQF_MASK_DEST_ADDR_BP 0x40000000
|
||||
#define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000
|
||||
#define E1000_FTQF_VF_BP 0x00008000
|
||||
#define E1000_FTQF_1588_TIME_STAMP 0x08000000
|
||||
#define E1000_FTQF_MASK 0xF0000000
|
||||
#define E1000_FTQF_MASK_PROTO_BP 0x10000000
|
||||
#define E1000_FTQF_MASK_SOURCE_ADDR_BP 0x20000000
|
||||
#define E1000_FTQF_MASK_DEST_ADDR_BP 0x40000000
|
||||
#define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000
|
||||
|
||||
#define E1000_NVM_APME_82575 0x0400
|
||||
#define MAX_NUM_VFS 8
|
||||
#define E1000_NVM_APME_82575 0x0400
|
||||
#define MAX_NUM_VFS 7
|
||||
|
||||
#define E1000_DTXSWC_MAC_SPOOF_MASK 0x000000FF /* Per VF MAC spoof control */
|
||||
#define E1000_DTXSWC_VLAN_SPOOF_MASK 0x0000FF00 /* Per VF VLAN spoof control */
|
||||
#define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enables */
|
||||
#define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8
|
||||
#define E1000_DTXSWC_LLE_SHIFT 16
|
||||
#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */
|
||||
#define E1000_DTXSWC_MAC_SPOOF_MASK 0x000000FF /* Per VF MAC spoof cntrl */
|
||||
#define E1000_DTXSWC_VLAN_SPOOF_MASK 0x0000FF00 /* Per VF VLAN spoof cntrl */
|
||||
#define E1000_DTXSWC_LLE_MASK 0x00FF0000 /* Per VF Local LB enables */
|
||||
#define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8
|
||||
#define E1000_DTXSWC_LLE_SHIFT 16
|
||||
#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31) /* global VF LB enable */
|
||||
|
||||
/* Easy defines for setting default pool, would normally be left a zero */
|
||||
#define E1000_VT_CTL_DEFAULT_POOL_SHIFT 7
|
||||
#define E1000_VT_CTL_DEFAULT_POOL_MASK (0x7 << E1000_VT_CTL_DEFAULT_POOL_SHIFT)
|
||||
#define E1000_VT_CTL_DEFAULT_POOL_SHIFT 7
|
||||
#define E1000_VT_CTL_DEFAULT_POOL_MASK (0x7 << E1000_VT_CTL_DEFAULT_POOL_SHIFT)
|
||||
|
||||
/* Other useful VMD_CTL register defines */
|
||||
#define E1000_VT_CTL_IGNORE_MAC (1 << 28)
|
||||
#define E1000_VT_CTL_DISABLE_DEF_POOL (1 << 29)
|
||||
#define E1000_VT_CTL_VM_REPL_EN (1 << 30)
|
||||
#define E1000_VT_CTL_IGNORE_MAC (1 << 28)
|
||||
#define E1000_VT_CTL_DISABLE_DEF_POOL (1 << 29)
|
||||
#define E1000_VT_CTL_VM_REPL_EN (1 << 30)
|
||||
|
||||
/* Per VM Offload register setup */
|
||||
#define E1000_VMOLR_RLPML_MASK 0x00003FFF /* Long Packet Maximum Length mask */
|
||||
#define E1000_VMOLR_LPE 0x00010000 /* Accept Long packet */
|
||||
#define E1000_VMOLR_RSSE 0x00020000 /* Enable RSS */
|
||||
#define E1000_VMOLR_AUPE 0x01000000 /* Accept untagged packets */
|
||||
#define E1000_VMOLR_ROMPE 0x02000000 /* Accept overflow multicast */
|
||||
#define E1000_VMOLR_ROPE 0x04000000 /* Accept overflow unicast */
|
||||
#define E1000_VMOLR_BAM 0x08000000 /* Accept Broadcast packets */
|
||||
#define E1000_VMOLR_MPME 0x10000000 /* Multicast promiscuous mode */
|
||||
#define E1000_VMOLR_STRVLAN 0x40000000 /* Vlan stripping enable */
|
||||
#define E1000_VMOLR_STRCRC 0x80000000 /* CRC stripping enable */
|
||||
#define E1000_VMOLR_RLPML_MASK 0x00003FFF /* Long Packet Maximum Length mask */
|
||||
#define E1000_VMOLR_LPE 0x00010000 /* Accept Long packet */
|
||||
#define E1000_VMOLR_RSSE 0x00020000 /* Enable RSS */
|
||||
#define E1000_VMOLR_AUPE 0x01000000 /* Accept untagged packets */
|
||||
#define E1000_VMOLR_ROMPE 0x02000000 /* Accept overflow multicast */
|
||||
#define E1000_VMOLR_ROPE 0x04000000 /* Accept overflow unicast */
|
||||
#define E1000_VMOLR_BAM 0x08000000 /* Accept Broadcast packets */
|
||||
#define E1000_VMOLR_MPME 0x10000000 /* Multicast promiscuous mode */
|
||||
#define E1000_VMOLR_STRVLAN 0x40000000 /* Vlan stripping enable */
|
||||
#define E1000_VMOLR_STRCRC 0x80000000 /* CRC stripping enable */
|
||||
|
||||
#define E1000_VMOLR_VPE 0x00800000 /* VLAN promiscuous enable */
|
||||
#define E1000_VMOLR_UPE 0x20000000 /* Unicast promisuous enable */
|
||||
#define E1000_DVMOLR_HIDVLAN 0x20000000 /* Vlan hiding enable */
|
||||
#define E1000_DVMOLR_STRVLAN 0x40000000 /* Vlan stripping enable */
|
||||
#define E1000_DVMOLR_STRCRC 0x80000000 /* CRC stripping enable */
|
||||
#define E1000_VMOLR_VPE 0x00800000 /* VLAN promiscuous enable */
|
||||
#define E1000_VMOLR_UPE 0x20000000 /* Unicast promisuous enable */
|
||||
#define E1000_DVMOLR_HIDVLAN 0x20000000 /* Vlan hiding enable */
|
||||
#define E1000_DVMOLR_STRVLAN 0x40000000 /* Vlan stripping enable */
|
||||
#define E1000_DVMOLR_STRCRC 0x80000000 /* CRC stripping enable */
|
||||
|
||||
#define E1000_PBRWAC_WALPB 0x00000007 /* Wrap around event on LAN Rx PB */
|
||||
#define E1000_PBRWAC_PBE 0x00000008 /* Rx packet buffer empty */
|
||||
#define E1000_PBRWAC_WALPB 0x00000007 /* Wrap around event on LAN Rx PB */
|
||||
#define E1000_PBRWAC_PBE 0x00000008 /* Rx packet buffer empty */
|
||||
|
||||
#define E1000_VLVF_ARRAY_SIZE 32
|
||||
#define E1000_VLVF_VLANID_MASK 0x00000FFF
|
||||
#define E1000_VLVF_POOLSEL_SHIFT 12
|
||||
#define E1000_VLVF_POOLSEL_MASK (0xFF << E1000_VLVF_POOLSEL_SHIFT)
|
||||
#define E1000_VLVF_LVLAN 0x00100000
|
||||
#define E1000_VLVF_VLANID_ENABLE 0x80000000
|
||||
#define E1000_VLVF_ARRAY_SIZE 32
|
||||
#define E1000_VLVF_VLANID_MASK 0x00000FFF
|
||||
#define E1000_VLVF_POOLSEL_SHIFT 12
|
||||
#define E1000_VLVF_POOLSEL_MASK (0xFF << E1000_VLVF_POOLSEL_SHIFT)
|
||||
#define E1000_VLVF_LVLAN 0x00100000
|
||||
#define E1000_VLVF_VLANID_ENABLE 0x80000000
|
||||
|
||||
#define E1000_VMVIR_VLANA_DEFAULT 0x40000000 /* Always use default VLAN */
|
||||
#define E1000_VMVIR_VLANA_NEVER 0x80000000 /* Never insert VLAN tag */
|
||||
#define E1000_VMVIR_VLANA_DEFAULT 0x40000000 /* Always use default VLAN */
|
||||
#define E1000_VMVIR_VLANA_NEVER 0x80000000 /* Never insert VLAN tag */
|
||||
|
||||
#define E1000_VF_INIT_TIMEOUT 200 /* Number of retries to clear RSTI */
|
||||
#define E1000_VF_INIT_TIMEOUT 200 /* Number of retries to clear RSTI */
|
||||
|
||||
#define E1000_IOVCTL 0x05BBC
|
||||
#define E1000_IOVCTL_REUSE_VFQ 0x00000001
|
||||
#define E1000_IOVCTL 0x05BBC
|
||||
#define E1000_IOVCTL_REUSE_VFQ 0x00000001
|
||||
|
||||
#define E1000_RPLOLR_STRVLAN 0x40000000
|
||||
#define E1000_RPLOLR_STRCRC 0x80000000
|
||||
#define E1000_RPLOLR_STRVLAN 0x40000000
|
||||
#define E1000_RPLOLR_STRCRC 0x80000000
|
||||
|
||||
#define E1000_TCTL_EXT_COLD 0x000FFC00
|
||||
#define E1000_TCTL_EXT_COLD_SHIFT 10
|
||||
#define E1000_TCTL_EXT_COLD 0x000FFC00
|
||||
#define E1000_TCTL_EXT_COLD_SHIFT 10
|
||||
|
||||
#define E1000_DTXCTL_8023LL 0x0004
|
||||
#define E1000_DTXCTL_VLAN_ADDED 0x0008
|
||||
#define E1000_DTXCTL_OOS_ENABLE 0x0010
|
||||
#define E1000_DTXCTL_MDP_EN 0x0020
|
||||
#define E1000_DTXCTL_SPOOF_INT 0x0040
|
||||
#define E1000_DTXCTL_8023LL 0x0004
|
||||
#define E1000_DTXCTL_VLAN_ADDED 0x0008
|
||||
#define E1000_DTXCTL_OOS_ENABLE 0x0010
|
||||
#define E1000_DTXCTL_MDP_EN 0x0020
|
||||
#define E1000_DTXCTL_SPOOF_INT 0x0040
|
||||
|
||||
#define ALL_QUEUES 0xFFFF
|
||||
#define E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT (1 << 14)
|
||||
|
||||
#define ALL_QUEUES 0xFFFF
|
||||
|
||||
/* Rx packet buffer size defines */
|
||||
#define E1000_RXPBS_SIZE_MASK_82576 0x0000007F
|
||||
#define E1000_RXPBS_SIZE_MASK_82576 0x0000007F
|
||||
void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable);
|
||||
void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf);
|
||||
void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable);
|
||||
@ -484,4 +489,23 @@ void e1000_rlpml_set_vf(struct e1000_hw *, u16);
|
||||
s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type);
|
||||
u16 e1000_rxpbs_adjust_82580(u32 data);
|
||||
s32 e1000_set_eee_i350(struct e1000_hw *);
|
||||
|
||||
/* I2C SDA and SCL timing parameters for standard mode */
|
||||
#define E1000_I2C_T_HD_STA 4
|
||||
#define E1000_I2C_T_LOW 5
|
||||
#define E1000_I2C_T_HIGH 4
|
||||
#define E1000_I2C_T_SU_STA 5
|
||||
#define E1000_I2C_T_HD_DATA 5
|
||||
#define E1000_I2C_T_SU_DATA 1
|
||||
#define E1000_I2C_T_RISE 1
|
||||
#define E1000_I2C_T_FALL 1
|
||||
#define E1000_I2C_T_SU_STO 4
|
||||
#define E1000_I2C_T_BUF 5
|
||||
|
||||
s32 e1000_set_i2c_bb(struct e1000_hw *hw);
|
||||
s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset,
|
||||
u8 dev_addr, u8 *data);
|
||||
s32 e1000_write_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset,
|
||||
u8 dev_addr, u8 data);
|
||||
void e1000_i2c_bus_clear(struct e1000_hw *hw);
|
||||
#endif /* _E1000_82575_H_ */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -277,7 +277,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
|
||||
case E1000_DEV_ID_ICH10_D_BM_LM:
|
||||
case E1000_DEV_ID_ICH10_D_BM_LF:
|
||||
case E1000_DEV_ID_ICH10_D_BM_V:
|
||||
case E1000_DEV_ID_ICH10_HANKSVILLE:
|
||||
mac->type = e1000_ich10lan;
|
||||
break;
|
||||
case E1000_DEV_ID_PCH_D_HV_DM:
|
||||
@ -293,7 +292,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
|
||||
case E1000_DEV_ID_82575EB_COPPER:
|
||||
case E1000_DEV_ID_82575EB_FIBER_SERDES:
|
||||
case E1000_DEV_ID_82575GB_QUAD_COPPER:
|
||||
case E1000_DEV_ID_82575GB_QUAD_COPPER_PM:
|
||||
mac->type = e1000_82575;
|
||||
break;
|
||||
case E1000_DEV_ID_82576:
|
||||
@ -322,6 +320,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
|
||||
case E1000_DEV_ID_I350_FIBER:
|
||||
case E1000_DEV_ID_I350_SERDES:
|
||||
case E1000_DEV_ID_I350_SGMII:
|
||||
case E1000_DEV_ID_I350_DA4:
|
||||
mac->type = e1000_i350;
|
||||
break;
|
||||
case E1000_DEV_ID_82576_VF:
|
||||
@ -343,10 +342,10 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
|
||||
* e1000_setup_init_funcs - Initializes function pointers
|
||||
* @hw: pointer to the HW structure
|
||||
* @init_device: TRUE will initialize the rest of the function pointers
|
||||
* getting the device ready for use. FALSE will only set
|
||||
* MAC type and the function pointers for the other init
|
||||
* functions. Passing FALSE will not generate any hardware
|
||||
* reads or writes.
|
||||
* getting the device ready for use. FALSE will only set
|
||||
* MAC type and the function pointers for the other init
|
||||
* functions. Passing FALSE will not generate any hardware
|
||||
* reads or writes.
|
||||
*
|
||||
* This function must be called by a driver in order to use the rest
|
||||
* of the 'shared' code files. Called by drivers only.
|
||||
@ -518,11 +517,11 @@ void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
|
||||
* The caller must have a packed mc_addr_list of multicast addresses.
|
||||
**/
|
||||
void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
|
||||
u32 mc_addr_count)
|
||||
u32 mc_addr_count)
|
||||
{
|
||||
if (hw->mac.ops.update_mc_addr_list)
|
||||
hw->mac.ops.update_mc_addr_list(hw, mc_addr_list,
|
||||
mc_addr_count);
|
||||
mc_addr_count);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -856,12 +855,12 @@ bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
|
||||
* 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(struct e1000_hw * hw, u8 *buffer, u16 length,
|
||||
u16 offset, u8 *sum)
|
||||
s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length,
|
||||
u16 offset, u8 *sum)
|
||||
{
|
||||
if (hw->mac.ops.mng_host_if_write)
|
||||
return hw->mac.ops.mng_host_if_write(hw, buffer, length,
|
||||
offset, sum);
|
||||
offset, sum);
|
||||
|
||||
return E1000_NOT_IMPLEMENTED;
|
||||
}
|
||||
@ -874,7 +873,7 @@ s32 e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, u16 length,
|
||||
* Writes the command header after does the checksum calculation.
|
||||
**/
|
||||
s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header *hdr)
|
||||
struct e1000_host_mng_command_header *hdr)
|
||||
{
|
||||
if (hw->mac.ops.mng_write_cmd_header)
|
||||
return hw->mac.ops.mng_write_cmd_header(hw, hdr);
|
||||
@ -892,7 +891,7 @@ s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
|
||||
* 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(struct e1000_hw * hw)
|
||||
s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
|
||||
{
|
||||
if (hw->mac.ops.mng_enable_host_if)
|
||||
return hw->mac.ops.mng_enable_host_if(hw);
|
||||
@ -1277,7 +1276,7 @@ s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
* This is a function pointer entry point called by drivers.
|
||||
**/
|
||||
s32 e1000_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg, u32 offset,
|
||||
u8 data)
|
||||
u8 data)
|
||||
{
|
||||
return e1000_write_8bit_ctrl_reg_generic(hw, reg, offset, data);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -37,90 +37,87 @@
|
||||
|
||||
#include "e1000_hw.h"
|
||||
|
||||
extern void e1000_init_function_pointers_82542(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82543(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82540(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82571(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82541(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 void e1000_init_function_pointers_82575(struct e1000_hw *hw);
|
||||
extern void e1000_rx_fifo_flush_82575(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_vf(struct e1000_hw *hw);
|
||||
extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw);
|
||||
extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82542(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82543(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82540(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82571(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_82541(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 void e1000_init_function_pointers_82575(struct e1000_hw *hw);
|
||||
extern void e1000_rx_fifo_flush_82575(struct e1000_hw *hw);
|
||||
extern void e1000_init_function_pointers_vf(struct e1000_hw *hw);
|
||||
extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw);
|
||||
extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw);
|
||||
|
||||
s32 e1000_set_mac_type(struct e1000_hw *hw);
|
||||
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device);
|
||||
s32 e1000_init_mac_params(struct e1000_hw *hw);
|
||||
s32 e1000_init_nvm_params(struct e1000_hw *hw);
|
||||
s32 e1000_init_phy_params(struct e1000_hw *hw);
|
||||
s32 e1000_init_mbx_params(struct e1000_hw *hw);
|
||||
s32 e1000_get_bus_info(struct e1000_hw *hw);
|
||||
s32 e1000_set_mac_type(struct e1000_hw *hw);
|
||||
s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device);
|
||||
s32 e1000_init_mac_params(struct e1000_hw *hw);
|
||||
s32 e1000_init_nvm_params(struct e1000_hw *hw);
|
||||
s32 e1000_init_phy_params(struct e1000_hw *hw);
|
||||
s32 e1000_init_mbx_params(struct e1000_hw *hw);
|
||||
s32 e1000_get_bus_info(struct e1000_hw *hw);
|
||||
void e1000_clear_vfta(struct e1000_hw *hw);
|
||||
void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value);
|
||||
s32 e1000_force_mac_fc(struct e1000_hw *hw);
|
||||
s32 e1000_check_for_link(struct e1000_hw *hw);
|
||||
s32 e1000_reset_hw(struct e1000_hw *hw);
|
||||
s32 e1000_init_hw(struct e1000_hw *hw);
|
||||
s32 e1000_setup_link(struct e1000_hw *hw);
|
||||
s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex);
|
||||
s32 e1000_disable_pcie_master(struct e1000_hw *hw);
|
||||
s32 e1000_force_mac_fc(struct e1000_hw *hw);
|
||||
s32 e1000_check_for_link(struct e1000_hw *hw);
|
||||
s32 e1000_reset_hw(struct e1000_hw *hw);
|
||||
s32 e1000_init_hw(struct e1000_hw *hw);
|
||||
s32 e1000_setup_link(struct e1000_hw *hw);
|
||||
s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex);
|
||||
s32 e1000_disable_pcie_master(struct e1000_hw *hw);
|
||||
void e1000_config_collision_dist(struct e1000_hw *hw);
|
||||
void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
|
||||
u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
|
||||
void e1000_update_mc_addr_list(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list, u32 mc_addr_count);
|
||||
s32 e1000_setup_led(struct e1000_hw *hw);
|
||||
s32 e1000_cleanup_led(struct e1000_hw *hw);
|
||||
s32 e1000_check_reset_block(struct e1000_hw *hw);
|
||||
s32 e1000_blink_led(struct e1000_hw *hw);
|
||||
s32 e1000_led_on(struct e1000_hw *hw);
|
||||
s32 e1000_led_off(struct e1000_hw *hw);
|
||||
u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
|
||||
void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
|
||||
u32 mc_addr_count);
|
||||
s32 e1000_setup_led(struct e1000_hw *hw);
|
||||
s32 e1000_cleanup_led(struct e1000_hw *hw);
|
||||
s32 e1000_check_reset_block(struct e1000_hw *hw);
|
||||
s32 e1000_blink_led(struct e1000_hw *hw);
|
||||
s32 e1000_led_on(struct e1000_hw *hw);
|
||||
s32 e1000_led_off(struct e1000_hw *hw);
|
||||
s32 e1000_id_led_init(struct e1000_hw *hw);
|
||||
void e1000_reset_adaptive(struct e1000_hw *hw);
|
||||
void e1000_update_adaptive(struct e1000_hw *hw);
|
||||
s32 e1000_get_cable_length(struct e1000_hw *hw);
|
||||
s32 e1000_validate_mdi_setting(struct e1000_hw *hw);
|
||||
s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,
|
||||
u32 offset, u8 data);
|
||||
s32 e1000_get_phy_info(struct e1000_hw *hw);
|
||||
s32 e1000_get_cable_length(struct e1000_hw *hw);
|
||||
s32 e1000_validate_mdi_setting(struct e1000_hw *hw);
|
||||
s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg, u32 offset,
|
||||
u8 data);
|
||||
s32 e1000_get_phy_info(struct e1000_hw *hw);
|
||||
void e1000_release_phy(struct e1000_hw *hw);
|
||||
s32 e1000_acquire_phy(struct e1000_hw *hw);
|
||||
s32 e1000_cfg_on_link_up(struct e1000_hw *hw);
|
||||
s32 e1000_phy_hw_reset(struct e1000_hw *hw);
|
||||
s32 e1000_phy_commit(struct e1000_hw *hw);
|
||||
s32 e1000_acquire_phy(struct e1000_hw *hw);
|
||||
s32 e1000_cfg_on_link_up(struct e1000_hw *hw);
|
||||
s32 e1000_phy_hw_reset(struct e1000_hw *hw);
|
||||
s32 e1000_phy_commit(struct e1000_hw *hw);
|
||||
void e1000_power_up_phy(struct e1000_hw *hw);
|
||||
void e1000_power_down_phy(struct e1000_hw *hw);
|
||||
s32 e1000_read_mac_addr(struct e1000_hw *hw);
|
||||
s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num,
|
||||
u32 pba_num_size);
|
||||
s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size);
|
||||
s32 e1000_read_mac_addr(struct e1000_hw *hw);
|
||||
s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size);
|
||||
s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size);
|
||||
void e1000_reload_nvm(struct e1000_hw *hw);
|
||||
s32 e1000_update_nvm_checksum(struct e1000_hw *hw);
|
||||
s32 e1000_validate_nvm_checksum(struct e1000_hw *hw);
|
||||
s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data);
|
||||
s32 e1000_wait_autoneg(struct e1000_hw *hw);
|
||||
s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active);
|
||||
s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
|
||||
s32 e1000_update_nvm_checksum(struct e1000_hw *hw);
|
||||
s32 e1000_validate_nvm_checksum(struct e1000_hw *hw);
|
||||
s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
s32 e1000_wait_autoneg(struct e1000_hw *hw);
|
||||
s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active);
|
||||
s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
|
||||
bool e1000_check_mng_mode(struct e1000_hw *hw);
|
||||
bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
||||
s32 e1000_mng_enable_host_if(struct e1000_hw *hw);
|
||||
s32 e1000_mng_host_if_write(struct e1000_hw *hw,
|
||||
u8 *buffer, u16 length, u16 offset, u8 *sum);
|
||||
s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header *hdr);
|
||||
s32 e1000_mng_write_dhcp_info(struct e1000_hw * hw,
|
||||
u8 *buffer, u16 length);
|
||||
s32 e1000_mng_enable_host_if(struct e1000_hw *hw);
|
||||
s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length,
|
||||
u16 offset, u8 *sum);
|
||||
s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
|
||||
struct e1000_host_mng_command_header *hdr);
|
||||
s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
|
||||
u32 e1000_translate_register_82542(u32 reg);
|
||||
|
||||
|
||||
/*
|
||||
* TBI_ACCEPT macro definition:
|
||||
*
|
||||
@ -152,14 +149,15 @@ u32 e1000_translate_register_82542(u32 reg);
|
||||
/* The carrier extension symbol, as received by the NIC. */
|
||||
#define CARRIER_EXTENSION 0x0F
|
||||
|
||||
#define TBI_ACCEPT(a, status, errors, length, last_byte, min_frame_size, max_frame_size) \
|
||||
(e1000_tbi_sbp_enabled_82543(a) && \
|
||||
(((errors) & E1000_RXD_ERR_FRAME_ERR_MASK) == E1000_RXD_ERR_CE) && \
|
||||
((last_byte) == CARRIER_EXTENSION) && \
|
||||
(((status) & E1000_RXD_STAT_VP) ? \
|
||||
(((length) > (min_frame_size - VLAN_TAG_SIZE)) && \
|
||||
((length) <= (max_frame_size + 1))) : \
|
||||
(((length) > min_frame_size) && \
|
||||
((length) <= (max_frame_size + VLAN_TAG_SIZE + 1)))))
|
||||
#define TBI_ACCEPT(a, status, errors, length, last_byte, \
|
||||
min_frame_size, max_frame_size) \
|
||||
(e1000_tbi_sbp_enabled_82543(a) && \
|
||||
(((errors) & E1000_RXD_ERR_FRAME_ERR_MASK) == E1000_RXD_ERR_CE) && \
|
||||
((last_byte) == CARRIER_EXTENSION) && \
|
||||
(((status) & E1000_RXD_STAT_VP) ? \
|
||||
(((length) > (min_frame_size - VLAN_TAG_SIZE)) && \
|
||||
((length) <= (max_frame_size + 1))) : \
|
||||
(((length) > min_frame_size) && \
|
||||
((length) <= (max_frame_size + VLAN_TAG_SIZE + 1)))))
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -41,139 +41,138 @@
|
||||
|
||||
struct e1000_hw;
|
||||
|
||||
#define E1000_DEV_ID_82542 0x1000
|
||||
#define E1000_DEV_ID_82543GC_FIBER 0x1001
|
||||
#define E1000_DEV_ID_82543GC_COPPER 0x1004
|
||||
#define E1000_DEV_ID_82544EI_COPPER 0x1008
|
||||
#define E1000_DEV_ID_82544EI_FIBER 0x1009
|
||||
#define E1000_DEV_ID_82544GC_COPPER 0x100C
|
||||
#define E1000_DEV_ID_82544GC_LOM 0x100D
|
||||
#define E1000_DEV_ID_82540EM 0x100E
|
||||
#define E1000_DEV_ID_82540EM_LOM 0x1015
|
||||
#define E1000_DEV_ID_82540EP_LOM 0x1016
|
||||
#define E1000_DEV_ID_82540EP 0x1017
|
||||
#define E1000_DEV_ID_82540EP_LP 0x101E
|
||||
#define E1000_DEV_ID_82545EM_COPPER 0x100F
|
||||
#define E1000_DEV_ID_82545EM_FIBER 0x1011
|
||||
#define E1000_DEV_ID_82545GM_COPPER 0x1026
|
||||
#define E1000_DEV_ID_82545GM_FIBER 0x1027
|
||||
#define E1000_DEV_ID_82545GM_SERDES 0x1028
|
||||
#define E1000_DEV_ID_82546EB_COPPER 0x1010
|
||||
#define E1000_DEV_ID_82546EB_FIBER 0x1012
|
||||
#define E1000_DEV_ID_82546EB_QUAD_COPPER 0x101D
|
||||
#define E1000_DEV_ID_82546GB_COPPER 0x1079
|
||||
#define E1000_DEV_ID_82546GB_FIBER 0x107A
|
||||
#define E1000_DEV_ID_82546GB_SERDES 0x107B
|
||||
#define E1000_DEV_ID_82546GB_PCIE 0x108A
|
||||
#define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099
|
||||
#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
|
||||
#define E1000_DEV_ID_82541EI 0x1013
|
||||
#define E1000_DEV_ID_82541EI_MOBILE 0x1018
|
||||
#define E1000_DEV_ID_82541ER_LOM 0x1014
|
||||
#define E1000_DEV_ID_82541ER 0x1078
|
||||
#define E1000_DEV_ID_82541GI 0x1076
|
||||
#define E1000_DEV_ID_82541GI_LF 0x107C
|
||||
#define E1000_DEV_ID_82541GI_MOBILE 0x1077
|
||||
#define E1000_DEV_ID_82547EI 0x1019
|
||||
#define E1000_DEV_ID_82547EI_MOBILE 0x101A
|
||||
#define E1000_DEV_ID_82547GI 0x1075
|
||||
#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_HANKSVILLE 0xF0FE
|
||||
#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_82542 0x1000
|
||||
#define E1000_DEV_ID_82543GC_FIBER 0x1001
|
||||
#define E1000_DEV_ID_82543GC_COPPER 0x1004
|
||||
#define E1000_DEV_ID_82544EI_COPPER 0x1008
|
||||
#define E1000_DEV_ID_82544EI_FIBER 0x1009
|
||||
#define E1000_DEV_ID_82544GC_COPPER 0x100C
|
||||
#define E1000_DEV_ID_82544GC_LOM 0x100D
|
||||
#define E1000_DEV_ID_82540EM 0x100E
|
||||
#define E1000_DEV_ID_82540EM_LOM 0x1015
|
||||
#define E1000_DEV_ID_82540EP_LOM 0x1016
|
||||
#define E1000_DEV_ID_82540EP 0x1017
|
||||
#define E1000_DEV_ID_82540EP_LP 0x101E
|
||||
#define E1000_DEV_ID_82545EM_COPPER 0x100F
|
||||
#define E1000_DEV_ID_82545EM_FIBER 0x1011
|
||||
#define E1000_DEV_ID_82545GM_COPPER 0x1026
|
||||
#define E1000_DEV_ID_82545GM_FIBER 0x1027
|
||||
#define E1000_DEV_ID_82545GM_SERDES 0x1028
|
||||
#define E1000_DEV_ID_82546EB_COPPER 0x1010
|
||||
#define E1000_DEV_ID_82546EB_FIBER 0x1012
|
||||
#define E1000_DEV_ID_82546EB_QUAD_COPPER 0x101D
|
||||
#define E1000_DEV_ID_82546GB_COPPER 0x1079
|
||||
#define E1000_DEV_ID_82546GB_FIBER 0x107A
|
||||
#define E1000_DEV_ID_82546GB_SERDES 0x107B
|
||||
#define E1000_DEV_ID_82546GB_PCIE 0x108A
|
||||
#define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099
|
||||
#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
|
||||
#define E1000_DEV_ID_82541EI 0x1013
|
||||
#define E1000_DEV_ID_82541EI_MOBILE 0x1018
|
||||
#define E1000_DEV_ID_82541ER_LOM 0x1014
|
||||
#define E1000_DEV_ID_82541ER 0x1078
|
||||
#define E1000_DEV_ID_82541GI 0x1076
|
||||
#define E1000_DEV_ID_82541GI_LF 0x107C
|
||||
#define E1000_DEV_ID_82541GI_MOBILE 0x1077
|
||||
#define E1000_DEV_ID_82547EI 0x1019
|
||||
#define E1000_DEV_ID_82547EI_MOBILE 0x101A
|
||||
#define E1000_DEV_ID_82547GI 0x1075
|
||||
#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_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_82576 0x10C9
|
||||
#define E1000_DEV_ID_82576_FIBER 0x10E6
|
||||
#define E1000_DEV_ID_82576_SERDES 0x10E7
|
||||
#define E1000_DEV_ID_82576_QUAD_COPPER 0x10E8
|
||||
#define E1000_DEV_ID_82576_QUAD_COPPER_ET2 0x1526
|
||||
#define E1000_DEV_ID_82576_NS 0x150A
|
||||
#define E1000_DEV_ID_82576_NS_SERDES 0x1518
|
||||
#define E1000_DEV_ID_82576_SERDES_QUAD 0x150D
|
||||
#define E1000_DEV_ID_82576_VF 0x10CA
|
||||
#define E1000_DEV_ID_I350_VF 0x1520
|
||||
#define E1000_DEV_ID_82575EB_COPPER 0x10A7
|
||||
#define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9
|
||||
#define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6
|
||||
#define E1000_DEV_ID_82575GB_QUAD_COPPER_PM 0x10E2
|
||||
#define E1000_DEV_ID_82580_COPPER 0x150E
|
||||
#define E1000_DEV_ID_82580_FIBER 0x150F
|
||||
#define E1000_DEV_ID_82580_SERDES 0x1510
|
||||
#define E1000_DEV_ID_82580_SGMII 0x1511
|
||||
#define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
|
||||
#define E1000_DEV_ID_82580_QUAD_FIBER 0x1527
|
||||
#define E1000_DEV_ID_I350_COPPER 0x1521
|
||||
#define E1000_DEV_ID_I350_FIBER 0x1522
|
||||
#define E1000_DEV_ID_I350_SERDES 0x1523
|
||||
#define E1000_DEV_ID_I350_SGMII 0x1524
|
||||
#define E1000_DEV_ID_DH89XXCC_SGMII 0x0438
|
||||
#define E1000_DEV_ID_DH89XXCC_SERDES 0x043A
|
||||
#define E1000_DEV_ID_DH89XXCC_BACKPLANE 0x043C
|
||||
#define E1000_DEV_ID_DH89XXCC_SFP 0x0440
|
||||
#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_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_82576 0x10C9
|
||||
#define E1000_DEV_ID_82576_FIBER 0x10E6
|
||||
#define E1000_DEV_ID_82576_SERDES 0x10E7
|
||||
#define E1000_DEV_ID_82576_QUAD_COPPER 0x10E8
|
||||
#define E1000_DEV_ID_82576_QUAD_COPPER_ET2 0x1526
|
||||
#define E1000_DEV_ID_82576_NS 0x150A
|
||||
#define E1000_DEV_ID_82576_NS_SERDES 0x1518
|
||||
#define E1000_DEV_ID_82576_SERDES_QUAD 0x150D
|
||||
#define E1000_DEV_ID_82576_VF 0x10CA
|
||||
#define E1000_DEV_ID_I350_VF 0x1520
|
||||
#define E1000_DEV_ID_82575EB_COPPER 0x10A7
|
||||
#define E1000_DEV_ID_82575EB_FIBER_SERDES 0x10A9
|
||||
#define E1000_DEV_ID_82575GB_QUAD_COPPER 0x10D6
|
||||
#define E1000_DEV_ID_82580_COPPER 0x150E
|
||||
#define E1000_DEV_ID_82580_FIBER 0x150F
|
||||
#define E1000_DEV_ID_82580_SERDES 0x1510
|
||||
#define E1000_DEV_ID_82580_SGMII 0x1511
|
||||
#define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
|
||||
#define E1000_DEV_ID_82580_QUAD_FIBER 0x1527
|
||||
#define E1000_DEV_ID_I350_COPPER 0x1521
|
||||
#define E1000_DEV_ID_I350_FIBER 0x1522
|
||||
#define E1000_DEV_ID_I350_SERDES 0x1523
|
||||
#define E1000_DEV_ID_I350_SGMII 0x1524
|
||||
#define E1000_DEV_ID_I350_DA4 0x1546
|
||||
#define E1000_DEV_ID_DH89XXCC_SGMII 0x0438
|
||||
#define E1000_DEV_ID_DH89XXCC_SERDES 0x043A
|
||||
#define E1000_DEV_ID_DH89XXCC_BACKPLANE 0x043C
|
||||
#define E1000_DEV_ID_DH89XXCC_SFP 0x0440
|
||||
#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_FUNC_0 0
|
||||
#define E1000_FUNC_1 1
|
||||
#define E1000_FUNC_2 2
|
||||
#define E1000_FUNC_3 3
|
||||
#define E1000_FUNC_0 0
|
||||
#define E1000_FUNC_1 1
|
||||
#define E1000_FUNC_2 2
|
||||
#define E1000_FUNC_3 3
|
||||
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN2 6
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN3 9
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN0 0
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 3
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN2 6
|
||||
#define E1000_ALT_MAC_ADDRESS_OFFSET_LAN3 9
|
||||
|
||||
enum e1000_mac_type {
|
||||
e1000_undefined = 0,
|
||||
@ -342,9 +341,9 @@ enum e1000_serdes_link_state {
|
||||
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 csum; /* Packet checksum */
|
||||
u8 status; /* Descriptor status */
|
||||
u8 errors; /* Descriptor Errors */
|
||||
__le16 special;
|
||||
};
|
||||
|
||||
@ -356,9 +355,9 @@ 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 */
|
||||
@ -368,7 +367,7 @@ union e1000_rx_desc_extended {
|
||||
struct {
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le16 length;
|
||||
__le16 vlan; /* VLAN tag */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
} upper;
|
||||
} wb; /* writeback */
|
||||
};
|
||||
@ -382,9 +381,9 @@ 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 */
|
||||
@ -393,8 +392,8 @@ union e1000_rx_desc_packet_split {
|
||||
} lower;
|
||||
struct {
|
||||
__le32 status_error; /* ext status/error */
|
||||
__le16 length0; /* length of buffer 0 */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
__le16 length0; /* length of buffer 0 */
|
||||
__le16 vlan; /* VLAN tag */
|
||||
} middle;
|
||||
struct {
|
||||
__le16 header_status;
|
||||
@ -410,16 +409,16 @@ struct e1000_tx_desc {
|
||||
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;
|
||||
@ -430,37 +429,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;
|
||||
@ -468,8 +467,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;
|
||||
@ -553,6 +552,10 @@ struct e1000_hw_stats {
|
||||
u64 scvpc;
|
||||
u64 hrmpc;
|
||||
u64 doosync;
|
||||
u64 o2bgptc;
|
||||
u64 o2bspc;
|
||||
u64 b2ospc;
|
||||
u64 b2ogprc;
|
||||
};
|
||||
|
||||
struct e1000_vf_stats {
|
||||
@ -611,7 +614,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];
|
||||
@ -626,7 +629,7 @@ struct e1000_host_mng_command_header {
|
||||
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];
|
||||
@ -668,11 +671,26 @@ struct e1000_mac_operations {
|
||||
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*);
|
||||
struct e1000_host_mng_command_header*);
|
||||
s32 (*mng_enable_host_if)(struct e1000_hw *);
|
||||
s32 (*wait_autoneg)(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 *);
|
||||
@ -684,16 +702,21 @@ struct e1000_phy_operations {
|
||||
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 *);
|
||||
s32 (*read_i2c_byte)(struct e1000_hw *, u8, u8, u8 *);
|
||||
s32 (*write_i2c_byte)(struct e1000_hw *, u8, u8, u8);
|
||||
};
|
||||
|
||||
struct e1000_nvm_operations {
|
||||
@ -781,7 +804,6 @@ 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;
|
||||
};
|
||||
@ -811,14 +833,14 @@ struct e1000_bus_info {
|
||||
};
|
||||
|
||||
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 */
|
||||
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 */
|
||||
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_mbx_operations {
|
||||
@ -896,6 +918,8 @@ struct e1000_dev_spec_82575 {
|
||||
bool sgmii_active;
|
||||
bool global_device_reset;
|
||||
bool eee_disable;
|
||||
bool module_plugged;
|
||||
u32 mtu;
|
||||
};
|
||||
|
||||
struct e1000_dev_spec_vf {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -35,182 +35,204 @@
|
||||
#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
|
||||
#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
|
||||
|
||||
/* 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_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 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 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_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 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 */
|
||||
#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_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_ICH_MNG_IAMT_MODE 0x2
|
||||
|
||||
#define E1000_FWSM_PROXY_MODE 0x00000008 /* FW is in proxy mode */
|
||||
#define E1000_FWSM_PROXY_MODE 0x00000008 /* FW is in proxy mode */
|
||||
#define E1000_FWSM_MEMC 0x00000010 /* ME Messaging capable */
|
||||
|
||||
/* Shared Receive Address Registers */
|
||||
#define E1000_SHRAL(_i) (0x05438 + ((_i) * 8))
|
||||
#define E1000_SHRAH(_i) (0x0543C + ((_i) * 8))
|
||||
#define E1000_SHRAH_AV 0x80000000 /* Addr Valid bit */
|
||||
#define E1000_SHRAH_MAV 0x40000000 /* Multicast Addr Valid bit */
|
||||
#define E1000_SHRAL(_i) (0x05438 + ((_i) * 8))
|
||||
#define E1000_SHRAH(_i) (0x0543C + ((_i) * 8))
|
||||
#define E1000_SHRAH_AV 0x80000000 /* Addr Valid bit */
|
||||
#define E1000_SHRAH_MAV 0x40000000 /* Multicast Addr Valid bit */
|
||||
|
||||
#define E1000_H2ME 0x05B50 /* Host to ME */
|
||||
#define E1000_H2ME_LSECREQ 0x00000001 /* Linksec Request */
|
||||
#define E1000_H2ME_LSECA 0x00000002 /* Linksec Active */
|
||||
#define E1000_H2ME_LSECSF 0x00000004 /* Linksec Failed */
|
||||
#define E1000_H2ME_LSECD 0x00000008 /* Linksec Disabled */
|
||||
#define E1000_H2ME_SLCAPD 0x00000010 /* Start LCAPD */
|
||||
#define E1000_H2ME_IPV4_ARP_EN 0x00000020 /* Arp Offload enable bit */
|
||||
#define E1000_H2ME_IPV6_NS_EN 0x00000040 /* NS Offload enable bit */
|
||||
#define E1000_H2ME 0x05B50 /* Host to ME */
|
||||
#define E1000_H2ME_LSECREQ 0x00000001 /* Linksec Request */
|
||||
#define E1000_H2ME_LSECA 0x00000002 /* Linksec Active */
|
||||
#define E1000_H2ME_LSECSF 0x00000004 /* Linksec Failed */
|
||||
#define E1000_H2ME_LSECD 0x00000008 /* Linksec Disabled */
|
||||
#define E1000_H2ME_SLCAPD 0x00000010 /* Start LCAPD */
|
||||
#define E1000_H2ME_IPV4_ARP_EN 0x00000020 /* Arp Offload enable bit */
|
||||
#define E1000_H2ME_IPV6_NS_EN 0x00000040 /* NS Offload enable bit */
|
||||
|
||||
#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 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_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_ICH8_LAN_INIT_TIMEOUT 1500
|
||||
|
||||
#define E1000_FEXTNVM_SW_CONFIG 1
|
||||
#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M */
|
||||
#define E1000_FEXTNVM_SW_CONFIG 1
|
||||
#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M */
|
||||
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7
|
||||
#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3
|
||||
|
||||
#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
|
||||
#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_ICH_RAR_ENTRIES 7
|
||||
#define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */
|
||||
|
||||
#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 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
|
||||
#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_IPAV (BM_PHY_REG(BM_WUC_PAGE, 64))
|
||||
#define BM_IP4AT_L(_i) (BM_PHY_REG(BM_WUC_PAGE, 82 + ((_i) * 2)))
|
||||
#define BM_IP4AT_H(_i) (BM_PHY_REG(BM_WUC_PAGE, 83 + ((_i) * 2)))
|
||||
#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_IPAV (BM_PHY_REG(BM_WUC_PAGE, 64))
|
||||
#define BM_IP4AT_L(_i) (BM_PHY_REG(BM_WUC_PAGE, 82 + ((_i) * 2)))
|
||||
#define BM_IP4AT_H(_i) (BM_PHY_REG(BM_WUC_PAGE, 83 + ((_i) * 2)))
|
||||
|
||||
#define BM_SHRAL_LOWER(_i) (BM_PHY_REG(BM_WUC_PAGE, 44 + ((_i) * 4)))
|
||||
#define BM_SHRAL_UPPER(_i) (BM_PHY_REG(BM_WUC_PAGE, 45 + ((_i) * 4)))
|
||||
#define BM_SHRAH_LOWER(_i) (BM_PHY_REG(BM_WUC_PAGE, 46 + ((_i) * 4)))
|
||||
#define BM_SHRAH_UPPER(_i) (BM_PHY_REG(BM_WUC_PAGE, 47 + ((_i) * 4)))
|
||||
#define BM_SHRAL_LOWER(_i) (BM_PHY_REG(BM_WUC_PAGE, 44 + ((_i) * 4)))
|
||||
#define BM_SHRAL_UPPER(_i) (BM_PHY_REG(BM_WUC_PAGE, 45 + ((_i) * 4)))
|
||||
#define BM_SHRAH_LOWER(_i) (BM_PHY_REG(BM_WUC_PAGE, 46 + ((_i) * 4)))
|
||||
#define BM_SHRAH_UPPER(_i) (BM_PHY_REG(BM_WUC_PAGE, 47 + ((_i) * 4)))
|
||||
|
||||
#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 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 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
|
||||
#define HV_SCC_UPPER PHY_REG(HV_STATS_PAGE, 16) /* Single Collision Count */
|
||||
#define HV_SCC_LOWER PHY_REG(HV_STATS_PAGE, 17)
|
||||
#define HV_ECOL_UPPER PHY_REG(HV_STATS_PAGE, 18) /* Excessive Coll. Count */
|
||||
#define HV_ECOL_LOWER PHY_REG(HV_STATS_PAGE, 19)
|
||||
#define HV_MCC_UPPER PHY_REG(HV_STATS_PAGE, 20) /* Multiple Coll. Count */
|
||||
#define HV_MCC_LOWER PHY_REG(HV_STATS_PAGE, 21)
|
||||
#define HV_LATECOL_UPPER PHY_REG(HV_STATS_PAGE, 23) /* Late Collision Count */
|
||||
#define HV_LATECOL_LOWER PHY_REG(HV_STATS_PAGE, 24)
|
||||
#define HV_COLC_UPPER PHY_REG(HV_STATS_PAGE, 25) /* Collision Count */
|
||||
#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) /* Transmit 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_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 */
|
||||
/*
|
||||
* For ICH, the name used for NVM word 17h is LED1 Config.
|
||||
* For PCH, the word was re-named to OEM Config.
|
||||
*/
|
||||
#define E1000_NVM_LED1_CONFIG 0x17 /* NVM LED1/LPLU Config Word */
|
||||
#define E1000_NVM_LED1_CONFIG_LPLU_NONDOA 0x0400 /* NVM LPLU in non-D0a Bit */
|
||||
#define E1000_NVM_OEM_CONFIG E1000_NVM_LED1_CONFIG
|
||||
#define E1000_NVM_OEM_CONFIG_LPLU_NONDOA E1000_NVM_LED1_CONFIG_LPLU_NONDOA
|
||||
|
||||
#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_MASK 0x007F
|
||||
#define HV_SMB_ADDR_PEC_EN 0x0200
|
||||
#define HV_SMB_ADDR_VALID 0x0080
|
||||
#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
|
||||
|
||||
/* 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 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 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 LCD_CFG_PHY_ADDR_BIT 0x0020 /* Phy addr bit from LCD Config word */
|
||||
|
||||
/* KMRN Mode Control */
|
||||
#define HV_KMRN_MODE_CTRL PHY_REG(769, 16)
|
||||
#define HV_KMRN_MDIO_SLOW 0x0400
|
||||
#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 PHY_REG(770, 17)
|
||||
|
||||
#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */
|
||||
#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */
|
||||
|
||||
/* PHY Low Power Idle Control */
|
||||
#define I82579_LPI_CTRL PHY_REG(772, 20)
|
||||
#define I82579_LPI_CTRL_ENABLE_MASK 0x6000
|
||||
#define I82579_LPI_CTRL PHY_REG(772, 20)
|
||||
#define I82579_LPI_CTRL_ENABLE_MASK 0x6000
|
||||
#define I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT 0x80
|
||||
|
||||
/* 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_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 /* Mean Square Error Threshold */
|
||||
#define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */
|
||||
|
||||
/*
|
||||
* Additional interrupts need to be handled for ICH family:
|
||||
@ -219,33 +241,32 @@
|
||||
* EPRST = Manageability reset event
|
||||
*/
|
||||
#define IMS_ICH_ENABLE_MASK (\
|
||||
E1000_IMS_DSW | \
|
||||
E1000_IMS_PHYINT | \
|
||||
E1000_IMS_EPRST)
|
||||
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 */
|
||||
#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
|
||||
#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
|
||||
|
||||
/* Receive Address Initial CRC Calculation */
|
||||
#define E1000_PCH_RAICC(_n) (0x05F50 + ((_n) * 4))
|
||||
#define E1000_PCH_RAICC(_n) (0x05F50 + ((_n) * 4))
|
||||
|
||||
void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
|
||||
bool state);
|
||||
bool state);
|
||||
void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000_disable_gig_wol_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);
|
||||
s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_config);
|
||||
s32 e1000_hv_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw);
|
||||
void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
|
||||
s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -177,8 +177,8 @@ s32 e1000_get_bus_info_pci_generic(struct e1000_hw *hw)
|
||||
/* Bus speed */
|
||||
if (bus->type == e1000_bus_type_pci) {
|
||||
bus->speed = (status & E1000_STATUS_PCI66)
|
||||
? e1000_bus_speed_66
|
||||
: e1000_bus_speed_33;
|
||||
? e1000_bus_speed_66
|
||||
: e1000_bus_speed_33;
|
||||
} else {
|
||||
switch (status & E1000_STATUS_PCIX_SPEED) {
|
||||
case E1000_STATUS_PCIX_SPEED_66:
|
||||
@ -198,8 +198,8 @@ s32 e1000_get_bus_info_pci_generic(struct e1000_hw *hw)
|
||||
|
||||
/* Bus width */
|
||||
bus->width = (status & E1000_STATUS_BUS64)
|
||||
? e1000_bus_width_64
|
||||
: e1000_bus_width_32;
|
||||
? e1000_bus_width_64
|
||||
: e1000_bus_width_32;
|
||||
|
||||
/* Which PCI(-X) function? */
|
||||
mac->ops.set_lan_id(hw);
|
||||
@ -226,9 +226,8 @@ s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw)
|
||||
|
||||
bus->type = e1000_bus_type_pci_express;
|
||||
|
||||
ret_val = e1000_read_pcie_cap_reg(hw,
|
||||
PCIE_LINK_STATUS,
|
||||
&pcie_link_status);
|
||||
ret_val = e1000_read_pcie_cap_reg(hw, PCIE_LINK_STATUS,
|
||||
&pcie_link_status);
|
||||
if (ret_val) {
|
||||
bus->width = e1000_bus_width_unknown;
|
||||
bus->speed = e1000_bus_speed_unknown;
|
||||
@ -246,8 +245,7 @@ s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw)
|
||||
}
|
||||
|
||||
bus->width = (enum e1000_bus_width)((pcie_link_status &
|
||||
PCIE_LINK_WIDTH_MASK) >>
|
||||
PCIE_LINK_WIDTH_SHIFT);
|
||||
PCIE_LINK_WIDTH_MASK) >> PCIE_LINK_WIDTH_SHIFT);
|
||||
}
|
||||
|
||||
mac->ops.set_lan_id(hw);
|
||||
@ -292,7 +290,7 @@ void e1000_set_lan_id_multi_port_pci(struct e1000_hw *hw)
|
||||
if (pci_header_type & PCI_HEADER_TYPE_MULTIFUNC) {
|
||||
status = E1000_READ_REG(hw, E1000_STATUS);
|
||||
bus->func = (status & E1000_STATUS_FUNC_MASK)
|
||||
>> E1000_STATUS_FUNC_SHIFT;
|
||||
>> E1000_STATUS_FUNC_SHIFT;
|
||||
} else {
|
||||
bus->func = 0;
|
||||
}
|
||||
@ -352,7 +350,7 @@ void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value)
|
||||
* @hw: pointer to the HW structure
|
||||
* @rar_count: receive address registers
|
||||
*
|
||||
* Setups the receive address registers by setting the base receive address
|
||||
* Setup the receive address registers by setting the base receive address
|
||||
* register to the devices MAC address and clearing all the other receive
|
||||
* address registers to 0.
|
||||
**/
|
||||
@ -399,23 +397,28 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
/* Check for LOM (vs. NIC) or one of two valid mezzanine cards */
|
||||
if (!((nvm_data & NVM_COMPAT_LOM) ||
|
||||
(hw->device_id == E1000_DEV_ID_82571EB_SERDES_DUAL) ||
|
||||
(hw->device_id == E1000_DEV_ID_82571EB_SERDES_QUAD)))
|
||||
/* not supported on older hardware or 82573 */
|
||||
if ((hw->mac.type < e1000_82571) || (hw->mac.type == e1000_82573))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* Alternate MAC address is handled by the option ROM for 82580
|
||||
* and newer. SW support not required.
|
||||
*/
|
||||
if (hw->mac.type >= e1000_82580)
|
||||
goto out;
|
||||
|
||||
ret_val = hw->nvm.ops.read(hw, NVM_ALT_MAC_ADDR_PTR, 1,
|
||||
&nvm_alt_mac_addr_offset);
|
||||
&nvm_alt_mac_addr_offset);
|
||||
if (ret_val) {
|
||||
DEBUGOUT("NVM Read Error\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (nvm_alt_mac_addr_offset == 0xFFFF) {
|
||||
if ((nvm_alt_mac_addr_offset == 0xFFFF) ||
|
||||
(nvm_alt_mac_addr_offset == 0x0000))
|
||||
/* There is no Alternate MAC Address */
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (hw->bus.func == E1000_FUNC_1)
|
||||
nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN1;
|
||||
@ -472,9 +475,8 @@ void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
|
||||
* HW expects these in little endian so we reverse the byte order
|
||||
* from network order (big endian) to little endian
|
||||
*/
|
||||
rar_low = ((u32) addr[0] |
|
||||
((u32) addr[1] << 8) |
|
||||
((u32) addr[2] << 16) | ((u32) addr[3] << 24));
|
||||
rar_low = ((u32) addr[0] | ((u32) addr[1] << 8) |
|
||||
((u32) addr[2] << 16) | ((u32) addr[3] << 24));
|
||||
|
||||
rar_high = ((u32) addr[4] | ((u32) addr[5] << 8));
|
||||
|
||||
@ -503,7 +505,7 @@ void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
|
||||
* The caller must have a packed mc_addr_list of multicast addresses.
|
||||
**/
|
||||
void e1000_update_mc_addr_list_generic(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list, u32 mc_addr_count)
|
||||
u8 *mc_addr_list, u32 mc_addr_count)
|
||||
{
|
||||
u32 hash_value, hash_bit, hash_reg;
|
||||
int i;
|
||||
@ -574,7 +576,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
|
||||
* values resulting from each mc_filter_type...
|
||||
* [0] [1] [2] [3] [4] [5]
|
||||
* 01 AA 00 12 34 56
|
||||
* LSB MSB
|
||||
* LSB MSB
|
||||
*
|
||||
* case 0: hash_value = ((0x34 >> 4) | (0x56 << 4)) & 0xFFF = 0x563
|
||||
* case 1: hash_value = ((0x34 >> 3) | (0x56 << 5)) & 0xFFF = 0xAC6
|
||||
@ -597,7 +599,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
|
||||
}
|
||||
|
||||
hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
|
||||
(((u16) mc_addr[5]) << bit_shift)));
|
||||
(((u16) mc_addr[5]) << bit_shift)));
|
||||
|
||||
return hash_value;
|
||||
}
|
||||
@ -627,9 +629,9 @@ void e1000_pcix_mmrbc_workaround_generic(struct e1000_hw *hw)
|
||||
e1000_read_pci_cfg(hw, PCIX_COMMAND_REGISTER, &pcix_cmd);
|
||||
e1000_read_pci_cfg(hw, PCIX_STATUS_REGISTER_HI, &pcix_stat_hi_word);
|
||||
cmd_mmrbc = (pcix_cmd & PCIX_COMMAND_MMRBC_MASK) >>
|
||||
PCIX_COMMAND_MMRBC_SHIFT;
|
||||
PCIX_COMMAND_MMRBC_SHIFT;
|
||||
stat_mmrbc = (pcix_stat_hi_word & PCIX_STATUS_HI_MMRBC_MASK) >>
|
||||
PCIX_STATUS_HI_MMRBC_SHIFT;
|
||||
PCIX_STATUS_HI_MMRBC_SHIFT;
|
||||
if (stat_mmrbc == PCIX_STATUS_HI_MMRBC_4K)
|
||||
stat_mmrbc = PCIX_STATUS_HI_MMRBC_2K;
|
||||
if (cmd_mmrbc > stat_mmrbc) {
|
||||
@ -926,12 +928,10 @@ s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
|
||||
if (rxcw & E1000_RXCW_SYNCH) {
|
||||
if (!(rxcw & E1000_RXCW_IV)) {
|
||||
mac->serdes_has_link = TRUE;
|
||||
DEBUGOUT("SERDES: Link up - autoneg "
|
||||
"completed sucessfully.\n");
|
||||
DEBUGOUT("SERDES: Link up - autoneg completed successfully.\n");
|
||||
} else {
|
||||
mac->serdes_has_link = FALSE;
|
||||
DEBUGOUT("SERDES: Link down - invalid"
|
||||
"codewords detected in autoneg.\n");
|
||||
DEBUGOUT("SERDES: Link down - invalid codewords detected in autoneg.\n");
|
||||
}
|
||||
} else {
|
||||
mac->serdes_has_link = FALSE;
|
||||
@ -1423,8 +1423,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
goto out;
|
||||
|
||||
if (!(mii_status_reg & MII_SR_AUTONEG_COMPLETE)) {
|
||||
DEBUGOUT("Copper PHY and Auto Neg "
|
||||
"has not completed.\n");
|
||||
DEBUGOUT("Copper PHY and Auto Neg has not completed.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1436,11 +1435,11 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
* flow control was negotiated.
|
||||
*/
|
||||
ret_val = hw->phy.ops.read_reg(hw, PHY_AUTONEG_ADV,
|
||||
&mii_nway_adv_reg);
|
||||
&mii_nway_adv_reg);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
ret_val = hw->phy.ops.read_reg(hw, PHY_LP_ABILITY,
|
||||
&mii_nway_lp_ability_reg);
|
||||
&mii_nway_lp_ability_reg);
|
||||
if (ret_val)
|
||||
goto out;
|
||||
|
||||
@ -1485,15 +1484,14 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
* of pause frames. In this case, we had to advertise
|
||||
* FULL flow control because we could not advertise Rx
|
||||
* ONLY. Hence, we must now check to see if we need to
|
||||
* turn OFF the TRANSMISSION of PAUSE frames.
|
||||
* turn OFF the TRANSMISSION of PAUSE frames.
|
||||
*/
|
||||
if (hw->fc.requested_mode == e1000_fc_full) {
|
||||
hw->fc.current_mode = e1000_fc_full;
|
||||
DEBUGOUT("Flow Control = FULL.\r\n");
|
||||
DEBUGOUT("Flow Control = FULL.\n");
|
||||
} else {
|
||||
hw->fc.current_mode = e1000_fc_rx_pause;
|
||||
DEBUGOUT("Flow Control = "
|
||||
"Rx PAUSE frames only.\r\n");
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\n");
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -1505,11 +1503,11 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
* 0 | 1 | 1 | 1 | e1000_fc_tx_pause
|
||||
*/
|
||||
else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
|
||||
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
|
||||
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
|
||||
hw->fc.current_mode = e1000_fc_tx_pause;
|
||||
DEBUGOUT("Flow Control = Tx PAUSE frames only.\r\n");
|
||||
DEBUGOUT("Flow Control = Tx PAUSE frames only.\n");
|
||||
}
|
||||
/*
|
||||
* For transmitting PAUSE frames ONLY.
|
||||
@ -1520,18 +1518,18 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
* 1 | 1 | 0 | 1 | e1000_fc_rx_pause
|
||||
*/
|
||||
else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
|
||||
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
|
||||
!(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
|
||||
(mii_nway_adv_reg & NWAY_AR_ASM_DIR) &&
|
||||
!(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
|
||||
hw->fc.current_mode = e1000_fc_rx_pause;
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\r\n");
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\n");
|
||||
} else {
|
||||
/*
|
||||
* Per the IEEE spec, at this point flow control
|
||||
* should be disabled.
|
||||
*/
|
||||
hw->fc.current_mode = e1000_fc_none;
|
||||
DEBUGOUT("Flow Control = NONE.\r\n");
|
||||
DEBUGOUT("Flow Control = NONE.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1573,7 +1571,7 @@ out:
|
||||
* speed and duplex for copper connections.
|
||||
**/
|
||||
s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex)
|
||||
u16 *duplex)
|
||||
{
|
||||
u32 status;
|
||||
|
||||
@ -1612,7 +1610,7 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
|
||||
* for fiber/serdes links.
|
||||
**/
|
||||
s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw *hw,
|
||||
u16 *speed, u16 *duplex)
|
||||
u16 *speed, u16 *duplex)
|
||||
{
|
||||
DEBUGFUNC("e1000_get_speed_and_duplex_fiber_serdes_generic");
|
||||
|
||||
@ -1843,11 +1841,10 @@ s32 e1000_setup_led_generic(struct e1000_hw *hw)
|
||||
ledctl = E1000_READ_REG(hw, E1000_LEDCTL);
|
||||
hw->mac.ledctl_default = ledctl;
|
||||
/* Turn off LED0 */
|
||||
ledctl &= ~(E1000_LEDCTL_LED0_IVRT |
|
||||
E1000_LEDCTL_LED0_BLINK |
|
||||
E1000_LEDCTL_LED0_MODE_MASK);
|
||||
ledctl &= ~(E1000_LEDCTL_LED0_IVRT | E1000_LEDCTL_LED0_BLINK |
|
||||
E1000_LEDCTL_LED0_MODE_MASK);
|
||||
ledctl |= (E1000_LEDCTL_MODE_LED_OFF <<
|
||||
E1000_LEDCTL_LED0_MODE_SHIFT);
|
||||
E1000_LEDCTL_LED0_MODE_SHIFT);
|
||||
E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl);
|
||||
} else if (hw->phy.media_type == e1000_media_type_copper) {
|
||||
E1000_WRITE_REG(hw, E1000_LEDCTL, hw->mac.ledctl_mode1);
|
||||
@ -1899,7 +1896,7 @@ s32 e1000_blink_led_generic(struct e1000_hw *hw)
|
||||
if (((hw->mac.ledctl_mode2 >> (i * 8)) & 0xFF) ==
|
||||
E1000_LEDCTL_MODE_LED_ON)
|
||||
ledctl_blink |= (E1000_LEDCTL_LED0_BLINK <<
|
||||
(i * 8));
|
||||
(i * 8));
|
||||
}
|
||||
|
||||
E1000_WRITE_REG(hw, E1000_LEDCTL, ledctl_blink);
|
||||
@ -2090,7 +2087,8 @@ void e1000_update_adaptive_generic(struct e1000_hw *hw)
|
||||
else
|
||||
mac->current_ifs_val +=
|
||||
mac->ifs_step_size;
|
||||
E1000_WRITE_REG(hw, E1000_AIT, mac->current_ifs_val);
|
||||
E1000_WRITE_REG(hw, E1000_AIT,
|
||||
mac->current_ifs_val);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -2141,7 +2139,7 @@ out:
|
||||
* completion.
|
||||
**/
|
||||
s32 e1000_write_8bit_ctrl_reg_generic(struct e1000_hw *hw, u32 reg,
|
||||
u32 offset, u8 data)
|
||||
u32 offset, u8 data)
|
||||
{
|
||||
u32 i, regvalue = 0;
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -313,8 +313,7 @@ static void e1000_standby_nvm(struct e1000_hw *hw)
|
||||
usec_delay(nvm->delay_usec);
|
||||
|
||||
e1000_lower_eec_clk(hw, &eecd);
|
||||
} else
|
||||
if (nvm->type == e1000_nvm_eeprom_spi) {
|
||||
} else if (nvm->type == e1000_nvm_eeprom_spi) {
|
||||
/* Toggle CS to flush commands */
|
||||
eecd |= E1000_EECD_CS;
|
||||
E1000_WRITE_REG(hw, E1000_EECD, eecd);
|
||||
@ -394,13 +393,13 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
|
||||
/* Set CS */
|
||||
eecd |= E1000_EECD_CS;
|
||||
E1000_WRITE_REG(hw, E1000_EECD, eecd);
|
||||
} else
|
||||
if (nvm->type == e1000_nvm_eeprom_spi) {
|
||||
} else if (nvm->type == e1000_nvm_eeprom_spi) {
|
||||
u16 timeout = NVM_MAX_RETRY_SPI;
|
||||
|
||||
/* Clear SK and CS */
|
||||
eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
|
||||
E1000_WRITE_REG(hw, E1000_EECD, eecd);
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
usec_delay(1);
|
||||
|
||||
/*
|
||||
@ -411,7 +410,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
|
||||
*/
|
||||
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;
|
||||
@ -506,7 +505,7 @@ out:
|
||||
* Reads a 16 bit word from the EEPROM.
|
||||
**/
|
||||
s32 e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data)
|
||||
u16 *data)
|
||||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
u32 i = 0;
|
||||
@ -593,7 +592,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
break;
|
||||
|
||||
data[i] = (E1000_READ_REG(hw, E1000_EERD) >>
|
||||
E1000_NVM_RW_REG_DATA);
|
||||
E1000_NVM_RW_REG_DATA);
|
||||
}
|
||||
|
||||
out:
|
||||
@ -646,7 +645,7 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
|
||||
/* 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);
|
||||
|
||||
@ -660,7 +659,7 @@ s32 e1000_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) {
|
||||
@ -697,7 +696,7 @@ out:
|
||||
* EEPROM will most likely contain an invalid checksum.
|
||||
**/
|
||||
s32 e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data)
|
||||
u16 *data)
|
||||
{
|
||||
struct e1000_nvm_info *nvm = &hw->nvm;
|
||||
s32 ret_val;
|
||||
@ -727,7 +726,7 @@ s32 e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
goto release;
|
||||
|
||||
e1000_shift_out_eec_bits(hw, NVM_EWEN_OPCODE_MICROWIRE,
|
||||
(u16)(nvm->opcode_bits + 2));
|
||||
(u16)(nvm->opcode_bits + 2));
|
||||
|
||||
e1000_shift_out_eec_bits(hw, 0, (u16)(nvm->address_bits - 2));
|
||||
|
||||
@ -735,10 +734,10 @@ s32 e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
|
||||
while (words_written < words) {
|
||||
e1000_shift_out_eec_bits(hw, NVM_WRITE_OPCODE_MICROWIRE,
|
||||
nvm->opcode_bits);
|
||||
nvm->opcode_bits);
|
||||
|
||||
e1000_shift_out_eec_bits(hw, (u16)(offset + words_written),
|
||||
nvm->address_bits);
|
||||
nvm->address_bits);
|
||||
|
||||
e1000_shift_out_eec_bits(hw, data[words_written], 16);
|
||||
|
||||
@ -763,7 +762,7 @@ s32 e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
}
|
||||
|
||||
e1000_shift_out_eec_bits(hw, NVM_EWDS_OPCODE_MICROWIRE,
|
||||
(u16)(nvm->opcode_bits + 2));
|
||||
(u16)(nvm->opcode_bits + 2));
|
||||
|
||||
e1000_shift_out_eec_bits(hw, 0, (u16)(nvm->address_bits - 2));
|
||||
|
||||
@ -784,7 +783,7 @@ out:
|
||||
* the value in pba_num.
|
||||
**/
|
||||
s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
|
||||
u32 pba_num_size)
|
||||
u32 pba_num_size)
|
||||
{
|
||||
s32 ret_val;
|
||||
u16 nvm_data;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -45,25 +45,23 @@ s32 e1000_acquire_nvm_generic(struct e1000_hw *hw);
|
||||
s32 e1000_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);
|
||||
u32 pba_num_size);
|
||||
s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size);
|
||||
s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
|
||||
s32 e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
u16 words, u16 *data);
|
||||
s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data);
|
||||
u16 *data);
|
||||
s32 e1000_valid_led_default_generic(struct e1000_hw *hw, u16 *data);
|
||||
s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
s32 e1000_write_nvm_eewr(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
s32 e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset,
|
||||
u16 words, u16 *data);
|
||||
u16 words, u16 *data);
|
||||
s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
u16 *data);
|
||||
u16 *data);
|
||||
s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw);
|
||||
void e1000_stop_nvm(struct e1000_hw *hw);
|
||||
void e1000_release_nvm_generic(struct e1000_hw *hw);
|
||||
|
||||
#define E1000_STM_OPCODE 0xDB00
|
||||
#define E1000_STM_OPCODE 0xDB00
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -40,6 +40,7 @@ s32 e1000_null_read_reg(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
void e1000_null_phy_generic(struct e1000_hw *hw);
|
||||
s32 e1000_null_lplu_state(struct e1000_hw *hw, bool active);
|
||||
s32 e1000_null_write_reg(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_null_set_page(struct e1000_hw *hw, u16 data);
|
||||
s32 e1000_check_downshift_generic(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_m88(struct e1000_hw *hw);
|
||||
s32 e1000_check_polarity_igp(struct e1000_hw *hw);
|
||||
@ -67,6 +68,7 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw);
|
||||
s32 e1000_phy_reset_dsp_generic(struct e1000_hw *hw);
|
||||
s32 e1000_read_kmrn_reg_generic(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page);
|
||||
s32 e1000_read_phy_reg_igp(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_read_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
@ -80,12 +82,14 @@ s32 e1000_write_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_write_phy_reg_m88(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_phy_reset_dsp(struct e1000_hw *hw);
|
||||
s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
|
||||
u32 usec_interval, bool *success);
|
||||
u32 usec_interval, bool *success);
|
||||
s32 e1000_phy_init_script_igp3(struct e1000_hw *hw);
|
||||
enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id);
|
||||
s32 e1000_determine_phy_address(struct e1000_hw *hw);
|
||||
s32 e1000_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_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 e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
void e1000_power_up_phy_copper(struct e1000_hw *hw);
|
||||
@ -94,10 +98,14 @@ s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
|
||||
s32 e1000_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
|
||||
s32 e1000_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data);
|
||||
s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 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);
|
||||
@ -105,34 +113,34 @@ 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
|
||||
#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 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
|
||||
#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_PORT_GEN_CFG_REG PHY_REG(BM_PORT_CTRL_PAGE, 17)
|
||||
#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 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 BM_WUC_ME_WU_BIT (1 << 5)
|
||||
|
||||
#define PHY_UPPER_SHIFT 21
|
||||
#define PHY_UPPER_SHIFT 21
|
||||
#define BM_PHY_REG(page, reg) \
|
||||
(((reg) & MAX_PHY_REG_ADDRESS) |\
|
||||
(((page) & 0xFFFF) << PHY_PAGE_SHIFT) |\
|
||||
@ -144,132 +152,156 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
|
||||
(((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
|
||||
#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
|
||||
#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
|
||||
#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
|
||||
#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
|
||||
#define I82577_DSTATUS_CABLE_LENGTH 0x03FC
|
||||
#define I82577_DSTATUS_CABLE_LENGTH_SHIFT 2
|
||||
|
||||
/* 82580 PHY Power Management */
|
||||
#define E1000_82580_PHY_POWER_MGMT 0xE14
|
||||
#define E1000_82580_PM_SPD 0x0001 /* Smart Power Down */
|
||||
#define E1000_82580_PM_D0_LPLU 0x0002 /* For D0a states */
|
||||
#define E1000_82580_PM_D3_LPLU 0x0004 /* For all other states */
|
||||
#define E1000_82580_PHY_POWER_MGMT 0xE14
|
||||
#define E1000_82580_PM_SPD 0x0001 /* Smart Power Down */
|
||||
#define E1000_82580_PM_D0_LPLU 0x0002 /* For D0a states */
|
||||
#define E1000_82580_PM_D3_LPLU 0x0004 /* For all other states */
|
||||
|
||||
/* BM PHY Copper Specific Control 1 */
|
||||
#define BM_CS_CTRL1 16
|
||||
#define BM_CS_CTRL1_ENERGY_DETECT 0x0300 /* Enable Energy Detect */
|
||||
#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
|
||||
#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 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_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_PSCR_AUTO_MDIX 0x1000
|
||||
#define IGP01E1000_PSCR_FORCE_MDI_MDIX 0x2000 /* 0=MDI, 1=MDIX */
|
||||
|
||||
#define IGP01E1000_PSCFR_SMART_SPEED 0x0080
|
||||
#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 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 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_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 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_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 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 IGP03E1000_PHY_MISC_CTRL 0x1B
|
||||
#define IGP03E1000_PHY_MISC_DUPLEX_MANUAL_SET 0x1000 /* Manually Set Duplex */
|
||||
|
||||
#define E1000_CABLE_LENGTH_UNDEFINED 0xFF
|
||||
#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
|
||||
#define E1000_KMRNCTRLSTA_HD_CTRL 0x10 /* Kumeran HD Control */
|
||||
#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
|
||||
#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 Control */
|
||||
#define IFE_PHY_SPECIAL_CONTROL_LED 0x1B /* PHY Special and LED Control */
|
||||
#define IFE_PHY_MDIX_CONTROL 0x1C /* MDI/MDI-X Control */
|
||||
#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
|
||||
#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
|
||||
#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 */
|
||||
#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 */
|
||||
#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 */
|
||||
|
||||
/* SFP modules ID memory locations */
|
||||
#define E1000_SFF_IDENTIFIER_OFFSET 0x00
|
||||
#define E1000_SFF_IDENTIFIER_SFF 0x02
|
||||
#define E1000_SFF_IDENTIFIER_SFP 0x03
|
||||
|
||||
#define E1000_SFF_ETH_FLAGS_OFFSET 0x06
|
||||
/* Flags for SFP modules compatible with ETH up to 1Gb */
|
||||
struct sfp_e1000_flags {
|
||||
u8 e1000_base_sx:1;
|
||||
u8 e1000_base_lx:1;
|
||||
u8 e1000_base_cx:1;
|
||||
u8 e1000_base_t:1;
|
||||
u8 e100_base_lx:1;
|
||||
u8 e100_base_fx:1;
|
||||
u8 e10_base_bx10:1;
|
||||
u8 e10_base_px:1;
|
||||
};
|
||||
|
||||
/* Vendor OUIs: format of OUI is 0x[byte0][byte1][byte2][00] */
|
||||
#define E1000_SFF_VENDOR_OUI_TYCO 0x00407600
|
||||
#define E1000_SFF_VENDOR_OUI_FTL 0x00906500
|
||||
#define E1000_SFF_VENDOR_OUI_AVAGO 0x00176A00
|
||||
#define E1000_SFF_VENDOR_OUI_INTEL 0x001B2100
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
|
||||
Copyright (c) 2001-2010, Intel Corporation
|
||||
Copyright (c) 2001-2011, Intel Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -36,21 +36,21 @@
|
||||
#include "e1000_api.h"
|
||||
|
||||
|
||||
static s32 e1000_init_phy_params_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_init_nvm_params_vf(struct e1000_hw *hw);
|
||||
static void e1000_release_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_acquire_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_setup_link_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_init_mac_params_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_check_for_link_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex);
|
||||
static s32 e1000_init_hw_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_reset_hw_vf(struct e1000_hw *hw);
|
||||
static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, u8 *, u32);
|
||||
static void e1000_rar_set_vf(struct e1000_hw *, u8 *, u32);
|
||||
static s32 e1000_read_mac_addr_vf(struct e1000_hw *);
|
||||
static s32 e1000_init_phy_params_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_init_nvm_params_vf(struct e1000_hw *hw);
|
||||
static void e1000_release_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_acquire_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_setup_link_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_init_mac_params_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_check_for_link_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex);
|
||||
static s32 e1000_init_hw_vf(struct e1000_hw *hw);
|
||||
static s32 e1000_reset_hw_vf(struct e1000_hw *hw);
|
||||
static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, u8 *, u32);
|
||||
static void e1000_rar_set_vf(struct e1000_hw *, u8 *, u32);
|
||||
static s32 e1000_read_mac_addr_vf(struct e1000_hw *);
|
||||
|
||||
/**
|
||||
* e1000_init_phy_params_vf - Inits PHY params
|
||||
@ -219,7 +219,7 @@ static s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw)
|
||||
* the status register's data which is often stale and inaccurate.
|
||||
**/
|
||||
static s32 e1000_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed,
|
||||
u16 *duplex)
|
||||
u16 *duplex)
|
||||
{
|
||||
s32 status;
|
||||
|
||||
@ -288,7 +288,7 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
|
||||
ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0);
|
||||
if (!ret_val) {
|
||||
if (msgbuf[0] == (E1000_VF_RESET |
|
||||
E1000_VT_MSGTYPE_ACK))
|
||||
E1000_VT_MSGTYPE_ACK))
|
||||
memcpy(hw->mac.perm_addr, addr, 6);
|
||||
else
|
||||
ret_val = -E1000_ERR_MAC_INIT;
|
||||
@ -369,11 +369,22 @@ static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
|
||||
bit_shift++;
|
||||
|
||||
hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
|
||||
(((u16) mc_addr[5]) << bit_shift)));
|
||||
(((u16) mc_addr[5]) << bit_shift)));
|
||||
|
||||
return hash_value;
|
||||
}
|
||||
|
||||
static void e1000_write_msg_read_ack(struct e1000_hw *hw,
|
||||
u32 *msg, u16 size)
|
||||
{
|
||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||
u32 retmsg[E1000_VFMAILBOX_SIZE];
|
||||
s32 retval = mbx->ops.write_posted(hw, msg, size, 0);
|
||||
|
||||
if (!retval)
|
||||
mbx->ops.read_posted(hw, retmsg, E1000_VFMAILBOX_SIZE, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* e1000_update_mc_addr_list_vf - Update Multicast addresses
|
||||
* @hw: pointer to the HW structure
|
||||
@ -384,9 +395,8 @@ static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
|
||||
* The caller must have a packed mc_addr_list of multicast addresses.
|
||||
**/
|
||||
void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
|
||||
u8 *mc_addr_list, u32 mc_addr_count)
|
||||
u8 *mc_addr_list, u32 mc_addr_count)
|
||||
{
|
||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||
u32 msgbuf[E1000_VFMAILBOX_SIZE];
|
||||
u16 *hash_list = (u16 *)&msgbuf[1];
|
||||
u32 hash_value;
|
||||
@ -420,7 +430,7 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
|
||||
mc_addr_list += ETH_ADDR_LEN;
|
||||
}
|
||||
|
||||
mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE, 0);
|
||||
e1000_write_msg_read_ack(hw, msgbuf, E1000_VFMAILBOX_SIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -431,7 +441,6 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
|
||||
**/
|
||||
void e1000_vfta_set_vf(struct e1000_hw *hw, u16 vid, bool set)
|
||||
{
|
||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||
u32 msgbuf[2];
|
||||
|
||||
msgbuf[0] = E1000_VF_SET_VLAN;
|
||||
@ -440,7 +449,7 @@ void e1000_vfta_set_vf(struct e1000_hw *hw, u16 vid, bool set)
|
||||
if (set)
|
||||
msgbuf[0] |= E1000_VF_SET_VLAN_ADD;
|
||||
|
||||
mbx->ops.write_posted(hw, msgbuf, 2, 0);
|
||||
e1000_write_msg_read_ack(hw, msgbuf, 2);
|
||||
}
|
||||
|
||||
/** e1000_rlpml_set_vf - Set the maximum receive packet length
|
||||
@ -449,13 +458,12 @@ void e1000_vfta_set_vf(struct e1000_hw *hw, u16 vid, bool set)
|
||||
**/
|
||||
void e1000_rlpml_set_vf(struct e1000_hw *hw, u16 max_size)
|
||||
{
|
||||
struct e1000_mbx_info *mbx = &hw->mbx;
|
||||
u32 msgbuf[2];
|
||||
|
||||
msgbuf[0] = E1000_VF_SET_LPE;
|
||||
msgbuf[1] = max_size;
|
||||
|
||||
mbx->ops.write_posted(hw, msgbuf, 2, 0);
|
||||
e1000_write_msg_read_ack(hw, msgbuf, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user