e1000: whitespace changes
Signed-off-by: Intel
This commit is contained in:
parent
f72751f2c7
commit
5037620be5
@ -31,8 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* 80003ES2LAN Gigabit Ethernet Controller (Copper)
|
||||
/* 80003ES2LAN Gigabit Ethernet Controller (Copper)
|
||||
* 80003ES2LAN Gigabit Ethernet Controller (Serdes)
|
||||
*/
|
||||
|
||||
@ -76,8 +75,7 @@ static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
|
||||
STATIC s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw);
|
||||
STATIC void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
|
||||
|
||||
/*
|
||||
* A table for the GG82563 cable length where the range is defined
|
||||
/* A table for the GG82563 cable length where the range is defined
|
||||
* with a lower bound at "index" and the upper bound at
|
||||
* "index + 5".
|
||||
*/
|
||||
@ -172,8 +170,7 @@ STATIC s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
|
||||
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
|
||||
E1000_EECD_SIZE_EX_SHIFT);
|
||||
|
||||
/*
|
||||
* Added to a constant, "size" becomes the left-shift value
|
||||
/* Added to a constant, "size" becomes the left-shift value
|
||||
* for setting word_size.
|
||||
*/
|
||||
size += NVM_WORD_SIZE_BASE_SHIFT;
|
||||
@ -423,8 +420,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
|
||||
if (!(swfw_sync & (fwmask | swmask)))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Firmware currently using resource (fwmask)
|
||||
/* Firmware currently using resource (fwmask)
|
||||
* or other software thread using resource (swmask)
|
||||
*/
|
||||
e1000_put_hw_semaphore_generic(hw);
|
||||
@ -494,8 +490,7 @@ STATIC s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
|
||||
page_select = GG82563_PHY_PAGE_SELECT;
|
||||
} else {
|
||||
/*
|
||||
* Use Alternative Page Select register to access
|
||||
/* Use Alternative Page Select register to access
|
||||
* registers 30 and 31
|
||||
*/
|
||||
page_select = GG82563_PHY_PAGE_SELECT_ALT;
|
||||
@ -509,8 +504,7 @@ STATIC s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
}
|
||||
|
||||
if (hw->dev_spec._80003es2lan.mdic_wa_enable) {
|
||||
/*
|
||||
* The "ready" bit in the MDIC register may be incorrectly set
|
||||
/* The "ready" bit in the MDIC register may be incorrectly set
|
||||
* before the device has completed the "Page Select" MDI
|
||||
* transaction. So we wait 200us after each MDI command...
|
||||
*/
|
||||
@ -567,8 +561,7 @@ STATIC s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
|
||||
page_select = GG82563_PHY_PAGE_SELECT;
|
||||
} else {
|
||||
/*
|
||||
* Use Alternative Page Select register to access
|
||||
/* Use Alternative Page Select register to access
|
||||
* registers 30 and 31
|
||||
*/
|
||||
page_select = GG82563_PHY_PAGE_SELECT_ALT;
|
||||
@ -582,8 +575,7 @@ STATIC s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
|
||||
}
|
||||
|
||||
if (hw->dev_spec._80003es2lan.mdic_wa_enable) {
|
||||
/*
|
||||
* The "ready" bit in the MDIC register may be incorrectly set
|
||||
/* The "ready" bit in the MDIC register may be incorrectly set
|
||||
* before the device has completed the "Page Select" MDI
|
||||
* transaction. So we wait 200us after each MDI command...
|
||||
*/
|
||||
@ -681,8 +673,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
if (!(hw->phy.ops.read_reg))
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
|
||||
/* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
|
||||
* forced whenever speed and duplex are forced.
|
||||
*/
|
||||
ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
|
||||
@ -720,8 +711,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
|
||||
if (!link) {
|
||||
/*
|
||||
* We didn't get link.
|
||||
/* We didn't get link.
|
||||
* Reset the DSP and cross our fingers.
|
||||
*/
|
||||
ret_val = e1000_phy_reset_dsp_generic(hw);
|
||||
@ -741,8 +731,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Resetting the phy means we need to verify the TX_CLK corresponds
|
||||
/* Resetting the phy means we need to verify the TX_CLK corresponds
|
||||
* to the link speed. 10Mbps -> 2.5MHz, else 25MHz.
|
||||
*/
|
||||
phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
|
||||
@ -751,8 +740,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
|
||||
else
|
||||
phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25;
|
||||
|
||||
/*
|
||||
* In addition, we must re-enable CRS on Tx for both half and full
|
||||
/* In addition, we must re-enable CRS on Tx for both half and full
|
||||
* duplex.
|
||||
*/
|
||||
phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
|
||||
@ -839,8 +827,7 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_80003es2lan");
|
||||
|
||||
/*
|
||||
* Prevent the PCI-E bus from sticking if there is no TLP connection
|
||||
/* Prevent the PCI-E bus from sticking if there is no TLP connection
|
||||
* on the last TLP read/write transaction when MAC is reset.
|
||||
*/
|
||||
ret_val = e1000_disable_pcie_master_generic(hw);
|
||||
@ -974,8 +961,7 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
|
||||
hw->dev_spec._80003es2lan.mdic_wa_enable = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear all of the statistics registers (clear on read). It is
|
||||
/* Clear all of the statistics registers (clear on read). It is
|
||||
* important that we do this after we have tried to establish link
|
||||
* because the symbol error count will increment wildly if there
|
||||
* is no link.
|
||||
@ -1022,8 +1008,7 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
|
||||
reg |= (1 << 28);
|
||||
E1000_WRITE_REG(hw, E1000_TARC(1), reg);
|
||||
|
||||
/*
|
||||
* Disable IPv6 extension header parsing because some malformed
|
||||
/* Disable IPv6 extension header parsing because some malformed
|
||||
* IPv6 headers can hang the Rx.
|
||||
*/
|
||||
reg = E1000_READ_REG(hw, E1000_RFCTL);
|
||||
@ -1060,8 +1045,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* MDI/MDI-X = 0 (default)
|
||||
* 0 - Auto for all speeds
|
||||
* 1 - MDI mode
|
||||
@ -1087,8 +1071,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* disable_polarity_correction = 0 (default)
|
||||
* Automatic Correction for Reversed Cable Polarity
|
||||
* 0 - Disabled
|
||||
@ -1144,8 +1127,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Do not init these registers when the HW is in IAMT mode, since the
|
||||
/* Do not init these registers when the HW is in IAMT mode, since the
|
||||
* firmware will have already initialized them. We only initialize
|
||||
* them if the HW is not in IAMT mode.
|
||||
*/
|
||||
@ -1169,8 +1151,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Workaround: Disable padding in Kumeran interface in the MAC
|
||||
/* Workaround: Disable padding in Kumeran interface in the MAC
|
||||
* and in the PHY to avoid CRC errors.
|
||||
*/
|
||||
ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_INBAND_CTRL, &data);
|
||||
@ -1205,8 +1186,7 @@ STATIC s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
|
||||
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
|
||||
E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
|
||||
|
||||
/*
|
||||
* Set the mac to wait the maximum time between each
|
||||
/* Set the mac to wait the maximum time between each
|
||||
* iteration and increase the max iterations when
|
||||
* polling the phy; this fixes erroneous timeouts at 10Mbps.
|
||||
*/
|
||||
@ -1449,8 +1429,7 @@ STATIC s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_read_mac_addr_80003es2lan");
|
||||
|
||||
/*
|
||||
* If there's an alternate MAC address place it in RAR0
|
||||
/* If there's an alternate MAC address place it in RAR0
|
||||
* so that it will override the Si installed default perm
|
||||
* address.
|
||||
*/
|
||||
|
@ -76,8 +76,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */
|
||||
|
||||
/* DSP Distance Register (Page 5, Register 26) */
|
||||
/*
|
||||
/* DSP Distance Register (Page 5, Register 26)
|
||||
* 0 = <50M
|
||||
* 1 = 50-80M
|
||||
* 2 = 80-100M
|
||||
|
@ -31,8 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* 82571EB Gigabit Ethernet Controller
|
||||
/* 82571EB Gigabit Ethernet Controller
|
||||
* 82571EB Gigabit Ethernet Controller (Copper)
|
||||
* 82571EB Gigabit Ethernet Controller (Fiber)
|
||||
* 82571EB Dual Port Gigabit Mezzanine Adapter
|
||||
@ -238,8 +237,7 @@ STATIC s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
|
||||
if (((eecd >> 15) & 0x3) == 0x3) {
|
||||
nvm->type = e1000_nvm_flash_hw;
|
||||
nvm->word_size = 2048;
|
||||
/*
|
||||
* Autonomous Flash update bit must be cleared due
|
||||
/* Autonomous Flash update bit must be cleared due
|
||||
* to Flash update issue.
|
||||
*/
|
||||
eecd &= ~E1000_EECD_AUPDEN;
|
||||
@ -251,8 +249,7 @@ STATIC s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
|
||||
nvm->type = e1000_nvm_eeprom_spi;
|
||||
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
|
||||
E1000_EECD_SIZE_EX_SHIFT);
|
||||
/*
|
||||
* Added to a constant, "size" becomes the left-shift value
|
||||
/* Added to a constant, "size" becomes the left-shift value
|
||||
* for setting word_size.
|
||||
*/
|
||||
size += NVM_WORD_SIZE_BASE_SHIFT;
|
||||
@ -379,8 +376,7 @@ STATIC s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
|
||||
/* FWSM register */
|
||||
mac->has_fwsm = true;
|
||||
/*
|
||||
* ARC supported; valid only if manageability features are
|
||||
/* ARC supported; valid only if manageability features are
|
||||
* enabled.
|
||||
*/
|
||||
mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) &
|
||||
@ -402,8 +398,7 @@ STATIC s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ensure that the inter-port SWSM.SMBI lock bit is clear before
|
||||
/* Ensure that the inter-port SWSM.SMBI lock bit is clear before
|
||||
* first NVM or PHY acess. This should be done for single-port
|
||||
* devices, and for one port only on dual-port devices so that
|
||||
* for those devices we can still use the SMBI lock to synchronize
|
||||
@ -441,10 +436,7 @@ STATIC s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_SWSM, swsm & ~E1000_SWSM_SMBI);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialze device specific counter of SMBI acquisition
|
||||
* timeouts.
|
||||
*/
|
||||
/* Initialze device specific counter of SMBI acquisition timeouts. */
|
||||
hw->dev_spec._82571.smb_counter = 0;
|
||||
|
||||
return E1000_SUCCESS;
|
||||
@ -483,8 +475,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
|
||||
switch (hw->mac.type) {
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
/*
|
||||
* The 82571 firmware may still be configuring the PHY.
|
||||
/* The 82571 firmware may still be configuring the PHY.
|
||||
* In this case, we cannot access the PHY until the
|
||||
* configuration is done. So we explicitly set the
|
||||
* PHY ID.
|
||||
@ -532,8 +523,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_get_hw_semaphore_82571");
|
||||
|
||||
/*
|
||||
* If we have timedout 3 times on trying to acquire
|
||||
/* If we have timedout 3 times on trying to acquire
|
||||
* the inter-port SMBI semaphore, there is old code
|
||||
* operating on the other port, and it is not
|
||||
* releasing SMBI. Modify the number of times that
|
||||
@ -850,8 +840,7 @@ STATIC s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* If our nvm is an EEPROM, then we're done
|
||||
/* If our nvm is an EEPROM, then we're done
|
||||
* otherwise, commit the checksum to the flash NVM.
|
||||
*/
|
||||
if (hw->nvm.type != e1000_nvm_flash_hw)
|
||||
@ -869,8 +858,7 @@ STATIC s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
|
||||
|
||||
/* Reset the firmware if using STM opcode. */
|
||||
if ((E1000_READ_REG(hw, E1000_FLOP) & 0xFF00) == E1000_STM_OPCODE) {
|
||||
/*
|
||||
* The enabling of and the actual reset must be done
|
||||
/* The enabling of and the actual reset must be done
|
||||
* in two write cycles.
|
||||
*/
|
||||
E1000_WRITE_REG(hw, E1000_HICR, E1000_HICR_FW_RESET_ENABLE);
|
||||
@ -934,8 +922,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
|
||||
|
||||
DEBUGFUNC("e1000_write_nvm_eewr_82571");
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
@ -1035,8 +1022,7 @@ STATIC s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
|
||||
data &= ~IGP02E1000_PM_D0_LPLU;
|
||||
ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT,
|
||||
data);
|
||||
/*
|
||||
* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
/* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
* during Dx states where the power conservation is most
|
||||
* important. During driver activity we should enable
|
||||
* SmartSpeed, so performance is maintained.
|
||||
@ -1086,8 +1072,7 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_82571");
|
||||
|
||||
/*
|
||||
* Prevent the PCI-E bus from sticking if there is no TLP connection
|
||||
/* Prevent the PCI-E bus from sticking if there is no TLP connection
|
||||
* on the last TLP read/write transaction when MAC is reset.
|
||||
*/
|
||||
ret_val = e1000_disable_pcie_master_generic(hw);
|
||||
@ -1105,8 +1090,7 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
|
||||
|
||||
msec_delay(10);
|
||||
|
||||
/*
|
||||
* Must acquire the MDIO ownership before MAC reset.
|
||||
/* Must acquire the MDIO ownership before MAC reset.
|
||||
* Ownership defaults to firmware after a reset.
|
||||
*/
|
||||
switch (hw->mac.type) {
|
||||
@ -1151,8 +1135,7 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
|
||||
/* We don't want to continue accessing MAC registers. */
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Phy configuration from NVM just starts after EECD_AUTO_RD is set.
|
||||
/* Phy configuration from NVM just starts after EECD_AUTO_RD is set.
|
||||
* Need to wait for Phy configuration completion before accessing
|
||||
* NVM and Phy.
|
||||
*/
|
||||
@ -1160,8 +1143,7 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
|
||||
switch (hw->mac.type) {
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
/*
|
||||
* REQ and GNT bits need to be cleared when using AUTO_RD
|
||||
/* REQ and GNT bits need to be cleared when using AUTO_RD
|
||||
* to access the EEPROM.
|
||||
*/
|
||||
eecd = E1000_READ_REG(hw, E1000_EECD);
|
||||
@ -1224,8 +1206,7 @@ STATIC s32 e1000_init_hw_82571(struct e1000_hw *hw)
|
||||
DEBUGOUT("Initializing the IEEE VLAN\n");
|
||||
mac->ops.clear_vfta(hw);
|
||||
|
||||
/* Setup the receive address. */
|
||||
/*
|
||||
/* Setup the receive address.
|
||||
* If, however, a locally administered address was assigned to the
|
||||
* 82571, we must reserve a RAR for it to work around an issue where
|
||||
* resetting one port will reload the MAC on the other port.
|
||||
@ -1268,8 +1249,7 @@ STATIC s32 e1000_init_hw_82571(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear all of the statistics registers (clear on read). It is
|
||||
/* Clear all of the statistics registers (clear on read). It is
|
||||
* important that we do this after we have tried to establish link
|
||||
* because the symbol error count will increment wildly if there
|
||||
* is no link.
|
||||
@ -1368,8 +1348,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_PBA_ECC, reg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Workaround for hardware errata.
|
||||
/* Workaround for hardware errata.
|
||||
* Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572
|
||||
*/
|
||||
if ((hw->mac.type == e1000_82571) ||
|
||||
@ -1379,8 +1358,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable IPv6 extension header parsing because some malformed
|
||||
/* Disable IPv6 extension header parsing because some malformed
|
||||
* IPv6 headers can hang the Rx.
|
||||
*/
|
||||
if (hw->mac.type <= e1000_82573) {
|
||||
@ -1397,8 +1375,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
|
||||
reg |= (1 << 22);
|
||||
E1000_WRITE_REG(hw, E1000_GCR, reg);
|
||||
|
||||
/*
|
||||
* Workaround for hardware errata.
|
||||
/* Workaround for hardware errata.
|
||||
* apply workaround for hardware errata documented in errata
|
||||
* docs Fixes issue where some error prone or unreliable PCIe
|
||||
* completions are occurring, particularly with ASPM enabled.
|
||||
@ -1436,8 +1413,7 @@ STATIC void e1000_clear_vfta_82571(struct e1000_hw *hw)
|
||||
case e1000_82574:
|
||||
case e1000_82583:
|
||||
if (hw->mng_cookie.vlan_id != 0) {
|
||||
/*
|
||||
* The VFTA is a 4096b bit-field, each identifying
|
||||
/* The VFTA is a 4096b bit-field, each identifying
|
||||
* a single VLAN ID. The following operations
|
||||
* determine which 32b entry (i.e. offset) into the
|
||||
* array we want to set the VLAN ID (i.e. bit) of
|
||||
@ -1455,8 +1431,7 @@ STATIC void e1000_clear_vfta_82571(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
|
||||
/*
|
||||
* If the offset we want to clear is the same offset of the
|
||||
/* If the offset we want to clear is the same offset of the
|
||||
* manageability VLAN ID, then clear all bits except that of
|
||||
* the manageability unit.
|
||||
*/
|
||||
@ -1498,8 +1473,7 @@ STATIC s32 e1000_led_on_82574(struct e1000_hw *hw)
|
||||
|
||||
ctrl = hw->mac.ledctl_mode2;
|
||||
if (!(E1000_STATUS_LU & E1000_READ_REG(hw, E1000_STATUS))) {
|
||||
/*
|
||||
* If no link, then turn LED on by setting the invert bit
|
||||
/* If no link, then turn LED on by setting the invert bit
|
||||
* for each LED that's "on" (0x0E) in ledctl_mode2.
|
||||
*/
|
||||
for (i = 0; i < 4; i++)
|
||||
@ -1526,8 +1500,7 @@ bool e1000_check_phy_82574(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_check_phy_82574");
|
||||
|
||||
/*
|
||||
* Read PHY Receive Error counter first, if its is max - all F's then
|
||||
/* Read PHY Receive Error counter first, if its is max - all F's then
|
||||
* 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,
|
||||
@ -1562,8 +1535,7 @@ STATIC s32 e1000_setup_link_82571(struct e1000_hw *hw)
|
||||
{
|
||||
DEBUGFUNC("e1000_setup_link_82571");
|
||||
|
||||
/*
|
||||
* 82573 does not have a word in the NVM to determine
|
||||
/* 82573 does not have a word in the NVM to determine
|
||||
* the default flow control setting, so we explicitly
|
||||
* set it to full.
|
||||
*/
|
||||
@ -1634,8 +1606,7 @@ STATIC s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
|
||||
switch (hw->mac.type) {
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
/*
|
||||
* If SerDes loopback mode is entered, there is no form
|
||||
/* If SerDes loopback mode is entered, there is no form
|
||||
* of reset to take the adapter out of that mode. So we
|
||||
* have to explicitly take the adapter out of loopback
|
||||
* mode. This prevents drivers from twiddling their thumbs
|
||||
@ -1695,8 +1666,7 @@ STATIC s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
switch (mac->serdes_link_state) {
|
||||
case e1000_serdes_link_autoneg_complete:
|
||||
if (!(status & E1000_STATUS_LU)) {
|
||||
/*
|
||||
* We have lost link, retry autoneg before
|
||||
/* We have lost link, retry autoneg before
|
||||
* reporting link failure
|
||||
*/
|
||||
mac->serdes_link_state =
|
||||
@ -1709,8 +1679,7 @@ STATIC s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
break;
|
||||
|
||||
case e1000_serdes_link_forced_up:
|
||||
/*
|
||||
* If we are receiving /C/ ordered sets, re-enable
|
||||
/* If we are receiving /C/ ordered sets, re-enable
|
||||
* auto-negotiation in the TXCW register and disable
|
||||
* forced link in the Device Control register in an
|
||||
* attempt to auto-negotiate with our link partner.
|
||||
@ -1731,8 +1700,7 @@ STATIC s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
|
||||
case e1000_serdes_link_autoneg_progress:
|
||||
if (rxcw & E1000_RXCW_C) {
|
||||
/*
|
||||
* We received /C/ ordered sets, meaning the
|
||||
/* We received /C/ ordered sets, meaning the
|
||||
* link partner has autonegotiated, and we can
|
||||
* trust the Link Up (LU) status bit.
|
||||
*/
|
||||
@ -1748,8 +1716,7 @@ STATIC s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
DEBUGOUT("AN_PROG -> DOWN\n");
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* The link partner did not autoneg.
|
||||
/* The link partner did not autoneg.
|
||||
* Force link up and full duplex, and change
|
||||
* state to forced.
|
||||
*/
|
||||
@ -1774,8 +1741,7 @@ STATIC s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
|
||||
case e1000_serdes_link_down:
|
||||
default:
|
||||
/*
|
||||
* The link was down but the receiver has now gained
|
||||
/* The link was down but the receiver has now gained
|
||||
* valid sync, so lets see if we can bring the link
|
||||
* up.
|
||||
*/
|
||||
@ -1794,8 +1760,7 @@ STATIC s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
|
||||
mac->serdes_link_state = e1000_serdes_link_down;
|
||||
DEBUGOUT("ANYSTATE -> DOWN\n");
|
||||
} else {
|
||||
/*
|
||||
* Check several times, if SYNCH bit and CONFIG
|
||||
/* Check several times, if SYNCH bit and CONFIG
|
||||
* bit both are consistently 1 then simply ignore
|
||||
* the IV bit and restart Autoneg
|
||||
*/
|
||||
@ -1901,8 +1866,7 @@ void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state)
|
||||
|
||||
/* If workaround is activated... */
|
||||
if (state)
|
||||
/*
|
||||
* Hold a copy of the LAA in RAR[14] This is done so that
|
||||
/* Hold a copy of the LAA in RAR[14] This is done so that
|
||||
* between the time RAR[0] gets clobbered and the time it
|
||||
* gets fixed, the actual LAA is in one of the RARs and no
|
||||
* incoming packets directed to this port are dropped.
|
||||
@ -1934,8 +1898,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
|
||||
if (nvm->type != e1000_nvm_flash_hw)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* Check bit 4 of word 10h. If it is 0, firmware is done updating
|
||||
/* Check bit 4 of word 10h. If it is 0, firmware is done updating
|
||||
* 10h-12h. Checksum may need to be fixed.
|
||||
*/
|
||||
ret_val = nvm->ops.read(hw, 0x10, 1, &data);
|
||||
@ -1943,8 +1906,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
|
||||
if (!(data & 0x10)) {
|
||||
/*
|
||||
* Read 0x23 and check bit 15. This bit is a 1
|
||||
/* Read 0x23 and check bit 15. This bit is a 1
|
||||
* when the checksum has already been fixed. If
|
||||
* the checksum is still wrong and this bit is a
|
||||
* 1, we need to return bad checksum. Otherwise,
|
||||
@ -1979,8 +1941,7 @@ STATIC s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
|
||||
if (hw->mac.type == e1000_82571) {
|
||||
s32 ret_val = E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* If there's an alternate MAC address place it in RAR0
|
||||
/* If there's an alternate MAC address place it in RAR0
|
||||
* so that it will override the Si installed default perm
|
||||
* address.
|
||||
*/
|
||||
|
@ -31,8 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* 82562G 10/100 Network Connection
|
||||
/* 82562G 10/100 Network Connection
|
||||
* 82562G-2 10/100 Network Connection
|
||||
* 82562GT 10/100 Network Connection
|
||||
* 82562GT-2 10/100 Network Connection
|
||||
@ -440,8 +439,7 @@ STATIC s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
|
||||
phy->ops.power_up = e1000_power_up_phy_copper;
|
||||
phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
|
||||
|
||||
/*
|
||||
* We may need to do this twice - once for IGP and if that fails,
|
||||
/* We may need to do this twice - once for IGP and if that fails,
|
||||
* we'll set BM func pointers and try again
|
||||
*/
|
||||
ret_val = e1000_determine_phy_address(hw);
|
||||
@ -528,8 +526,7 @@ STATIC s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG);
|
||||
|
||||
/*
|
||||
* sector_X_addr is a "sector"-aligned address (4096 bytes)
|
||||
/* sector_X_addr is a "sector"-aligned address (4096 bytes)
|
||||
* Add 1 to sector_end_addr since this sector is included in
|
||||
* the overall size.
|
||||
*/
|
||||
@ -539,8 +536,7 @@ STATIC s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
|
||||
/* flash_base_addr is byte-aligned */
|
||||
nvm->flash_base_addr = sector_base_addr << FLASH_SECTOR_ADDR_SHIFT;
|
||||
|
||||
/*
|
||||
* find total size of the NVM, then cut in half since the total
|
||||
/* find total size of the NVM, then cut in half since the total
|
||||
* size represents two separate NVM banks.
|
||||
*/
|
||||
nvm->flash_bank_size = (sector_end_addr - sector_base_addr)
|
||||
@ -843,8 +839,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_check_for_copper_link_ich8lan");
|
||||
|
||||
/*
|
||||
* We only want to go out to the PHY registers to see if Auto-Neg
|
||||
/* We only want to go out to the PHY registers to see if Auto-Neg
|
||||
* has completed and/or if our link status has changed. The
|
||||
* get_link_status flag is set upon receiving a Link Status
|
||||
* Change or Rx Sequence Error interrupt.
|
||||
@ -888,8 +883,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Workaround for PCHx parts in half-duplex:
|
||||
/* Workaround for PCHx parts in half-duplex:
|
||||
* Set the number of preambles removed from the packet
|
||||
* when it is passed from the PHY to the MAC to prevent
|
||||
* the MAC from misinterpreting the packet type.
|
||||
@ -907,8 +901,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if there was DownShift, must be checked
|
||||
/* Check if there was DownShift, must be checked
|
||||
* immediately after link-up
|
||||
*/
|
||||
e1000_check_downshift_generic(hw);
|
||||
@ -918,22 +911,19 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* If we are forcing speed/duplex, then we simply return since
|
||||
/* If we are forcing speed/duplex, then we simply return since
|
||||
* we have already determined whether we have link or not.
|
||||
*/
|
||||
if (!mac->autoneg)
|
||||
return -E1000_ERR_CONFIG;
|
||||
|
||||
/*
|
||||
* Auto-Neg is enabled. Auto Speed Detection takes care
|
||||
/* Auto-Neg is enabled. Auto Speed Detection takes care
|
||||
* of MAC speed/duplex configuration. So we only need to
|
||||
* configure Collision Distance in the MAC.
|
||||
*/
|
||||
mac->ops.config_collision_dist(hw);
|
||||
|
||||
/*
|
||||
* Configure Flow Control now that Auto-Neg has completed.
|
||||
/* Configure Flow Control now that Auto-Neg has completed.
|
||||
* First, we need to restore the desired flow control
|
||||
* settings because we may have had to re-autoneg with a
|
||||
* different link partner.
|
||||
@ -1148,8 +1138,7 @@ STATIC void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index)
|
||||
|
||||
DEBUGFUNC("e1000_rar_set_pch2lan");
|
||||
|
||||
/*
|
||||
* HW expects these in little endian so we reverse the byte order
|
||||
/* 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] |
|
||||
@ -1274,8 +1263,7 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_sw_lcd_config_ich8lan");
|
||||
|
||||
/*
|
||||
* Initialize the PHY from the NVM on ICH platforms. This
|
||||
/* Initialize the PHY from the NVM on ICH platforms. This
|
||||
* is needed due to an issue where the NVM configuration is
|
||||
* not properly autoloaded after power transitions.
|
||||
* Therefore, after each PHY reset, we will load the
|
||||
@ -1308,8 +1296,7 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
|
||||
if (!(data & sw_cfg_mask))
|
||||
goto release;
|
||||
|
||||
/*
|
||||
* Make sure HW does not configure LCD from PHY
|
||||
/* Make sure HW does not configure LCD from PHY
|
||||
* extended configuration before SW configuration
|
||||
*/
|
||||
data = E1000_READ_REG(hw, E1000_EXTCNF_CTRL);
|
||||
@ -1329,8 +1316,7 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
|
||||
if (((hw->mac.type == e1000_pchlan) &&
|
||||
!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)) ||
|
||||
(hw->mac.type > e1000_pchlan)) {
|
||||
/*
|
||||
* HW configures the SMBus address and LEDs when the
|
||||
/* HW configures the SMBus address and LEDs when the
|
||||
* OEM and LCD Write Enable bits are set in the NVM.
|
||||
* When both NVM bits are cleared, SW will configure
|
||||
* them instead.
|
||||
@ -1649,8 +1635,7 @@ STATIC s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
|
||||
}
|
||||
|
||||
if (hw->phy.type == e1000_phy_82578) {
|
||||
/*
|
||||
* Return registers to default by doing a soft reset then
|
||||
/* Return registers to default by doing a soft reset then
|
||||
* writing 0x3140 to the control register.
|
||||
*/
|
||||
if (hw->phy.revision < 2) {
|
||||
@ -1671,8 +1656,7 @@ STATIC s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Configure the K1 Si workaround during phy reset assuming there is
|
||||
/* Configure the K1 Si workaround during phy reset assuming there is
|
||||
* link so that it disables K1 if link is in 1Gbps.
|
||||
*/
|
||||
ret_val = e1000_k1_gig_workaround_hv(hw, true);
|
||||
@ -1784,8 +1768,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
|
||||
return ret_val;
|
||||
|
||||
if (enable) {
|
||||
/*
|
||||
* Write Rx addresses (rar_entry_count for RAL/H, +4 for
|
||||
/* Write Rx addresses (rar_entry_count for RAL/H, and
|
||||
* SHRAL/H) and initial CRC values to the MAC
|
||||
*/
|
||||
for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {
|
||||
@ -2072,8 +2055,7 @@ STATIC void e1000_lan_init_done_ich8lan(struct e1000_hw *hw)
|
||||
usec_delay(100);
|
||||
} while ((!data) && --loop);
|
||||
|
||||
/*
|
||||
* If basic configuration is incomplete before the above loop
|
||||
/* If basic configuration is incomplete before the above loop
|
||||
* count reaches 0, loading the configuration from NVM will
|
||||
* leave the PHY in a bad state possibly resulting in no link.
|
||||
*/
|
||||
@ -2248,8 +2230,7 @@ STATIC s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
|
||||
if (phy->type != e1000_phy_igp_3)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* Call gig speed drop workaround on LPLU before accessing
|
||||
/* Call gig speed drop workaround on LPLU before accessing
|
||||
* any PHY registers
|
||||
*/
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
@ -2272,8 +2253,7 @@ STATIC s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
|
||||
if (phy->type != e1000_phy_igp_3)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
/* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
* during Dx states where the power conservation is most
|
||||
* important. During driver activity we should enable
|
||||
* SmartSpeed, so performance is maintained.
|
||||
@ -2341,8 +2321,7 @@ STATIC s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
|
||||
if (phy->type != e1000_phy_igp_3)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
/* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
* during Dx states where the power conservation is most
|
||||
* important. During driver activity we should enable
|
||||
* SmartSpeed, so performance is maintained.
|
||||
@ -2383,8 +2362,7 @@ STATIC s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
|
||||
if (phy->type != e1000_phy_igp_3)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* Call gig speed drop workaround on LPLU before accessing
|
||||
/* Call gig speed drop workaround on LPLU before accessing
|
||||
* any PHY registers
|
||||
*/
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
@ -2562,8 +2540,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
E1000_WRITE_FLASH_REG16(hw, ICH_FLASH_HSFSTS, hsfsts.regval);
|
||||
|
||||
/*
|
||||
* Either we should have a hardware SPI cycle in progress
|
||||
/* Either we should have a hardware SPI cycle in progress
|
||||
* bit to check against, in order to start a new cycle or
|
||||
* FDONE bit should be changed in the hardware so that it
|
||||
* is 1 after hardware reset, which can then be used as an
|
||||
@ -2572,8 +2549,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
|
||||
*/
|
||||
|
||||
if (!hsfsts.hsf_status.flcinprog) {
|
||||
/*
|
||||
* There is no cycle running at present,
|
||||
/* There is no cycle running at present,
|
||||
* so we can start a cycle.
|
||||
* Begin by setting Flash Cycle Done.
|
||||
*/
|
||||
@ -2583,8 +2559,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
|
||||
} else {
|
||||
s32 i;
|
||||
|
||||
/*
|
||||
* Otherwise poll for sometime so the current
|
||||
/* Otherwise poll for sometime so the current
|
||||
* cycle has a chance to end before giving up.
|
||||
*/
|
||||
for (i = 0; i < ICH_FLASH_READ_COMMAND_TIMEOUT; i++) {
|
||||
@ -2597,8 +2572,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
|
||||
usec_delay(1);
|
||||
}
|
||||
if (ret_val == E1000_SUCCESS) {
|
||||
/*
|
||||
* Successful in waiting for previous cycle to timeout,
|
||||
/* Successful in waiting for previous cycle to timeout,
|
||||
* now set the Flash Cycle Done.
|
||||
*/
|
||||
hsfsts.hsf_status.flcdone = 1;
|
||||
@ -2737,8 +2711,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
|
||||
ret_val = e1000_flash_cycle_ich8lan(hw,
|
||||
ICH_FLASH_READ_COMMAND_TIMEOUT);
|
||||
|
||||
/*
|
||||
* Check if FCERR is set to 1, if set to 1, clear it
|
||||
/* Check if FCERR is set to 1, if set to 1, clear it
|
||||
* and try the whole sequence a few more times, else
|
||||
* read in (shift in) the Flash Data0, the order is
|
||||
* least significant byte first msb to lsb
|
||||
@ -2751,8 +2724,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
|
||||
*data = (u16)(flash_data & 0x0000FFFF);
|
||||
break;
|
||||
} else {
|
||||
/*
|
||||
* If we've gotten here, then things are probably
|
||||
/* If we've gotten here, then things are probably
|
||||
* completely hosed, but if the error condition is
|
||||
* detected, it won't hurt to give it another try...
|
||||
* ICH_FLASH_CYCLE_REPEAT_COUNT times.
|
||||
@ -2838,8 +2810,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
nvm->ops.acquire(hw);
|
||||
|
||||
/*
|
||||
* We're writing to the opposite bank so if we're on bank 1,
|
||||
/* We're writing to the opposite bank so if we're on bank 1,
|
||||
* write to bank 0 etc. We also need to erase the segment that
|
||||
* is going to be written
|
||||
*/
|
||||
@ -2864,8 +2835,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
}
|
||||
|
||||
for (i = 0; i < E1000_SHADOW_RAM_WORDS; i++) {
|
||||
/*
|
||||
* Determine whether to write the value stored
|
||||
/* Determine whether to write the value stored
|
||||
* in the other NVM bank or a modified value stored
|
||||
* in the shadow RAM
|
||||
*/
|
||||
@ -2879,8 +2849,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the word is 0x13, then make sure the signature bits
|
||||
/* If the word is 0x13, then make sure the signature bits
|
||||
* (15:14) are 11b until the commit has completed.
|
||||
* This will allow us to write 10b which indicates the
|
||||
* signature is valid. We want to do this after the write
|
||||
@ -2909,8 +2878,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't bother writing the segment valid bits if sector
|
||||
/* Don't bother writing the segment valid bits if sector
|
||||
* programming failed.
|
||||
*/
|
||||
if (ret_val) {
|
||||
@ -2918,8 +2886,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
goto release;
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally validate the new segment by setting bit 15:14
|
||||
/* Finally validate the new segment by setting bit 15:14
|
||||
* to 10b in word 0x13 , this can be done without an
|
||||
* erase as well since these bits are 11 to start with
|
||||
* and we need to change bit 14 to 0b
|
||||
@ -2936,8 +2903,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
goto release;
|
||||
|
||||
/*
|
||||
* And invalidate the previously valid segment by setting
|
||||
/* And invalidate the previously valid segment by setting
|
||||
* its signature word (0x13) high_byte to 0b. This can be
|
||||
* done without an erase because flash erase sets all bits
|
||||
* to 1's. We can write 1's to 0's without an erase
|
||||
@ -2956,8 +2922,7 @@ STATIC s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
release:
|
||||
nvm->ops.release(hw);
|
||||
|
||||
/*
|
||||
* Reload the EEPROM, or else modifications will not appear
|
||||
/* Reload the EEPROM, or else modifications will not appear
|
||||
* until after the next adapter reset.
|
||||
*/
|
||||
if (!ret_val) {
|
||||
@ -2989,8 +2954,7 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_validate_nvm_checksum_ich8lan");
|
||||
|
||||
/*
|
||||
* Read NVM and check Invalid Image CSUM bit. If this bit is 0,
|
||||
/* Read NVM and check Invalid Image CSUM bit. If this bit is 0,
|
||||
* the checksum needs to be fixed. This bit is an indication that
|
||||
* the NVM was prepared by OEM software and did not calculate
|
||||
* the checksum...a likely scenario.
|
||||
@ -3069,8 +3033,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
|
||||
|
||||
E1000_WRITE_FLASH_REG(hw, ICH_FLASH_FDATA0, flash_data);
|
||||
|
||||
/*
|
||||
* check if FCERR is set to 1 , if set to 1, clear it
|
||||
/* check if FCERR is set to 1 , if set to 1, clear it
|
||||
* and try the whole sequence a few more times else done
|
||||
*/
|
||||
ret_val = e1000_flash_cycle_ich8lan(hw,
|
||||
@ -3078,8 +3041,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
|
||||
if (ret_val == E1000_SUCCESS)
|
||||
break;
|
||||
|
||||
/*
|
||||
* If we're here, then things are most likely
|
||||
/* If we're here, then things are most likely
|
||||
* completely hosed, but if the error condition
|
||||
* is detected, it won't hurt to give it another
|
||||
* try...ICH_FLASH_CYCLE_REPEAT_COUNT times.
|
||||
@ -3173,8 +3135,7 @@ STATIC s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
|
||||
|
||||
hsfsts.regval = E1000_READ_FLASH_REG16(hw, ICH_FLASH_HSFSTS);
|
||||
|
||||
/*
|
||||
* Determine HW Sector size: Read BERASE bits of hw flash status
|
||||
/* Determine HW Sector size: Read BERASE bits of hw flash status
|
||||
* register
|
||||
* 00: The Hw sector is 256 bytes, hence we need to erase 16
|
||||
* consecutive sectors. The start index for the nth Hw sector
|
||||
@ -3219,8 +3180,7 @@ STATIC s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Write a value 11 (block Erase) in Flash
|
||||
/* Write a value 11 (block Erase) in Flash
|
||||
* Cycle field in hw flash control
|
||||
*/
|
||||
hsflctl.regval = E1000_READ_FLASH_REG16(hw,
|
||||
@ -3229,8 +3189,7 @@ STATIC s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
|
||||
E1000_WRITE_FLASH_REG16(hw, ICH_FLASH_HSFCTL,
|
||||
hsflctl.regval);
|
||||
|
||||
/*
|
||||
* Write the last 24 bits of an index within the
|
||||
/* Write the last 24 bits of an index within the
|
||||
* block into Flash Linear address field in Flash
|
||||
* Address.
|
||||
*/
|
||||
@ -3243,8 +3202,7 @@ STATIC s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
|
||||
if (ret_val == E1000_SUCCESS)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Check if FCERR is set to 1. If 1,
|
||||
/* Check if FCERR is set to 1. If 1,
|
||||
* clear it and try the whole sequence
|
||||
* a few more times else Done
|
||||
*/
|
||||
@ -3378,8 +3336,7 @@ STATIC s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
ret_val = e1000_get_bus_info_pcie_generic(hw);
|
||||
|
||||
/*
|
||||
* ICH devices are "PCI Express"-ish. They have
|
||||
/* ICH devices are "PCI Express"-ish. They have
|
||||
* a configuration space, but do not contain
|
||||
* PCI Express Capability registers, so bus width
|
||||
* must be hardcoded.
|
||||
@ -3406,8 +3363,7 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_reset_hw_ich8lan");
|
||||
|
||||
/*
|
||||
* Prevent the PCI-E bus from sticking if there is no TLP connection
|
||||
/* Prevent the PCI-E bus from sticking if there is no TLP connection
|
||||
* on the last TLP read/write transaction when MAC is reset.
|
||||
*/
|
||||
ret_val = e1000_disable_pcie_master_generic(hw);
|
||||
@ -3417,8 +3373,7 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
|
||||
DEBUGOUT("Masking off all interrupts\n");
|
||||
E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
|
||||
|
||||
/*
|
||||
* Disable the Transmit and Receive units. Then delay to allow
|
||||
/* Disable the Transmit and Receive units. Then delay to allow
|
||||
* any pending transactions to complete before we hit the MAC
|
||||
* with the global reset.
|
||||
*/
|
||||
@ -3451,15 +3406,13 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
|
||||
ctrl = E1000_READ_REG(hw, E1000_CTRL);
|
||||
|
||||
if (!hw->phy.ops.check_reset_block(hw)) {
|
||||
/*
|
||||
* Full-chip reset requires MAC and PHY reset at the same
|
||||
/* Full-chip reset requires MAC and PHY reset at the same
|
||||
* time to make sure the interface between MAC and the
|
||||
* external PHY is reset.
|
||||
*/
|
||||
ctrl |= E1000_CTRL_PHY_RST;
|
||||
|
||||
/*
|
||||
* Gate automatic PHY configuration by hardware on
|
||||
/* Gate automatic PHY configuration by hardware on
|
||||
* non-managed 82579
|
||||
*/
|
||||
if ((hw->mac.type == e1000_pch2lan) &&
|
||||
@ -3493,8 +3446,7 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* For PCH, this write will make sure that any noise
|
||||
/* For PCH, this write will make sure that any noise
|
||||
* will be detected as a CRC error and be dropped rather than show up
|
||||
* as a bad packet to the DMA engine.
|
||||
*/
|
||||
@ -3548,8 +3500,7 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
|
||||
for (i = 0; i < mac->mta_reg_count; i++)
|
||||
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
|
||||
|
||||
/*
|
||||
* The 82578 Rx buffer will stall if wakeup is enabled in host and
|
||||
/* The 82578 Rx buffer will stall if wakeup is enabled in host and
|
||||
* the ME. Disable wakeup by clearing the host wakeup bit.
|
||||
* Reset the phy after disabling host wakeup to reset the Rx buffer.
|
||||
*/
|
||||
@ -3579,8 +3530,7 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
|
||||
E1000_TXDCTL_MAX_TX_DESC_PREFETCH;
|
||||
E1000_WRITE_REG(hw, E1000_TXDCTL(1), txdctl);
|
||||
|
||||
/*
|
||||
* ICH8 has opposite polarity of no_snoop bits.
|
||||
/* ICH8 has opposite polarity of no_snoop bits.
|
||||
* By default, we should use snoop behavior.
|
||||
*/
|
||||
if (mac->type == e1000_ich8lan)
|
||||
@ -3593,8 +3543,7 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
|
||||
ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
|
||||
E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
|
||||
|
||||
/*
|
||||
* Clear all of the statistics registers (clear on read). It is
|
||||
/* Clear all of the statistics registers (clear on read). It is
|
||||
* important that we do this after we have tried to establish link
|
||||
* because the symbol error count will increment wildly if there
|
||||
* is no link.
|
||||
@ -3658,14 +3607,13 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
|
||||
E1000_WRITE_REG(hw, E1000_STATUS, reg);
|
||||
}
|
||||
|
||||
/*
|
||||
* work-around descriptor data corruption issue during nfs v2 udp
|
||||
/* work-around descriptor data corruption issue during nfs v2 udp
|
||||
* traffic, just disable the nfs filtering capability
|
||||
*/
|
||||
reg = E1000_READ_REG(hw, E1000_RFCTL);
|
||||
reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS);
|
||||
/*
|
||||
* Disable IPv6 extension header parsing because some malformed
|
||||
|
||||
/* Disable IPv6 extension header parsing because some malformed
|
||||
* IPv6 headers can hang the Rx.
|
||||
*/
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
@ -3694,16 +3642,14 @@ STATIC s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
|
||||
if (hw->phy.ops.check_reset_block(hw))
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* ICH parts do not have a word in the NVM to determine
|
||||
/* ICH parts do not have a word in the NVM to determine
|
||||
* the default flow control setting, so we explicitly
|
||||
* set it to full.
|
||||
*/
|
||||
if (hw->fc.requested_mode == e1000_fc_default)
|
||||
hw->fc.requested_mode = e1000_fc_full;
|
||||
|
||||
/*
|
||||
* Save off the requested flow control mode for use later. Depending
|
||||
/* Save off the requested flow control mode for use later. Depending
|
||||
* on the link partner's capabilities, we may or may not use this mode.
|
||||
*/
|
||||
hw->fc.current_mode = hw->fc.requested_mode;
|
||||
@ -3754,8 +3700,7 @@ STATIC s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
|
||||
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
|
||||
E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
|
||||
|
||||
/*
|
||||
* Set the mac to wait the maximum time between each iteration
|
||||
/* Set the mac to wait the maximum time between each iteration
|
||||
* and increase the max iterations when polling the phy;
|
||||
* this fixes erroneous timeouts at 10Mbps.
|
||||
*/
|
||||
@ -3884,8 +3829,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
|
||||
if (!dev_spec->kmrn_lock_loss_workaround_enabled)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* Make sure link is up before proceeding. If not just return.
|
||||
/* Make sure link is up before proceeding. If not just return.
|
||||
* Attempting this while link is negotiating fouled up link
|
||||
* stability
|
||||
*/
|
||||
@ -3917,8 +3861,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
|
||||
E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
|
||||
E1000_WRITE_REG(hw, E1000_PHY_CTRL, phy_ctrl);
|
||||
|
||||
/*
|
||||
* Call gig speed drop workaround on Gig disable before accessing
|
||||
/* Call gig speed drop workaround on Gig disable before accessing
|
||||
* any PHY registers
|
||||
*/
|
||||
e1000_gig_downshift_workaround_ich8lan(hw);
|
||||
@ -3981,8 +3924,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
|
||||
E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
|
||||
E1000_WRITE_REG(hw, E1000_PHY_CTRL, reg);
|
||||
|
||||
/*
|
||||
* Call gig speed drop workaround on Gig disable before
|
||||
/* Call gig speed drop workaround on Gig disable before
|
||||
* accessing any PHY registers
|
||||
*/
|
||||
if (hw->mac.type == e1000_ich8lan)
|
||||
@ -4085,8 +4027,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
goto release;
|
||||
|
||||
/*
|
||||
* Disable LPLU if both link partners support 100BaseT
|
||||
/* Disable LPLU if both link partners support 100BaseT
|
||||
* EEE and 100Full is advertised on both ends of the
|
||||
* link.
|
||||
*/
|
||||
@ -4098,8 +4039,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
|
||||
E1000_PHY_CTRL_NOND0A_LPLU);
|
||||
}
|
||||
|
||||
/*
|
||||
* For i217 Intel Rapid Start Technology support,
|
||||
/* For i217 Intel Rapid Start Technology support,
|
||||
* when the system is going into Sx and no manageability engine
|
||||
* is present, the driver must configure proxy to reset only on
|
||||
* power good. LPI (Low Power Idle) state must also reset only
|
||||
@ -4116,8 +4056,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
|
||||
hw->phy.ops.write_reg_locked(hw, I217_PROXY_CTRL,
|
||||
phy_reg);
|
||||
|
||||
/*
|
||||
* Set bit enable LPI (EEE) to reset only on
|
||||
/* Set bit enable LPI (EEE) to reset only on
|
||||
* power good.
|
||||
*/
|
||||
hw->phy.ops.read_reg_locked(hw, I217_SxCTRL, &phy_reg);
|
||||
@ -4130,8 +4069,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
|
||||
hw->phy.ops.write_reg_locked(hw, I217_MEMPWR, phy_reg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable MTA to reset for Intel Rapid Start Technology
|
||||
/* Enable MTA to reset for Intel Rapid Start Technology
|
||||
* Support
|
||||
*/
|
||||
hw->phy.ops.read_reg_locked(hw, I217_CGFREG, &phy_reg);
|
||||
@ -4189,8 +4127,7 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* For i217 Intel Rapid Start Technology support when the system
|
||||
/* For i217 Intel Rapid Start Technology support when the system
|
||||
* is transitioning from Sx and no manageability engine is present
|
||||
* configure SMBus to restore on reset, disable proxy, and enable
|
||||
* the reset on MTA (Multicast table array).
|
||||
@ -4206,8 +4143,7 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
|
||||
|
||||
if (!(E1000_READ_REG(hw, E1000_FWSM) &
|
||||
E1000_ICH_FWSM_FW_VALID)) {
|
||||
/*
|
||||
* Restore clear on SMB if no manageability engine
|
||||
/* Restore clear on SMB if no manageability engine
|
||||
* is present
|
||||
*/
|
||||
ret_val = hw->phy.ops.read_reg_locked(hw, I217_MEMPWR,
|
||||
@ -4329,8 +4265,7 @@ STATIC s32 e1000_led_on_pchlan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_led_on_pchlan");
|
||||
|
||||
/*
|
||||
* If no link, then turn LED on by setting the invert bit
|
||||
/* If no link, then turn LED on by setting the invert bit
|
||||
* for each LED that's mode is "link_up" in ledctl_mode2.
|
||||
*/
|
||||
if (!(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
|
||||
@ -4362,8 +4297,7 @@ STATIC s32 e1000_led_off_pchlan(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_led_off_pchlan");
|
||||
|
||||
/*
|
||||
* If no link, then turn LED off by clearing the invert bit
|
||||
/* If no link, then turn LED off by clearing the invert bit
|
||||
* for each LED that's mode is "link_up" in ledctl_mode1.
|
||||
*/
|
||||
if (!(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) {
|
||||
@ -4410,8 +4344,7 @@ STATIC s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
|
||||
} else {
|
||||
ret_val = e1000_get_auto_rd_done_generic(hw);
|
||||
if (ret_val) {
|
||||
/*
|
||||
* When auto config read does not complete, do not
|
||||
/* When auto config read does not complete, do not
|
||||
* return with an error. This can happen in situations
|
||||
* where there is no eeprom and prevents getting link.
|
||||
*/
|
||||
|
@ -267,8 +267,7 @@ STATIC void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw)
|
||||
struct e1000_bus_info *bus = &hw->bus;
|
||||
u32 reg;
|
||||
|
||||
/*
|
||||
* The status register reports the correct function number
|
||||
/* The status register reports the correct function number
|
||||
* for the device regardless of function swap state.
|
||||
*/
|
||||
reg = E1000_READ_REG(hw, E1000_STATUS);
|
||||
@ -402,8 +401,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
|
||||
if ((hw->mac.type < e1000_82571) || (hw->mac.type == e1000_82573))
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* Alternate MAC address is handled by the option ROM for 82580
|
||||
/* Alternate MAC address is handled by the option ROM for 82580
|
||||
* and newer. SW support not required.
|
||||
*/
|
||||
if (hw->mac.type >= e1000_82580)
|
||||
@ -446,8 +444,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* We have a valid alternate MAC address, and we want to treat it the
|
||||
/* We have a valid alternate MAC address, and we want to treat it the
|
||||
* same as the normal permanent MAC address stored by the HW into the
|
||||
* RAR. Do this by mapping this address into RAR0.
|
||||
*/
|
||||
@ -471,8 +468,7 @@ STATIC void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
|
||||
|
||||
DEBUGFUNC("e1000_rar_set_generic");
|
||||
|
||||
/*
|
||||
* HW expects these in little endian so we reverse the byte order
|
||||
/* 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) |
|
||||
@ -484,8 +480,7 @@ STATIC void e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
|
||||
if (rar_low || rar_high)
|
||||
rar_high |= E1000_RAH_AV;
|
||||
|
||||
/*
|
||||
* Some bridges will combine consecutive 32-bit writes into
|
||||
/* Some bridges will combine consecutive 32-bit writes into
|
||||
* a single burst write, which will malfunction on some parts.
|
||||
* The flushes avoid this.
|
||||
*/
|
||||
@ -513,15 +508,13 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
|
||||
/* Register count multiplied by bits per register */
|
||||
hash_mask = (hw->mac.mta_reg_count * 32) - 1;
|
||||
|
||||
/*
|
||||
* For a mc_filter_type of 0, bit_shift is the number of left-shifts
|
||||
/* For a mc_filter_type of 0, bit_shift is the number of left-shifts
|
||||
* where 0xFF would still fall within the hash mask.
|
||||
*/
|
||||
while (hash_mask >> bit_shift != 0xFF)
|
||||
bit_shift++;
|
||||
|
||||
/*
|
||||
* The portion of the address that is used for the hash table
|
||||
/* The portion of the address that is used for the hash table
|
||||
* is determined by the mc_filter_type setting.
|
||||
* The algorithm is such that there is a total of 8 bits of shifting.
|
||||
* The bit_shift for a mc_filter_type of 0 represents the number of
|
||||
@ -706,8 +699,7 @@ s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_check_for_copper_link");
|
||||
|
||||
/*
|
||||
* We only want to go out to the PHY registers to see if Auto-Neg
|
||||
/* We only want to go out to the PHY registers to see if Auto-Neg
|
||||
* has completed and/or if our link status has changed. The
|
||||
* get_link_status flag is set upon receiving a Link Status
|
||||
* Change or Rx Sequence Error interrupt.
|
||||
@ -715,8 +707,7 @@ s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw)
|
||||
if (!mac->get_link_status)
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* First we want to see if the MII Status Register reports
|
||||
/* First we want to see if the MII Status Register reports
|
||||
* link. If so, then we want to get the current speed/duplex
|
||||
* of the PHY.
|
||||
*/
|
||||
@ -729,28 +720,24 @@ s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw)
|
||||
|
||||
mac->get_link_status = false;
|
||||
|
||||
/*
|
||||
* Check if there was DownShift, must be checked
|
||||
/* Check if there was DownShift, must be checked
|
||||
* immediately after link-up
|
||||
*/
|
||||
e1000_check_downshift_generic(hw);
|
||||
|
||||
/*
|
||||
* If we are forcing speed/duplex, then we simply return since
|
||||
/* If we are forcing speed/duplex, then we simply return since
|
||||
* we have already determined whether we have link or not.
|
||||
*/
|
||||
if (!mac->autoneg)
|
||||
return -E1000_ERR_CONFIG;
|
||||
|
||||
/*
|
||||
* Auto-Neg is enabled. Auto Speed Detection takes care
|
||||
/* Auto-Neg is enabled. Auto Speed Detection takes care
|
||||
* of MAC speed/duplex configuration. So we only need to
|
||||
* configure Collision Distance in the MAC.
|
||||
*/
|
||||
mac->ops.config_collision_dist(hw);
|
||||
|
||||
/*
|
||||
* Configure Flow Control now that Auto-Neg has completed.
|
||||
/* Configure Flow Control now that Auto-Neg has completed.
|
||||
* First, we need to restore the desired flow control
|
||||
* settings because we may have had to re-autoneg with a
|
||||
* different link partner.
|
||||
@ -783,8 +770,7 @@ s32 e1000_check_for_fiber_link_generic(struct e1000_hw *hw)
|
||||
status = E1000_READ_REG(hw, E1000_STATUS);
|
||||
rxcw = E1000_READ_REG(hw, E1000_RXCW);
|
||||
|
||||
/*
|
||||
* If we don't have link (auto-negotiation failed or link partner
|
||||
/* If we don't have link (auto-negotiation failed or link partner
|
||||
* cannot auto-negotiate), the cable is plugged in (we have signal),
|
||||
* and our link partner is not trying to auto-negotiate with us (we
|
||||
* are receiving idles or data), we need to force link up. We also
|
||||
@ -815,8 +801,7 @@ s32 e1000_check_for_fiber_link_generic(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
|
||||
/*
|
||||
* If we are forcing link and we are receiving /C/ ordered
|
||||
/* If we are forcing link and we are receiving /C/ ordered
|
||||
* sets, re-enable auto-negotiation in the TXCW register
|
||||
* and disable forced link in the Device Control register
|
||||
* in an attempt to auto-negotiate with our link partner.
|
||||
@ -852,8 +837,7 @@ s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
|
||||
status = E1000_READ_REG(hw, E1000_STATUS);
|
||||
rxcw = E1000_READ_REG(hw, E1000_RXCW);
|
||||
|
||||
/*
|
||||
* If we don't have link (auto-negotiation failed or link partner
|
||||
/* If we don't have link (auto-negotiation failed or link partner
|
||||
* cannot auto-negotiate), and our link partner is not trying to
|
||||
* auto-negotiate with us (we are receiving idles or data),
|
||||
* we need to force link up. We also need to give auto-negotiation
|
||||
@ -882,8 +866,7 @@ s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
|
||||
/*
|
||||
* If we are forcing link and we are receiving /C/ ordered
|
||||
/* If we are forcing link and we are receiving /C/ ordered
|
||||
* sets, re-enable auto-negotiation in the TXCW register
|
||||
* and disable forced link in the Device Control register
|
||||
* in an attempt to auto-negotiate with our link partner.
|
||||
@ -894,8 +877,7 @@ s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
|
||||
|
||||
mac->serdes_has_link = true;
|
||||
} else if (!(E1000_TXCW_ANE & E1000_READ_REG(hw, E1000_TXCW))) {
|
||||
/*
|
||||
* If we force link for non-auto-negotiation switch, check
|
||||
/* If we force link for non-auto-negotiation switch, check
|
||||
* link status based on MAC synchronization for internal
|
||||
* serdes media type.
|
||||
*/
|
||||
@ -954,8 +936,7 @@ s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_set_default_fc_generic");
|
||||
|
||||
/*
|
||||
* Read and store word 0x0F of the EEPROM. This word contains bits
|
||||
/* Read and store word 0x0F of the EEPROM. This word contains bits
|
||||
* that determine the hardware's default PAUSE (flow control) mode,
|
||||
* a bit that determines whether the HW defaults to enabling or
|
||||
* disabling auto-negotiation, and the direction of the
|
||||
@ -997,15 +978,13 @@ s32 e1000_setup_link_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_setup_link_generic");
|
||||
|
||||
/*
|
||||
* In the case of the phy reset being blocked, we already have a link.
|
||||
/* In the case of the phy reset being blocked, we already have a link.
|
||||
* We do not need to set it up again.
|
||||
*/
|
||||
if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw))
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/*
|
||||
* If requested flow control is set to default, set flow control
|
||||
/* If requested flow control is set to default, set flow control
|
||||
* based on the EEPROM flow control settings.
|
||||
*/
|
||||
if (hw->fc.requested_mode == e1000_fc_default) {
|
||||
@ -1014,8 +993,7 @@ s32 e1000_setup_link_generic(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Save off the requested flow control mode for use later. Depending
|
||||
/* Save off the requested flow control mode for use later. Depending
|
||||
* on the link partner's capabilities, we may or may not use this mode.
|
||||
*/
|
||||
hw->fc.current_mode = hw->fc.requested_mode;
|
||||
@ -1028,8 +1006,7 @@ s32 e1000_setup_link_generic(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Initialize the flow control address, type, and PAUSE timer
|
||||
/* Initialize the flow control address, type, and PAUSE timer
|
||||
* registers to their default values. This is done even if flow
|
||||
* control is disabled, because it does not hurt anything to
|
||||
* initialize these registers.
|
||||
@ -1058,8 +1035,7 @@ s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_commit_fc_settings_generic");
|
||||
|
||||
/*
|
||||
* Check for a software override of the flow control settings, and
|
||||
/* Check for a software override of the flow control settings, and
|
||||
* setup the device accordingly. If auto-negotiation is enabled, then
|
||||
* software will have to set the "PAUSE" bits to the correct value in
|
||||
* the Transmit Config Word Register (TXCW) and re-start auto-
|
||||
@ -1081,8 +1057,7 @@ s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
|
||||
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD);
|
||||
break;
|
||||
case e1000_fc_rx_pause:
|
||||
/*
|
||||
* Rx Flow control is enabled and Tx Flow control is disabled
|
||||
/* Rx Flow control is enabled and Tx Flow control is disabled
|
||||
* by a software over-ride. Since there really isn't a way to
|
||||
* advertise that we are capable of Rx Pause ONLY, we will
|
||||
* advertise that we support both symmetric and asymmetric Rx
|
||||
@ -1092,15 +1067,13 @@ s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
|
||||
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
|
||||
break;
|
||||
case e1000_fc_tx_pause:
|
||||
/*
|
||||
* Tx Flow control is enabled, and Rx Flow control is disabled,
|
||||
/* Tx Flow control is enabled, and Rx Flow control is disabled,
|
||||
* by a software over-ride.
|
||||
*/
|
||||
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR);
|
||||
break;
|
||||
case e1000_fc_full:
|
||||
/*
|
||||
* Flow control (both Rx and Tx) is enabled by a software
|
||||
/* Flow control (both Rx and Tx) is enabled by a software
|
||||
* over-ride.
|
||||
*/
|
||||
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
|
||||
@ -1132,8 +1105,7 @@ s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_poll_fiber_serdes_link_generic");
|
||||
|
||||
/*
|
||||
* If we have a signal (the cable is plugged in, or assumed true for
|
||||
/* If we have a signal (the cable is plugged in, or assumed true for
|
||||
* serdes media) then poll for a "Link-Up" indication in the Device
|
||||
* Status Register. Time-out if a link isn't seen in 500 milliseconds
|
||||
* seconds (Auto-negotiation should complete in less than 500
|
||||
@ -1148,8 +1120,7 @@ s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
|
||||
if (i == FIBER_LINK_UP_LIMIT) {
|
||||
DEBUGOUT("Never got a valid link from auto-neg!!!\n");
|
||||
mac->autoneg_failed = true;
|
||||
/*
|
||||
* AutoNeg failed to achieve a link, so we'll call
|
||||
/* AutoNeg failed to achieve a link, so we'll call
|
||||
* mac->check_for_link. This routine will force the
|
||||
* link up if we detect a signal. This will allow us to
|
||||
* communicate with non-autonegotiating link partners.
|
||||
@ -1193,8 +1164,7 @@ s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Since auto-negotiation is enabled, take the link out of reset (the
|
||||
/* Since auto-negotiation is enabled, take the link out of reset (the
|
||||
* link will be in reset, because we previously reset the chip). This
|
||||
* will restart auto-negotiation. If auto-negotiation is successful
|
||||
* then the link-up status bit will be set and the flow control enable
|
||||
@ -1206,8 +1176,7 @@ s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw)
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
msec_delay(1);
|
||||
|
||||
/*
|
||||
* For these adapters, the SW definable pin 1 is set when the optics
|
||||
/* For these adapters, the SW definable pin 1 is set when the optics
|
||||
* detect a signal. If we have a signal, then poll for a "Link-Up"
|
||||
* indication.
|
||||
*/
|
||||
@ -1257,16 +1226,14 @@ s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_set_fc_watermarks_generic");
|
||||
|
||||
/*
|
||||
* Set the flow control receive threshold registers. Normally,
|
||||
/* Set the flow control receive threshold registers. Normally,
|
||||
* these registers will be set to a default threshold that may be
|
||||
* adjusted later by the driver's runtime code. However, if the
|
||||
* ability to transmit pause frames is not enabled, then these
|
||||
* registers will be set to 0.
|
||||
*/
|
||||
if (hw->fc.current_mode & e1000_fc_tx_pause) {
|
||||
/*
|
||||
* We need to set up the Receive Threshold high and low water
|
||||
/* We need to set up the Receive Threshold high and low water
|
||||
* marks as well as (optionally) enabling the transmission of
|
||||
* XON frames.
|
||||
*/
|
||||
@ -1300,8 +1267,7 @@ s32 e1000_force_mac_fc_generic(struct e1000_hw *hw)
|
||||
|
||||
ctrl = E1000_READ_REG(hw, E1000_CTRL);
|
||||
|
||||
/*
|
||||
* Because we didn't get link via the internal auto-negotiation
|
||||
/* Because we didn't get link via the internal auto-negotiation
|
||||
* mechanism (we either forced link or we got link via PHY
|
||||
* auto-neg), we have to manually enable/disable transmit an
|
||||
* receive flow control.
|
||||
@ -1365,8 +1331,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_config_fc_after_link_up_generic");
|
||||
|
||||
/*
|
||||
* Check for the case where we have fiber media and auto-neg failed
|
||||
/* Check for the case where we have fiber media and auto-neg failed
|
||||
* so we had to force link. In this case, we need to force the
|
||||
* configuration of the MAC to match the "fc" parameter.
|
||||
*/
|
||||
@ -1384,15 +1349,13 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for the case where we have copper media and auto-neg is
|
||||
/* Check for the case where we have copper media and auto-neg is
|
||||
* enabled. In this case, we need to check and see if Auto-Neg
|
||||
* has completed, and if so, how the PHY and link partner has
|
||||
* flow control configured.
|
||||
*/
|
||||
if ((hw->phy.media_type == e1000_media_type_copper) && mac->autoneg) {
|
||||
/*
|
||||
* Read the MII Status Register and check to see if AutoNeg
|
||||
/* Read the MII Status Register and check to see if AutoNeg
|
||||
* has completed. We read this twice because this reg has
|
||||
* some "sticky" (latched) bits.
|
||||
*/
|
||||
@ -1408,8 +1371,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* The AutoNeg process has completed, so we now need to
|
||||
/* The AutoNeg process has completed, so we now need to
|
||||
* read both the Auto Negotiation Advertisement
|
||||
* Register (Address 4) and the Auto_Negotiation Base
|
||||
* Page Ability Register (Address 5) to determine how
|
||||
@ -1424,8 +1386,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Two bits in the Auto Negotiation Advertisement Register
|
||||
/* Two bits in the Auto Negotiation Advertisement Register
|
||||
* (Address 4) and two bits in the Auto Negotiation Base
|
||||
* Page Ability Register (Address 5) determine flow control
|
||||
* for both the PHY and the link partner. The following
|
||||
@ -1460,8 +1421,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
*/
|
||||
if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
|
||||
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE)) {
|
||||
/*
|
||||
* Now we need to check if the user selected Rx ONLY
|
||||
/* Now we need to check if the user selected Rx ONLY
|
||||
* 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
|
||||
@ -1475,8 +1435,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\n");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* For receiving PAUSE frames ONLY.
|
||||
/* For receiving PAUSE frames ONLY.
|
||||
*
|
||||
* LOCAL DEVICE | LINK PARTNER
|
||||
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
|
||||
@ -1490,8 +1449,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
hw->fc.current_mode = e1000_fc_tx_pause;
|
||||
DEBUGOUT("Flow Control = Tx PAUSE frames only.\n");
|
||||
}
|
||||
/*
|
||||
* For transmitting PAUSE frames ONLY.
|
||||
/* For transmitting PAUSE frames ONLY.
|
||||
*
|
||||
* LOCAL DEVICE | LINK PARTNER
|
||||
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
|
||||
@ -1505,16 +1463,14 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
hw->fc.current_mode = e1000_fc_rx_pause;
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\n");
|
||||
} else {
|
||||
/*
|
||||
* Per the IEEE spec, at this point flow control
|
||||
/* Per the IEEE spec, at this point flow control
|
||||
* should be disabled.
|
||||
*/
|
||||
hw->fc.current_mode = e1000_fc_none;
|
||||
DEBUGOUT("Flow Control = NONE.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we need to do one last check... If we auto-
|
||||
/* Now we need to do one last check... If we auto-
|
||||
* negotiated to HALF DUPLEX, flow control should not be
|
||||
* enabled per IEEE 802.3 spec.
|
||||
*/
|
||||
@ -1527,8 +1483,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
if (duplex == HALF_DUPLEX)
|
||||
hw->fc.current_mode = e1000_fc_none;
|
||||
|
||||
/*
|
||||
* Now we call a subroutine to actually force the MAC
|
||||
/* Now we call a subroutine to actually force the MAC
|
||||
* controller to use the correct flow control settings.
|
||||
*/
|
||||
ret_val = e1000_force_mac_fc_generic(hw);
|
||||
@ -1538,8 +1493,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for the case where we have SerDes media and auto-neg is
|
||||
/* Check for the case where we have SerDes media and auto-neg is
|
||||
* enabled. In this case, we need to check and see if Auto-Neg
|
||||
* has completed, and if so, how the PHY and link partner has
|
||||
* flow control configured.
|
||||
@ -1557,8 +1511,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* The AutoNeg process has completed, so we now need to
|
||||
/* The AutoNeg process has completed, so we now need to
|
||||
* read both the Auto Negotiation Advertisement
|
||||
* Register (PCS_ANADV) and the Auto_Negotiation Base
|
||||
* Page Ability Register (PCS_LPAB) to determine how
|
||||
@ -1567,8 +1520,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
pcs_adv_reg = E1000_READ_REG(hw, E1000_PCS_ANADV);
|
||||
pcs_lp_ability_reg = E1000_READ_REG(hw, E1000_PCS_LPAB);
|
||||
|
||||
/*
|
||||
* Two bits in the Auto Negotiation Advertisement Register
|
||||
/* Two bits in the Auto Negotiation Advertisement Register
|
||||
* (PCS_ANADV) and two bits in the Auto Negotiation Base
|
||||
* Page Ability Register (PCS_LPAB) determine flow control
|
||||
* for both the PHY and the link partner. The following
|
||||
@ -1603,8 +1555,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
*/
|
||||
if ((pcs_adv_reg & E1000_TXCW_PAUSE) &&
|
||||
(pcs_lp_ability_reg & E1000_TXCW_PAUSE)) {
|
||||
/*
|
||||
* Now we need to check if the user selected Rx ONLY
|
||||
/* Now we need to check if the user selected Rx ONLY
|
||||
* 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
|
||||
@ -1618,8 +1569,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\n");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* For receiving PAUSE frames ONLY.
|
||||
/* For receiving PAUSE frames ONLY.
|
||||
*
|
||||
* LOCAL DEVICE | LINK PARTNER
|
||||
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
|
||||
@ -1633,8 +1583,7 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
hw->fc.current_mode = e1000_fc_tx_pause;
|
||||
DEBUGOUT("Flow Control = Tx PAUSE frames only.\n");
|
||||
}
|
||||
/*
|
||||
* For transmitting PAUSE frames ONLY.
|
||||
/* For transmitting PAUSE frames ONLY.
|
||||
*
|
||||
* LOCAL DEVICE | LINK PARTNER
|
||||
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
|
||||
@ -1648,16 +1597,14 @@ s32 e1000_config_fc_after_link_up_generic(struct e1000_hw *hw)
|
||||
hw->fc.current_mode = e1000_fc_rx_pause;
|
||||
DEBUGOUT("Flow Control = Rx PAUSE frames only.\n");
|
||||
} else {
|
||||
/*
|
||||
* Per the IEEE spec, at this point flow control
|
||||
/* Per the IEEE spec, at this point flow control
|
||||
* should be disabled.
|
||||
*/
|
||||
hw->fc.current_mode = e1000_fc_none;
|
||||
DEBUGOUT("Flow Control = NONE.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we call a subroutine to actually force the MAC
|
||||
/* Now we call a subroutine to actually force the MAC
|
||||
* controller to use the correct flow control settings.
|
||||
*/
|
||||
pcs_ctrl_reg = E1000_READ_REG(hw, E1000_PCS_LCTL);
|
||||
|
@ -144,8 +144,7 @@ bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw)
|
||||
return hw->mac.tx_pkt_filtering;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we can't read from the host interface for whatever
|
||||
/* If we can't read from the host interface for whatever
|
||||
* reason, disable filtering.
|
||||
*/
|
||||
ret_val = hw->mac.ops.mng_enable_host_if(hw);
|
||||
@ -164,8 +163,7 @@ bool e1000_enable_tx_pkt_filtering_generic(struct e1000_hw *hw)
|
||||
hdr->checksum = 0;
|
||||
csum = e1000_calculate_checksum((u8 *)hdr,
|
||||
E1000_MNG_DHCP_COOKIE_LENGTH);
|
||||
/*
|
||||
* If either the checksums or signature don't match, then
|
||||
/* If either the checksums or signature don't match, then
|
||||
* the cookie area isn't considered valid, in which case we
|
||||
* take the safe route of assuming Tx filtering is enabled.
|
||||
*/
|
||||
@ -258,8 +256,7 @@ s32 e1000_mng_host_if_write_generic(struct e1000_hw *hw, u8 *buffer,
|
||||
/* Calculate length in DWORDs */
|
||||
length >>= 2;
|
||||
|
||||
/*
|
||||
* The device driver writes the relevant command block into the
|
||||
/* The device driver writes the relevant command block into the
|
||||
* ram area.
|
||||
*/
|
||||
for (i = 0; i < length; i++) {
|
||||
@ -423,8 +420,7 @@ s32 e1000_host_interface_command(struct e1000_hw *hw, u8 *buffer, u32 length)
|
||||
/* Calculate length in DWORDs */
|
||||
length >>= 2;
|
||||
|
||||
/*
|
||||
* The device driver writes the relevant command block
|
||||
/* The device driver writes the relevant command block
|
||||
* into the ram area.
|
||||
*/
|
||||
for (i = 0; i < length; i++)
|
||||
@ -536,8 +532,7 @@ s32 e1000_load_firmware(struct e1000_hw *hw, u8 *buffer, u32 length)
|
||||
/* Calculate length in DWORDs */
|
||||
length >>= 2;
|
||||
|
||||
/*
|
||||
* The device driver writes the relevant FW code block
|
||||
/* The device driver writes the relevant FW code block
|
||||
* into the ram area in DWORDs via 1kB ram addressing window.
|
||||
*/
|
||||
for (i = 0; i < length; i++) {
|
||||
|
@ -396,8 +396,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
usec_delay(1);
|
||||
|
||||
/*
|
||||
* Read "Status Register" repeatedly until the LSB is cleared.
|
||||
/* Read "Status Register" repeatedly until the LSB is cleared.
|
||||
* The EEPROM will signal that the command has been completed
|
||||
* by clearing bit 0 of the internal status register. If it's
|
||||
* not cleared within 'timeout', then error out.
|
||||
@ -442,8 +441,7 @@ s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
|
||||
DEBUGFUNC("e1000_read_nvm_spi");
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
@ -469,8 +467,7 @@ s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
e1000_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits);
|
||||
e1000_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits);
|
||||
|
||||
/*
|
||||
* Read the data. SPI NVMs increment the address with each byte
|
||||
/* Read the data. SPI NVMs increment the address with each byte
|
||||
* read and will roll over if reading beyond the end. This allows
|
||||
* us to read the whole NVM from any offset
|
||||
*/
|
||||
@ -504,8 +501,7 @@ s32 e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
|
||||
DEBUGFUNC("e1000_read_nvm_microwire");
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
@ -528,8 +524,7 @@ s32 e1000_read_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
e1000_shift_out_eec_bits(hw, (u16)(offset + i),
|
||||
nvm->address_bits);
|
||||
|
||||
/*
|
||||
* Read the data. For microwire, each word requires the
|
||||
/* Read the data. For microwire, each word requires the
|
||||
* overhead of setup and tear-down.
|
||||
*/
|
||||
data[i] = e1000_shift_in_eec_bits(hw, 16);
|
||||
@ -559,8 +554,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
|
||||
DEBUGFUNC("e1000_read_nvm_eerd");
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* too many words for the offset, and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
@ -605,8 +599,7 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
|
||||
DEBUGFUNC("e1000_write_nvm_spi");
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
@ -636,8 +629,7 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
|
||||
|
||||
e1000_standby_nvm(hw);
|
||||
|
||||
/*
|
||||
* Some SPI eeproms use the 8th address bit embedded in the
|
||||
/* Some SPI eeproms use the 8th address bit embedded in the
|
||||
* opcode
|
||||
*/
|
||||
if ((nvm->address_bits == 8) && (offset >= 128))
|
||||
@ -690,8 +682,7 @@ s32 e1000_write_nvm_microwire(struct e1000_hw *hw, u16 offset, u16 words,
|
||||
|
||||
DEBUGFUNC("e1000_write_nvm_microwire");
|
||||
|
||||
/*
|
||||
* A check for invalid values: offset too large, too many words,
|
||||
/* A check for invalid values: offset too large, too many words,
|
||||
* and not enough words.
|
||||
*/
|
||||
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
|
||||
@ -792,8 +783,7 @@ s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* if nvm_data is not ptr guard the PBA must be in legacy format which
|
||||
/* if nvm_data is not ptr guard the PBA must be in legacy format which
|
||||
* means pba_ptr is actually our second data word for the PBA number
|
||||
* and we can decode it into an ascii string
|
||||
*/
|
||||
@ -917,8 +907,7 @@ s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size)
|
||||
return -E1000_ERR_NVM_PBA_SECTION;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert from length in u16 values to u8 chars, add 1 for NULL,
|
||||
/* Convert from length in u16 values to u8 chars, add 1 for NULL,
|
||||
* and subtract 2 because length field is included in length.
|
||||
*/
|
||||
*pba_num_size = ((u32)length * 2) - 1;
|
||||
|
@ -284,8 +284,7 @@ s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
return -E1000_ERR_PARAM;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up Op-code, Phy Address, and register offset in the MDI
|
||||
/* Set up Op-code, Phy Address, and register offset in the MDI
|
||||
* Control register. The MAC will take care of interfacing with the
|
||||
* PHY to retrieve the desired data.
|
||||
*/
|
||||
@ -295,8 +294,7 @@ s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
|
||||
E1000_WRITE_REG(hw, E1000_MDIC, mdic);
|
||||
|
||||
/*
|
||||
* Poll the ready bit to see if the MDI read completed
|
||||
/* Poll the ready bit to see if the MDI read completed
|
||||
* Increasing the time out as testing showed failures with
|
||||
* the lower time out
|
||||
*/
|
||||
@ -316,8 +314,7 @@ s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
}
|
||||
*data = (u16) mdic;
|
||||
|
||||
/*
|
||||
* Allow some time after each MDIC transaction to avoid
|
||||
/* Allow some time after each MDIC transaction to avoid
|
||||
* reading duplicate data in the next MDIC transaction.
|
||||
*/
|
||||
if (hw->mac.type == e1000_pch2lan)
|
||||
@ -346,8 +343,7 @@ s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
return -E1000_ERR_PARAM;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up Op-code, Phy Address, and register offset in the MDI
|
||||
/* Set up Op-code, Phy Address, and register offset in the MDI
|
||||
* Control register. The MAC will take care of interfacing with the
|
||||
* PHY to retrieve the desired data.
|
||||
*/
|
||||
@ -358,8 +354,7 @@ s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
|
||||
E1000_WRITE_REG(hw, E1000_MDIC, mdic);
|
||||
|
||||
/*
|
||||
* Poll the ready bit to see if the MDI read completed
|
||||
/* Poll the ready bit to see if the MDI read completed
|
||||
* Increasing the time out as testing showed failures with
|
||||
* the lower time out
|
||||
*/
|
||||
@ -378,8 +373,7 @@ s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
return -E1000_ERR_PHY;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow some time after each MDIC transaction to avoid
|
||||
/* Allow some time after each MDIC transaction to avoid
|
||||
* reading duplicate data in the next MDIC transaction.
|
||||
*/
|
||||
if (hw->mac.type == e1000_pch2lan)
|
||||
@ -404,8 +398,7 @@ s32 e1000_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
|
||||
DEBUGFUNC("e1000_read_phy_reg_i2c");
|
||||
|
||||
/*
|
||||
* Set up Op-code, Phy Address, and register address in the I2CCMD
|
||||
/* Set up Op-code, Phy Address, and register address in the I2CCMD
|
||||
* register. The MAC will take care of interfacing with the
|
||||
* PHY to retrieve the desired data.
|
||||
*/
|
||||
@ -463,8 +456,7 @@ s32 e1000_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
/* Swap the data bytes for the I2C interface */
|
||||
phy_data_swapped = ((data >> 8) & 0x00FF) | ((data << 8) & 0xFF00);
|
||||
|
||||
/*
|
||||
* Set up Op-code, Phy Address, and register address in the I2CCMD
|
||||
/* Set up Op-code, Phy Address, and register address in the I2CCMD
|
||||
* register. The MAC will take care of interfacing with the
|
||||
* PHY to retrieve the desired data.
|
||||
*/
|
||||
@ -520,8 +512,7 @@ s32 e1000_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data)
|
||||
return -E1000_ERR_PHY;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up Op-code, EEPROM Address,in the I2CCMD
|
||||
/* Set up Op-code, EEPROM Address,in the I2CCMD
|
||||
* register. The MAC will take care of interfacing with the
|
||||
* EEPROM to retrieve the desired data.
|
||||
*/
|
||||
@ -575,14 +566,12 @@ s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data)
|
||||
DEBUGOUT("I2CCMD command address exceeds upper limit\n");
|
||||
return -E1000_ERR_PHY;
|
||||
}
|
||||
/*
|
||||
* The programming interface is 16 bits wide
|
||||
/* The programming interface is 16 bits wide
|
||||
* so we need to read the whole word first
|
||||
* then update appropriate byte lane and write
|
||||
* the updated word back.
|
||||
*/
|
||||
/*
|
||||
* Set up Op-code, EEPROM Address,in the I2CCMD
|
||||
/* Set up Op-code, EEPROM Address,in the I2CCMD
|
||||
* register. The MAC will take care of interfacing
|
||||
* with an EEPROM to write the data given.
|
||||
*/
|
||||
@ -592,8 +581,7 @@ s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data)
|
||||
E1000_WRITE_REG(hw, E1000_I2CCMD, i2ccmd);
|
||||
for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
|
||||
usec_delay(50);
|
||||
/*
|
||||
* Poll the ready bit to see if lastly
|
||||
/* Poll the ready bit to see if lastly
|
||||
* launched I2C operation completed
|
||||
*/
|
||||
i2ccmd = E1000_READ_REG(hw, E1000_I2CCMD);
|
||||
@ -601,8 +589,7 @@ s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data)
|
||||
/* Check if this is READ or WRITE phase */
|
||||
if ((i2ccmd & E1000_I2CCMD_OPCODE_READ) ==
|
||||
E1000_I2CCMD_OPCODE_READ) {
|
||||
/*
|
||||
* Write the selected byte
|
||||
/* Write the selected byte
|
||||
* lane and update whole word
|
||||
*/
|
||||
data_local = i2ccmd & 0xFF00;
|
||||
@ -1071,8 +1058,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
phy_data &= ~I82577_PHY_CTRL2_MDIX_CFG_MASK;
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* 0 - Auto (default)
|
||||
* 1 - MDI mode
|
||||
* 2 - MDI-X mode
|
||||
@ -1120,8 +1106,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
|
||||
if (phy->type != e1000_phy_bm)
|
||||
phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
|
||||
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* MDI/MDI-X = 0 (default)
|
||||
* 0 - Auto for all speeds
|
||||
* 1 - MDI mode
|
||||
@ -1146,8 +1131,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* disable_polarity_correction = 0 (default)
|
||||
* Automatic Correction for Reversed Cable Polarity
|
||||
* 0 - Disabled
|
||||
@ -1184,8 +1168,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw)
|
||||
if ((phy->type == e1000_phy_m88) &&
|
||||
(phy->revision < E1000_REVISION_4) &&
|
||||
(phy->id != BME1000_E_PHY_ID_R2)) {
|
||||
/*
|
||||
* Force TX_CLK in the Extended PHY Specific Control Register
|
||||
/* Force TX_CLK in the Extended PHY Specific Control Register
|
||||
* to 25MHz clock.
|
||||
*/
|
||||
ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL,
|
||||
@ -1277,8 +1260,7 @@ s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* MDI/MDI-X = 0 (default)
|
||||
* 0 - Auto for all speeds
|
||||
* 1 - MDI mode
|
||||
@ -1306,8 +1288,7 @@ s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Options:
|
||||
/* Options:
|
||||
* disable_polarity_correction = 0 (default)
|
||||
* Automatic Correction for Reversed Cable Polarity
|
||||
* 0 - Disabled
|
||||
@ -1358,14 +1339,12 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait 100ms for MAC to configure PHY from NVM settings, to avoid
|
||||
/* Wait 100ms for MAC to configure PHY from NVM settings, to avoid
|
||||
* timeout issues when LFS is enabled.
|
||||
*/
|
||||
msec_delay(100);
|
||||
|
||||
/*
|
||||
* The NVM settings will configure LPLU in D3 for
|
||||
/* The NVM settings will configure LPLU in D3 for
|
||||
* non-IGP1 PHYs.
|
||||
*/
|
||||
if (phy->type == e1000_phy_igp) {
|
||||
@ -1410,8 +1389,7 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
|
||||
|
||||
/* set auto-master slave resolution settings */
|
||||
if (hw->mac.autoneg) {
|
||||
/*
|
||||
* when autonegotiation advertisement is only 1000Mbps then we
|
||||
/* when autonegotiation advertisement is only 1000Mbps then we
|
||||
* should disable SmartSpeed and enable Auto MasterSlave
|
||||
* resolution as hardware default.
|
||||
*/
|
||||
@ -1480,16 +1458,14 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Need to parse both autoneg_advertised and fc and set up
|
||||
/* Need to parse both autoneg_advertised and fc and set up
|
||||
* the appropriate PHY registers. First we will parse for
|
||||
* autoneg_advertised software override. Since we can advertise
|
||||
* a plethora of combinations, we need to check each bit
|
||||
* individually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* First we clear all the 10/100 mb speed bits in the Auto-Neg
|
||||
/* First we clear all the 10/100 mb speed bits in the Auto-Neg
|
||||
* Advertisement Register (Address 4) and the 1000 mb speed bits in
|
||||
* the 1000Base-T Control Register (Address 9).
|
||||
*/
|
||||
@ -1535,8 +1511,7 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
|
||||
mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a software override of the flow control settings, and
|
||||
/* Check for a software override of the flow control settings, and
|
||||
* setup the PHY advertisement registers accordingly. If
|
||||
* auto-negotiation is enabled, then software will have to set the
|
||||
* "PAUSE" bits to the correct value in the Auto-Negotiation
|
||||
@ -1555,15 +1530,13 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
|
||||
*/
|
||||
switch (hw->fc.current_mode) {
|
||||
case e1000_fc_none:
|
||||
/*
|
||||
* Flow control (Rx & Tx) is completely disabled by a
|
||||
/* Flow control (Rx & Tx) is completely disabled by a
|
||||
* software over-ride.
|
||||
*/
|
||||
mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
|
||||
break;
|
||||
case e1000_fc_rx_pause:
|
||||
/*
|
||||
* Rx Flow control is enabled, and Tx Flow control is
|
||||
/* Rx Flow control is enabled, and Tx Flow control is
|
||||
* disabled, by a software over-ride.
|
||||
*
|
||||
* Since there really isn't a way to advertise that we are
|
||||
@ -1575,16 +1548,14 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
|
||||
mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
|
||||
break;
|
||||
case e1000_fc_tx_pause:
|
||||
/*
|
||||
* Tx Flow control is enabled, and Rx Flow control is
|
||||
/* Tx Flow control is enabled, and Rx Flow control is
|
||||
* disabled, by a software over-ride.
|
||||
*/
|
||||
mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR;
|
||||
mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE;
|
||||
break;
|
||||
case e1000_fc_full:
|
||||
/*
|
||||
* Flow control (both Rx and Tx) is enabled by a software
|
||||
/* Flow control (both Rx and Tx) is enabled by a software
|
||||
* over-ride.
|
||||
*/
|
||||
mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
|
||||
@ -1624,14 +1595,12 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_copper_link_autoneg");
|
||||
|
||||
/*
|
||||
* Perform some bounds checking on the autoneg advertisement
|
||||
/* Perform some bounds checking on the autoneg advertisement
|
||||
* parameter.
|
||||
*/
|
||||
phy->autoneg_advertised &= phy->autoneg_mask;
|
||||
|
||||
/*
|
||||
* If autoneg_advertised is zero, we assume it was not defaulted
|
||||
/* If autoneg_advertised is zero, we assume it was not defaulted
|
||||
* by the calling code so we set to advertise full capability.
|
||||
*/
|
||||
if (!phy->autoneg_advertised)
|
||||
@ -1645,8 +1614,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
|
||||
}
|
||||
DEBUGOUT("Restarting Auto-Neg\n");
|
||||
|
||||
/*
|
||||
* Restart auto-negotiation by setting the Auto Neg Enable bit and
|
||||
/* Restart auto-negotiation by setting the Auto Neg Enable bit and
|
||||
* the Auto Neg Restart bit in the PHY control register.
|
||||
*/
|
||||
ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_ctrl);
|
||||
@ -1658,8 +1626,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Does the user want to wait for Auto-Neg to complete here, or
|
||||
/* Does the user want to wait for Auto-Neg to complete here, or
|
||||
* check at a later time (for example, callback routine).
|
||||
*/
|
||||
if (phy->autoneg_wait_to_complete) {
|
||||
@ -1692,16 +1659,14 @@ s32 e1000_setup_copper_link_generic(struct e1000_hw *hw)
|
||||
DEBUGFUNC("e1000_setup_copper_link_generic");
|
||||
|
||||
if (hw->mac.autoneg) {
|
||||
/*
|
||||
* Setup autoneg and flow control advertisement and perform
|
||||
/* Setup autoneg and flow control advertisement and perform
|
||||
* autonegotiation.
|
||||
*/
|
||||
ret_val = e1000_copper_link_autoneg(hw);
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
} else {
|
||||
/*
|
||||
* PHY will be set to 10H, 10F, 100H or 100F
|
||||
/* PHY will be set to 10H, 10F, 100H or 100F
|
||||
* depending on user settings.
|
||||
*/
|
||||
DEBUGOUT("Forcing Speed and Duplex\n");
|
||||
@ -1712,8 +1677,7 @@ s32 e1000_setup_copper_link_generic(struct e1000_hw *hw)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Check link status. Wait up to 100 microseconds for link to become
|
||||
/* Check link status. Wait up to 100 microseconds for link to become
|
||||
* valid.
|
||||
*/
|
||||
ret_val = e1000_phy_has_link_generic(hw, COPPER_LINK_UP_LIMIT, 10,
|
||||
@ -1759,8 +1723,7 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Clear Auto-Crossover to force MDI manually. IGP requires MDI
|
||||
/* Clear Auto-Crossover to force MDI manually. IGP requires MDI
|
||||
* forced whenever speed and duplex are forced.
|
||||
*/
|
||||
ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data);
|
||||
@ -1818,8 +1781,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
|
||||
|
||||
/* I210 and I211 devices support Auto-Crossover in forced operation. */
|
||||
if (phy->type != e1000_phy_i210) {
|
||||
/*
|
||||
* Clear Auto-Crossover to force MDI manually. M88E1000
|
||||
/* Clear Auto-Crossover to force MDI manually. M88E1000
|
||||
* requires MDI forced whenever speed and duplex are forced.
|
||||
*/
|
||||
ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL,
|
||||
@ -1878,8 +1840,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
|
||||
if (!reset_dsp) {
|
||||
DEBUGOUT("Link taking longer than expected.\n");
|
||||
} else {
|
||||
/*
|
||||
* We didn't get link.
|
||||
/* We didn't get link.
|
||||
* Reset the DSP and cross our fingers.
|
||||
*/
|
||||
ret_val = phy->ops.write_reg(hw,
|
||||
@ -1913,8 +1874,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Resetting the phy means we need to re-force TX_CLK in the
|
||||
/* Resetting the phy means we need to re-force TX_CLK in the
|
||||
* Extended PHY Specific Control Register to 25MHz clock from
|
||||
* the reset value of 2.5MHz.
|
||||
*/
|
||||
@ -1923,8 +1883,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* In addition, we must re-enable CRS on Tx for both half and full
|
||||
/* In addition, we must re-enable CRS on Tx for both half and full
|
||||
* duplex.
|
||||
*/
|
||||
ret_val = phy->ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
|
||||
@ -2098,8 +2057,7 @@ s32 e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active)
|
||||
data);
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
/*
|
||||
* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
/* LPLU and SmartSpeed are mutually exclusive. LPLU is used
|
||||
* during Dx states where the power conservation is most
|
||||
* important. During driver activity we should enable
|
||||
* SmartSpeed, so performance is maintained.
|
||||
@ -2242,8 +2200,7 @@ s32 e1000_check_polarity_igp(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_check_polarity_igp");
|
||||
|
||||
/*
|
||||
* Polarity is determined based on the speed of
|
||||
/* Polarity is determined based on the speed of
|
||||
* our connection.
|
||||
*/
|
||||
ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_STATUS, &data);
|
||||
@ -2255,8 +2212,7 @@ s32 e1000_check_polarity_igp(struct e1000_hw *hw)
|
||||
offset = IGP01E1000_PHY_PCS_INIT_REG;
|
||||
mask = IGP01E1000_PHY_POLARITY_MASK;
|
||||
} else {
|
||||
/*
|
||||
* This really only applies to 10Mbps since
|
||||
/* This really only applies to 10Mbps since
|
||||
* there is no polarity for 100Mbps (always 0).
|
||||
*/
|
||||
offset = IGP01E1000_PHY_PORT_STATUS;
|
||||
@ -2287,8 +2243,7 @@ s32 e1000_check_polarity_ife(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_check_polarity_ife");
|
||||
|
||||
/*
|
||||
* Polarity is determined based on the reversal feature being enabled.
|
||||
/* Polarity is determined based on the reversal feature being enabled.
|
||||
*/
|
||||
if (phy->polarity_correction) {
|
||||
offset = IFE_PHY_EXTENDED_STATUS_CONTROL;
|
||||
@ -2338,8 +2293,7 @@ s32 e1000_wait_autoneg_generic(struct e1000_hw *hw)
|
||||
msec_delay(100);
|
||||
}
|
||||
|
||||
/*
|
||||
* PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation
|
||||
/* PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation
|
||||
* has completed.
|
||||
*/
|
||||
return ret_val;
|
||||
@ -2366,15 +2320,13 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
|
||||
return E1000_SUCCESS;
|
||||
|
||||
for (i = 0; i < iterations; i++) {
|
||||
/*
|
||||
* Some PHYs require the PHY_STATUS register to be read
|
||||
/* Some PHYs require the PHY_STATUS register to be read
|
||||
* twice due to the link bit being sticky. No harm doing
|
||||
* it across the board.
|
||||
*/
|
||||
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
|
||||
if (ret_val)
|
||||
/*
|
||||
* If the first read fails, another entity may have
|
||||
/* If the first read fails, another entity may have
|
||||
* ownership of the resources, wait and try again to
|
||||
* see if they have relinquished the resources yet.
|
||||
*/
|
||||
@ -2578,8 +2530,7 @@ s32 e1000_get_cable_length_igp_2(struct e1000_hw *hw)
|
||||
if (ret_val)
|
||||
return ret_val;
|
||||
|
||||
/*
|
||||
* Getting bits 15:9, which represent the combination of
|
||||
/* Getting bits 15:9, which represent the combination of
|
||||
* coarse and fine gain values. The result is a number
|
||||
* that can be put into the lookup table to obtain the
|
||||
* approximate cable length.
|
||||
@ -2965,15 +2916,13 @@ s32 e1000_phy_init_script_igp3(struct e1000_hw *hw)
|
||||
hw->phy.ops.write_reg(hw, 0x1796, 0x0008);
|
||||
/* Change cg_icount + enable integbp for channels BCD */
|
||||
hw->phy.ops.write_reg(hw, 0x1798, 0xD008);
|
||||
/*
|
||||
* Change cg_icount + enable integbp + change prop_factor_master
|
||||
/* Change cg_icount + enable integbp + change prop_factor_master
|
||||
* to 8 for channel A
|
||||
*/
|
||||
hw->phy.ops.write_reg(hw, 0x1898, 0xD918);
|
||||
/* Disable AHT in Slave mode on channel A */
|
||||
hw->phy.ops.write_reg(hw, 0x187A, 0x0800);
|
||||
/*
|
||||
* Enable LPLU and disable AN to 1000 in non-D0a states,
|
||||
/* Enable LPLU and disable AN to 1000 in non-D0a states,
|
||||
* Enable SPD+B2B
|
||||
*/
|
||||
hw->phy.ops.write_reg(hw, 0x0019, 0x008D);
|
||||
@ -3074,8 +3023,7 @@ s32 e1000_determine_phy_address(struct e1000_hw *hw)
|
||||
e1000_get_phy_id(hw);
|
||||
phy_type = e1000_get_phy_type_from_id(hw->phy.id);
|
||||
|
||||
/*
|
||||
* If phy_type is valid, break - we found our
|
||||
/* If phy_type is valid, break - we found our
|
||||
* PHY address
|
||||
*/
|
||||
if (phy_type != e1000_phy_unknown)
|
||||
@ -3137,8 +3085,7 @@ s32 e1000_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data)
|
||||
if (offset > MAX_PHY_MULTI_PAGE_REG) {
|
||||
u32 page_shift, page_select;
|
||||
|
||||
/*
|
||||
* Page select is register 31 for phy address 1 and 22 for
|
||||
/* Page select is register 31 for phy address 1 and 22 for
|
||||
* phy address 2 and 3. Page select is shifted only for
|
||||
* phy address 1.
|
||||
*/
|
||||
@ -3198,8 +3145,7 @@ s32 e1000_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data)
|
||||
if (offset > MAX_PHY_MULTI_PAGE_REG) {
|
||||
u32 page_shift, page_select;
|
||||
|
||||
/*
|
||||
* Page select is register 31 for phy address 1 and 22 for
|
||||
/* Page select is register 31 for phy address 1 and 22 for
|
||||
* phy address 2 and 3. Page select is shifted only for
|
||||
* phy address 1.
|
||||
*/
|
||||
@ -3353,8 +3299,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable both PHY wakeup mode and Wakeup register page writes.
|
||||
/* Enable both PHY wakeup mode and Wakeup register page writes.
|
||||
* Prevent a power state change by disabling ME and Host PHY wakeup.
|
||||
*/
|
||||
temp = *phy_reg;
|
||||
@ -3368,8 +3313,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Select Host Wakeup Registers page - caller now able to write
|
||||
/* Select Host Wakeup Registers page - caller now able to write
|
||||
* registers on the Wakeup registers page
|
||||
*/
|
||||
return e1000_set_page_igp(hw, (BM_WUC_PAGE << IGP_PAGE_SHIFT));
|
||||
@ -3695,8 +3639,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
|
||||
if (page == HV_INTC_FC_PAGE_START)
|
||||
page = 0;
|
||||
|
||||
/*
|
||||
* Workaround MDIO accesses being disabled after entering IEEE
|
||||
/* Workaround MDIO accesses being disabled after entering IEEE
|
||||
* Power Down (when bit 11 of the PHY Control register is set)
|
||||
*/
|
||||
if ((hw->phy.type == e1000_phy_82578) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user