Commit e921eb1a authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher

e1000e: cosmetic cleanup of comments

Update comments to conform to the preferred style for networking code as
described in ./Documentation/CodingStyle and checked for in the recently
added checkpatch NETWORKING_BLOCK_COMMENT_STYLE test.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent daf56e40
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
*******************************************************************************/ *******************************************************************************/
/* /* 80003ES2LAN Gigabit Ethernet Controller (Copper)
* 80003ES2LAN Gigabit Ethernet Controller (Copper)
* 80003ES2LAN Gigabit Ethernet Controller (Serdes) * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
*/ */
...@@ -80,7 +79,8 @@ ...@@ -80,7 +79,8 @@
1 = 50-80M 1 = 50-80M
2 = 80-110M 2 = 80-110M
3 = 110-140M 3 = 110-140M
4 = >140M */ 4 = >140M
*/
/* Kumeran Mode Control Register (Page 193, Register 16) */ /* Kumeran Mode Control Register (Page 193, Register 16) */
#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800 #define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
...@@ -95,8 +95,7 @@ ...@@ -95,8 +95,7 @@
/* In-Band Control Register (Page 194, Register 18) */ /* In-Band Control Register (Page 194, Register 18) */
#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */ #define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */
/* /* 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 * with a lower bound at "index" and the upper bound at
* "index + 5". * "index + 5".
*/ */
...@@ -183,8 +182,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw) ...@@ -183,8 +182,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
E1000_EECD_SIZE_EX_SHIFT); E1000_EECD_SIZE_EX_SHIFT);
/* /* Added to a constant, "size" becomes the left-shift value
* Added to a constant, "size" becomes the left-shift value
* for setting word_size. * for setting word_size.
*/ */
size += NVM_WORD_SIZE_BASE_SHIFT; size += NVM_WORD_SIZE_BASE_SHIFT;
...@@ -375,8 +373,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask) ...@@ -375,8 +373,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
if (!(swfw_sync & (fwmask | swmask))) if (!(swfw_sync & (fwmask | swmask)))
break; break;
/* /* Firmware currently using resource (fwmask)
* Firmware currently using resource (fwmask)
* or other software thread using resource (swmask) * or other software thread using resource (swmask)
*/ */
e1000e_put_hw_semaphore(hw); e1000e_put_hw_semaphore(hw);
...@@ -442,8 +439,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, ...@@ -442,8 +439,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
page_select = GG82563_PHY_PAGE_SELECT; page_select = GG82563_PHY_PAGE_SELECT;
} else { } else {
/* /* Use Alternative Page Select register to access
* Use Alternative Page Select register to access
* registers 30 and 31 * registers 30 and 31
*/ */
page_select = GG82563_PHY_PAGE_SELECT_ALT; page_select = GG82563_PHY_PAGE_SELECT_ALT;
...@@ -457,8 +453,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, ...@@ -457,8 +453,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
} }
if (hw->dev_spec.e80003es2lan.mdic_wa_enable) { if (hw->dev_spec.e80003es2lan.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 * before the device has completed the "Page Select" MDI
* transaction. So we wait 200us after each MDI command... * transaction. So we wait 200us after each MDI command...
*/ */
...@@ -513,8 +508,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, ...@@ -513,8 +508,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
page_select = GG82563_PHY_PAGE_SELECT; page_select = GG82563_PHY_PAGE_SELECT;
} else { } else {
/* /* Use Alternative Page Select register to access
* Use Alternative Page Select register to access
* registers 30 and 31 * registers 30 and 31
*/ */
page_select = GG82563_PHY_PAGE_SELECT_ALT; page_select = GG82563_PHY_PAGE_SELECT_ALT;
...@@ -528,8 +522,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, ...@@ -528,8 +522,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
} }
if (hw->dev_spec.e80003es2lan.mdic_wa_enable) { if (hw->dev_spec.e80003es2lan.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 * before the device has completed the "Page Select" MDI
* transaction. So we wait 200us after each MDI command... * transaction. So we wait 200us after each MDI command...
*/ */
...@@ -618,8 +611,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw) ...@@ -618,8 +611,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
u16 phy_data; u16 phy_data;
bool link; bool link;
/* /* 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. * forced whenever speed and duplex are forced.
*/ */
ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
...@@ -657,8 +649,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw) ...@@ -657,8 +649,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
return ret_val; return ret_val;
if (!link) { if (!link) {
/* /* We didn't get link.
* We didn't get link.
* Reset the DSP and cross our fingers. * Reset the DSP and cross our fingers.
*/ */
ret_val = e1000e_phy_reset_dsp(hw); ret_val = e1000e_phy_reset_dsp(hw);
...@@ -677,8 +668,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw) ...@@ -677,8 +668,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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. * to the link speed. 10Mbps -> 2.5MHz, else 25MHz.
*/ */
phy_data &= ~GG82563_MSCR_TX_CLK_MASK; phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
...@@ -687,8 +677,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw) ...@@ -687,8 +677,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
else else
phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25; 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. * duplex.
*/ */
phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
...@@ -766,8 +755,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw) ...@@ -766,8 +755,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
u16 kum_reg_data; u16 kum_reg_data;
/* /* 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. * on the last TLP read/write transaction when MAC is reset.
*/ */
ret_val = e1000e_disable_pcie_master(hw); ret_val = e1000e_disable_pcie_master(hw);
...@@ -899,8 +887,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw) ...@@ -899,8 +887,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
hw->dev_spec.e80003es2lan.mdic_wa_enable = false; hw->dev_spec.e80003es2lan.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 * important that we do this after we have tried to establish link
* because the symbol error count will increment wildly if there * because the symbol error count will increment wildly if there
* is no link. * is no link.
...@@ -945,8 +932,7 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw) ...@@ -945,8 +932,7 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
reg |= (1 << 28); reg |= (1 << 28);
ew32(TARC(1), reg); ew32(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. * IPv6 headers can hang the Rx.
*/ */
reg = er32(RFCTL); reg = er32(RFCTL);
...@@ -979,8 +965,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw) ...@@ -979,8 +965,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
/* /* Options:
* Options:
* MDI/MDI-X = 0 (default) * MDI/MDI-X = 0 (default)
* 0 - Auto for all speeds * 0 - Auto for all speeds
* 1 - MDI mode * 1 - MDI mode
...@@ -1006,8 +991,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw) ...@@ -1006,8 +991,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
break; break;
} }
/* /* Options:
* Options:
* disable_polarity_correction = 0 (default) * disable_polarity_correction = 0 (default)
* Automatic Correction for Reversed Cable Polarity * Automatic Correction for Reversed Cable Polarity
* 0 - Disabled * 0 - Disabled
...@@ -1065,8 +1049,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw) ...@@ -1065,8 +1049,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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 * firmware will have already initialized them. We only initialize
* them if the HW is not in IAMT mode. * them if the HW is not in IAMT mode.
*/ */
...@@ -1087,8 +1070,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw) ...@@ -1087,8 +1070,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
return ret_val; 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. * and in the PHY to avoid CRC errors.
*/ */
ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data); ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data);
...@@ -1121,8 +1103,7 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw) ...@@ -1121,8 +1103,7 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
ew32(CTRL, ctrl); ew32(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 * iteration and increase the max iterations when
* polling the phy; this fixes erroneous timeouts at 10Mbps. * polling the phy; this fixes erroneous timeouts at 10Mbps.
*/ */
...@@ -1352,8 +1333,7 @@ static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw) ...@@ -1352,8 +1333,7 @@ static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
{ {
s32 ret_val = 0; s32 ret_val = 0;
/* /* 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 * so that it will override the Si installed default perm
* address. * address.
*/ */
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
*******************************************************************************/ *******************************************************************************/
/* /* 82571EB Gigabit Ethernet Controller
* 82571EB Gigabit Ethernet Controller
* 82571EB Gigabit Ethernet Controller (Copper) * 82571EB Gigabit Ethernet Controller (Copper)
* 82571EB Gigabit Ethernet Controller (Fiber) * 82571EB Gigabit Ethernet Controller (Fiber)
* 82571EB Dual Port Gigabit Mezzanine Adapter * 82571EB Dual Port Gigabit Mezzanine Adapter
...@@ -191,8 +190,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) ...@@ -191,8 +190,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
if (((eecd >> 15) & 0x3) == 0x3) { if (((eecd >> 15) & 0x3) == 0x3) {
nvm->type = e1000_nvm_flash_hw; nvm->type = e1000_nvm_flash_hw;
nvm->word_size = 2048; nvm->word_size = 2048;
/* /* Autonomous Flash update bit must be cleared due
* Autonomous Flash update bit must be cleared due
* to Flash update issue. * to Flash update issue.
*/ */
eecd &= ~E1000_EECD_AUPDEN; eecd &= ~E1000_EECD_AUPDEN;
...@@ -204,8 +202,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) ...@@ -204,8 +202,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
nvm->type = e1000_nvm_eeprom_spi; nvm->type = e1000_nvm_eeprom_spi;
size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
E1000_EECD_SIZE_EX_SHIFT); E1000_EECD_SIZE_EX_SHIFT);
/* /* Added to a constant, "size" becomes the left-shift value
* Added to a constant, "size" becomes the left-shift value
* for setting word_size. * for setting word_size.
*/ */
size += NVM_WORD_SIZE_BASE_SHIFT; size += NVM_WORD_SIZE_BASE_SHIFT;
...@@ -291,8 +288,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) ...@@ -291,8 +288,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
/* FWSM register */ /* FWSM register */
mac->has_fwsm = true; mac->has_fwsm = true;
/* /* ARC supported; valid only if manageability features are
* ARC supported; valid only if manageability features are
* enabled. * enabled.
*/ */
mac->arc_subsystem_valid = !!(er32(FWSM) & mac->arc_subsystem_valid = !!(er32(FWSM) &
...@@ -314,8 +310,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) ...@@ -314,8 +310,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
break; 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 access. This should be done for single-port * first NVM or PHY access. This should be done for single-port
* devices, and for one port only on dual-port devices so that * devices, and for one port only on dual-port devices so that
* for those devices we can still use the SMBI lock to synchronize * for those devices we can still use the SMBI lock to synchronize
...@@ -352,10 +347,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) ...@@ -352,10 +347,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
ew32(SWSM, swsm & ~E1000_SWSM_SMBI); ew32(SWSM, swsm & ~E1000_SWSM_SMBI);
} }
/* /* Initialize device specific counter of SMBI acquisition timeouts. */
* Initialize device specific counter of SMBI acquisition
* timeouts.
*/
hw->dev_spec.e82571.smb_counter = 0; hw->dev_spec.e82571.smb_counter = 0;
return 0; return 0;
...@@ -445,8 +437,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) ...@@ -445,8 +437,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82571: case e1000_82571:
case e1000_82572: 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 * In this case, we cannot access the PHY until the
* configuration is done. So we explicitly set the * configuration is done. So we explicitly set the
* PHY ID. * PHY ID.
...@@ -492,8 +483,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) ...@@ -492,8 +483,7 @@ static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw)
s32 fw_timeout = hw->nvm.word_size + 1; s32 fw_timeout = hw->nvm.word_size + 1;
s32 i = 0; s32 i = 0;
/* /* 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 * the inter-port SMBI semaphore, there is old code
* operating on the other port, and it is not * operating on the other port, and it is not
* releasing SMBI. Modify the number of times that * releasing SMBI. Modify the number of times that
...@@ -787,8 +777,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw) ...@@ -787,8 +777,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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. * otherwise, commit the checksum to the flash NVM.
*/ */
if (hw->nvm.type != e1000_nvm_flash_hw) if (hw->nvm.type != e1000_nvm_flash_hw)
...@@ -806,8 +795,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw) ...@@ -806,8 +795,7 @@ static s32 e1000_update_nvm_checksum_82571(struct e1000_hw *hw)
/* Reset the firmware if using STM opcode. */ /* Reset the firmware if using STM opcode. */
if ((er32(FLOP) & 0xFF00) == E1000_STM_OPCODE) { if ((er32(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. * in two write cycles.
*/ */
ew32(HICR, E1000_HICR_FW_RESET_ENABLE); ew32(HICR, E1000_HICR_FW_RESET_ENABLE);
...@@ -867,8 +855,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, ...@@ -867,8 +855,7 @@ static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
u32 i, eewr = 0; u32 i, eewr = 0;
s32 ret_val = 0; s32 ret_val = 0;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* and not enough words. * and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -957,8 +944,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) ...@@ -957,8 +944,7 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
} else { } else {
data &= ~IGP02E1000_PM_D0_LPLU; data &= ~IGP02E1000_PM_D0_LPLU;
ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); ret_val = e1e_wphy(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 * during Dx states where the power conservation is most
* important. During driver activity we should enable * important. During driver activity we should enable
* SmartSpeed, so performance is maintained. * SmartSpeed, so performance is maintained.
...@@ -1002,8 +988,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -1002,8 +988,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
u32 ctrl, ctrl_ext, eecd, tctl; u32 ctrl, ctrl_ext, eecd, tctl;
s32 ret_val; s32 ret_val;
/* /* 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. * on the last TLP read/write transaction when MAC is reset.
*/ */
ret_val = e1000e_disable_pcie_master(hw); ret_val = e1000e_disable_pcie_master(hw);
...@@ -1021,8 +1006,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -1021,8 +1006,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
usleep_range(10000, 20000); usleep_range(10000, 20000);
/* /* Must acquire the MDIO ownership before MAC reset.
* Must acquire the MDIO ownership before MAC reset.
* Ownership defaults to firmware after a reset. * Ownership defaults to firmware after a reset.
*/ */
switch (hw->mac.type) { switch (hw->mac.type) {
...@@ -1067,8 +1051,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -1067,8 +1051,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
/* We don't want to continue accessing MAC registers. */ /* We don't want to continue accessing MAC registers. */
return ret_val; 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 * Need to wait for Phy configuration completion before accessing
* NVM and Phy. * NVM and Phy.
*/ */
...@@ -1076,8 +1059,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -1076,8 +1059,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82571: case e1000_82571:
case e1000_82572: 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. * to access the EEPROM.
*/ */
eecd = er32(EECD); eecd = er32(EECD);
...@@ -1138,8 +1120,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) ...@@ -1138,8 +1120,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
e_dbg("Initializing the IEEE VLAN\n"); e_dbg("Initializing the IEEE VLAN\n");
mac->ops.clear_vfta(hw); mac->ops.clear_vfta(hw);
/* Setup the receive address. */ /* Setup the receive address.
/*
* If, however, a locally administered address was assigned to the * If, however, a locally administered address was assigned to the
* 82571, we must reserve a RAR for it to work around an issue where * 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. * resetting one port will reload the MAC on the other port.
...@@ -1183,8 +1164,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) ...@@ -1183,8 +1164,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
break; 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 * important that we do this after we have tried to establish link
* because the symbol error count will increment wildly if there * because the symbol error count will increment wildly if there
* is no link. * is no link.
...@@ -1281,8 +1261,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) ...@@ -1281,8 +1261,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
ew32(PBA_ECC, reg); ew32(PBA_ECC, reg);
} }
/* /* Workaround for hardware errata.
* Workaround for hardware errata.
* Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572 * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572
*/ */
if ((hw->mac.type == e1000_82571) || (hw->mac.type == e1000_82572)) { if ((hw->mac.type == e1000_82571) || (hw->mac.type == e1000_82572)) {
...@@ -1291,8 +1270,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) ...@@ -1291,8 +1270,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
ew32(CTRL_EXT, reg); ew32(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. * IPv6 headers can hang the Rx.
*/ */
if (hw->mac.type <= e1000_82573) { if (hw->mac.type <= e1000_82573) {
...@@ -1309,8 +1287,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) ...@@ -1309,8 +1287,7 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
reg |= (1 << 22); reg |= (1 << 22);
ew32(GCR, reg); ew32(GCR, reg);
/* /* Workaround for hardware errata.
* Workaround for hardware errata.
* apply workaround for hardware errata documented in errata * apply workaround for hardware errata documented in errata
* docs Fixes issue where some error prone or unreliable PCIe * docs Fixes issue where some error prone or unreliable PCIe
* completions are occurring, particularly with ASPM enabled. * completions are occurring, particularly with ASPM enabled.
...@@ -1344,8 +1321,7 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw) ...@@ -1344,8 +1321,7 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw)
case e1000_82574: case e1000_82574:
case e1000_82583: case e1000_82583:
if (hw->mng_cookie.vlan_id != 0) { 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 * a single VLAN ID. The following operations
* determine which 32b entry (i.e. offset) into the * determine which 32b entry (i.e. offset) into the
* array we want to set the VLAN ID (i.e. bit) of * array we want to set the VLAN ID (i.e. bit) of
...@@ -1362,8 +1338,7 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw) ...@@ -1362,8 +1338,7 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw)
break; break;
} }
for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { 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 * manageability VLAN ID, then clear all bits except that of
* the manageability unit. * the manageability unit.
*/ */
...@@ -1401,8 +1376,7 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw) ...@@ -1401,8 +1376,7 @@ static s32 e1000_led_on_82574(struct e1000_hw *hw)
ctrl = hw->mac.ledctl_mode2; ctrl = hw->mac.ledctl_mode2;
if (!(E1000_STATUS_LU & er32(STATUS))) { if (!(E1000_STATUS_LU & er32(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 each LED that's "on" (0x0E) in ledctl_mode2.
*/ */
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
...@@ -1427,8 +1401,7 @@ bool e1000_check_phy_82574(struct e1000_hw *hw) ...@@ -1427,8 +1401,7 @@ bool e1000_check_phy_82574(struct e1000_hw *hw)
u16 receive_errors = 0; u16 receive_errors = 0;
s32 ret_val = 0; s32 ret_val = 0;
/* /* 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. * read the Base1000T status register If both are max then PHY is hung.
*/ */
ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors); ret_val = e1e_rphy(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors);
...@@ -1458,8 +1431,7 @@ bool e1000_check_phy_82574(struct e1000_hw *hw) ...@@ -1458,8 +1431,7 @@ bool e1000_check_phy_82574(struct e1000_hw *hw)
**/ **/
static s32 e1000_setup_link_82571(struct e1000_hw *hw) static s32 e1000_setup_link_82571(struct e1000_hw *hw)
{ {
/* /* 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 * the default flow control setting, so we explicitly
* set it to full. * set it to full.
*/ */
...@@ -1526,8 +1498,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw) ...@@ -1526,8 +1498,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82571: case e1000_82571:
case e1000_82572: 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 * of reset to take the adapter out of that mode. So we
* have to explicitly take the adapter out of loopback * have to explicitly take the adapter out of loopback
* mode. This prevents drivers from twiddling their thumbs * mode. This prevents drivers from twiddling their thumbs
...@@ -1584,8 +1555,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ...@@ -1584,8 +1555,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
switch (mac->serdes_link_state) { switch (mac->serdes_link_state) {
case e1000_serdes_link_autoneg_complete: case e1000_serdes_link_autoneg_complete:
if (!(status & E1000_STATUS_LU)) { if (!(status & E1000_STATUS_LU)) {
/* /* We have lost link, retry autoneg before
* We have lost link, retry autoneg before
* reporting link failure * reporting link failure
*/ */
mac->serdes_link_state = mac->serdes_link_state =
...@@ -1598,8 +1568,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ...@@ -1598,8 +1568,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
break; break;
case e1000_serdes_link_forced_up: 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 * auto-negotiation in the TXCW register and disable
* forced link in the Device Control register in an * forced link in the Device Control register in an
* attempt to auto-negotiate with our link partner. * attempt to auto-negotiate with our link partner.
...@@ -1619,8 +1588,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ...@@ -1619,8 +1588,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
case e1000_serdes_link_autoneg_progress: case e1000_serdes_link_autoneg_progress:
if (rxcw & E1000_RXCW_C) { 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 * link partner has autonegotiated, and we can
* trust the Link Up (LU) status bit. * trust the Link Up (LU) status bit.
*/ */
...@@ -1636,8 +1604,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ...@@ -1636,8 +1604,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
e_dbg("AN_PROG -> DOWN\n"); e_dbg("AN_PROG -> DOWN\n");
} }
} else { } else {
/* /* The link partner did not autoneg.
* The link partner did not autoneg.
* Force link up and full duplex, and change * Force link up and full duplex, and change
* state to forced. * state to forced.
*/ */
...@@ -1660,8 +1627,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ...@@ -1660,8 +1627,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
case e1000_serdes_link_down: case e1000_serdes_link_down:
default: 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 * valid sync, so lets see if we can bring the link
* up. * up.
*/ */
...@@ -1679,8 +1645,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ...@@ -1679,8 +1645,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
mac->serdes_link_state = e1000_serdes_link_down; mac->serdes_link_state = e1000_serdes_link_down;
e_dbg("ANYSTATE -> DOWN\n"); e_dbg("ANYSTATE -> DOWN\n");
} else { } 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 * bit both are consistently 1 then simply ignore
* the IV bit and restart Autoneg * the IV bit and restart Autoneg
*/ */
...@@ -1780,8 +1745,7 @@ void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state) ...@@ -1780,8 +1745,7 @@ void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state)
/* If workaround is activated... */ /* If workaround is activated... */
if (state) 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 * between the time RAR[0] gets clobbered and the time it
* gets fixed, the actual LAA is in one of the RARs and no * gets fixed, the actual LAA is in one of the RARs and no
* incoming packets directed to this port are dropped. * incoming packets directed to this port are dropped.
...@@ -1810,8 +1774,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) ...@@ -1810,8 +1774,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
if (nvm->type != e1000_nvm_flash_hw) if (nvm->type != e1000_nvm_flash_hw)
return 0; return 0;
/* /* 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. * 10h-12h. Checksum may need to be fixed.
*/ */
ret_val = e1000_read_nvm(hw, 0x10, 1, &data); ret_val = e1000_read_nvm(hw, 0x10, 1, &data);
...@@ -1819,8 +1782,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw) ...@@ -1819,8 +1782,7 @@ static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw)
return ret_val; return ret_val;
if (!(data & 0x10)) { 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 * when the checksum has already been fixed. If
* the checksum is still wrong and this bit is a * the checksum is still wrong and this bit is a
* 1, we need to return bad checksum. Otherwise, * 1, we need to return bad checksum. Otherwise,
...@@ -1852,8 +1814,7 @@ static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw) ...@@ -1852,8 +1814,7 @@ static s32 e1000_read_mac_addr_82571(struct e1000_hw *hw)
if (hw->mac.type == e1000_82571) { if (hw->mac.type == e1000_82571) {
s32 ret_val = 0; s32 ret_val = 0;
/* /* 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 * so that it will override the Si installed default perm
* address. * address.
*/ */
......
...@@ -185,8 +185,7 @@ ...@@ -185,8 +185,7 @@
#define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */ #define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */
#define E1000_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */ #define E1000_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */
/* /* Use byte values for the following shift parameters
* Use byte values for the following shift parameters
* Usage: * Usage:
* psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) & * psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) &
* E1000_PSRCTL_BSIZE0_MASK) | * E1000_PSRCTL_BSIZE0_MASK) |
...@@ -242,8 +241,7 @@ ...@@ -242,8 +241,7 @@
#define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */ #define E1000_CTRL_VME 0x40000000 /* IEEE VLAN mode enable */
#define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */ #define E1000_CTRL_PHY_RST 0x80000000 /* PHY Reset */
/* /* Bit definitions for the Management Data IO (MDIO) and Management Data
* Bit definitions for the Management Data IO (MDIO) and Management Data
* Clock (MDC) pins in the Device Control Register. * Clock (MDC) pins in the Device Control Register.
*/ */
...@@ -424,8 +422,7 @@ ...@@ -424,8 +422,7 @@
#define E1000_PBA_ECC_STAT_CLR 0x00000002 /* Clear ECC error counter */ #define E1000_PBA_ECC_STAT_CLR 0x00000002 /* Clear ECC error counter */
#define E1000_PBA_ECC_INT_EN 0x00000004 /* Enable ICR bit 5 for ECC */ #define E1000_PBA_ECC_INT_EN 0x00000004 /* Enable ICR bit 5 for ECC */
/* /* This defines the bits that are set in the Interrupt Mask
* This defines the bits that are set in the Interrupt Mask
* Set/Read Register. Each bit is documented below: * Set/Read Register. Each bit is documented below:
* o RXT0 = Receiver Timer Interrupt (ring 0) * o RXT0 = Receiver Timer Interrupt (ring 0)
* o TXDW = Transmit Descriptor Written Back * o TXDW = Transmit Descriptor Written Back
...@@ -475,8 +472,7 @@ ...@@ -475,8 +472,7 @@
/* 802.1q VLAN Packet Size */ /* 802.1q VLAN Packet Size */
#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ #define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */
/* Receive Address */ /* Receive Address
/*
* Number of high/low register pairs in the RAR. The RAR (Receive Address * Number of high/low register pairs in the RAR. The RAR (Receive Address
* Registers) holds the directed and multicast addresses that we monitor. * Registers) holds the directed and multicast addresses that we monitor.
* Technically, we have 16 spots. However, we reserve one of these spots * Technically, we have 16 spots. However, we reserve one of these spots
...@@ -723,8 +719,7 @@ ...@@ -723,8 +719,7 @@
#define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */ #define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */
#define MAX_PHY_MULTI_PAGE_REG 0xF #define MAX_PHY_MULTI_PAGE_REG 0xF
/* Bit definitions for valid PHY IDs. */ /* Bit definitions for valid PHY IDs.
/*
* I = Integrated * I = Integrated
* E = External * E = External
*/ */
...@@ -762,8 +757,7 @@ ...@@ -762,8 +757,7 @@
#define M88E1000_PSCR_AUTO_X_1000T 0x0040 #define M88E1000_PSCR_AUTO_X_1000T 0x0040
/* Auto crossover enabled all speeds */ /* Auto crossover enabled all speeds */
#define M88E1000_PSCR_AUTO_X_MODE 0x0060 #define M88E1000_PSCR_AUTO_X_MODE 0x0060
/* /* 1=Enable Extended 10BASE-T distance (Lower 10BASE-T Rx Threshold)
* 1=Enable Extended 10BASE-T distance (Lower 10BASE-T Rx Threshold)
* 0=Normal 10BASE-T Rx Threshold * 0=Normal 10BASE-T Rx Threshold
*/ */
#define M88E1000_PSCR_ASSERT_CRS_ON_TX 0x0800 /* 1=Assert CRS on Transmit */ #define M88E1000_PSCR_ASSERT_CRS_ON_TX 0x0800 /* 1=Assert CRS on Transmit */
...@@ -779,14 +773,12 @@ ...@@ -779,14 +773,12 @@
#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7 #define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7
/* /* Number of times we will attempt to autonegotiate before downshifting if we
* Number of times we will attempt to autonegotiate before downshifting if we
* are the master * are the master
*/ */
#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00 #define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00
#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000 #define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000
/* /* Number of times we will attempt to autonegotiate before downshifting if we
* Number of times we will attempt to autonegotiate before downshifting if we
* are the slave * are the slave
*/ */
#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300 #define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300
...@@ -808,8 +800,7 @@ ...@@ -808,8 +800,7 @@
#define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \ #define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \
((reg) & MAX_PHY_REG_ADDRESS)) ((reg) & MAX_PHY_REG_ADDRESS))
/* /* Bits...
* Bits...
* 15-5: page * 15-5: page
* 4-0: register offset * 4-0: register offset
*/ */
......
...@@ -161,8 +161,7 @@ struct e1000_info; ...@@ -161,8 +161,7 @@ struct e1000_info;
/* Time to wait before putting the device into D3 if there's no link (in ms). */ /* Time to wait before putting the device into D3 if there's no link (in ms). */
#define LINK_TIMEOUT 100 #define LINK_TIMEOUT 100
/* /* Count for polling __E1000_RESET condition every 10-20msec.
* Count for polling __E1000_RESET condition every 10-20msec.
* Experimentation has shown the reset can take approximately 210msec. * Experimentation has shown the reset can take approximately 210msec.
*/ */
#define E1000_CHECK_RESET_COUNT 25 #define E1000_CHECK_RESET_COUNT 25
...@@ -172,8 +171,7 @@ struct e1000_info; ...@@ -172,8 +171,7 @@ struct e1000_info;
#define BURST_RDTR 0x20 #define BURST_RDTR 0x20
#define BURST_RADV 0x20 #define BURST_RADV 0x20
/* /* in the case of WTHRESH, it appears at least the 82571/2 hardware
* in the case of WTHRESH, it appears at least the 82571/2 hardware
* writes back 4 descriptors when WTHRESH=5, and 3 descriptors when * writes back 4 descriptors when WTHRESH=5, and 3 descriptors when
* WTHRESH=4, so a setting of 5 gives the most efficient bus * WTHRESH=4, so a setting of 5 gives the most efficient bus
* utilization but to avoid possible Tx stalls, set it to 1 * utilization but to avoid possible Tx stalls, set it to 1
...@@ -214,8 +212,7 @@ struct e1000_ps_page { ...@@ -214,8 +212,7 @@ struct e1000_ps_page {
u64 dma; /* must be u64 - written to hw */ u64 dma; /* must be u64 - written to hw */
}; };
/* /* wrappers around a pointer to a socket buffer,
* wrappers around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer * so a DMA handle can be stored along with the buffer
*/ */
struct e1000_buffer { struct e1000_buffer {
...@@ -305,9 +302,7 @@ struct e1000_adapter { ...@@ -305,9 +302,7 @@ struct e1000_adapter {
u16 tx_itr; u16 tx_itr;
u16 rx_itr; u16 rx_itr;
/* /* Tx */
* Tx
*/
struct e1000_ring *tx_ring /* One per active queue */ struct e1000_ring *tx_ring /* One per active queue */
____cacheline_aligned_in_smp; ____cacheline_aligned_in_smp;
u32 tx_fifo_limit; u32 tx_fifo_limit;
...@@ -340,9 +335,7 @@ struct e1000_adapter { ...@@ -340,9 +335,7 @@ struct e1000_adapter {
u32 tx_fifo_size; u32 tx_fifo_size;
u32 tx_dma_failed; u32 tx_dma_failed;
/* /* Rx */
* Rx
*/
bool (*clean_rx) (struct e1000_ring *ring, int *work_done, bool (*clean_rx) (struct e1000_ring *ring, int *work_done,
int work_to_do) ____cacheline_aligned_in_smp; int work_to_do) ____cacheline_aligned_in_smp;
void (*alloc_rx_buf) (struct e1000_ring *ring, int cleaned_count, void (*alloc_rx_buf) (struct e1000_ring *ring, int cleaned_count,
......
...@@ -214,7 +214,8 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx) ...@@ -214,7 +214,8 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx)
mac->autoneg = 0; mac->autoneg = 0;
/* Make sure dplx is at most 1 bit and lsb of speed is not set /* Make sure dplx is at most 1 bit and lsb of speed is not set
* for the switch() below to work */ * for the switch() below to work
*/
if ((spd & 1) || (dplx & ~1)) if ((spd & 1) || (dplx & ~1))
goto err_inval; goto err_inval;
...@@ -263,8 +264,7 @@ static int e1000_set_settings(struct net_device *netdev, ...@@ -263,8 +264,7 @@ static int e1000_set_settings(struct net_device *netdev,
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
/* /* When SoL/IDER sessions are active, autoneg/speed/duplex
* When SoL/IDER sessions are active, autoneg/speed/duplex
* cannot be changed * cannot be changed
*/ */
if (hw->phy.ops.check_reset_block && if (hw->phy.ops.check_reset_block &&
...@@ -273,8 +273,7 @@ static int e1000_set_settings(struct net_device *netdev, ...@@ -273,8 +273,7 @@ static int e1000_set_settings(struct net_device *netdev,
return -EINVAL; return -EINVAL;
} }
/* /* MDI setting is only allowed when autoneg enabled because
* MDI setting is only allowed when autoneg enabled because
* some hardware doesn't allow MDI setting when speed or * some hardware doesn't allow MDI setting when speed or
* duplex is forced. * duplex is forced.
*/ */
...@@ -316,8 +315,7 @@ static int e1000_set_settings(struct net_device *netdev, ...@@ -316,8 +315,7 @@ static int e1000_set_settings(struct net_device *netdev,
/* MDI-X => 2; MDI => 1; Auto => 3 */ /* MDI-X => 2; MDI => 1; Auto => 3 */
if (ecmd->eth_tp_mdix_ctrl) { if (ecmd->eth_tp_mdix_ctrl) {
/* /* fix up the value for auto (3 => 0) as zero is mapped
* fix up the value for auto (3 => 0) as zero is mapped
* internally to auto * internally to auto
*/ */
if (ecmd->eth_tp_mdix_ctrl == ETH_TP_MDI_AUTO) if (ecmd->eth_tp_mdix_ctrl == ETH_TP_MDI_AUTO)
...@@ -454,8 +452,8 @@ static void e1000_get_regs(struct net_device *netdev, ...@@ -454,8 +452,8 @@ static void e1000_get_regs(struct net_device *netdev,
regs_buff[12] = adapter->hw.phy.type; /* PHY type (IGP=1, M88=0) */ regs_buff[12] = adapter->hw.phy.type; /* PHY type (IGP=1, M88=0) */
/* ethtool doesn't use anything past this point, so all this /* ethtool doesn't use anything past this point, so all this
* code is likely legacy junk for apps that may or may not * code is likely legacy junk for apps that may or may not exist
* exist */ */
if (hw->phy.type == e1000_phy_m88) { if (hw->phy.type == e1000_phy_m88) {
e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
regs_buff[13] = (u32)phy_data; /* cable length */ regs_buff[13] = (u32)phy_data; /* cable length */
...@@ -598,8 +596,7 @@ static int e1000_set_eeprom(struct net_device *netdev, ...@@ -598,8 +596,7 @@ static int e1000_set_eeprom(struct net_device *netdev,
if (ret_val) if (ret_val)
goto out; goto out;
/* /* Update the checksum over the first part of the EEPROM if needed
* Update the checksum over the first part of the EEPROM if needed
* and flush shadow RAM for applicable controllers * and flush shadow RAM for applicable controllers
*/ */
if ((first_word <= NVM_CHECKSUM_REG) || if ((first_word <= NVM_CHECKSUM_REG) ||
...@@ -623,8 +620,7 @@ static void e1000_get_drvinfo(struct net_device *netdev, ...@@ -623,8 +620,7 @@ static void e1000_get_drvinfo(struct net_device *netdev,
strlcpy(drvinfo->version, e1000e_driver_version, strlcpy(drvinfo->version, e1000e_driver_version,
sizeof(drvinfo->version)); sizeof(drvinfo->version));
/* /* EEPROM image version # is reported as firmware version # for
* EEPROM image version # is reported as firmware version # for
* PCI-E controllers * PCI-E controllers
*/ */
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
...@@ -708,8 +704,7 @@ static int e1000_set_ringparam(struct net_device *netdev, ...@@ -708,8 +704,7 @@ static int e1000_set_ringparam(struct net_device *netdev,
e1000e_down(adapter); e1000e_down(adapter);
/* /* We can't just free everything and then setup again, because the
* We can't just free everything and then setup again, because the
* ISRs in MSI-X mode get passed pointers to the Tx and Rx ring * ISRs in MSI-X mode get passed pointers to the Tx and Rx ring
* structs. First, attempt to allocate new resources... * structs. First, attempt to allocate new resources...
*/ */
...@@ -813,8 +808,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) ...@@ -813,8 +808,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
u32 mask; u32 mask;
u32 wlock_mac = 0; u32 wlock_mac = 0;
/* /* The status register is Read Only, so a write should fail.
* The status register is Read Only, so a write should fail.
* Some bits that get toggled are ignored. * Some bits that get toggled are ignored.
*/ */
switch (mac->type) { switch (mac->type) {
...@@ -996,8 +990,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ...@@ -996,8 +990,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
} }
if (!shared_int) { if (!shared_int) {
/* /* Disable the interrupt to be reported in
* Disable the interrupt to be reported in
* the cause register and then force the same * the cause register and then force the same
* interrupt and see if one gets posted. If * interrupt and see if one gets posted. If
* an interrupt was posted to the bus, the * an interrupt was posted to the bus, the
...@@ -1015,8 +1008,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1015,8 +1008,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
} }
} }
/* /* Enable the interrupt to be reported in
* Enable the interrupt to be reported in
* the cause register and then force the same * the cause register and then force the same
* interrupt and see if one gets posted. If * interrupt and see if one gets posted. If
* an interrupt was not posted to the bus, the * an interrupt was not posted to the bus, the
...@@ -1034,8 +1026,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1034,8 +1026,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
} }
if (!shared_int) { if (!shared_int) {
/* /* Disable the other interrupts to be reported in
* Disable the other interrupts to be reported in
* the cause register and then force the other * the cause register and then force the other
* interrupts and see if any get posted. If * interrupts and see if any get posted. If
* an interrupt was posted to the bus, the * an interrupt was posted to the bus, the
...@@ -1378,8 +1369,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter) ...@@ -1378,8 +1369,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
hw->phy.type == e1000_phy_m88) { hw->phy.type == e1000_phy_m88) {
ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */ ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
} else { } else {
/* /* Set the ILOS bit on the fiber Nic if half duplex link is
* Set the ILOS bit on the fiber Nic if half duplex link is
* detected. * detected.
*/ */
if ((er32(STATUS) & E1000_STATUS_FD) == 0) if ((er32(STATUS) & E1000_STATUS_FD) == 0)
...@@ -1388,8 +1378,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter) ...@@ -1388,8 +1378,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
ew32(CTRL, ctrl_reg); ew32(CTRL, ctrl_reg);
/* /* Disable the receiver on the PHY so when a cable is plugged in, the
* Disable the receiver on the PHY so when a cable is plugged in, the
* PHY does not begin to autoneg when a cable is reconnected to the NIC. * PHY does not begin to autoneg when a cable is reconnected to the NIC.
*/ */
if (hw->phy.type == e1000_phy_m88) if (hw->phy.type == e1000_phy_m88)
...@@ -1408,8 +1397,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter) ...@@ -1408,8 +1397,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)
/* special requirements for 82571/82572 fiber adapters */ /* special requirements for 82571/82572 fiber adapters */
/* /* jump through hoops to make sure link is up because serdes
* jump through hoops to make sure link is up because serdes
* link is hardwired up * link is hardwired up
*/ */
ctrl |= E1000_CTRL_SLU; ctrl |= E1000_CTRL_SLU;
...@@ -1429,8 +1417,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter) ...@@ -1429,8 +1417,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)
ew32(CTRL, ctrl); ew32(CTRL, ctrl);
} }
/* /* special write to serdes control register to enable SerDes analog
* special write to serdes control register to enable SerDes analog
* loopback * loopback
*/ */
#define E1000_SERDES_LB_ON 0x410 #define E1000_SERDES_LB_ON 0x410
...@@ -1448,8 +1435,7 @@ static int e1000_set_es2lan_mac_loopback(struct e1000_adapter *adapter) ...@@ -1448,8 +1435,7 @@ static int e1000_set_es2lan_mac_loopback(struct e1000_adapter *adapter)
u32 ctrlext = er32(CTRL_EXT); u32 ctrlext = er32(CTRL_EXT);
u32 ctrl = er32(CTRL); u32 ctrl = er32(CTRL);
/* /* save CTRL_EXT to restore later, reuse an empty variable (unused
* save CTRL_EXT to restore later, reuse an empty variable (unused
* on mac_type 80003es2lan) * on mac_type 80003es2lan)
*/ */
adapter->tx_fifo_head = ctrlext; adapter->tx_fifo_head = ctrlext;
...@@ -1585,8 +1571,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) ...@@ -1585,8 +1571,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
ew32(RDT(0), rx_ring->count - 1); ew32(RDT(0), rx_ring->count - 1);
/* /* Calculate the loop count based on the largest descriptor ring
* Calculate the loop count based on the largest descriptor ring
* The idea is to wrap the largest ring a number of times using 64 * The idea is to wrap the largest ring a number of times using 64
* send/receive pairs during each loop * send/receive pairs during each loop
*/ */
...@@ -1627,8 +1612,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter) ...@@ -1627,8 +1612,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
l++; l++;
if (l == rx_ring->count) if (l == rx_ring->count)
l = 0; l = 0;
/* /* time + 20 msecs (200 msecs on 2.4) is more than
* time + 20 msecs (200 msecs on 2.4) is more than
* enough time to complete the receives, if it's * enough time to complete the receives, if it's
* exceeded, break and error off * exceeded, break and error off
*/ */
...@@ -1649,10 +1633,7 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1649,10 +1633,7 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
/* /* PHY loopback cannot be performed if SoL/IDER sessions are active */
* PHY loopback cannot be performed if SoL/IDER
* sessions are active
*/
if (hw->phy.ops.check_reset_block && if (hw->phy.ops.check_reset_block &&
hw->phy.ops.check_reset_block(hw)) { hw->phy.ops.check_reset_block(hw)) {
e_err("Cannot do PHY loopback test when SoL/IDER is active.\n"); e_err("Cannot do PHY loopback test when SoL/IDER is active.\n");
...@@ -1686,8 +1667,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1686,8 +1667,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
int i = 0; int i = 0;
hw->mac.serdes_has_link = false; hw->mac.serdes_has_link = false;
/* /* On some blade server designs, link establishment
* On some blade server designs, link establishment
* could take as long as 2-3 minutes * could take as long as 2-3 minutes
*/ */
do { do {
...@@ -1701,8 +1681,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1701,8 +1681,7 @@ static int e1000_link_test(struct e1000_adapter *adapter, u64 *data)
} else { } else {
hw->mac.ops.check_for_link(hw); hw->mac.ops.check_for_link(hw);
if (hw->mac.autoneg) if (hw->mac.autoneg)
/* /* On some Phy/switch combinations, link establishment
* On some Phy/switch combinations, link establishment
* can take a few seconds more than expected. * can take a few seconds more than expected.
*/ */
msleep(5000); msleep(5000);
......
...@@ -85,8 +85,7 @@ enum e1e_registers { ...@@ -85,8 +85,7 @@ enum e1e_registers {
E1000_FCRTL = 0x02160, /* Flow Control Receive Threshold Low - RW */ E1000_FCRTL = 0x02160, /* Flow Control Receive Threshold Low - RW */
E1000_FCRTH = 0x02168, /* Flow Control Receive Threshold High - RW */ E1000_FCRTH = 0x02168, /* Flow Control Receive Threshold High - RW */
E1000_PSRCTL = 0x02170, /* Packet Split Receive Control - RW */ E1000_PSRCTL = 0x02170, /* Packet Split Receive Control - RW */
/* /* Convenience macros
* Convenience macros
* *
* Note: "_n" is the queue number of the register to be written to. * Note: "_n" is the queue number of the register to be written to.
* *
...@@ -800,8 +799,7 @@ struct e1000_mac_operations { ...@@ -800,8 +799,7 @@ struct e1000_mac_operations {
s32 (*read_mac_addr)(struct e1000_hw *); s32 (*read_mac_addr)(struct e1000_hw *);
}; };
/* /* When to use various PHY register access functions:
* When to use various PHY register access functions:
* *
* Func Caller * Func Caller
* Function Does Does When to use * Function Does Does When to use
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
*******************************************************************************/ *******************************************************************************/
/* /* 82562G 10/100 Network Connection
* 82562G 10/100 Network Connection
* 82562G-2 10/100 Network Connection * 82562G-2 10/100 Network Connection
* 82562GT 10/100 Network Connection * 82562GT 10/100 Network Connection
* 82562GT-2 10/100 Network Connection * 82562GT-2 10/100 Network Connection
...@@ -354,8 +353,7 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) ...@@ -354,8 +353,7 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)
return true; return true;
} }
/* /* In case the PHY needs to be in mdio slow mode,
* In case the PHY needs to be in mdio slow mode,
* set slow mode and try to get the PHY id again. * set slow mode and try to get the PHY id again.
*/ */
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
...@@ -386,8 +384,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) ...@@ -386,8 +384,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
return ret_val; return ret_val;
} }
/* /* The MAC-PHY interconnect may be in SMBus mode. If the PHY is
* The MAC-PHY interconnect may be in SMBus mode. If the PHY is
* inaccessible and resetting the PHY is not blocked, toggle the * inaccessible and resetting the PHY is not blocked, toggle the
* LANPHYPC Value bit to force the interconnect to PCIe mode. * LANPHYPC Value bit to force the interconnect to PCIe mode.
*/ */
...@@ -396,8 +393,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) ...@@ -396,8 +393,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
if (e1000_phy_is_accessible_pchlan(hw)) if (e1000_phy_is_accessible_pchlan(hw))
break; break;
/* /* Before toggling LANPHYPC, see if PHY is accessible by
* Before toggling LANPHYPC, see if PHY is accessible by
* forcing MAC to SMBus mode first. * forcing MAC to SMBus mode first.
*/ */
mac_reg = er32(CTRL_EXT); mac_reg = er32(CTRL_EXT);
...@@ -406,8 +402,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) ...@@ -406,8 +402,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
/* fall-through */ /* fall-through */
case e1000_pch2lan: case e1000_pch2lan:
/* /* Gate automatic PHY configuration by hardware on
* Gate automatic PHY configuration by hardware on
* non-managed 82579 * non-managed 82579
*/ */
if ((hw->mac.type == e1000_pch2lan) && if ((hw->mac.type == e1000_pch2lan) &&
...@@ -474,8 +469,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) ...@@ -474,8 +469,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
/* /* Reset the PHY before any access to it. Doing so, ensures
* Reset the PHY before any access to it. Doing so, ensures
* that the PHY is in a known good state before we read/write * that the PHY is in a known good state before we read/write
* PHY registers. The generic reset is sufficient here, * PHY registers. The generic reset is sufficient here,
* because we haven't determined the PHY type yet. * because we haven't determined the PHY type yet.
...@@ -536,8 +530,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) ...@@ -536,8 +530,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
/* fall-through */ /* fall-through */
case e1000_pch2lan: case e1000_pch2lan:
case e1000_pch_lpt: case e1000_pch_lpt:
/* /* In case the PHY needs to be in mdio slow mode,
* In case the PHY needs to be in mdio slow mode,
* set slow mode and try to get the PHY id again. * set slow mode and try to get the PHY id again.
*/ */
ret_val = e1000_set_mdio_slow_mode_hv(hw); ret_val = e1000_set_mdio_slow_mode_hv(hw);
...@@ -593,8 +586,7 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw) ...@@ -593,8 +586,7 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
phy->ops.power_up = e1000_power_up_phy_copper; phy->ops.power_up = e1000_power_up_phy_copper;
phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; 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 * we'll set BM func pointers and try again
*/ */
ret_val = e1000e_determine_phy_address(hw); ret_val = e1000e_determine_phy_address(hw);
...@@ -679,8 +671,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw) ...@@ -679,8 +671,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
gfpreg = er32flash(ICH_FLASH_GFPREG); gfpreg = er32flash(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 * Add 1 to sector_end_addr since this sector is included in
* the overall size. * the overall size.
*/ */
...@@ -690,8 +681,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw) ...@@ -690,8 +681,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
/* flash_base_addr is byte-aligned */ /* flash_base_addr is byte-aligned */
nvm->flash_base_addr = sector_base_addr << FLASH_SECTOR_ADDR_SHIFT; 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. * size represents two separate NVM banks.
*/ */
nvm->flash_bank_size = (sector_end_addr - sector_base_addr) nvm->flash_bank_size = (sector_end_addr - sector_base_addr)
...@@ -788,8 +778,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) ...@@ -788,8 +778,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
if (mac->type == e1000_ich8lan) if (mac->type == e1000_ich8lan)
e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true);
/* /* Gate automatic PHY configuration by hardware on managed
* Gate automatic PHY configuration by hardware on managed
* 82579 and i217 * 82579 and i217
*/ */
if ((mac->type == e1000_pch2lan || mac->type == e1000_pch_lpt) && if ((mac->type == e1000_pch2lan || mac->type == e1000_pch_lpt) &&
...@@ -840,8 +829,7 @@ static s32 e1000_set_eee_pchlan(struct e1000_hw *hw) ...@@ -840,8 +829,7 @@ static s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
goto release; goto release;
e1e_rphy_locked(hw, I82579_EMI_DATA, &dev_spec->eee_lp_ability); e1e_rphy_locked(hw, I82579_EMI_DATA, &dev_spec->eee_lp_ability);
/* /* EEE is not supported in 100Half, so ignore partner's EEE
* EEE is not supported in 100Half, so ignore partner's EEE
* in 100 ability if full-duplex is not advertised. * in 100 ability if full-duplex is not advertised.
*/ */
e1e_rphy_locked(hw, PHY_LP_ABILITY, &phy_reg); e1e_rphy_locked(hw, PHY_LP_ABILITY, &phy_reg);
...@@ -869,8 +857,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -869,8 +857,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
bool link; bool link;
u16 phy_reg; u16 phy_reg;
/* /* 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 * has completed and/or if our link status has changed. The
* get_link_status flag is set upon receiving a Link Status * get_link_status flag is set upon receiving a Link Status
* Change or Rx Sequence Error interrupt. * Change or Rx Sequence Error interrupt.
...@@ -878,8 +865,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -878,8 +865,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
if (!mac->get_link_status) if (!mac->get_link_status)
return 0; return 0;
/* /* 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 * link. If so, then we want to get the current speed/duplex
* of the PHY. * of the PHY.
*/ */
...@@ -914,8 +900,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -914,8 +900,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
return ret_val; 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 * Set the number of preambles removed from the packet
* when it is passed from the PHY to the MAC to prevent * when it is passed from the PHY to the MAC to prevent
* the MAC from misinterpreting the packet type. * the MAC from misinterpreting the packet type.
...@@ -932,8 +917,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -932,8 +917,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
break; break;
} }
/* /* Check if there was DownShift, must be checked
* Check if there was DownShift, must be checked
* immediately after link-up * immediately after link-up
*/ */
e1000e_check_downshift(hw); e1000e_check_downshift(hw);
...@@ -943,22 +927,19 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -943,22 +927,19 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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. * we have already determined whether we have link or not.
*/ */
if (!mac->autoneg) if (!mac->autoneg)
return -E1000_ERR_CONFIG; 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 * of MAC speed/duplex configuration. So we only need to
* configure Collision Distance in the MAC. * configure Collision Distance in the MAC.
*/ */
mac->ops.config_collision_dist(hw); 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 * First, we need to restore the desired flow control
* settings because we may have had to re-autoneg with a * settings because we may have had to re-autoneg with a
* different link partner. * different link partner.
...@@ -1000,8 +981,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) ...@@ -1000,8 +981,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
if (rc) if (rc)
return rc; return rc;
/* /* Disable Jumbo Frame support on parts with Intel 10/100 PHY or
* Disable Jumbo Frame support on parts with Intel 10/100 PHY or
* on parts with MACsec enabled in NVM (reflected in CTRL_EXT). * on parts with MACsec enabled in NVM (reflected in CTRL_EXT).
*/ */
if ((adapter->hw.phy.type == e1000_phy_ife) || if ((adapter->hw.phy.type == e1000_phy_ife) ||
...@@ -1191,8 +1171,7 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) ...@@ -1191,8 +1171,7 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index)
{ {
u32 rar_low, rar_high; u32 rar_low, rar_high;
/* /* 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 * from network order (big endian) to little endian
*/ */
rar_low = ((u32)addr[0] | rar_low = ((u32)addr[0] |
...@@ -1256,8 +1235,7 @@ static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) ...@@ -1256,8 +1235,7 @@ static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index)
u32 rar_low, rar_high; u32 rar_low, rar_high;
u32 wlock_mac; u32 wlock_mac;
/* /* 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 * from network order (big endian) to little endian
*/ */
rar_low = ((u32)addr[0] | ((u32)addr[1] << 8) | rar_low = ((u32)addr[0] | ((u32)addr[1] << 8) |
...@@ -1277,8 +1255,7 @@ static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) ...@@ -1277,8 +1255,7 @@ static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index)
return; return;
} }
/* /* The manageability engine (ME) can lock certain SHRAR registers that
* The manageability engine (ME) can lock certain SHRAR registers that
* it is using - those registers are unavailable for use. * it is using - those registers are unavailable for use.
*/ */
if (index < hw->mac.rar_entry_count) { if (index < hw->mac.rar_entry_count) {
...@@ -1387,8 +1364,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) ...@@ -1387,8 +1364,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
s32 ret_val = 0; s32 ret_val = 0;
u16 word_addr, reg_data, reg_addr, phy_page = 0; u16 word_addr, reg_data, reg_addr, phy_page = 0;
/* /* 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 * is needed due to an issue where the NVM configuration is
* not properly autoloaded after power transitions. * not properly autoloaded after power transitions.
* Therefore, after each PHY reset, we will load the * Therefore, after each PHY reset, we will load the
...@@ -1422,8 +1398,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) ...@@ -1422,8 +1398,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
if (!(data & sw_cfg_mask)) if (!(data & sw_cfg_mask))
goto release; 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 * extended configuration before SW configuration
*/ */
data = er32(EXTCNF_CTRL); data = er32(EXTCNF_CTRL);
...@@ -1443,8 +1418,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) ...@@ -1443,8 +1418,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
if (((hw->mac.type == e1000_pchlan) && if (((hw->mac.type == e1000_pchlan) &&
!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)) || !(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)) ||
(hw->mac.type > e1000_pchlan)) { (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. * OEM and LCD Write Enable bits are set in the NVM.
* When both NVM bits are cleared, SW will configure * When both NVM bits are cleared, SW will configure
* them instead. * them instead.
...@@ -1748,8 +1722,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -1748,8 +1722,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
} }
if (hw->phy.type == e1000_phy_82578) { 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. * writing 0x3140 to the control register.
*/ */
if (hw->phy.revision < 2) { if (hw->phy.revision < 2) {
...@@ -1769,8 +1742,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -1769,8 +1742,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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. * link so that it disables K1 if link is in 1Gbps.
*/ */
ret_val = e1000_k1_gig_workaround_hv(hw, true); ret_val = e1000_k1_gig_workaround_hv(hw, true);
...@@ -1853,8 +1825,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) ...@@ -1853,8 +1825,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
return ret_val; return ret_val;
if (enable) { if (enable) {
/* /* Write Rx addresses (rar_entry_count for RAL/H, +4 for
* Write Rx addresses (rar_entry_count for RAL/H, +4 for
* SHRAL/H) and initial CRC values to the MAC * SHRAL/H) and initial CRC values to the MAC
*/ */
for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) { for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {
...@@ -2131,8 +2102,7 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw) ...@@ -2131,8 +2102,7 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw)
udelay(100); udelay(100);
} while ((!data) && --loop); } 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 * count reaches 0, loading the configuration from NVM will
* leave the PHY in a bad state possibly resulting in no link. * leave the PHY in a bad state possibly resulting in no link.
*/ */
...@@ -2299,8 +2269,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active) ...@@ -2299,8 +2269,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
if (phy->type != e1000_phy_igp_3) if (phy->type != e1000_phy_igp_3)
return 0; return 0;
/* /* Call gig speed drop workaround on LPLU before accessing
* Call gig speed drop workaround on LPLU before accessing
* any PHY registers * any PHY registers
*/ */
if (hw->mac.type == e1000_ich8lan) if (hw->mac.type == e1000_ich8lan)
...@@ -2319,8 +2288,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active) ...@@ -2319,8 +2288,7 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
if (phy->type != e1000_phy_igp_3) if (phy->type != e1000_phy_igp_3)
return 0; return 0;
/* /* 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 * during Dx states where the power conservation is most
* important. During driver activity we should enable * important. During driver activity we should enable
* SmartSpeed, so performance is maintained. * SmartSpeed, so performance is maintained.
...@@ -2382,8 +2350,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active) ...@@ -2382,8 +2350,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
if (phy->type != e1000_phy_igp_3) if (phy->type != e1000_phy_igp_3)
return 0; return 0;
/* /* 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 * during Dx states where the power conservation is most
* important. During driver activity we should enable * important. During driver activity we should enable
* SmartSpeed, so performance is maintained. * SmartSpeed, so performance is maintained.
...@@ -2420,8 +2387,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active) ...@@ -2420,8 +2387,7 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
if (phy->type != e1000_phy_igp_3) if (phy->type != e1000_phy_igp_3)
return 0; return 0;
/* /* Call gig speed drop workaround on LPLU before accessing
* Call gig speed drop workaround on LPLU before accessing
* any PHY registers * any PHY registers
*/ */
if (hw->mac.type == e1000_ich8lan) if (hw->mac.type == e1000_ich8lan)
...@@ -2589,8 +2555,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) ...@@ -2589,8 +2555,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval); ew16flash(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 * bit to check against, in order to start a new cycle or
* FDONE bit should be changed in the hardware so that it * FDONE bit should be changed in the hardware so that it
* is 1 after hardware reset, which can then be used as an * is 1 after hardware reset, which can then be used as an
...@@ -2599,8 +2564,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) ...@@ -2599,8 +2564,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
*/ */
if (!hsfsts.hsf_status.flcinprog) { 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. * so we can start a cycle.
* Begin by setting Flash Cycle Done. * Begin by setting Flash Cycle Done.
*/ */
...@@ -2610,8 +2574,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) ...@@ -2610,8 +2574,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
} else { } else {
s32 i; 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. * cycle has a chance to end before giving up.
*/ */
for (i = 0; i < ICH_FLASH_READ_COMMAND_TIMEOUT; i++) { for (i = 0; i < ICH_FLASH_READ_COMMAND_TIMEOUT; i++) {
...@@ -2623,8 +2586,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw) ...@@ -2623,8 +2586,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
udelay(1); udelay(1);
} }
if (!ret_val) { if (!ret_val) {
/* /* Successful in waiting for previous cycle to timeout,
* Successful in waiting for previous cycle to timeout,
* now set the Flash Cycle Done. * now set the Flash Cycle Done.
*/ */
hsfsts.hsf_status.flcdone = 1; hsfsts.hsf_status.flcdone = 1;
...@@ -2753,8 +2715,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, ...@@ -2753,8 +2715,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
ret_val = e1000_flash_cycle_ich8lan(hw, ret_val = e1000_flash_cycle_ich8lan(hw,
ICH_FLASH_READ_COMMAND_TIMEOUT); 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 * and try the whole sequence a few more times, else
* read in (shift in) the Flash Data0, the order is * read in (shift in) the Flash Data0, the order is
* least significant byte first msb to lsb * least significant byte first msb to lsb
...@@ -2767,8 +2728,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, ...@@ -2767,8 +2728,7 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
*data = (u16)(flash_data & 0x0000FFFF); *data = (u16)(flash_data & 0x0000FFFF);
break; break;
} else { } 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 * completely hosed, but if the error condition is
* detected, it won't hurt to give it another try... * detected, it won't hurt to give it another try...
* ICH_FLASH_CYCLE_REPEAT_COUNT times. * ICH_FLASH_CYCLE_REPEAT_COUNT times.
...@@ -2849,8 +2809,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2849,8 +2809,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
nvm->ops.acquire(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 * write to bank 0 etc. We also need to erase the segment that
* is going to be written * is going to be written
*/ */
...@@ -2875,8 +2834,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2875,8 +2834,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
} }
for (i = 0; i < E1000_ICH8_SHADOW_RAM_WORDS; i++) { for (i = 0; i < E1000_ICH8_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 other NVM bank or a modified value stored
* in the shadow RAM * in the shadow RAM
*/ */
...@@ -2890,8 +2848,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2890,8 +2848,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
break; 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. * (15:14) are 11b until the commit has completed.
* This will allow us to write 10b which indicates the * This will allow us to write 10b which indicates the
* signature is valid. We want to do this after the write * signature is valid. We want to do this after the write
...@@ -2920,8 +2877,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2920,8 +2877,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
break; break;
} }
/* /* Don't bother writing the segment valid bits if sector
* Don't bother writing the segment valid bits if sector
* programming failed. * programming failed.
*/ */
if (ret_val) { if (ret_val) {
...@@ -2930,8 +2886,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2930,8 +2886,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
goto release; 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 * to 10b in word 0x13 , this can be done without an
* erase as well since these bits are 11 to start with * erase as well since these bits are 11 to start with
* and we need to change bit 14 to 0b * and we need to change bit 14 to 0b
...@@ -2948,8 +2903,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2948,8 +2903,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
if (ret_val) if (ret_val)
goto release; 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 * its signature word (0x13) high_byte to 0b. This can be
* done without an erase because flash erase sets all bits * done without an erase because flash erase sets all bits
* to 1's. We can write 1's to 0's without an erase * to 1's. We can write 1's to 0's without an erase
...@@ -2968,8 +2922,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2968,8 +2922,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
release: release:
nvm->ops.release(hw); 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. * until after the next adapter reset.
*/ */
if (!ret_val) { if (!ret_val) {
...@@ -2997,8 +2950,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw) ...@@ -2997,8 +2950,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
u16 data; u16 data;
/* /* Read 0x19 and check bit 6. If this bit is 0, the checksum
* Read 0x19 and check bit 6. If this bit is 0, the checksum
* needs to be fixed. This bit is an indication that the NVM * needs to be fixed. This bit is an indication that the NVM
* was prepared by OEM software and did not calculate the * was prepared by OEM software and did not calculate the
* checksum...a likely scenario. * checksum...a likely scenario.
...@@ -3048,8 +3000,7 @@ void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw) ...@@ -3048,8 +3000,7 @@ void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw)
pr0.range.wpe = true; pr0.range.wpe = true;
ew32flash(ICH_FLASH_PR0, pr0.regval); ew32flash(ICH_FLASH_PR0, pr0.regval);
/* /* Lock down a subset of GbE Flash Control Registers, e.g.
* Lock down a subset of GbE Flash Control Registers, e.g.
* PR0 to prevent the write-protection from being lifted. * PR0 to prevent the write-protection from being lifted.
* Once FLOCKDN is set, the registers protected by it cannot * Once FLOCKDN is set, the registers protected by it cannot
* be written until FLOCKDN is cleared by a hardware reset. * be written until FLOCKDN is cleared by a hardware reset.
...@@ -3109,8 +3060,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, ...@@ -3109,8 +3060,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
ew32flash(ICH_FLASH_FDATA0, flash_data); ew32flash(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 * and try the whole sequence a few more times else done
*/ */
ret_val = e1000_flash_cycle_ich8lan(hw, ret_val = e1000_flash_cycle_ich8lan(hw,
...@@ -3118,8 +3068,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, ...@@ -3118,8 +3068,7 @@ static s32 e1000_write_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,
if (!ret_val) if (!ret_val)
break; 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 * completely hosed, but if the error condition
* is detected, it won't hurt to give it another * is detected, it won't hurt to give it another
* try...ICH_FLASH_CYCLE_REPEAT_COUNT times. * try...ICH_FLASH_CYCLE_REPEAT_COUNT times.
...@@ -3207,8 +3156,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) ...@@ -3207,8 +3156,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
hsfsts.regval = er16flash(ICH_FLASH_HSFSTS); hsfsts.regval = er16flash(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 * register
* 00: The Hw sector is 256 bytes, hence we need to erase 16 * 00: The Hw sector is 256 bytes, hence we need to erase 16
* consecutive sectors. The start index for the nth Hw sector * consecutive sectors. The start index for the nth Hw sector
...@@ -3253,16 +3201,14 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) ...@@ -3253,16 +3201,14 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
if (ret_val) if (ret_val)
return 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 * Cycle field in hw flash control
*/ */
hsflctl.regval = er16flash(ICH_FLASH_HSFCTL); hsflctl.regval = er16flash(ICH_FLASH_HSFCTL);
hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_ERASE; hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_ERASE;
ew16flash(ICH_FLASH_HSFCTL, hsflctl.regval); ew16flash(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 * block into Flash Linear address field in Flash
* Address. * Address.
*/ */
...@@ -3274,8 +3220,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank) ...@@ -3274,8 +3220,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
if (!ret_val) if (!ret_val)
break; 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 * clear it and try the whole sequence
* a few more times else Done * a few more times else Done
*/ */
...@@ -3403,8 +3348,7 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw) ...@@ -3403,8 +3348,7 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
ret_val = e1000e_get_bus_info_pcie(hw); ret_val = e1000e_get_bus_info_pcie(hw);
/* /* ICH devices are "PCI Express"-ish. They have
* ICH devices are "PCI Express"-ish. They have
* a configuration space, but do not contain * a configuration space, but do not contain
* PCI Express Capability registers, so bus width * PCI Express Capability registers, so bus width
* must be hardcoded. * must be hardcoded.
...@@ -3429,8 +3373,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) ...@@ -3429,8 +3373,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
u32 ctrl, reg; u32 ctrl, reg;
s32 ret_val; s32 ret_val;
/* /* 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. * on the last TLP read/write transaction when MAC is reset.
*/ */
ret_val = e1000e_disable_pcie_master(hw); ret_val = e1000e_disable_pcie_master(hw);
...@@ -3440,8 +3383,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) ...@@ -3440,8 +3383,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
e_dbg("Masking off all interrupts\n"); e_dbg("Masking off all interrupts\n");
ew32(IMC, 0xffffffff); ew32(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 * any pending transactions to complete before we hit the MAC
* with the global reset. * with the global reset.
*/ */
...@@ -3474,15 +3416,13 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) ...@@ -3474,15 +3416,13 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
ctrl = er32(CTRL); ctrl = er32(CTRL);
if (!hw->phy.ops.check_reset_block(hw)) { 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 * time to make sure the interface between MAC and the
* external PHY is reset. * external PHY is reset.
*/ */
ctrl |= E1000_CTRL_PHY_RST; ctrl |= E1000_CTRL_PHY_RST;
/* /* Gate automatic PHY configuration by hardware on
* Gate automatic PHY configuration by hardware on
* non-managed 82579 * non-managed 82579
*/ */
if ((hw->mac.type == e1000_pch2lan) && if ((hw->mac.type == e1000_pch2lan) &&
...@@ -3516,8 +3456,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) ...@@ -3516,8 +3456,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
return ret_val; 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 * will be detected as a CRC error and be dropped rather than show up
* as a bad packet to the DMA engine. * as a bad packet to the DMA engine.
*/ */
...@@ -3569,8 +3508,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) ...@@ -3569,8 +3508,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
for (i = 0; i < mac->mta_reg_count; i++) for (i = 0; i < mac->mta_reg_count; i++)
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); 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. * the ME. Disable wakeup by clearing the host wakeup bit.
* Reset the phy after disabling host wakeup to reset the Rx buffer. * Reset the phy after disabling host wakeup to reset the Rx buffer.
*/ */
...@@ -3600,8 +3538,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) ...@@ -3600,8 +3538,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
E1000_TXDCTL_MAX_TX_DESC_PREFETCH; E1000_TXDCTL_MAX_TX_DESC_PREFETCH;
ew32(TXDCTL(1), txdctl); ew32(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. * By default, we should use snoop behavior.
*/ */
if (mac->type == e1000_ich8lan) if (mac->type == e1000_ich8lan)
...@@ -3614,8 +3551,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) ...@@ -3614,8 +3551,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
ctrl_ext |= E1000_CTRL_EXT_RO_DIS; ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
ew32(CTRL_EXT, ctrl_ext); ew32(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 * important that we do this after we have tried to establish link
* because the symbol error count will increment wildly if there * because the symbol error count will increment wildly if there
* is no link. * is no link.
...@@ -3676,15 +3612,13 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw) ...@@ -3676,15 +3612,13 @@ static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw)
ew32(STATUS, reg); ew32(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 * traffic, just disable the nfs filtering capability
*/ */
reg = er32(RFCTL); reg = er32(RFCTL);
reg |= (E1000_RFCTL_NFSW_DIS | E1000_RFCTL_NFSR_DIS); 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. * IPv6 headers can hang the Rx.
*/ */
if (hw->mac.type == e1000_ich8lan) if (hw->mac.type == e1000_ich8lan)
...@@ -3709,8 +3643,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw) ...@@ -3709,8 +3643,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
if (hw->phy.ops.check_reset_block(hw)) if (hw->phy.ops.check_reset_block(hw))
return 0; return 0;
/* /* 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 * the default flow control setting, so we explicitly
* set it to full. * set it to full.
*/ */
...@@ -3722,8 +3655,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw) ...@@ -3722,8 +3655,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
hw->fc.requested_mode = e1000_fc_full; 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. * on the link partner's capabilities, we may or may not use this mode.
*/ */
hw->fc.current_mode = hw->fc.requested_mode; hw->fc.current_mode = hw->fc.requested_mode;
...@@ -3771,8 +3703,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw) ...@@ -3771,8 +3703,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw)
ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
ew32(CTRL, ctrl); ew32(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; * and increase the max iterations when polling the phy;
* this fixes erroneous timeouts at 10Mbps. * this fixes erroneous timeouts at 10Mbps.
*/ */
...@@ -3892,8 +3823,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw) ...@@ -3892,8 +3823,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
if (!dev_spec->kmrn_lock_loss_workaround_enabled) if (!dev_spec->kmrn_lock_loss_workaround_enabled)
return 0; return 0;
/* /* 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 * Attempting this while link is negotiating fouled up link
* stability * stability
*/ */
...@@ -3925,8 +3855,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw) ...@@ -3925,8 +3855,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
E1000_PHY_CTRL_NOND0A_GBE_DISABLE); E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
ew32(PHY_CTRL, phy_ctrl); ew32(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 * any PHY registers
*/ */
e1000e_gig_downshift_workaround_ich8lan(hw); e1000e_gig_downshift_workaround_ich8lan(hw);
...@@ -3983,8 +3912,7 @@ void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw) ...@@ -3983,8 +3912,7 @@ void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
E1000_PHY_CTRL_NOND0A_GBE_DISABLE); E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
ew32(PHY_CTRL, reg); ew32(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 * accessing any PHY registers
*/ */
if (hw->mac.type == e1000_ich8lan) if (hw->mac.type == e1000_ich8lan)
...@@ -4078,8 +4006,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -4078,8 +4006,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
goto release; goto release;
e1e_rphy_locked(hw, I82579_EMI_DATA, &eee_advert); e1e_rphy_locked(hw, I82579_EMI_DATA, &eee_advert);
/* /* 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 * EEE and 100Full is advertised on both ends of the
* link. * link.
*/ */
...@@ -4091,8 +4018,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -4091,8 +4018,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
E1000_PHY_CTRL_NOND0A_LPLU); 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 * when the system is going into Sx and no manageability engine
* is present, the driver must configure proxy to reset only on * is present, the driver must configure proxy to reset only on
* power good. LPI (Low Power Idle) state must also reset only * power good. LPI (Low Power Idle) state must also reset only
...@@ -4106,8 +4032,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -4106,8 +4032,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
phy_reg |= I217_PROXY_CTRL_AUTO_DISABLE; phy_reg |= I217_PROXY_CTRL_AUTO_DISABLE;
e1e_wphy_locked(hw, I217_PROXY_CTRL, phy_reg); e1e_wphy_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. * power good.
*/ */
e1e_rphy_locked(hw, I217_SxCTRL, &phy_reg); e1e_rphy_locked(hw, I217_SxCTRL, &phy_reg);
...@@ -4120,8 +4045,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -4120,8 +4045,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
e1e_wphy_locked(hw, I217_MEMPWR, phy_reg); e1e_wphy_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 * Support
*/ */
e1e_rphy_locked(hw, I217_CGFREG, &phy_reg); e1e_rphy_locked(hw, I217_CGFREG, &phy_reg);
...@@ -4175,8 +4099,7 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) ...@@ -4175,8 +4099,7 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
return; 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 * is transitioning from Sx and no manageability engine is present
* configure SMBus to restore on reset, disable proxy, and enable * configure SMBus to restore on reset, disable proxy, and enable
* the reset on MTA (Multicast table array). * the reset on MTA (Multicast table array).
...@@ -4191,8 +4114,7 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) ...@@ -4191,8 +4114,7 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
} }
if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
/* /* Restore clear on SMB if no manageability engine
* Restore clear on SMB if no manageability engine
* is present * is present
*/ */
ret_val = e1e_rphy_locked(hw, I217_MEMPWR, &phy_reg); ret_val = e1e_rphy_locked(hw, I217_MEMPWR, &phy_reg);
...@@ -4298,8 +4220,7 @@ static s32 e1000_led_on_pchlan(struct e1000_hw *hw) ...@@ -4298,8 +4220,7 @@ static s32 e1000_led_on_pchlan(struct e1000_hw *hw)
u16 data = (u16)hw->mac.ledctl_mode2; u16 data = (u16)hw->mac.ledctl_mode2;
u32 i, led; u32 i, led;
/* /* 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. * for each LED that's mode is "link_up" in ledctl_mode2.
*/ */
if (!(er32(STATUS) & E1000_STATUS_LU)) { if (!(er32(STATUS) & E1000_STATUS_LU)) {
...@@ -4329,8 +4250,7 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw) ...@@ -4329,8 +4250,7 @@ static s32 e1000_led_off_pchlan(struct e1000_hw *hw)
u16 data = (u16)hw->mac.ledctl_mode1; u16 data = (u16)hw->mac.ledctl_mode1;
u32 i, led; u32 i, led;
/* /* 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. * for each LED that's mode is "link_up" in ledctl_mode1.
*/ */
if (!(er32(STATUS) & E1000_STATUS_LU)) { if (!(er32(STATUS) & E1000_STATUS_LU)) {
...@@ -4375,8 +4295,7 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) ...@@ -4375,8 +4295,7 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
} else { } else {
ret_val = e1000e_get_auto_rd_done(hw); ret_val = e1000e_get_auto_rd_done(hw);
if (ret_val) { 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 * return with an error. This can happen in situations
* where there is no eeprom and prevents getting link. * where there is no eeprom and prevents getting link.
*/ */
......
...@@ -73,8 +73,7 @@ void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw) ...@@ -73,8 +73,7 @@ void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw)
struct e1000_bus_info *bus = &hw->bus; struct e1000_bus_info *bus = &hw->bus;
u32 reg; 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. * for the device regardless of function swap state.
*/ */
reg = er32(STATUS); reg = er32(STATUS);
...@@ -210,8 +209,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) ...@@ -210,8 +209,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
return 0; return 0;
} }
/* /* 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 * same as the normal permanent MAC address stored by the HW into the
* RAR. Do this by mapping this address into RAR0. * RAR. Do this by mapping this address into RAR0.
*/ */
...@@ -233,8 +231,7 @@ void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) ...@@ -233,8 +231,7 @@ void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
{ {
u32 rar_low, rar_high; u32 rar_low, rar_high;
/* /* 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 * from network order (big endian) to little endian
*/ */
rar_low = ((u32)addr[0] | ((u32)addr[1] << 8) | rar_low = ((u32)addr[0] | ((u32)addr[1] << 8) |
...@@ -246,8 +243,7 @@ void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) ...@@ -246,8 +243,7 @@ void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
if (rar_low || rar_high) if (rar_low || rar_high)
rar_high |= E1000_RAH_AV; 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. * a single burst write, which will malfunction on some parts.
* The flushes avoid this. * The flushes avoid this.
*/ */
...@@ -273,15 +269,13 @@ static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr) ...@@ -273,15 +269,13 @@ static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
/* Register count multiplied by bits per register */ /* Register count multiplied by bits per register */
hash_mask = (hw->mac.mta_reg_count * 32) - 1; 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. * where 0xFF would still fall within the hash mask.
*/ */
while (hash_mask >> bit_shift != 0xFF) while (hash_mask >> bit_shift != 0xFF)
bit_shift++; 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. * is determined by the mc_filter_type setting.
* The algorithm is such that there is a total of 8 bits of shifting. * 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 * The bit_shift for a mc_filter_type of 0 represents the number of
...@@ -423,8 +417,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) ...@@ -423,8 +417,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
bool link; bool 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 * has completed and/or if our link status has changed. The
* get_link_status flag is set upon receiving a Link Status * get_link_status flag is set upon receiving a Link Status
* Change or Rx Sequence Error interrupt. * Change or Rx Sequence Error interrupt.
...@@ -432,8 +425,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) ...@@ -432,8 +425,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
if (!mac->get_link_status) if (!mac->get_link_status)
return 0; return 0;
/* /* 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 * link. If so, then we want to get the current speed/duplex
* of the PHY. * of the PHY.
*/ */
...@@ -446,28 +438,24 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw) ...@@ -446,28 +438,24 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
mac->get_link_status = false; 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 * immediately after link-up
*/ */
e1000e_check_downshift(hw); e1000e_check_downshift(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. * we have already determined whether we have link or not.
*/ */
if (!mac->autoneg) if (!mac->autoneg)
return -E1000_ERR_CONFIG; 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 * of MAC speed/duplex configuration. So we only need to
* configure Collision Distance in the MAC. * configure Collision Distance in the MAC.
*/ */
mac->ops.config_collision_dist(hw); 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 * First, we need to restore the desired flow control
* settings because we may have had to re-autoneg with a * settings because we may have had to re-autoneg with a
* different link partner. * different link partner.
...@@ -498,8 +486,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw) ...@@ -498,8 +486,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
status = er32(STATUS); status = er32(STATUS);
rxcw = er32(RXCW); rxcw = er32(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), * cannot auto-negotiate), the cable is plugged in (we have signal),
* and our link partner is not trying to auto-negotiate with us (we * 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 * are receiving idles or data), we need to force link up. We also
...@@ -530,8 +517,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw) ...@@ -530,8 +517,7 @@ s32 e1000e_check_for_fiber_link(struct e1000_hw *hw)
return ret_val; return ret_val;
} }
} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { } 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 * sets, re-enable auto-negotiation in the TXCW register
* and disable forced link in the Device Control register * and disable forced link in the Device Control register
* in an attempt to auto-negotiate with our link partner. * in an attempt to auto-negotiate with our link partner.
...@@ -565,8 +551,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) ...@@ -565,8 +551,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
status = er32(STATUS); status = er32(STATUS);
rxcw = er32(RXCW); rxcw = er32(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 * cannot auto-negotiate), and our link partner is not trying to
* auto-negotiate with us (we are receiving idles or data), * auto-negotiate with us (we are receiving idles or data),
* we need to force link up. We also need to give auto-negotiation * we need to force link up. We also need to give auto-negotiation
...@@ -595,8 +580,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) ...@@ -595,8 +580,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
return ret_val; return ret_val;
} }
} else if ((ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { } 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 * sets, re-enable auto-negotiation in the TXCW register
* and disable forced link in the Device Control register * and disable forced link in the Device Control register
* in an attempt to auto-negotiate with our link partner. * in an attempt to auto-negotiate with our link partner.
...@@ -607,8 +591,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw) ...@@ -607,8 +591,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
mac->serdes_has_link = true; mac->serdes_has_link = true;
} else if (!(E1000_TXCW_ANE & er32(TXCW))) { } else if (!(E1000_TXCW_ANE & er32(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 * link status based on MAC synchronization for internal
* serdes media type. * serdes media type.
*/ */
...@@ -665,8 +648,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw) ...@@ -665,8 +648,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
u16 nvm_data; u16 nvm_data;
/* /* 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, * that determine the hardware's default PAUSE (flow control) mode,
* a bit that determines whether the HW defaults to enabling or * a bit that determines whether the HW defaults to enabling or
* disabling auto-negotiation, and the direction of the * disabling auto-negotiation, and the direction of the
...@@ -705,15 +687,13 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw) ...@@ -705,15 +687,13 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw)
{ {
s32 ret_val; s32 ret_val;
/* /* 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. * We do not need to set it up again.
*/ */
if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw)) if (hw->phy.ops.check_reset_block && hw->phy.ops.check_reset_block(hw))
return 0; return 0;
/* /* 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. * based on the EEPROM flow control settings.
*/ */
if (hw->fc.requested_mode == e1000_fc_default) { if (hw->fc.requested_mode == e1000_fc_default) {
...@@ -722,8 +702,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw) ...@@ -722,8 +702,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw)
return ret_val; 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. * on the link partner's capabilities, we may or may not use this mode.
*/ */
hw->fc.current_mode = hw->fc.requested_mode; hw->fc.current_mode = hw->fc.requested_mode;
...@@ -735,8 +714,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw) ...@@ -735,8 +714,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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 * registers to their default values. This is done even if flow
* control is disabled, because it does not hurt anything to * control is disabled, because it does not hurt anything to
* initialize these registers. * initialize these registers.
...@@ -763,8 +741,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw) ...@@ -763,8 +741,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
struct e1000_mac_info *mac = &hw->mac; struct e1000_mac_info *mac = &hw->mac;
u32 txcw; u32 txcw;
/* /* 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 * setup the device accordingly. If auto-negotiation is enabled, then
* software will have to set the "PAUSE" bits to the correct value in * software will have to set the "PAUSE" bits to the correct value in
* the Transmit Config Word Register (TXCW) and re-start auto- * the Transmit Config Word Register (TXCW) and re-start auto-
...@@ -786,8 +763,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw) ...@@ -786,8 +763,7 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD);
break; break;
case e1000_fc_rx_pause: 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 * 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 are capable of Rx Pause ONLY, we will
* advertise that we support both symmetric and asymmetric Rx * advertise that we support both symmetric and asymmetric Rx
...@@ -797,15 +773,13 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw) ...@@ -797,15 +773,13 @@ static s32 e1000_commit_fc_settings_generic(struct e1000_hw *hw)
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
break; break;
case e1000_fc_tx_pause: 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. * by a software over-ride.
*/ */
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_ASM_DIR);
break; break;
case e1000_fc_full: 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. * over-ride.
*/ */
txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK); txcw = (E1000_TXCW_ANE | E1000_TXCW_FD | E1000_TXCW_PAUSE_MASK);
...@@ -835,8 +809,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw) ...@@ -835,8 +809,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
u32 i, status; u32 i, status;
s32 ret_val; s32 ret_val;
/* /* 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 * 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 * Status Register. Time-out if a link isn't seen in 500 milliseconds
* seconds (Auto-negotiation should complete in less than 500 * seconds (Auto-negotiation should complete in less than 500
...@@ -851,8 +824,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw) ...@@ -851,8 +824,7 @@ static s32 e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw)
if (i == FIBER_LINK_UP_LIMIT) { if (i == FIBER_LINK_UP_LIMIT) {
e_dbg("Never got a valid link from auto-neg!!!\n"); e_dbg("Never got a valid link from auto-neg!!!\n");
mac->autoneg_failed = true; 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 * mac->check_for_link. This routine will force the
* link up if we detect a signal. This will allow us to * link up if we detect a signal. This will allow us to
* communicate with non-autonegotiating link partners. * communicate with non-autonegotiating link partners.
...@@ -894,8 +866,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw) ...@@ -894,8 +866,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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 * link will be in reset, because we previously reset the chip). This
* will restart auto-negotiation. If auto-negotiation is successful * will restart auto-negotiation. If auto-negotiation is successful
* then the link-up status bit will be set and the flow control enable * then the link-up status bit will be set and the flow control enable
...@@ -907,8 +878,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw) ...@@ -907,8 +878,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
e1e_flush(); e1e_flush();
usleep_range(1000, 2000); usleep_range(1000, 2000);
/* /* 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" * detect a signal. If we have a signal, then poll for a "Link-Up"
* indication. * indication.
*/ */
...@@ -954,16 +924,14 @@ s32 e1000e_set_fc_watermarks(struct e1000_hw *hw) ...@@ -954,16 +924,14 @@ s32 e1000e_set_fc_watermarks(struct e1000_hw *hw)
{ {
u32 fcrtl = 0, fcrth = 0; u32 fcrtl = 0, fcrth = 0;
/* /* 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 * these registers will be set to a default threshold that may be
* adjusted later by the driver's runtime code. However, if the * adjusted later by the driver's runtime code. However, if the
* ability to transmit pause frames is not enabled, then these * ability to transmit pause frames is not enabled, then these
* registers will be set to 0. * registers will be set to 0.
*/ */
if (hw->fc.current_mode & e1000_fc_tx_pause) { 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 * marks as well as (optionally) enabling the transmission of
* XON frames. * XON frames.
*/ */
...@@ -995,8 +963,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw) ...@@ -995,8 +963,7 @@ s32 e1000e_force_mac_fc(struct e1000_hw *hw)
ctrl = er32(CTRL); ctrl = er32(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 * mechanism (we either forced link or we got link via PHY
* auto-neg), we have to manually enable/disable transmit an * auto-neg), we have to manually enable/disable transmit an
* receive flow control. * receive flow control.
...@@ -1057,8 +1024,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1057,8 +1024,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg; u16 mii_status_reg, mii_nway_adv_reg, mii_nway_lp_ability_reg;
u16 speed, duplex; u16 speed, duplex;
/* /* 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 * so we had to force link. In this case, we need to force the
* configuration of the MAC to match the "fc" parameter. * configuration of the MAC to match the "fc" parameter.
*/ */
...@@ -1076,15 +1042,13 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1076,15 +1042,13 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
return ret_val; 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 * 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 * has completed, and if so, how the PHY and link partner has
* flow control configured. * flow control configured.
*/ */
if ((hw->phy.media_type == e1000_media_type_copper) && mac->autoneg) { 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 * has completed. We read this twice because this reg has
* some "sticky" (latched) bits. * some "sticky" (latched) bits.
*/ */
...@@ -1100,8 +1064,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1100,8 +1064,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
return ret_val; 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 * read both the Auto Negotiation Advertisement
* Register (Address 4) and the Auto_Negotiation Base * Register (Address 4) and the Auto_Negotiation Base
* Page Ability Register (Address 5) to determine how * Page Ability Register (Address 5) to determine how
...@@ -1115,8 +1078,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1115,8 +1078,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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 * (Address 4) and two bits in the Auto Negotiation Base
* Page Ability Register (Address 5) determine flow control * Page Ability Register (Address 5) determine flow control
* for both the PHY and the link partner. The following * for both the PHY and the link partner. The following
...@@ -1151,8 +1113,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1151,8 +1113,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
*/ */
if ((mii_nway_adv_reg & NWAY_AR_PAUSE) && if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_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 * of pause frames. In this case, we had to advertise
* FULL flow control because we could not advertise Rx * FULL flow control because we could not advertise Rx
* ONLY. Hence, we must now check to see if we need to * ONLY. Hence, we must now check to see if we need to
...@@ -1166,8 +1127,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1166,8 +1127,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
e_dbg("Flow Control = Rx PAUSE frames only.\n"); e_dbg("Flow Control = Rx PAUSE frames only.\n");
} }
} }
/* /* For receiving PAUSE frames ONLY.
* For receiving PAUSE frames ONLY.
* *
* LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
...@@ -1181,8 +1141,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1181,8 +1141,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
hw->fc.current_mode = e1000_fc_tx_pause; hw->fc.current_mode = e1000_fc_tx_pause;
e_dbg("Flow Control = Tx PAUSE frames only.\n"); e_dbg("Flow Control = Tx PAUSE frames only.\n");
} }
/* /* For transmitting PAUSE frames ONLY.
* For transmitting PAUSE frames ONLY.
* *
* LOCAL DEVICE | LINK PARTNER * LOCAL DEVICE | LINK PARTNER
* PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
...@@ -1196,16 +1155,14 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1196,16 +1155,14 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
hw->fc.current_mode = e1000_fc_rx_pause; hw->fc.current_mode = e1000_fc_rx_pause;
e_dbg("Flow Control = Rx PAUSE frames only.\n"); e_dbg("Flow Control = Rx PAUSE frames only.\n");
} else { } else {
/* /* Per the IEEE spec, at this point flow control
* Per the IEEE spec, at this point flow control
* should be disabled. * should be disabled.
*/ */
hw->fc.current_mode = e1000_fc_none; hw->fc.current_mode = e1000_fc_none;
e_dbg("Flow Control = NONE.\n"); e_dbg("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 * negotiated to HALF DUPLEX, flow control should not be
* enabled per IEEE 802.3 spec. * enabled per IEEE 802.3 spec.
*/ */
...@@ -1218,8 +1175,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) ...@@ -1218,8 +1175,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
if (duplex == HALF_DUPLEX) if (duplex == HALF_DUPLEX)
hw->fc.current_mode = e1000_fc_none; 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. * controller to use the correct flow control settings.
*/ */
ret_val = e1000e_force_mac_fc(hw); ret_val = e1000e_force_mac_fc(hw);
...@@ -1520,8 +1476,7 @@ s32 e1000e_blink_led_generic(struct e1000_hw *hw) ...@@ -1520,8 +1476,7 @@ s32 e1000e_blink_led_generic(struct e1000_hw *hw)
ledctl_blink = E1000_LEDCTL_LED0_BLINK | ledctl_blink = E1000_LEDCTL_LED0_BLINK |
(E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT); (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT);
} else { } else {
/* /* set the blink bit for each LED that's "on" (0x0E)
* set the blink bit for each LED that's "on" (0x0E)
* in ledctl_mode2 * in ledctl_mode2
*/ */
ledctl_blink = hw->mac.ledctl_mode2; ledctl_blink = hw->mac.ledctl_mode2;
......
...@@ -143,8 +143,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) ...@@ -143,8 +143,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
return hw->mac.tx_pkt_filtering; 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. * reason, disable filtering.
*/ */
ret_val = e1000_mng_enable_host_if(hw); ret_val = e1000_mng_enable_host_if(hw);
...@@ -163,8 +162,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw) ...@@ -163,8 +162,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
hdr->checksum = 0; hdr->checksum = 0;
csum = e1000_calculate_checksum((u8 *)hdr, csum = e1000_calculate_checksum((u8 *)hdr,
E1000_MNG_DHCP_COOKIE_LENGTH); 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 * the cookie area isn't considered valid, in which case we
* take the safe route of assuming Tx filtering is enabled. * take the safe route of assuming Tx filtering is enabled.
*/ */
...@@ -252,8 +250,7 @@ static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, ...@@ -252,8 +250,7 @@ static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer,
/* Calculate length in DWORDs */ /* Calculate length in DWORDs */
length >>= 2; length >>= 2;
/* /* The device driver writes the relevant command block into the
* The device driver writes the relevant command block into the
* ram area. * ram area.
*/ */
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
......
...@@ -146,9 +146,11 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = { ...@@ -146,9 +146,11 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
{0, NULL} {0, NULL}
}; };
/* /**
* e1000_regdump - register printout routine * e1000_regdump - register printout routine
*/ * @hw: pointer to the HW structure
* @reginfo: pointer to the register info table
**/
static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo) static void e1000_regdump(struct e1000_hw *hw, struct e1000_reg_info *reginfo)
{ {
int n = 0; int n = 0;
...@@ -196,9 +198,10 @@ static void e1000e_dump_ps_pages(struct e1000_adapter *adapter, ...@@ -196,9 +198,10 @@ static void e1000e_dump_ps_pages(struct e1000_adapter *adapter,
} }
} }
/* /**
* e1000e_dump - Print registers, Tx-ring and Rx-ring * e1000e_dump - Print registers, Tx-ring and Rx-ring
*/ * @adapter: board private structure
**/
static void e1000e_dump(struct e1000_adapter *adapter) static void e1000e_dump(struct e1000_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
...@@ -623,8 +626,7 @@ static void e1000_alloc_rx_buffers(struct e1000_ring *rx_ring, ...@@ -623,8 +626,7 @@ static void e1000_alloc_rx_buffers(struct e1000_ring *rx_ring,
rx_desc->read.buffer_addr = cpu_to_le64(buffer_info->dma); rx_desc->read.buffer_addr = cpu_to_le64(buffer_info->dma);
if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) { if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
/* /* Force memory writes to complete before letting h/w
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only * know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs, * applicable for weak-ordered memory model archs,
* such as IA-64). * such as IA-64).
...@@ -692,8 +694,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_ring *rx_ring, ...@@ -692,8 +694,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_ring *rx_ring,
goto no_buffers; goto no_buffers;
} }
} }
/* /* Refresh the desc even if buffer_addrs
* Refresh the desc even if buffer_addrs
* didn't change because each write-back * didn't change because each write-back
* erases this info. * erases this info.
*/ */
...@@ -726,8 +727,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_ring *rx_ring, ...@@ -726,8 +727,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_ring *rx_ring,
rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma); rx_desc->read.buffer_addr[0] = cpu_to_le64(buffer_info->dma);
if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) { if (unlikely(!(i & (E1000_RX_BUFFER_WRITE - 1)))) {
/* /* Force memory writes to complete before letting h/w
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only * know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs, * applicable for weak-ordered memory model archs,
* such as IA-64). * such as IA-64).
...@@ -817,7 +817,8 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_ring *rx_ring, ...@@ -817,7 +817,8 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_ring *rx_ring,
/* Force memory writes to complete before letting h/w /* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only * know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs, * applicable for weak-ordered memory model archs,
* such as IA-64). */ * such as IA-64).
*/
wmb(); wmb();
if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA) if (adapter->flags2 & FLAG2_PCIM2PCI_ARBITER_WA)
e1000e_update_rdt_wa(rx_ring, i); e1000e_update_rdt_wa(rx_ring, i);
...@@ -891,8 +892,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done, ...@@ -891,8 +892,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
length = le16_to_cpu(rx_desc->wb.upper.length); length = le16_to_cpu(rx_desc->wb.upper.length);
/* /* !EOP means multiple descriptors were used to store a single
* !EOP means multiple descriptors were used to store a single
* packet, if that's the case we need to toss it. In fact, we * packet, if that's the case we need to toss it. In fact, we
* need to toss every packet with the EOP bit clear and the * need to toss every packet with the EOP bit clear and the
* next frame that _does_ have the EOP bit set, as it is by * next frame that _does_ have the EOP bit set, as it is by
...@@ -933,8 +933,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done, ...@@ -933,8 +933,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
total_rx_bytes += length; total_rx_bytes += length;
total_rx_packets++; total_rx_packets++;
/* /* code added for copybreak, this should improve
* code added for copybreak, this should improve
* performance for small packets with large amounts * performance for small packets with large amounts
* of reassembly being done in the stack * of reassembly being done in the stack
*/ */
...@@ -1032,15 +1031,13 @@ static void e1000_print_hw_hang(struct work_struct *work) ...@@ -1032,15 +1031,13 @@ static void e1000_print_hw_hang(struct work_struct *work)
if (!adapter->tx_hang_recheck && if (!adapter->tx_hang_recheck &&
(adapter->flags2 & FLAG2_DMA_BURST)) { (adapter->flags2 & FLAG2_DMA_BURST)) {
/* /* May be block on write-back, flush and detect again
* May be block on write-back, flush and detect again
* flush pending descriptor writebacks to memory * flush pending descriptor writebacks to memory
*/ */
ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
/* execute the writes immediately */ /* execute the writes immediately */
e1e_flush(); e1e_flush();
/* /* Due to rare timing issues, write to TIDV again to ensure
* Due to rare timing issues, write to TIDV again to ensure
* the write is successful * the write is successful
*/ */
ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
...@@ -1169,8 +1166,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring) ...@@ -1169,8 +1166,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring)
} }
if (adapter->detect_tx_hung) { if (adapter->detect_tx_hung) {
/* /* Detect a transmit hang in hardware, this serializes the
* Detect a transmit hang in hardware, this serializes the
* check with the clearing of time_stamp and movement of i * check with the clearing of time_stamp and movement of i
*/ */
adapter->detect_tx_hung = false; adapter->detect_tx_hung = false;
...@@ -1270,14 +1266,12 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done, ...@@ -1270,14 +1266,12 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done,
skb_put(skb, length); skb_put(skb, length);
{ {
/* /* this looks ugly, but it seems compiler issues make
* this looks ugly, but it seems compiler issues make
* it more efficient than reusing j * it more efficient than reusing j
*/ */
int l1 = le16_to_cpu(rx_desc->wb.upper.length[0]); int l1 = le16_to_cpu(rx_desc->wb.upper.length[0]);
/* /* page alloc/put takes too long and effects small
* page alloc/put takes too long and effects small
* packet throughput, so unsplit small packets and * packet throughput, so unsplit small packets and
* save the alloc/put only valid in softirq (napi) * save the alloc/put only valid in softirq (napi)
* context to call kmap_* * context to call kmap_*
...@@ -1288,8 +1282,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done, ...@@ -1288,8 +1282,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done,
ps_page = &buffer_info->ps_pages[0]; ps_page = &buffer_info->ps_pages[0];
/* /* there is no documentation about how to call
* there is no documentation about how to call
* kmap_atomic, so we can't hold the mapping * kmap_atomic, so we can't hold the mapping
* very long * very long
*/ */
...@@ -1486,14 +1479,16 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done, ...@@ -1486,14 +1479,16 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,
skb_shinfo(rxtop)->nr_frags, skb_shinfo(rxtop)->nr_frags,
buffer_info->page, 0, length); buffer_info->page, 0, length);
/* re-use the current skb, we only consumed the /* re-use the current skb, we only consumed the
* page */ * page
*/
buffer_info->skb = skb; buffer_info->skb = skb;
skb = rxtop; skb = rxtop;
rxtop = NULL; rxtop = NULL;
e1000_consume_page(buffer_info, skb, length); e1000_consume_page(buffer_info, skb, length);
} else { } else {
/* no chain, got EOP, this buf is the packet /* no chain, got EOP, this buf is the packet
* copybreak to save the put_page/alloc_page */ * copybreak to save the put_page/alloc_page
*/
if (length <= copybreak && if (length <= copybreak &&
skb_tailroom(skb) >= length) { skb_tailroom(skb) >= length) {
u8 *vaddr; u8 *vaddr;
...@@ -1502,7 +1497,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done, ...@@ -1502,7 +1497,8 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_ring *rx_ring, int *work_done,
length); length);
kunmap_atomic(vaddr); kunmap_atomic(vaddr);
/* re-use the page, so don't erase /* re-use the page, so don't erase
* buffer_info->page */ * buffer_info->page
*/
skb_put(skb, length); skb_put(skb, length);
} else { } else {
skb_fill_page_desc(skb, 0, skb_fill_page_desc(skb, 0,
...@@ -1656,22 +1652,17 @@ static irqreturn_t e1000_intr_msi(int irq, void *data) ...@@ -1656,22 +1652,17 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 icr = er32(ICR); u32 icr = er32(ICR);
/* /* read ICR disables interrupts using IAM */
* read ICR disables interrupts using IAM
*/
if (icr & E1000_ICR_LSC) { if (icr & E1000_ICR_LSC) {
hw->mac.get_link_status = true; hw->mac.get_link_status = true;
/* /* ICH8 workaround-- Call gig speed drop workaround on cable
* ICH8 workaround-- Call gig speed drop workaround on cable
* disconnect (LSC) before accessing any PHY registers * disconnect (LSC) before accessing any PHY registers
*/ */
if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) && if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) &&
(!(er32(STATUS) & E1000_STATUS_LU))) (!(er32(STATUS) & E1000_STATUS_LU)))
schedule_work(&adapter->downshift_task); schedule_work(&adapter->downshift_task);
/* /* 80003ES2LAN workaround-- For packet buffer work-around on
* 80003ES2LAN workaround-- For packet buffer work-around on
* link down event; disable receives here in the ISR and reset * link down event; disable receives here in the ISR and reset
* adapter in watchdog * adapter in watchdog
*/ */
...@@ -1713,31 +1704,27 @@ static irqreturn_t e1000_intr(int irq, void *data) ...@@ -1713,31 +1704,27 @@ static irqreturn_t e1000_intr(int irq, void *data)
if (!icr || test_bit(__E1000_DOWN, &adapter->state)) if (!icr || test_bit(__E1000_DOWN, &adapter->state))
return IRQ_NONE; /* Not our interrupt */ return IRQ_NONE; /* Not our interrupt */
/* /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
* not set, then the adapter didn't send an interrupt * not set, then the adapter didn't send an interrupt
*/ */
if (!(icr & E1000_ICR_INT_ASSERTED)) if (!(icr & E1000_ICR_INT_ASSERTED))
return IRQ_NONE; return IRQ_NONE;
/* /* Interrupt Auto-Mask...upon reading ICR,
* Interrupt Auto-Mask...upon reading ICR,
* interrupts are masked. No need for the * interrupts are masked. No need for the
* IMC write * IMC write
*/ */
if (icr & E1000_ICR_LSC) { if (icr & E1000_ICR_LSC) {
hw->mac.get_link_status = true; hw->mac.get_link_status = true;
/* /* ICH8 workaround-- Call gig speed drop workaround on cable
* ICH8 workaround-- Call gig speed drop workaround on cable
* disconnect (LSC) before accessing any PHY registers * disconnect (LSC) before accessing any PHY registers
*/ */
if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) && if ((adapter->flags & FLAG_LSC_GIG_SPEED_DROP) &&
(!(er32(STATUS) & E1000_STATUS_LU))) (!(er32(STATUS) & E1000_STATUS_LU)))
schedule_work(&adapter->downshift_task); schedule_work(&adapter->downshift_task);
/* /* 80003ES2LAN workaround--
* 80003ES2LAN workaround--
* For packet buffer work-around on link down event; * For packet buffer work-around on link down event;
* disable receives here in the ISR and * disable receives here in the ISR and
* reset adapter in watchdog * reset adapter in watchdog
...@@ -2469,8 +2456,7 @@ static void e1000_set_itr(struct e1000_adapter *adapter) ...@@ -2469,8 +2456,7 @@ static void e1000_set_itr(struct e1000_adapter *adapter)
set_itr_now: set_itr_now:
if (new_itr != adapter->itr) { if (new_itr != adapter->itr) {
/* /* this attempts to bias the interrupt rate towards Bulk
* this attempts to bias the interrupt rate towards Bulk
* by adding intermediate steps when interrupt rate is * by adding intermediate steps when interrupt rate is
* increasing * increasing
*/ */
...@@ -2740,8 +2726,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter) ...@@ -2740,8 +2726,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
manc = er32(MANC); manc = er32(MANC);
/* /* enable receiving management packets to the host. this will probably
* enable receiving management packets to the host. this will probably
* generate destination unreachable messages from the host OS, but * generate destination unreachable messages from the host OS, but
* the packets will be handled on SMBUS * the packets will be handled on SMBUS
*/ */
...@@ -2754,8 +2739,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter) ...@@ -2754,8 +2739,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
break; break;
case e1000_82574: case e1000_82574:
case e1000_82583: case e1000_82583:
/* /* Check if IPMI pass-through decision filter already exists;
* Check if IPMI pass-through decision filter already exists;
* if so, enable it. * if so, enable it.
*/ */
for (i = 0, j = 0; i < 8; i++) { for (i = 0, j = 0; i < 8; i++) {
...@@ -2827,8 +2811,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -2827,8 +2811,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
u32 txdctl = er32(TXDCTL(0)); u32 txdctl = er32(TXDCTL(0));
txdctl &= ~(E1000_TXDCTL_PTHRESH | E1000_TXDCTL_HTHRESH | txdctl &= ~(E1000_TXDCTL_PTHRESH | E1000_TXDCTL_HTHRESH |
E1000_TXDCTL_WTHRESH); E1000_TXDCTL_WTHRESH);
/* /* set up some performance related parameters to encourage the
* set up some performance related parameters to encourage the
* hardware to use the bus more efficiently in bursts, depends * hardware to use the bus more efficiently in bursts, depends
* on the tx_int_delay to be enabled, * on the tx_int_delay to be enabled,
* wthresh = 1 ==> burst write is disabled to avoid Tx stalls * wthresh = 1 ==> burst write is disabled to avoid Tx stalls
...@@ -2845,8 +2828,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter) ...@@ -2845,8 +2828,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) { if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) {
tarc = er32(TARC(0)); tarc = er32(TARC(0));
/* /* set the speed mode bit, we'll clear it if we're not at
* set the speed mode bit, we'll clear it if we're not at
* gigabit link later * gigabit link later
*/ */
#define SPEED_MODE_BIT (1 << 21) #define SPEED_MODE_BIT (1 << 21)
...@@ -2967,8 +2949,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -2967,8 +2949,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
rfctl |= E1000_RFCTL_EXTEN; rfctl |= E1000_RFCTL_EXTEN;
ew32(RFCTL, rfctl); ew32(RFCTL, rfctl);
/* /* 82571 and greater support packet-split where the protocol
* 82571 and greater support packet-split where the protocol
* header is placed in skb->data and the packet data is * header is placed in skb->data and the packet data is
* placed in pages hanging off of skb_shinfo(skb)->nr_frags. * placed in pages hanging off of skb_shinfo(skb)->nr_frags.
* In the case of a non-split, skb->data is linearly filled, * In the case of a non-split, skb->data is linearly filled,
...@@ -3016,7 +2997,8 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) ...@@ -3016,7 +2997,8 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
/* This is useful for sniffing bad packets. */ /* This is useful for sniffing bad packets. */
if (adapter->netdev->features & NETIF_F_RXALL) { if (adapter->netdev->features & NETIF_F_RXALL) {
/* UPE and MPE will be handled by normal PROMISC logic /* UPE and MPE will be handled by normal PROMISC logic
* in e1000e_set_rx_mode */ * in e1000e_set_rx_mode
*/
rctl |= (E1000_RCTL_SBP | /* Receive bad packets */ rctl |= (E1000_RCTL_SBP | /* Receive bad packets */
E1000_RCTL_BAM | /* RX All Bcast Pkts */ E1000_RCTL_BAM | /* RX All Bcast Pkts */
E1000_RCTL_PMCF); /* RX All MAC Ctrl Pkts */ E1000_RCTL_PMCF); /* RX All MAC Ctrl Pkts */
...@@ -3071,8 +3053,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -3071,8 +3053,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
usleep_range(10000, 20000); usleep_range(10000, 20000);
if (adapter->flags2 & FLAG2_DMA_BURST) { if (adapter->flags2 & FLAG2_DMA_BURST) {
/* /* set the writeback threshold (only takes effect if the RDTR
* set the writeback threshold (only takes effect if the RDTR
* is set). set GRAN=1 and write back up to 0x4 worth, and * is set). set GRAN=1 and write back up to 0x4 worth, and
* enable prefetching of 0x20 Rx descriptors * enable prefetching of 0x20 Rx descriptors
* granularity = 01 * granularity = 01
...@@ -3083,8 +3064,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -3083,8 +3064,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
ew32(RXDCTL(0), E1000_RXDCTL_DMA_BURST_ENABLE); ew32(RXDCTL(0), E1000_RXDCTL_DMA_BURST_ENABLE);
ew32(RXDCTL(1), E1000_RXDCTL_DMA_BURST_ENABLE); ew32(RXDCTL(1), E1000_RXDCTL_DMA_BURST_ENABLE);
/* /* override the delay timers for enabling bursting, only if
* override the delay timers for enabling bursting, only if
* the value was not set by the user via module options * the value was not set by the user via module options
*/ */
if (adapter->rx_int_delay == DEFAULT_RDTR) if (adapter->rx_int_delay == DEFAULT_RDTR)
...@@ -3108,8 +3088,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -3108,8 +3088,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
ew32(CTRL_EXT, ctrl_ext); ew32(CTRL_EXT, ctrl_ext);
e1e_flush(); e1e_flush();
/* /* Setup the HW Rx Head and Tail Descriptor Pointers and
* Setup the HW Rx Head and Tail Descriptor Pointers and
* the Base and Length of the Rx Descriptor Ring * the Base and Length of the Rx Descriptor Ring
*/ */
rdba = rx_ring->dma; rdba = rx_ring->dma;
...@@ -3130,8 +3109,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter) ...@@ -3130,8 +3109,7 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
ew32(RXCSUM, rxcsum); ew32(RXCSUM, rxcsum);
if (adapter->hw.mac.type == e1000_pch2lan) { if (adapter->hw.mac.type == e1000_pch2lan) {
/* /* With jumbo frames, excessive C-state transition
* With jumbo frames, excessive C-state transition
* latencies result in dropped transactions. * latencies result in dropped transactions.
*/ */
if (adapter->netdev->mtu > ETH_DATA_LEN) { if (adapter->netdev->mtu > ETH_DATA_LEN) {
...@@ -3216,8 +3194,7 @@ static int e1000e_write_uc_addr_list(struct net_device *netdev) ...@@ -3216,8 +3194,7 @@ static int e1000e_write_uc_addr_list(struct net_device *netdev)
if (!netdev_uc_empty(netdev) && rar_entries) { if (!netdev_uc_empty(netdev) && rar_entries) {
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
/* /* write the addresses in reverse order to avoid write
* write the addresses in reverse order to avoid write
* combining * combining
*/ */
netdev_for_each_uc_addr(ha, netdev) { netdev_for_each_uc_addr(ha, netdev) {
...@@ -3269,8 +3246,7 @@ static void e1000e_set_rx_mode(struct net_device *netdev) ...@@ -3269,8 +3246,7 @@ static void e1000e_set_rx_mode(struct net_device *netdev)
if (netdev->flags & IFF_ALLMULTI) { if (netdev->flags & IFF_ALLMULTI) {
rctl |= E1000_RCTL_MPE; rctl |= E1000_RCTL_MPE;
} else { } else {
/* /* Write addresses to the MTA, if the attempt fails
* Write addresses to the MTA, if the attempt fails
* then we should just turn on promiscuous mode so * then we should just turn on promiscuous mode so
* that we can at least receive multicast traffic * that we can at least receive multicast traffic
*/ */
...@@ -3279,8 +3255,7 @@ static void e1000e_set_rx_mode(struct net_device *netdev) ...@@ -3279,8 +3255,7 @@ static void e1000e_set_rx_mode(struct net_device *netdev)
rctl |= E1000_RCTL_MPE; rctl |= E1000_RCTL_MPE;
} }
e1000e_vlan_filter_enable(adapter); e1000e_vlan_filter_enable(adapter);
/* /* Write addresses to available RAR registers, if there is not
* Write addresses to available RAR registers, if there is not
* sufficient space to store all the addresses then enable * sufficient space to store all the addresses then enable
* unicast promiscuous mode * unicast promiscuous mode
*/ */
...@@ -3315,8 +3290,7 @@ static void e1000e_setup_rss_hash(struct e1000_adapter *adapter) ...@@ -3315,8 +3290,7 @@ static void e1000e_setup_rss_hash(struct e1000_adapter *adapter)
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
ew32(RETA(i), 0); ew32(RETA(i), 0);
/* /* Disable raw packet checksumming so that RSS hash is placed in
* Disable raw packet checksumming so that RSS hash is placed in
* descriptor on writeback. * descriptor on writeback.
*/ */
rxcsum = er32(RXCSUM); rxcsum = er32(RXCSUM);
...@@ -3408,8 +3382,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3408,8 +3382,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
ew32(PBA, pba); ew32(PBA, pba);
if (adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) { if (adapter->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN) {
/* /* To maintain wire speed transmits, the Tx FIFO should be
* To maintain wire speed transmits, the Tx FIFO should be
* large enough to accommodate two full transmit packets, * large enough to accommodate two full transmit packets,
* rounded up to the next 1KB and expressed in KB. Likewise, * rounded up to the next 1KB and expressed in KB. Likewise,
* the Rx FIFO should be large enough to accommodate at least * the Rx FIFO should be large enough to accommodate at least
...@@ -3421,8 +3394,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3421,8 +3394,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
tx_space = pba >> 16; tx_space = pba >> 16;
/* lower 16 bits has Rx packet buffer allocation size in KB */ /* lower 16 bits has Rx packet buffer allocation size in KB */
pba &= 0xffff; pba &= 0xffff;
/* /* the Tx fifo also stores 16 bytes of information about the Tx
* the Tx fifo also stores 16 bytes of information about the Tx
* but don't include ethernet FCS because hardware appends it * but don't include ethernet FCS because hardware appends it
*/ */
min_tx_space = (adapter->max_frame_size + min_tx_space = (adapter->max_frame_size +
...@@ -3435,8 +3407,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3435,8 +3407,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
min_rx_space = ALIGN(min_rx_space, 1024); min_rx_space = ALIGN(min_rx_space, 1024);
min_rx_space >>= 10; min_rx_space >>= 10;
/* /* If current Tx allocation is less than the min Tx FIFO size,
* If current Tx allocation is less than the min Tx FIFO size,
* and the min Tx FIFO size is less than the current Rx FIFO * and the min Tx FIFO size is less than the current Rx FIFO
* allocation, take space away from current Rx allocation * allocation, take space away from current Rx allocation
*/ */
...@@ -3444,8 +3415,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3444,8 +3415,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
((min_tx_space - tx_space) < pba)) { ((min_tx_space - tx_space) < pba)) {
pba -= min_tx_space - tx_space; pba -= min_tx_space - tx_space;
/* /* if short on Rx space, Rx wins and must trump Tx
* if short on Rx space, Rx wins and must trump Tx
* adjustment * adjustment
*/ */
if (pba < min_rx_space) if (pba < min_rx_space)
...@@ -3455,8 +3425,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3455,8 +3425,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
ew32(PBA, pba); ew32(PBA, pba);
} }
/* /* flow control settings
* flow control settings
* *
* The high water mark must be low enough to fit one full frame * The high water mark must be low enough to fit one full frame
* (or the size used for early receive) above it in the Rx FIFO. * (or the size used for early receive) above it in the Rx FIFO.
...@@ -3490,8 +3459,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3490,8 +3459,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
fc->low_water = fc->high_water - 8; fc->low_water = fc->high_water - 8;
break; break;
case e1000_pchlan: case e1000_pchlan:
/* /* Workaround PCH LOM adapter hangs with certain network
* Workaround PCH LOM adapter hangs with certain network
* loads. If hangs persist, try disabling Tx flow control. * loads. If hangs persist, try disabling Tx flow control.
*/ */
if (adapter->netdev->mtu > ETH_DATA_LEN) { if (adapter->netdev->mtu > ETH_DATA_LEN) {
...@@ -3516,8 +3484,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3516,8 +3484,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
break; break;
} }
/* /* Alignment of Tx data is on an arbitrary byte boundary with the
* Alignment of Tx data is on an arbitrary byte boundary with the
* maximum size per Tx descriptor limited only to the transmit * maximum size per Tx descriptor limited only to the transmit
* allocation of the packet buffer minus 96 bytes with an upper * allocation of the packet buffer minus 96 bytes with an upper
* limit of 24KB due to receive synchronization limitations. * limit of 24KB due to receive synchronization limitations.
...@@ -3525,8 +3492,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3525,8 +3492,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
adapter->tx_fifo_limit = min_t(u32, ((er32(PBA) >> 16) << 10) - 96, adapter->tx_fifo_limit = min_t(u32, ((er32(PBA) >> 16) << 10) - 96,
24 << 10); 24 << 10);
/* /* Disable Adaptive Interrupt Moderation if 2 full packets cannot
* Disable Adaptive Interrupt Moderation if 2 full packets cannot
* fit in receive buffer. * fit in receive buffer.
*/ */
if (adapter->itr_setting & 0x3) { if (adapter->itr_setting & 0x3) {
...@@ -3549,8 +3515,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3549,8 +3515,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
/* Allow time for pending master requests to run */ /* Allow time for pending master requests to run */
mac->ops.reset_hw(hw); mac->ops.reset_hw(hw);
/* /* For parts with AMT enabled, let the firmware know
* For parts with AMT enabled, let the firmware know
* that the network interface is in control * that the network interface is in control
*/ */
if (adapter->flags & FLAG_HAS_AMT) if (adapter->flags & FLAG_HAS_AMT)
...@@ -3579,8 +3544,7 @@ void e1000e_reset(struct e1000_adapter *adapter) ...@@ -3579,8 +3544,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) && if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN) &&
!(adapter->flags & FLAG_SMART_POWER_DOWN)) { !(adapter->flags & FLAG_SMART_POWER_DOWN)) {
u16 phy_data = 0; u16 phy_data = 0;
/* /* speed up time to link by disabling smart power down, ignore
* speed up time to link by disabling smart power down, ignore
* the return value of this function because there is nothing * the return value of this function because there is nothing
* different we would do if it failed * different we would do if it failed
*/ */
...@@ -3628,8 +3592,7 @@ static void e1000e_flush_descriptors(struct e1000_adapter *adapter) ...@@ -3628,8 +3592,7 @@ static void e1000e_flush_descriptors(struct e1000_adapter *adapter)
/* execute the writes immediately */ /* execute the writes immediately */
e1e_flush(); e1e_flush();
/* /* due to rare timing issues, write to TIDV/RDTR again to ensure the
* due to rare timing issues, write to TIDV/RDTR again to ensure the
* write is successful * write is successful
*/ */
ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
...@@ -3647,8 +3610,7 @@ void e1000e_down(struct e1000_adapter *adapter) ...@@ -3647,8 +3610,7 @@ void e1000e_down(struct e1000_adapter *adapter)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 tctl, rctl; u32 tctl, rctl;
/* /* signal that we're down so the interrupt handler does not
* signal that we're down so the interrupt handler does not
* reschedule our watchdog timer * reschedule our watchdog timer
*/ */
set_bit(__E1000_DOWN, &adapter->state); set_bit(__E1000_DOWN, &adapter->state);
...@@ -3691,8 +3653,7 @@ void e1000e_down(struct e1000_adapter *adapter) ...@@ -3691,8 +3653,7 @@ void e1000e_down(struct e1000_adapter *adapter)
if (!pci_channel_offline(adapter->pdev)) if (!pci_channel_offline(adapter->pdev))
e1000e_reset(adapter); e1000e_reset(adapter);
/* /* TODO: for power management, we could drop the link and
* TODO: for power management, we could drop the link and
* pci_disable_device here. * pci_disable_device here.
*/ */
} }
...@@ -3755,8 +3716,7 @@ static irqreturn_t e1000_intr_msi_test(int irq, void *data) ...@@ -3755,8 +3716,7 @@ static irqreturn_t e1000_intr_msi_test(int irq, void *data)
e_dbg("icr is %08X\n", icr); e_dbg("icr is %08X\n", icr);
if (icr & E1000_ICR_RXSEQ) { if (icr & E1000_ICR_RXSEQ) {
adapter->flags &= ~FLAG_MSI_TEST_FAILED; adapter->flags &= ~FLAG_MSI_TEST_FAILED;
/* /* Force memory writes to complete before acknowledging the
* Force memory writes to complete before acknowledging the
* interrupt is handled. * interrupt is handled.
*/ */
wmb(); wmb();
...@@ -3786,7 +3746,8 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter) ...@@ -3786,7 +3746,8 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
e1000e_reset_interrupt_capability(adapter); e1000e_reset_interrupt_capability(adapter);
/* Assume that the test fails, if it succeeds then the test /* Assume that the test fails, if it succeeds then the test
* MSI irq handler will unset this flag */ * MSI irq handler will unset this flag
*/
adapter->flags |= FLAG_MSI_TEST_FAILED; adapter->flags |= FLAG_MSI_TEST_FAILED;
err = pci_enable_msi(adapter->pdev); err = pci_enable_msi(adapter->pdev);
...@@ -3800,8 +3761,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter) ...@@ -3800,8 +3761,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
goto msi_test_failed; goto msi_test_failed;
} }
/* /* Force memory writes to complete before enabling and firing an
* Force memory writes to complete before enabling and firing an
* interrupt. * interrupt.
*/ */
wmb(); wmb();
...@@ -3901,8 +3861,7 @@ static int e1000_open(struct net_device *netdev) ...@@ -3901,8 +3861,7 @@ static int e1000_open(struct net_device *netdev)
if (err) if (err)
goto err_setup_rx; goto err_setup_rx;
/* /* If AMT is enabled, let the firmware know that the network
* If AMT is enabled, let the firmware know that the network
* interface is now open and reset the part to a known state. * interface is now open and reset the part to a known state.
*/ */
if (adapter->flags & FLAG_HAS_AMT) { if (adapter->flags & FLAG_HAS_AMT) {
...@@ -3923,8 +3882,7 @@ static int e1000_open(struct net_device *netdev) ...@@ -3923,8 +3882,7 @@ static int e1000_open(struct net_device *netdev)
PM_QOS_CPU_DMA_LATENCY, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE); PM_QOS_DEFAULT_VALUE);
/* /* before we allocate an interrupt, we must be ready to handle it.
* before we allocate an interrupt, we must be ready to handle it.
* Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
* as soon as we call pci_request_irq, so we have to setup our * as soon as we call pci_request_irq, so we have to setup our
* clean_rx handler before we do so. * clean_rx handler before we do so.
...@@ -3935,8 +3893,7 @@ static int e1000_open(struct net_device *netdev) ...@@ -3935,8 +3893,7 @@ static int e1000_open(struct net_device *netdev)
if (err) if (err)
goto err_req_irq; goto err_req_irq;
/* /* Work around PCIe errata with MSI interrupts causing some chipsets to
* Work around PCIe errata with MSI interrupts causing some chipsets to
* ignore e1000e MSI messages, which means we need to test our MSI * ignore e1000e MSI messages, which means we need to test our MSI
* interrupt now * interrupt now
*/ */
...@@ -4017,16 +3974,14 @@ static int e1000_close(struct net_device *netdev) ...@@ -4017,16 +3974,14 @@ static int e1000_close(struct net_device *netdev)
e1000e_free_tx_resources(adapter->tx_ring); e1000e_free_tx_resources(adapter->tx_ring);
e1000e_free_rx_resources(adapter->rx_ring); e1000e_free_rx_resources(adapter->rx_ring);
/* /* kill manageability vlan ID if supported, but not if a vlan with
* kill manageability vlan ID if supported, but not if a vlan with
* the same ID is registered on the host OS (let 8021q kill it) * the same ID is registered on the host OS (let 8021q kill it)
*/ */
if (adapter->hw.mng_cookie.status & if (adapter->hw.mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN) E1000_MNG_DHCP_COOKIE_STATUS_VLAN)
e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id);
/* /* If AMT is enabled, let the firmware know that the network
* If AMT is enabled, let the firmware know that the network
* interface is now closed * interface is now closed
*/ */
if ((adapter->flags & FLAG_HAS_AMT) && if ((adapter->flags & FLAG_HAS_AMT) &&
...@@ -4065,8 +4020,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p) ...@@ -4065,8 +4020,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
/* activate the work around */ /* activate the work around */
e1000e_set_laa_state_82571(&adapter->hw, 1); e1000e_set_laa_state_82571(&adapter->hw, 1);
/* /* 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 * between the time RAR[0] gets clobbered and the time it
* gets fixed (in e1000_watchdog), the actual LAA is in one * gets fixed (in e1000_watchdog), the actual LAA is in one
* of the RARs and no incoming packets directed to this port * of the RARs and no incoming packets directed to this port
...@@ -4099,10 +4053,13 @@ static void e1000e_update_phy_task(struct work_struct *work) ...@@ -4099,10 +4053,13 @@ static void e1000e_update_phy_task(struct work_struct *work)
e1000_get_phy_info(&adapter->hw); e1000_get_phy_info(&adapter->hw);
} }
/* /**
* e1000_update_phy_info - timre call-back to update PHY info
* @data: pointer to adapter cast into an unsigned long
*
* Need to wait a few seconds after link up to get diagnostic information from * Need to wait a few seconds after link up to get diagnostic information from
* the phy * the phy
*/ **/
static void e1000_update_phy_info(unsigned long data) static void e1000_update_phy_info(unsigned long data)
{ {
struct e1000_adapter *adapter = (struct e1000_adapter *) data; struct e1000_adapter *adapter = (struct e1000_adapter *) data;
...@@ -4129,8 +4086,7 @@ static void e1000e_update_phy_stats(struct e1000_adapter *adapter) ...@@ -4129,8 +4086,7 @@ static void e1000e_update_phy_stats(struct e1000_adapter *adapter)
if (ret_val) if (ret_val)
return; return;
/* /* A page set is expensive so check if already on desired page.
* A page set is expensive so check if already on desired page.
* If not, set to the page with the PHY status registers. * If not, set to the page with the PHY status registers.
*/ */
hw->phy.addr = 1; hw->phy.addr = 1;
...@@ -4201,8 +4157,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter) ...@@ -4201,8 +4157,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
/* /* Prevent stats update while adapter is being reset, or if the pci
* Prevent stats update while adapter is being reset, or if the pci
* connection is down. * connection is down.
*/ */
if (adapter->link_speed == 0) if (adapter->link_speed == 0)
...@@ -4270,8 +4225,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter) ...@@ -4270,8 +4225,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter)
/* Rx Errors */ /* Rx Errors */
/* /* RLEC on some newer hardware can be incorrect so build
* RLEC on some newer hardware can be incorrect so build
* our own version based on RUC and ROC * our own version based on RUC and ROC
*/ */
netdev->stats.rx_errors = adapter->stats.rxerrc + netdev->stats.rx_errors = adapter->stats.rxerrc +
...@@ -4323,8 +4277,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) ...@@ -4323,8 +4277,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
if (ret_val) if (ret_val)
e_warn("Error reading PHY register\n"); e_warn("Error reading PHY register\n");
} else { } else {
/* /* Do not read PHY registers if link is not up
* Do not read PHY registers if link is not up
* Set values to typical power-on defaults * Set values to typical power-on defaults
*/ */
phy->bmcr = (BMCR_SPEED1000 | BMCR_ANENABLE | BMCR_FULLDPLX); phy->bmcr = (BMCR_SPEED1000 | BMCR_ANENABLE | BMCR_FULLDPLX);
...@@ -4362,8 +4315,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter) ...@@ -4362,8 +4315,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
bool link_active = false; bool link_active = false;
s32 ret_val = 0; s32 ret_val = 0;
/* /* get_link_status is set on LSC (link status) interrupt or
* get_link_status is set on LSC (link status) interrupt or
* Rx sequence error interrupt. get_link_status will stay * Rx sequence error interrupt. get_link_status will stay
* false until the check_for_link establishes link * false until the check_for_link establishes link
* for copper adapters ONLY * for copper adapters ONLY
...@@ -4415,8 +4367,7 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter) ...@@ -4415,8 +4367,7 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
/* /* With 82574 controllers, PHY needs to be checked periodically
* With 82574 controllers, PHY needs to be checked periodically
* for hung state and reset, if two calls return true * for hung state and reset, if two calls return true
*/ */
if (e1000_check_phy_82574(hw)) if (e1000_check_phy_82574(hw))
...@@ -4484,8 +4435,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4484,8 +4435,7 @@ static void e1000_watchdog_task(struct work_struct *work)
&adapter->link_speed, &adapter->link_speed,
&adapter->link_duplex); &adapter->link_duplex);
e1000_print_link_info(adapter); e1000_print_link_info(adapter);
/* /* On supported PHYs, check for duplex mismatch only
* On supported PHYs, check for duplex mismatch only
* if link has autonegotiated at 10/100 half * if link has autonegotiated at 10/100 half
*/ */
if ((hw->phy.type == e1000_phy_igp_3 || if ((hw->phy.type == e1000_phy_igp_3 ||
...@@ -4515,8 +4465,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4515,8 +4465,7 @@ static void e1000_watchdog_task(struct work_struct *work)
break; break;
} }
/* /* workaround: re-program speed mode bit after
* workaround: re-program speed mode bit after
* link-up event * link-up event
*/ */
if ((adapter->flags & FLAG_TARC_SPEED_MODE_BIT) && if ((adapter->flags & FLAG_TARC_SPEED_MODE_BIT) &&
...@@ -4527,8 +4476,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4527,8 +4476,7 @@ static void e1000_watchdog_task(struct work_struct *work)
ew32(TARC(0), tarc0); ew32(TARC(0), tarc0);
} }
/* /* disable TSO for pcie and 10/100 speeds, to avoid
* disable TSO for pcie and 10/100 speeds, to avoid
* some hardware issues * some hardware issues
*/ */
if (!(adapter->flags & FLAG_TSO_FORCE)) { if (!(adapter->flags & FLAG_TSO_FORCE)) {
...@@ -4549,16 +4497,14 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4549,16 +4497,14 @@ static void e1000_watchdog_task(struct work_struct *work)
} }
} }
/* /* enable transmits in the hardware, need to do this
* enable transmits in the hardware, need to do this
* after setting TARC(0) * after setting TARC(0)
*/ */
tctl = er32(TCTL); tctl = er32(TCTL);
tctl |= E1000_TCTL_EN; tctl |= E1000_TCTL_EN;
ew32(TCTL, tctl); ew32(TCTL, tctl);
/* /* Perform any post-link-up configuration before
* Perform any post-link-up configuration before
* reporting link up. * reporting link up.
*/ */
if (phy->ops.cfg_on_link_up) if (phy->ops.cfg_on_link_up)
...@@ -4609,8 +4555,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4609,8 +4555,7 @@ static void e1000_watchdog_task(struct work_struct *work)
if (!netif_carrier_ok(netdev) && if (!netif_carrier_ok(netdev) &&
(e1000_desc_unused(tx_ring) + 1 < tx_ring->count)) { (e1000_desc_unused(tx_ring) + 1 < tx_ring->count)) {
/* /* We've lost link, so the controller stops DMA,
* We've lost link, so the controller stops DMA,
* but we've got queued Tx work that's never going * but we've got queued Tx work that's never going
* to get done, so reset controller to flush Tx. * to get done, so reset controller to flush Tx.
* (Do the reset outside of interrupt context). * (Do the reset outside of interrupt context).
...@@ -4622,8 +4567,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4622,8 +4567,7 @@ static void e1000_watchdog_task(struct work_struct *work)
/* Simple mode for Interrupt Throttle Rate (ITR) */ /* Simple mode for Interrupt Throttle Rate (ITR) */
if (adapter->itr_setting == 4) { if (adapter->itr_setting == 4) {
/* /* Symmetric Tx/Rx gets a reduced ITR=2000;
* Symmetric Tx/Rx gets a reduced ITR=2000;
* Total asymmetrical Tx or Rx gets ITR=8000; * Total asymmetrical Tx or Rx gets ITR=8000;
* everyone else is between 2000-8000. * everyone else is between 2000-8000.
*/ */
...@@ -4648,8 +4592,7 @@ static void e1000_watchdog_task(struct work_struct *work) ...@@ -4648,8 +4592,7 @@ static void e1000_watchdog_task(struct work_struct *work)
/* Force detection of hung controller every watchdog period */ /* Force detection of hung controller every watchdog period */
adapter->detect_tx_hung = true; adapter->detect_tx_hung = true;
/* /* With 82571 controllers, LAA may be overwritten due to controller
* With 82571 controllers, LAA may be overwritten due to controller
* reset from the other port. Set the appropriate LAA in RAR[0] * reset from the other port. Set the appropriate LAA in RAR[0]
*/ */
if (e1000e_get_laa_state_82571(hw)) if (e1000e_get_laa_state_82571(hw))
...@@ -4948,8 +4891,7 @@ static void e1000_tx_queue(struct e1000_ring *tx_ring, int tx_flags, int count) ...@@ -4948,8 +4891,7 @@ static void e1000_tx_queue(struct e1000_ring *tx_ring, int tx_flags, int count)
if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS)) if (unlikely(tx_flags & E1000_TX_FLAGS_NO_FCS))
tx_desc->lower.data &= ~(cpu_to_le32(E1000_TXD_CMD_IFCS)); tx_desc->lower.data &= ~(cpu_to_le32(E1000_TXD_CMD_IFCS));
/* /* Force memory writes to complete before letting h/w
* Force memory writes to complete before letting h/w
* know there are new descriptors to fetch. (Only * know there are new descriptors to fetch. (Only
* applicable for weak-ordered memory model archs, * applicable for weak-ordered memory model archs,
* such as IA-64). * such as IA-64).
...@@ -4963,8 +4905,7 @@ static void e1000_tx_queue(struct e1000_ring *tx_ring, int tx_flags, int count) ...@@ -4963,8 +4905,7 @@ static void e1000_tx_queue(struct e1000_ring *tx_ring, int tx_flags, int count)
else else
writel(i, tx_ring->tail); writel(i, tx_ring->tail);
/* /* we need this if more than one processor can write to our tail
* we need this if more than one processor can write to our tail
* at a time, it synchronizes IO on IA64/Altix systems * at a time, it synchronizes IO on IA64/Altix systems
*/ */
mmiowb(); mmiowb();
...@@ -5014,15 +4955,13 @@ static int __e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size) ...@@ -5014,15 +4955,13 @@ static int __e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size)
struct e1000_adapter *adapter = tx_ring->adapter; struct e1000_adapter *adapter = tx_ring->adapter;
netif_stop_queue(adapter->netdev); netif_stop_queue(adapter->netdev);
/* /* Herbert's original patch had:
* Herbert's original patch had:
* smp_mb__after_netif_stop_queue(); * smp_mb__after_netif_stop_queue();
* but since that doesn't exist yet, just open code it. * but since that doesn't exist yet, just open code it.
*/ */
smp_mb(); smp_mb();
/* /* We need to check again in a case another CPU has just
* We need to check again in a case another CPU has just
* made room available. * made room available.
*/ */
if (e1000_desc_unused(tx_ring) < size) if (e1000_desc_unused(tx_ring) < size)
...@@ -5067,8 +5006,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, ...@@ -5067,8 +5006,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
/* /* The minimum packet size with TCTL.PSP set is 17 bytes so
* The minimum packet size with TCTL.PSP set is 17 bytes so
* pad skb in order to meet this minimum size requirement * pad skb in order to meet this minimum size requirement
*/ */
if (unlikely(skb->len < 17)) { if (unlikely(skb->len < 17)) {
...@@ -5082,14 +5020,12 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, ...@@ -5082,14 +5020,12 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
if (mss) { if (mss) {
u8 hdr_len; u8 hdr_len;
/* /* TSO Workaround for 82571/2/3 Controllers -- if skb->data
* TSO Workaround for 82571/2/3 Controllers -- if skb->data
* points to just header, pull a few bytes of payload from * points to just header, pull a few bytes of payload from
* frags into skb->data * frags into skb->data
*/ */
hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
/* /* we do this workaround for ES2LAN, but it is un-necessary,
* we do this workaround for ES2LAN, but it is un-necessary,
* avoiding it could save a lot of cycles * avoiding it could save a lot of cycles
*/ */
if (skb->data_len && (hdr_len == len)) { if (skb->data_len && (hdr_len == len)) {
...@@ -5120,8 +5056,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, ...@@ -5120,8 +5056,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
if (adapter->hw.mac.tx_pkt_filtering) if (adapter->hw.mac.tx_pkt_filtering)
e1000_transfer_dhcp_info(adapter, skb); e1000_transfer_dhcp_info(adapter, skb);
/* /* need: count + 2 desc gap to keep tail from touching
* need: count + 2 desc gap to keep tail from touching
* head, otherwise try next time * head, otherwise try next time
*/ */
if (e1000_maybe_stop_tx(tx_ring, count + 2)) if (e1000_maybe_stop_tx(tx_ring, count + 2))
...@@ -5145,8 +5080,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, ...@@ -5145,8 +5080,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
else if (e1000_tx_csum(tx_ring, skb)) else if (e1000_tx_csum(tx_ring, skb))
tx_flags |= E1000_TX_FLAGS_CSUM; tx_flags |= E1000_TX_FLAGS_CSUM;
/* /* Old method was to assume IPv4 packet by default if TSO was enabled.
* Old method was to assume IPv4 packet by default if TSO was enabled.
* 82571 hardware supports TSO capabilities for IPv6 as well... * 82571 hardware supports TSO capabilities for IPv6 as well...
* no longer assume, we must. * no longer assume, we must.
*/ */
...@@ -5233,8 +5167,7 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev, ...@@ -5233,8 +5167,7 @@ struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
/* Rx Errors */ /* Rx Errors */
/* /* RLEC on some newer hardware can be incorrect so build
* RLEC on some newer hardware can be incorrect so build
* our own version based on RUC and ROC * our own version based on RUC and ROC
*/ */
stats->rx_errors = adapter->stats.rxerrc + stats->rx_errors = adapter->stats.rxerrc +
...@@ -5303,8 +5236,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -5303,8 +5236,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
if (netif_running(netdev)) if (netif_running(netdev))
e1000e_down(adapter); e1000e_down(adapter);
/* /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
* means we reserve 2 more, this pushes us to allocate from the next * means we reserve 2 more, this pushes us to allocate from the next
* larger slab size. * larger slab size.
* i.e. RXBUFFER_2048 --> size-4096 slab * i.e. RXBUFFER_2048 --> size-4096 slab
...@@ -5566,8 +5498,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake, ...@@ -5566,8 +5498,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
if (adapter->hw.phy.type == e1000_phy_igp_3) if (adapter->hw.phy.type == e1000_phy_igp_3)
e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw); e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
/* /* Release control of h/w to f/w. If f/w is AMT enabled, this
* Release control of h/w to f/w. If f/w is AMT enabled, this
* would have already happened in close and is redundant. * would have already happened in close and is redundant.
*/ */
e1000e_release_hw_control(adapter); e1000e_release_hw_control(adapter);
...@@ -5594,8 +5525,7 @@ static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep, ...@@ -5594,8 +5525,7 @@ static void e1000_complete_shutdown(struct pci_dev *pdev, bool sleep,
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
/* /* The pci-e switch on some quad port adapters will report a
* The pci-e switch on some quad port adapters will report a
* correctable error when the MAC transitions from D0 to D3. To * correctable error when the MAC transitions from D0 to D3. To
* prevent this we need to mask off the correctable errors on the * prevent this we need to mask off the correctable errors on the
* downstream port of the pci-e switch. * downstream port of the pci-e switch.
...@@ -5624,8 +5554,7 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) ...@@ -5624,8 +5554,7 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
#else #else
static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
{ {
/* /* Both device and parent should have the same ASPM setting.
* Both device and parent should have the same ASPM setting.
* Disable ASPM in downstream component first and then upstream. * Disable ASPM in downstream component first and then upstream.
*/ */
pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, state); pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, state);
...@@ -5719,8 +5648,7 @@ static int __e1000_resume(struct pci_dev *pdev) ...@@ -5719,8 +5648,7 @@ static int __e1000_resume(struct pci_dev *pdev)
netif_device_attach(netdev); netif_device_attach(netdev);
/* /* If the controller has AMT, do not set DRV_LOAD until the interface
* If the controller has AMT, do not set DRV_LOAD until the interface
* is up. For all other cases, let the f/w know that the h/w is now * is up. For all other cases, let the f/w know that the h/w is now
* under the control of the driver. * under the control of the driver.
*/ */
...@@ -5848,7 +5776,10 @@ static irqreturn_t e1000_intr_msix(int irq, void *data) ...@@ -5848,7 +5776,10 @@ static irqreturn_t e1000_intr_msix(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/* /**
* e1000_netpoll
* @netdev: network interface device structure
*
* Polling 'interrupt' - used by things like netconsole to send skbs * Polling 'interrupt' - used by things like netconsole to send skbs
* without having to re-enable interrupts. It's not called while * without having to re-enable interrupts. It's not called while
* the interrupt routine is executing. * the interrupt routine is executing.
...@@ -5973,8 +5904,7 @@ static void e1000_io_resume(struct pci_dev *pdev) ...@@ -5973,8 +5904,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
netif_device_attach(netdev); netif_device_attach(netdev);
/* /* If the controller has AMT, do not set DRV_LOAD until the interface
* If the controller has AMT, do not set DRV_LOAD until the interface
* is up. For all other cases, let the f/w know that the h/w is now * is up. For all other cases, let the f/w know that the h/w is now
* under the control of the driver. * under the control of the driver.
*/ */
...@@ -6273,14 +6203,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6273,14 +6203,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
if (e1000e_enable_mng_pass_thru(&adapter->hw)) if (e1000e_enable_mng_pass_thru(&adapter->hw))
adapter->flags |= FLAG_MNG_PT_ENABLED; adapter->flags |= FLAG_MNG_PT_ENABLED;
/* /* before reading the NVM, reset the controller to
* before reading the NVM, reset the controller to
* put the device in a known good starting state * put the device in a known good starting state
*/ */
adapter->hw.mac.ops.reset_hw(&adapter->hw); adapter->hw.mac.ops.reset_hw(&adapter->hw);
/* /* systems with ASPM and others may see the checksum fail on the first
* systems with ASPM and others may see the checksum fail on the first
* attempt. Let's give it a few tries * attempt. Let's give it a few tries
*/ */
for (i = 0;; i++) { for (i = 0;; i++) {
...@@ -6335,8 +6263,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6335,8 +6263,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
adapter->rx_ring->count = E1000_DEFAULT_RXD; adapter->rx_ring->count = E1000_DEFAULT_RXD;
adapter->tx_ring->count = E1000_DEFAULT_TXD; adapter->tx_ring->count = E1000_DEFAULT_TXD;
/* /* Initial Wake on LAN setting - If APM wake is enabled in
* Initial Wake on LAN setting - If APM wake is enabled in
* the EEPROM, enable the ACPI Magic Packet filter * the EEPROM, enable the ACPI Magic Packet filter
*/ */
if (adapter->flags & FLAG_APME_IN_WUC) { if (adapter->flags & FLAG_APME_IN_WUC) {
...@@ -6360,8 +6287,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6360,8 +6287,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
if (eeprom_data & eeprom_apme_mask) if (eeprom_data & eeprom_apme_mask)
adapter->eeprom_wol |= E1000_WUFC_MAG; adapter->eeprom_wol |= E1000_WUFC_MAG;
/* /* now that we have the eeprom settings, apply the special cases
* now that we have the eeprom settings, apply the special cases
* where the eeprom may be wrong or the board simply won't support * where the eeprom may be wrong or the board simply won't support
* wake on lan on a particular port * wake on lan on a particular port
*/ */
...@@ -6378,8 +6304,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -6378,8 +6304,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
/* reset the hardware with the new settings */ /* reset the hardware with the new settings */
e1000e_reset(adapter); e1000e_reset(adapter);
/* /* If the controller has AMT, do not set DRV_LOAD until the interface
* If the controller has AMT, do not set DRV_LOAD until the interface
* is up. For all other cases, let the f/w know that the h/w is now * is up. For all other cases, let the f/w know that the h/w is now
* under the control of the driver. * under the control of the driver.
*/ */
...@@ -6442,8 +6367,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev) ...@@ -6442,8 +6367,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
bool down = test_bit(__E1000_DOWN, &adapter->state); bool down = test_bit(__E1000_DOWN, &adapter->state);
/* /* The timers may be rescheduled, so explicitly disable them
* The timers may be rescheduled, so explicitly disable them
* from being rescheduled. * from being rescheduled.
*/ */
if (!down) if (!down)
...@@ -6468,8 +6392,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev) ...@@ -6468,8 +6392,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
if (pci_dev_run_wake(pdev)) if (pci_dev_run_wake(pdev))
pm_runtime_get_noresume(&pdev->dev); pm_runtime_get_noresume(&pdev->dev);
/* /* Release control of h/w to f/w. If f/w is AMT enabled, this
* Release control of h/w to f/w. If f/w is AMT enabled, this
* would have already happened in close and is redundant. * would have already happened in close and is redundant.
*/ */
e1000e_release_hw_control(adapter); e1000e_release_hw_control(adapter);
......
...@@ -279,8 +279,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw) ...@@ -279,8 +279,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
e1e_flush(); e1e_flush();
udelay(1); udelay(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 * The EEPROM will signal that the command has been completed
* by clearing bit 0 of the internal status register. If it's * by clearing bit 0 of the internal status register. If it's
* not cleared within 'timeout', then error out. * not cleared within 'timeout', then error out.
...@@ -321,8 +320,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -321,8 +320,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
u32 i, eerd = 0; u32 i, eerd = 0;
s32 ret_val = 0; s32 ret_val = 0;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* too many words for the offset, and not enough words. * too many words for the offset, and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -364,8 +362,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -364,8 +362,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
s32 ret_val; s32 ret_val;
u16 widx = 0; u16 widx = 0;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* and not enough words. * and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -393,8 +390,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -393,8 +390,7 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
e1000_standby_nvm(hw); 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 * opcode
*/ */
if ((nvm->address_bits == 8) && (offset >= 128)) if ((nvm->address_bits == 8) && (offset >= 128))
...@@ -461,8 +457,7 @@ s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, ...@@ -461,8 +457,7 @@ s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
return ret_val; 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 * means pba_ptr is actually our second data word for the PBA number
* and we can decode it into an ascii string * and we can decode it into an ascii string
*/ */
......
...@@ -32,11 +32,9 @@ ...@@ -32,11 +32,9 @@
#include "e1000.h" #include "e1000.h"
/* /* This is the only thing that needs to be changed to adjust the
* This is the only thing that needs to be changed to adjust the
* maximum number of ports that the driver can manage. * maximum number of ports that the driver can manage.
*/ */
#define E1000_MAX_NIC 32 #define E1000_MAX_NIC 32
#define OPTION_UNSET -1 #define OPTION_UNSET -1
...@@ -49,12 +47,10 @@ module_param(copybreak, uint, 0644); ...@@ -49,12 +47,10 @@ module_param(copybreak, uint, 0644);
MODULE_PARM_DESC(copybreak, MODULE_PARM_DESC(copybreak,
"Maximum size of packet that is copied to a new buffer on receive"); "Maximum size of packet that is copied to a new buffer on receive");
/* /* All parameters are treated the same, as an integer array of values.
* All parameters are treated the same, as an integer array of values.
* This macro just reduces the need to repeat the same declaration code * This macro just reduces the need to repeat the same declaration code
* over and over (plus this helps to avoid typo bugs). * over and over (plus this helps to avoid typo bugs).
*/ */
#define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET } #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
#define E1000_PARAM(X, desc) \ #define E1000_PARAM(X, desc) \
static int __devinitdata X[E1000_MAX_NIC+1] \ static int __devinitdata X[E1000_MAX_NIC+1] \
...@@ -63,8 +59,7 @@ MODULE_PARM_DESC(copybreak, ...@@ -63,8 +59,7 @@ MODULE_PARM_DESC(copybreak,
module_param_array_named(X, X, int, &num_##X, 0); \ module_param_array_named(X, X, int, &num_##X, 0); \
MODULE_PARM_DESC(X, desc); MODULE_PARM_DESC(X, desc);
/* /* Transmit Interrupt Delay in units of 1.024 microseconds
* Transmit Interrupt Delay in units of 1.024 microseconds
* Tx interrupt delay needs to typically be set to something non-zero * Tx interrupt delay needs to typically be set to something non-zero
* *
* Valid Range: 0-65535 * Valid Range: 0-65535
...@@ -74,8 +69,7 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay"); ...@@ -74,8 +69,7 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
#define MAX_TXDELAY 0xFFFF #define MAX_TXDELAY 0xFFFF
#define MIN_TXDELAY 0 #define MIN_TXDELAY 0
/* /* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
* *
* Valid Range: 0-65535 * Valid Range: 0-65535
*/ */
...@@ -84,8 +78,7 @@ E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay"); ...@@ -84,8 +78,7 @@ E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
#define MAX_TXABSDELAY 0xFFFF #define MAX_TXABSDELAY 0xFFFF
#define MIN_TXABSDELAY 0 #define MIN_TXABSDELAY 0
/* /* Receive Interrupt Delay in units of 1.024 microseconds
* Receive Interrupt Delay in units of 1.024 microseconds
* hardware will likely hang if you set this to anything but zero. * hardware will likely hang if you set this to anything but zero.
* *
* Valid Range: 0-65535 * Valid Range: 0-65535
...@@ -94,8 +87,7 @@ E1000_PARAM(RxIntDelay, "Receive Interrupt Delay"); ...@@ -94,8 +87,7 @@ E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
#define MAX_RXDELAY 0xFFFF #define MAX_RXDELAY 0xFFFF
#define MIN_RXDELAY 0 #define MIN_RXDELAY 0
/* /* Receive Absolute Interrupt Delay in units of 1.024 microseconds
* Receive Absolute Interrupt Delay in units of 1.024 microseconds
* *
* Valid Range: 0-65535 * Valid Range: 0-65535
*/ */
...@@ -103,8 +95,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay"); ...@@ -103,8 +95,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
#define MAX_RXABSDELAY 0xFFFF #define MAX_RXABSDELAY 0xFFFF
#define MIN_RXABSDELAY 0 #define MIN_RXABSDELAY 0
/* /* Interrupt Throttle Rate (interrupts/sec)
* Interrupt Throttle Rate (interrupts/sec)
* *
* Valid Range: 100-100000 or one of: 0=off, 1=dynamic, 3=dynamic conservative * Valid Range: 100-100000 or one of: 0=off, 1=dynamic, 3=dynamic conservative
*/ */
...@@ -113,8 +104,7 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); ...@@ -113,8 +104,7 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
#define MAX_ITR 100000 #define MAX_ITR 100000
#define MIN_ITR 100 #define MIN_ITR 100
/* /* IntMode (Interrupt Mode)
* IntMode (Interrupt Mode)
* *
* Valid Range: varies depending on kernel configuration & hardware support * Valid Range: varies depending on kernel configuration & hardware support
* *
...@@ -132,8 +122,7 @@ E1000_PARAM(IntMode, "Interrupt Mode"); ...@@ -132,8 +122,7 @@ E1000_PARAM(IntMode, "Interrupt Mode");
#define MAX_INTMODE 2 #define MAX_INTMODE 2
#define MIN_INTMODE 0 #define MIN_INTMODE 0
/* /* Enable Smart Power Down of the PHY
* Enable Smart Power Down of the PHY
* *
* Valid Range: 0, 1 * Valid Range: 0, 1
* *
...@@ -141,8 +130,7 @@ E1000_PARAM(IntMode, "Interrupt Mode"); ...@@ -141,8 +130,7 @@ E1000_PARAM(IntMode, "Interrupt Mode");
*/ */
E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down"); E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
/* /* Enable Kumeran Lock Loss workaround
* Enable Kumeran Lock Loss workaround
* *
* Valid Range: 0, 1 * Valid Range: 0, 1
* *
...@@ -150,8 +138,7 @@ E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down"); ...@@ -150,8 +138,7 @@ E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
*/ */
E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
/* /* Write Protect NVM
* Write Protect NVM
* *
* Valid Range: 0, 1 * Valid Range: 0, 1
* *
...@@ -159,8 +146,7 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); ...@@ -159,8 +146,7 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
*/ */
E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]"); E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]");
/* /* Enable CRC Stripping
* Enable CRC Stripping
* *
* Valid Range: 0, 1 * Valid Range: 0, 1
* *
...@@ -351,8 +337,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) ...@@ -351,8 +337,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
if (num_InterruptThrottleRate > bd) { if (num_InterruptThrottleRate > bd) {
adapter->itr = InterruptThrottleRate[bd]; adapter->itr = InterruptThrottleRate[bd];
/* /* Make sure a message is printed for non-special
* Make sure a message is printed for non-special
* values. And in case of an invalid option, display * values. And in case of an invalid option, display
* warning, use default and go through itr/itr_setting * warning, use default and go through itr/itr_setting
* adjustment logic below * adjustment logic below
...@@ -361,14 +346,12 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) ...@@ -361,14 +346,12 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
e1000_validate_option(&adapter->itr, &opt, adapter)) e1000_validate_option(&adapter->itr, &opt, adapter))
adapter->itr = opt.def; adapter->itr = opt.def;
} else { } else {
/* /* If no option specified, use default value and go
* If no option specified, use default value and go
* through the logic below to adjust itr/itr_setting * through the logic below to adjust itr/itr_setting
*/ */
adapter->itr = opt.def; adapter->itr = opt.def;
/* /* Make sure a message is printed for non-special
* Make sure a message is printed for non-special
* default values * default values
*/ */
if (adapter->itr > 4) if (adapter->itr > 4)
...@@ -400,8 +383,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) ...@@ -400,8 +383,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
opt.name); opt.name);
break; break;
default: default:
/* /* Save the setting, because the dynamic bits
* Save the setting, because the dynamic bits
* change itr. * change itr.
* *
* Clear the lower two bits because * Clear the lower two bits because
......
...@@ -193,8 +193,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) ...@@ -193,8 +193,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
return -E1000_ERR_PARAM; 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 * Control register. The MAC will take care of interfacing with the
* PHY to retrieve the desired data. * PHY to retrieve the desired data.
*/ */
...@@ -204,8 +203,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) ...@@ -204,8 +203,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
ew32(MDIC, mdic); ew32(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 * Increasing the time out as testing showed failures with
* the lower time out * the lower time out
*/ */
...@@ -225,8 +223,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) ...@@ -225,8 +223,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
} }
*data = (u16) mdic; *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. * reading duplicate data in the next MDIC transaction.
*/ */
if (hw->mac.type == e1000_pch2lan) if (hw->mac.type == e1000_pch2lan)
...@@ -253,8 +250,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data) ...@@ -253,8 +250,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
return -E1000_ERR_PARAM; 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 * Control register. The MAC will take care of interfacing with the
* PHY to retrieve the desired data. * PHY to retrieve the desired data.
*/ */
...@@ -265,8 +261,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data) ...@@ -265,8 +261,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
ew32(MDIC, mdic); ew32(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 * Increasing the time out as testing showed failures with
* the lower time out * the lower time out
*/ */
...@@ -285,8 +280,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data) ...@@ -285,8 +280,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
return -E1000_ERR_PHY; 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. * reading duplicate data in the next MDIC transaction.
*/ */
if (hw->mac.type == e1000_pch2lan) if (hw->mac.type == e1000_pch2lan)
...@@ -708,8 +702,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw) ...@@ -708,8 +702,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
phy_data &= ~I82577_PHY_CTRL2_MDIX_CFG_MASK; phy_data &= ~I82577_PHY_CTRL2_MDIX_CFG_MASK;
/* /* Options:
* Options:
* 0 - Auto (default) * 0 - Auto (default)
* 1 - MDI mode * 1 - MDI mode
* 2 - MDI-X mode * 2 - MDI-X mode
...@@ -754,8 +747,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw) ...@@ -754,8 +747,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
if (phy->type != e1000_phy_bm) if (phy->type != e1000_phy_bm)
phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX; phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX;
/* /* Options:
* Options:
* MDI/MDI-X = 0 (default) * MDI/MDI-X = 0 (default)
* 0 - Auto for all speeds * 0 - Auto for all speeds
* 1 - MDI mode * 1 - MDI mode
...@@ -780,8 +772,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw) ...@@ -780,8 +772,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
break; break;
} }
/* /* Options:
* Options:
* disable_polarity_correction = 0 (default) * disable_polarity_correction = 0 (default)
* Automatic Correction for Reversed Cable Polarity * Automatic Correction for Reversed Cable Polarity
* 0 - Disabled * 0 - Disabled
...@@ -818,8 +809,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw) ...@@ -818,8 +809,7 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw)
if ((phy->type == e1000_phy_m88) && if ((phy->type == e1000_phy_m88) &&
(phy->revision < E1000_REVISION_4) && (phy->revision < E1000_REVISION_4) &&
(phy->id != BME1000_E_PHY_ID_R2)) { (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. * to 25MHz clock.
*/ */
ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); ret_val = e1e_rphy(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
...@@ -899,8 +889,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw) ...@@ -899,8 +889,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
return ret_val; 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. * timeout issues when LFS is enabled.
*/ */
msleep(100); msleep(100);
...@@ -936,8 +925,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw) ...@@ -936,8 +925,7 @@ s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw)
/* set auto-master slave resolution settings */ /* set auto-master slave resolution settings */
if (hw->mac.autoneg) { 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 * should disable SmartSpeed and enable Auto MasterSlave
* resolution as hardware default. * resolution as hardware default.
*/ */
...@@ -1001,16 +989,14 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) ...@@ -1001,16 +989,14 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
return ret_val; 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 * the appropriate PHY registers. First we will parse for
* autoneg_advertised software override. Since we can advertise * autoneg_advertised software override. Since we can advertise
* a plethora of combinations, we need to check each bit * a plethora of combinations, we need to check each bit
* individually. * 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 * Advertisement Register (Address 4) and the 1000 mb speed bits in
* the 1000Base-T Control Register (Address 9). * the 1000Base-T Control Register (Address 9).
*/ */
...@@ -1056,8 +1042,7 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) ...@@ -1056,8 +1042,7 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
mii_1000t_ctrl_reg |= CR_1000T_FD_CAPS; 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 * setup the PHY advertisement registers accordingly. If
* auto-negotiation is enabled, then software will have to set the * auto-negotiation is enabled, then software will have to set the
* "PAUSE" bits to the correct value in the Auto-Negotiation * "PAUSE" bits to the correct value in the Auto-Negotiation
...@@ -1076,15 +1061,13 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) ...@@ -1076,15 +1061,13 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
*/ */
switch (hw->fc.current_mode) { switch (hw->fc.current_mode) {
case e1000_fc_none: 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. * software over-ride.
*/ */
mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg &= ~(NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
break; break;
case e1000_fc_rx_pause: 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. * disabled, by a software over-ride.
* *
* Since there really isn't a way to advertise that we are * Since there really isn't a way to advertise that we are
...@@ -1096,16 +1079,14 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) ...@@ -1096,16 +1079,14 @@ static s32 e1000_phy_setup_autoneg(struct e1000_hw *hw)
mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
break; break;
case e1000_fc_tx_pause: 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. * disabled, by a software over-ride.
*/ */
mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR; mii_autoneg_adv_reg |= NWAY_AR_ASM_DIR;
mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE; mii_autoneg_adv_reg &= ~NWAY_AR_PAUSE;
break; break;
case e1000_fc_full: 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. * over-ride.
*/ */
mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE); mii_autoneg_adv_reg |= (NWAY_AR_ASM_DIR | NWAY_AR_PAUSE);
...@@ -1142,14 +1123,12 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) ...@@ -1142,14 +1123,12 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
u16 phy_ctrl; u16 phy_ctrl;
/* /* Perform some bounds checking on the autoneg advertisement
* Perform some bounds checking on the autoneg advertisement
* parameter. * parameter.
*/ */
phy->autoneg_advertised &= phy->autoneg_mask; 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. * by the calling code so we set to advertise full capability.
*/ */
if (!phy->autoneg_advertised) if (!phy->autoneg_advertised)
...@@ -1163,8 +1142,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) ...@@ -1163,8 +1142,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
} }
e_dbg("Restarting Auto-Neg\n"); e_dbg("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. * the Auto Neg Restart bit in the PHY control register.
*/ */
ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_ctrl); ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_ctrl);
...@@ -1176,8 +1154,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) ...@@ -1176,8 +1154,7 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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). * check at a later time (for example, callback routine).
*/ */
if (phy->autoneg_wait_to_complete) { if (phy->autoneg_wait_to_complete) {
...@@ -1208,16 +1185,14 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw) ...@@ -1208,16 +1185,14 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw)
bool link; bool link;
if (hw->mac.autoneg) { if (hw->mac.autoneg) {
/* /* Setup autoneg and flow control advertisement and perform
* Setup autoneg and flow control advertisement and perform
* autonegotiation. * autonegotiation.
*/ */
ret_val = e1000_copper_link_autoneg(hw); ret_val = e1000_copper_link_autoneg(hw);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
} else { } 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. * depending on user settings.
*/ */
e_dbg("Forcing Speed and Duplex\n"); e_dbg("Forcing Speed and Duplex\n");
...@@ -1228,8 +1203,7 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw) ...@@ -1228,8 +1203,7 @@ s32 e1000e_setup_copper_link(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. * valid.
*/ */
ret_val = e1000e_phy_has_link_generic(hw, COPPER_LINK_UP_LIMIT, 10, ret_val = e1000e_phy_has_link_generic(hw, COPPER_LINK_UP_LIMIT, 10,
...@@ -1273,8 +1247,7 @@ s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw) ...@@ -1273,8 +1247,7 @@ s32 e1000e_phy_force_speed_duplex_igp(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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. * forced whenever speed and duplex are forced.
*/ */
ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data); ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data);
...@@ -1328,8 +1301,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw) ...@@ -1328,8 +1301,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
u16 phy_data; u16 phy_data;
bool link; bool link;
/* /* 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. * forced whenever speed and duplex are forced.
*/ */
ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
...@@ -1370,8 +1342,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw) ...@@ -1370,8 +1342,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
if (hw->phy.type != e1000_phy_m88) { if (hw->phy.type != e1000_phy_m88) {
e_dbg("Link taking longer than expected.\n"); e_dbg("Link taking longer than expected.\n");
} else { } else {
/* /* We didn't get link.
* We didn't get link.
* Reset the DSP and cross our fingers. * Reset the DSP and cross our fingers.
*/ */
ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT, ret_val = e1e_wphy(hw, M88E1000_PHY_PAGE_SELECT,
...@@ -1398,8 +1369,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw) ...@@ -1398,8 +1369,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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 * Extended PHY Specific Control Register to 25MHz clock from
* the reset value of 2.5MHz. * the reset value of 2.5MHz.
*/ */
...@@ -1408,8 +1378,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw) ...@@ -1408,8 +1378,7 @@ s32 e1000e_phy_force_speed_duplex_m88(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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. * duplex.
*/ */
ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
...@@ -1573,8 +1542,7 @@ s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active) ...@@ -1573,8 +1542,7 @@ s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active)
ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
if (ret_val) if (ret_val)
return 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 * during Dx states where the power conservation is most
* important. During driver activity we should enable * important. During driver activity we should enable
* SmartSpeed, so performance is maintained. * SmartSpeed, so performance is maintained.
...@@ -1702,8 +1670,7 @@ s32 e1000_check_polarity_igp(struct e1000_hw *hw) ...@@ -1702,8 +1670,7 @@ s32 e1000_check_polarity_igp(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
u16 data, offset, mask; u16 data, offset, mask;
/* /* Polarity is determined based on the speed of
* Polarity is determined based on the speed of
* our connection. * our connection.
*/ */
ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data); ret_val = e1e_rphy(hw, IGP01E1000_PHY_PORT_STATUS, &data);
...@@ -1715,8 +1682,7 @@ s32 e1000_check_polarity_igp(struct e1000_hw *hw) ...@@ -1715,8 +1682,7 @@ s32 e1000_check_polarity_igp(struct e1000_hw *hw)
offset = IGP01E1000_PHY_PCS_INIT_REG; offset = IGP01E1000_PHY_PCS_INIT_REG;
mask = IGP01E1000_PHY_POLARITY_MASK; mask = IGP01E1000_PHY_POLARITY_MASK;
} else { } else {
/* /* This really only applies to 10Mbps since
* This really only applies to 10Mbps since
* there is no polarity for 100Mbps (always 0). * there is no polarity for 100Mbps (always 0).
*/ */
offset = IGP01E1000_PHY_PORT_STATUS; offset = IGP01E1000_PHY_PORT_STATUS;
...@@ -1745,8 +1711,7 @@ s32 e1000_check_polarity_ife(struct e1000_hw *hw) ...@@ -1745,8 +1711,7 @@ s32 e1000_check_polarity_ife(struct e1000_hw *hw)
s32 ret_val; s32 ret_val;
u16 phy_data, offset, mask; u16 phy_data, offset, mask;
/* /* Polarity is determined based on the reversal feature being enabled.
* Polarity is determined based on the reversal feature being enabled.
*/ */
if (phy->polarity_correction) { if (phy->polarity_correction) {
offset = IFE_PHY_EXTENDED_STATUS_CONTROL; offset = IFE_PHY_EXTENDED_STATUS_CONTROL;
...@@ -1791,8 +1756,7 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw) ...@@ -1791,8 +1756,7 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw)
msleep(100); msleep(100);
} }
/* /* PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation
* PHY_AUTO_NEG_TIME expiration doesn't guarantee auto-negotiation
* has completed. * has completed.
*/ */
return ret_val; return ret_val;
...@@ -1814,15 +1778,13 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, ...@@ -1814,15 +1778,13 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
u16 i, phy_status; u16 i, phy_status;
for (i = 0; i < iterations; i++) { 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 * twice due to the link bit being sticky. No harm doing
* it across the board. * it across the board.
*/ */
ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status); ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
if (ret_val) 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 * ownership of the resources, wait and try again to
* see if they have relinquished the resources yet. * see if they have relinquished the resources yet.
*/ */
...@@ -1913,8 +1875,7 @@ s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw) ...@@ -1913,8 +1875,7 @@ s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return 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 * coarse and fine gain values. The result is a number
* that can be put into the lookup table to obtain the * that can be put into the lookup table to obtain the
* approximate cable length. * approximate cable length.
...@@ -2285,15 +2246,13 @@ s32 e1000e_phy_init_script_igp3(struct e1000_hw *hw) ...@@ -2285,15 +2246,13 @@ s32 e1000e_phy_init_script_igp3(struct e1000_hw *hw)
e1e_wphy(hw, 0x1796, 0x0008); e1e_wphy(hw, 0x1796, 0x0008);
/* Change cg_icount + enable integbp for channels BCD */ /* Change cg_icount + enable integbp for channels BCD */
e1e_wphy(hw, 0x1798, 0xD008); e1e_wphy(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 * to 8 for channel A
*/ */
e1e_wphy(hw, 0x1898, 0xD918); e1e_wphy(hw, 0x1898, 0xD918);
/* Disable AHT in Slave mode on channel A */ /* Disable AHT in Slave mode on channel A */
e1e_wphy(hw, 0x187A, 0x0800); e1e_wphy(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 * Enable SPD+B2B
*/ */
e1e_wphy(hw, 0x0019, 0x008D); e1e_wphy(hw, 0x0019, 0x008D);
...@@ -2417,8 +2376,7 @@ s32 e1000e_determine_phy_address(struct e1000_hw *hw) ...@@ -2417,8 +2376,7 @@ s32 e1000e_determine_phy_address(struct e1000_hw *hw)
e1000e_get_phy_id(hw); e1000e_get_phy_id(hw);
phy_type = e1000e_get_phy_type_from_id(hw->phy.id); phy_type = e1000e_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 * PHY address
*/ */
if (phy_type != e1000_phy_unknown) if (phy_type != e1000_phy_unknown)
...@@ -2478,8 +2436,7 @@ s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data) ...@@ -2478,8 +2436,7 @@ s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data)
if (offset > MAX_PHY_MULTI_PAGE_REG) { if (offset > MAX_PHY_MULTI_PAGE_REG) {
u32 page_shift, page_select; 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 2 and 3. Page select is shifted only for
* phy address 1. * phy address 1.
*/ */
...@@ -2537,8 +2494,7 @@ s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data) ...@@ -2537,8 +2494,7 @@ s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data)
if (offset > MAX_PHY_MULTI_PAGE_REG) { if (offset > MAX_PHY_MULTI_PAGE_REG) {
u32 page_shift, page_select; 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 2 and 3. Page select is shifted only for
* phy address 1. * phy address 1.
*/ */
...@@ -2683,8 +2639,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg) ...@@ -2683,8 +2639,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
return ret_val; 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. * Prevent a power state change by disabling ME and Host PHY wakeup.
*/ */
temp = *phy_reg; temp = *phy_reg;
...@@ -2698,8 +2653,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg) ...@@ -2698,8 +2653,7 @@ s32 e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
return ret_val; 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 * registers on the Wakeup registers page
*/ */
return e1000_set_page_igp(hw, (BM_WUC_PAGE << IGP_PAGE_SHIFT)); return e1000_set_page_igp(hw, (BM_WUC_PAGE << IGP_PAGE_SHIFT));
...@@ -3038,8 +2992,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, ...@@ -3038,8 +2992,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
if (page == HV_INTC_FC_PAGE_START) if (page == HV_INTC_FC_PAGE_START)
page = 0; 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) * Power Down (when bit 11 of the PHY Control register is set)
*/ */
if ((hw->phy.type == e1000_phy_82578) && if ((hw->phy.type == e1000_phy_82578) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment