aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_hw.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-20 08:59:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-20 08:59:45 -0400
commitd59bf96cdde5b874a57bfd1425faa45da915d0b7 (patch)
tree351a40b72514d620e5bebea2de38c26f23277ffc /drivers/net/e1000/e1000_hw.c
parent28df955a2ad484d602314b30183ea8496a9aa34a (diff)
parent25f42b6af09e34c3f92107b36b5aa6edc2fdba2f (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r--drivers/net/e1000/e1000_hw.c115
1 files changed, 58 insertions, 57 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 523c2c9fc0ac..3959039b16ec 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -22,6 +22,7 @@
22 22
23 Contact Information: 23 Contact Information:
24 Linux NICS <linux.nics@intel.com> 24 Linux NICS <linux.nics@intel.com>
25 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26 27
27*******************************************************************************/ 28*******************************************************************************/
@@ -764,7 +765,7 @@ e1000_init_hw(struct e1000_hw *hw)
764 } 765 }
765 766
766 if (hw->mac_type == e1000_82573) { 767 if (hw->mac_type == e1000_82573) {
767 e1000_enable_tx_pkt_filtering(hw); 768 e1000_enable_tx_pkt_filtering(hw);
768 } 769 }
769 770
770 switch (hw->mac_type) { 771 switch (hw->mac_type) {
@@ -860,7 +861,7 @@ e1000_adjust_serdes_amplitude(struct e1000_hw *hw)
860 861
861 if(eeprom_data != EEPROM_RESERVED_WORD) { 862 if(eeprom_data != EEPROM_RESERVED_WORD) {
862 /* Adjust SERDES output amplitude only. */ 863 /* Adjust SERDES output amplitude only. */
863 eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK; 864 eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK;
864 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_EXT_CTRL, eeprom_data); 865 ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_EXT_CTRL, eeprom_data);
865 if(ret_val) 866 if(ret_val)
866 return ret_val; 867 return ret_val;
@@ -1227,7 +1228,7 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw)
1227 1228
1228 if (hw->phy_reset_disable) 1229 if (hw->phy_reset_disable)
1229 return E1000_SUCCESS; 1230 return E1000_SUCCESS;
1230 1231
1231 ret_val = e1000_phy_reset(hw); 1232 ret_val = e1000_phy_reset(hw);
1232 if (ret_val) { 1233 if (ret_val) {
1233 DEBUGOUT("Error Resetting the PHY\n"); 1234 DEBUGOUT("Error Resetting the PHY\n");
@@ -1369,7 +1370,7 @@ e1000_copper_link_ggp_setup(struct e1000_hw *hw)
1369 DEBUGFUNC("e1000_copper_link_ggp_setup"); 1370 DEBUGFUNC("e1000_copper_link_ggp_setup");
1370 1371
1371 if(!hw->phy_reset_disable) { 1372 if(!hw->phy_reset_disable) {
1372 1373
1373 /* Enable CRS on TX for half-duplex operation. */ 1374 /* Enable CRS on TX for half-duplex operation. */
1374 ret_val = e1000_read_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, 1375 ret_val = e1000_read_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
1375 &phy_data); 1376 &phy_data);
@@ -1518,7 +1519,7 @@ e1000_copper_link_mgp_setup(struct e1000_hw *hw)
1518 1519
1519 if(hw->phy_reset_disable) 1520 if(hw->phy_reset_disable)
1520 return E1000_SUCCESS; 1521 return E1000_SUCCESS;
1521 1522
1522 /* Enable CRS on TX. This must be set for half-duplex operation. */ 1523 /* Enable CRS on TX. This must be set for half-duplex operation. */
1523 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); 1524 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
1524 if(ret_val) 1525 if(ret_val)
@@ -1664,7 +1665,7 @@ e1000_copper_link_autoneg(struct e1000_hw *hw)
1664* collision distance in the Transmit Control Register. 1665* collision distance in the Transmit Control Register.
1665* 2) Set up flow control on the MAC to that established with 1666* 2) Set up flow control on the MAC to that established with
1666* the link partner. 1667* the link partner.
1667* 3) Config DSP to improve Gigabit link quality for some PHY revisions. 1668* 3) Config DSP to improve Gigabit link quality for some PHY revisions.
1668* 1669*
1669* hw - Struct containing variables accessed by shared code 1670* hw - Struct containing variables accessed by shared code
1670******************************************************************************/ 1671******************************************************************************/
@@ -1673,7 +1674,7 @@ e1000_copper_link_postconfig(struct e1000_hw *hw)
1673{ 1674{
1674 int32_t ret_val; 1675 int32_t ret_val;
1675 DEBUGFUNC("e1000_copper_link_postconfig"); 1676 DEBUGFUNC("e1000_copper_link_postconfig");
1676 1677
1677 if(hw->mac_type >= e1000_82544) { 1678 if(hw->mac_type >= e1000_82544) {
1678 e1000_config_collision_dist(hw); 1679 e1000_config_collision_dist(hw);
1679 } else { 1680 } else {
@@ -1697,7 +1698,7 @@ e1000_copper_link_postconfig(struct e1000_hw *hw)
1697 return ret_val; 1698 return ret_val;
1698 } 1699 }
1699 } 1700 }
1700 1701
1701 return E1000_SUCCESS; 1702 return E1000_SUCCESS;
1702} 1703}
1703 1704
@@ -1753,11 +1754,11 @@ e1000_setup_copper_link(struct e1000_hw *hw)
1753 } 1754 }
1754 1755
1755 if(hw->autoneg) { 1756 if(hw->autoneg) {
1756 /* Setup autoneg and flow control advertisement 1757 /* Setup autoneg and flow control advertisement
1757 * and perform autonegotiation */ 1758 * and perform autonegotiation */
1758 ret_val = e1000_copper_link_autoneg(hw); 1759 ret_val = e1000_copper_link_autoneg(hw);
1759 if(ret_val) 1760 if(ret_val)
1760 return ret_val; 1761 return ret_val;
1761 } else { 1762 } else {
1762 /* PHY will be set to 10H, 10F, 100H,or 100F 1763 /* PHY will be set to 10H, 10F, 100H,or 100F
1763 * depending on value from forced_speed_duplex. */ 1764 * depending on value from forced_speed_duplex. */
@@ -1785,7 +1786,7 @@ e1000_setup_copper_link(struct e1000_hw *hw)
1785 ret_val = e1000_copper_link_postconfig(hw); 1786 ret_val = e1000_copper_link_postconfig(hw);
1786 if(ret_val) 1787 if(ret_val)
1787 return ret_val; 1788 return ret_val;
1788 1789
1789 DEBUGOUT("Valid link established!!!\n"); 1790 DEBUGOUT("Valid link established!!!\n");
1790 return E1000_SUCCESS; 1791 return E1000_SUCCESS;
1791 } 1792 }
@@ -1983,7 +1984,7 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)
1983 1984
1984 DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); 1985 DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
1985 1986
1986 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg); 1987 ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
1987 if(ret_val) 1988 if(ret_val)
1988 return ret_val; 1989 return ret_val;
1989 1990
@@ -2272,7 +2273,7 @@ e1000_config_mac_to_phy(struct e1000_hw *hw)
2272 2273
2273 DEBUGFUNC("e1000_config_mac_to_phy"); 2274 DEBUGFUNC("e1000_config_mac_to_phy");
2274 2275
2275 /* 82544 or newer MAC, Auto Speed Detection takes care of 2276 /* 82544 or newer MAC, Auto Speed Detection takes care of
2276 * MAC speed/duplex configuration.*/ 2277 * MAC speed/duplex configuration.*/
2277 if (hw->mac_type >= e1000_82544) 2278 if (hw->mac_type >= e1000_82544)
2278 return E1000_SUCCESS; 2279 return E1000_SUCCESS;
@@ -2291,9 +2292,9 @@ e1000_config_mac_to_phy(struct e1000_hw *hw)
2291 if(ret_val) 2292 if(ret_val)
2292 return ret_val; 2293 return ret_val;
2293 2294
2294 if(phy_data & M88E1000_PSSR_DPLX) 2295 if(phy_data & M88E1000_PSSR_DPLX)
2295 ctrl |= E1000_CTRL_FD; 2296 ctrl |= E1000_CTRL_FD;
2296 else 2297 else
2297 ctrl &= ~E1000_CTRL_FD; 2298 ctrl &= ~E1000_CTRL_FD;
2298 2299
2299 e1000_config_collision_dist(hw); 2300 e1000_config_collision_dist(hw);
@@ -2492,10 +2493,10 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
2492 */ 2493 */
2493 if(hw->original_fc == e1000_fc_full) { 2494 if(hw->original_fc == e1000_fc_full) {
2494 hw->fc = e1000_fc_full; 2495 hw->fc = e1000_fc_full;
2495 DEBUGOUT("Flow Control = FULL.\r\n"); 2496 DEBUGOUT("Flow Control = FULL.\n");
2496 } else { 2497 } else {
2497 hw->fc = e1000_fc_rx_pause; 2498 hw->fc = e1000_fc_rx_pause;
2498 DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); 2499 DEBUGOUT("Flow Control = RX PAUSE frames only.\n");
2499 } 2500 }
2500 } 2501 }
2501 /* For receiving PAUSE frames ONLY. 2502 /* For receiving PAUSE frames ONLY.
@@ -2511,7 +2512,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
2511 (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && 2512 (mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
2512 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 2513 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
2513 hw->fc = e1000_fc_tx_pause; 2514 hw->fc = e1000_fc_tx_pause;
2514 DEBUGOUT("Flow Control = TX PAUSE frames only.\r\n"); 2515 DEBUGOUT("Flow Control = TX PAUSE frames only.\n");
2515 } 2516 }
2516 /* For transmitting PAUSE frames ONLY. 2517 /* For transmitting PAUSE frames ONLY.
2517 * 2518 *
@@ -2526,7 +2527,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
2526 !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) && 2527 !(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
2527 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 2528 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
2528 hw->fc = e1000_fc_rx_pause; 2529 hw->fc = e1000_fc_rx_pause;
2529 DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); 2530 DEBUGOUT("Flow Control = RX PAUSE frames only.\n");
2530 } 2531 }
2531 /* Per the IEEE spec, at this point flow control should be 2532 /* Per the IEEE spec, at this point flow control should be
2532 * disabled. However, we want to consider that we could 2533 * disabled. However, we want to consider that we could
@@ -2552,10 +2553,10 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
2552 hw->original_fc == e1000_fc_tx_pause) || 2553 hw->original_fc == e1000_fc_tx_pause) ||
2553 hw->fc_strict_ieee) { 2554 hw->fc_strict_ieee) {
2554 hw->fc = e1000_fc_none; 2555 hw->fc = e1000_fc_none;
2555 DEBUGOUT("Flow Control = NONE.\r\n"); 2556 DEBUGOUT("Flow Control = NONE.\n");
2556 } else { 2557 } else {
2557 hw->fc = e1000_fc_rx_pause; 2558 hw->fc = e1000_fc_rx_pause;
2558 DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); 2559 DEBUGOUT("Flow Control = RX PAUSE frames only.\n");
2559 } 2560 }
2560 2561
2561 /* Now we need to do one last check... If we auto- 2562 /* Now we need to do one last check... If we auto-
@@ -2580,7 +2581,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
2580 return ret_val; 2581 return ret_val;
2581 } 2582 }
2582 } else { 2583 } else {
2583 DEBUGOUT("Copper PHY and Auto Neg has not completed.\r\n"); 2584 DEBUGOUT("Copper PHY and Auto Neg has not completed.\n");
2584 } 2585 }
2585 } 2586 }
2586 return E1000_SUCCESS; 2587 return E1000_SUCCESS;
@@ -2763,7 +2764,7 @@ e1000_check_for_link(struct e1000_hw *hw)
2763 hw->autoneg_failed = 1; 2764 hw->autoneg_failed = 1;
2764 return 0; 2765 return 0;
2765 } 2766 }
2766 DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\r\n"); 2767 DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n");
2767 2768
2768 /* Disable auto-negotiation in the TXCW register */ 2769 /* Disable auto-negotiation in the TXCW register */
2769 E1000_WRITE_REG(hw, TXCW, (hw->txcw & ~E1000_TXCW_ANE)); 2770 E1000_WRITE_REG(hw, TXCW, (hw->txcw & ~E1000_TXCW_ANE));
@@ -2788,7 +2789,7 @@ e1000_check_for_link(struct e1000_hw *hw)
2788 else if(((hw->media_type == e1000_media_type_fiber) || 2789 else if(((hw->media_type == e1000_media_type_fiber) ||
2789 (hw->media_type == e1000_media_type_internal_serdes)) && 2790 (hw->media_type == e1000_media_type_internal_serdes)) &&
2790 (ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { 2791 (ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
2791 DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\r\n"); 2792 DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\n");
2792 E1000_WRITE_REG(hw, TXCW, hw->txcw); 2793 E1000_WRITE_REG(hw, TXCW, hw->txcw);
2793 E1000_WRITE_REG(hw, CTRL, (ctrl & ~E1000_CTRL_SLU)); 2794 E1000_WRITE_REG(hw, CTRL, (ctrl & ~E1000_CTRL_SLU));
2794 2795
@@ -2851,13 +2852,13 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw,
2851 2852
2852 if(status & E1000_STATUS_FD) { 2853 if(status & E1000_STATUS_FD) {
2853 *duplex = FULL_DUPLEX; 2854 *duplex = FULL_DUPLEX;
2854 DEBUGOUT("Full Duplex\r\n"); 2855 DEBUGOUT("Full Duplex\n");
2855 } else { 2856 } else {
2856 *duplex = HALF_DUPLEX; 2857 *duplex = HALF_DUPLEX;
2857 DEBUGOUT(" Half Duplex\r\n"); 2858 DEBUGOUT(" Half Duplex\n");
2858 } 2859 }
2859 } else { 2860 } else {
2860 DEBUGOUT("1000 Mbs, Full Duplex\r\n"); 2861 DEBUGOUT("1000 Mbs, Full Duplex\n");
2861 *speed = SPEED_1000; 2862 *speed = SPEED_1000;
2862 *duplex = FULL_DUPLEX; 2863 *duplex = FULL_DUPLEX;
2863 } 2864 }
@@ -2883,7 +2884,7 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw,
2883 } 2884 }
2884 } 2885 }
2885 2886
2886 if ((hw->mac_type == e1000_80003es2lan) && 2887 if ((hw->mac_type == e1000_80003es2lan) &&
2887 (hw->media_type == e1000_media_type_copper)) { 2888 (hw->media_type == e1000_media_type_copper)) {
2888 if (*speed == SPEED_1000) 2889 if (*speed == SPEED_1000)
2889 ret_val = e1000_configure_kmrn_for_1000(hw); 2890 ret_val = e1000_configure_kmrn_for_1000(hw);
@@ -3159,7 +3160,7 @@ e1000_read_phy_reg(struct e1000_hw *hw,
3159 if (e1000_swfw_sync_acquire(hw, swfw)) 3160 if (e1000_swfw_sync_acquire(hw, swfw))
3160 return -E1000_ERR_SWFW_SYNC; 3161 return -E1000_ERR_SWFW_SYNC;
3161 3162
3162 if((hw->phy_type == e1000_phy_igp || 3163 if((hw->phy_type == e1000_phy_igp ||
3163 hw->phy_type == e1000_phy_igp_2) && 3164 hw->phy_type == e1000_phy_igp_2) &&
3164 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { 3165 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
3165 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, 3166 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
@@ -3298,7 +3299,7 @@ e1000_write_phy_reg(struct e1000_hw *hw,
3298 if (e1000_swfw_sync_acquire(hw, swfw)) 3299 if (e1000_swfw_sync_acquire(hw, swfw))
3299 return -E1000_ERR_SWFW_SYNC; 3300 return -E1000_ERR_SWFW_SYNC;
3300 3301
3301 if((hw->phy_type == e1000_phy_igp || 3302 if((hw->phy_type == e1000_phy_igp ||
3302 hw->phy_type == e1000_phy_igp_2) && 3303 hw->phy_type == e1000_phy_igp_2) &&
3303 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { 3304 (reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
3304 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, 3305 ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
@@ -3496,22 +3497,22 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
3496 } 3497 }
3497 /* Read the device control register and assert the E1000_CTRL_PHY_RST 3498 /* Read the device control register and assert the E1000_CTRL_PHY_RST
3498 * bit. Then, take it out of reset. 3499 * bit. Then, take it out of reset.
3499 * For pre-e1000_82571 hardware, we delay for 10ms between the assert 3500 * For pre-e1000_82571 hardware, we delay for 10ms between the assert
3500 * and deassert. For e1000_82571 hardware and later, we instead delay 3501 * and deassert. For e1000_82571 hardware and later, we instead delay
3501 * for 50us between and 10ms after the deassertion. 3502 * for 50us between and 10ms after the deassertion.
3502 */ 3503 */
3503 ctrl = E1000_READ_REG(hw, CTRL); 3504 ctrl = E1000_READ_REG(hw, CTRL);
3504 E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST); 3505 E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST);
3505 E1000_WRITE_FLUSH(hw); 3506 E1000_WRITE_FLUSH(hw);
3506 3507
3507 if (hw->mac_type < e1000_82571) 3508 if (hw->mac_type < e1000_82571)
3508 msec_delay(10); 3509 msec_delay(10);
3509 else 3510 else
3510 udelay(100); 3511 udelay(100);
3511 3512
3512 E1000_WRITE_REG(hw, CTRL, ctrl); 3513 E1000_WRITE_REG(hw, CTRL, ctrl);
3513 E1000_WRITE_FLUSH(hw); 3514 E1000_WRITE_FLUSH(hw);
3514 3515
3515 if (hw->mac_type >= e1000_82571) 3516 if (hw->mac_type >= e1000_82571)
3516 msec_delay(10); 3517 msec_delay(10);
3517 e1000_swfw_sync_release(hw, swfw); 3518 e1000_swfw_sync_release(hw, swfw);
@@ -3815,7 +3816,7 @@ e1000_phy_m88_get_info(struct e1000_hw *hw,
3815 /* Check polarity status */ 3816 /* Check polarity status */
3816 ret_val = e1000_check_polarity(hw, &polarity); 3817 ret_val = e1000_check_polarity(hw, &polarity);
3817 if(ret_val) 3818 if(ret_val)
3818 return ret_val; 3819 return ret_val;
3819 phy_info->cable_polarity = polarity; 3820 phy_info->cable_polarity = polarity;
3820 3821
3821 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data); 3822 ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
@@ -4540,14 +4541,14 @@ e1000_read_eeprom_eerd(struct e1000_hw *hw,
4540 4541
4541 E1000_WRITE_REG(hw, EERD, eerd); 4542 E1000_WRITE_REG(hw, EERD, eerd);
4542 error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_READ); 4543 error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_READ);
4543 4544
4544 if(error) { 4545 if(error) {
4545 break; 4546 break;
4546 } 4547 }
4547 data[i] = (E1000_READ_REG(hw, EERD) >> E1000_EEPROM_RW_REG_DATA); 4548 data[i] = (E1000_READ_REG(hw, EERD) >> E1000_EEPROM_RW_REG_DATA);
4548 4549
4549 } 4550 }
4550 4551
4551 return error; 4552 return error;
4552} 4553}
4553 4554
@@ -4573,24 +4574,24 @@ e1000_write_eeprom_eewr(struct e1000_hw *hw,
4573 return -E1000_ERR_SWFW_SYNC; 4574 return -E1000_ERR_SWFW_SYNC;
4574 4575
4575 for (i = 0; i < words; i++) { 4576 for (i = 0; i < words; i++) {
4576 register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) | 4577 register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) |
4577 ((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) | 4578 ((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) |
4578 E1000_EEPROM_RW_REG_START; 4579 E1000_EEPROM_RW_REG_START;
4579 4580
4580 error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE); 4581 error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE);
4581 if(error) { 4582 if(error) {
4582 break; 4583 break;
4583 } 4584 }
4584 4585
4585 E1000_WRITE_REG(hw, EEWR, register_value); 4586 E1000_WRITE_REG(hw, EEWR, register_value);
4586 4587
4587 error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE); 4588 error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE);
4588 4589
4589 if(error) { 4590 if(error) {
4590 break; 4591 break;
4591 } 4592 }
4592 } 4593 }
4593 4594
4594 e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM); 4595 e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM);
4595 return error; 4596 return error;
4596} 4597}
@@ -4610,7 +4611,7 @@ e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd)
4610 for(i = 0; i < attempts; i++) { 4611 for(i = 0; i < attempts; i++) {
4611 if(eerd == E1000_EEPROM_POLL_READ) 4612 if(eerd == E1000_EEPROM_POLL_READ)
4612 reg = E1000_READ_REG(hw, EERD); 4613 reg = E1000_READ_REG(hw, EERD);
4613 else 4614 else
4614 reg = E1000_READ_REG(hw, EEWR); 4615 reg = E1000_READ_REG(hw, EEWR);
4615 4616
4616 if(reg & E1000_EEPROM_RW_REG_DONE) { 4617 if(reg & E1000_EEPROM_RW_REG_DONE) {
@@ -5135,7 +5136,7 @@ e1000_mc_addr_list_update(struct e1000_hw *hw,
5135 uint32_t i; 5136 uint32_t i;
5136 uint32_t num_rar_entry; 5137 uint32_t num_rar_entry;
5137 uint32_t num_mta_entry; 5138 uint32_t num_mta_entry;
5138 5139
5139 DEBUGFUNC("e1000_mc_addr_list_update"); 5140 DEBUGFUNC("e1000_mc_addr_list_update");
5140 5141
5141 /* Set the new number of MC addresses that we are being requested to use. */ 5142 /* Set the new number of MC addresses that we are being requested to use. */
@@ -6240,7 +6241,7 @@ e1000_check_polarity(struct e1000_hw *hw,
6240 * 1 - Downshift ocured. 6241 * 1 - Downshift ocured.
6241 * 6242 *
6242 * returns: - E1000_ERR_XXX 6243 * returns: - E1000_ERR_XXX
6243 * E1000_SUCCESS 6244 * E1000_SUCCESS
6244 * 6245 *
6245 * For phy's older then IGP, this function reads the Downshift bit in the Phy 6246 * For phy's older then IGP, this function reads the Downshift bit in the Phy
6246 * Specific Status register. For IGP phy's, it reads the Downgrade bit in the 6247 * Specific Status register. For IGP phy's, it reads the Downgrade bit in the
@@ -6255,7 +6256,7 @@ e1000_check_downshift(struct e1000_hw *hw)
6255 6256
6256 DEBUGFUNC("e1000_check_downshift"); 6257 DEBUGFUNC("e1000_check_downshift");
6257 6258
6258 if(hw->phy_type == e1000_phy_igp || 6259 if(hw->phy_type == e1000_phy_igp ||
6259 hw->phy_type == e1000_phy_igp_2) { 6260 hw->phy_type == e1000_phy_igp_2) {
6260 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, 6261 ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH,
6261 &phy_data); 6262 &phy_data);
@@ -6684,8 +6685,8 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw,
6684 6685
6685 6686
6686 } else { 6687 } else {
6687 6688
6688 phy_data |= IGP02E1000_PM_D0_LPLU; 6689 phy_data |= IGP02E1000_PM_D0_LPLU;
6689 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data); 6690 ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data);
6690 if (ret_val) 6691 if (ret_val)
6691 return ret_val; 6692 return ret_val;
@@ -6777,7 +6778,7 @@ int32_t
6777e1000_host_if_read_cookie(struct e1000_hw * hw, uint8_t *buffer) 6778e1000_host_if_read_cookie(struct e1000_hw * hw, uint8_t *buffer)
6778{ 6779{
6779 uint8_t i; 6780 uint8_t i;
6780 uint32_t offset = E1000_MNG_DHCP_COOKIE_OFFSET; 6781 uint32_t offset = E1000_MNG_DHCP_COOKIE_OFFSET;
6781 uint8_t length = E1000_MNG_DHCP_COOKIE_LENGTH; 6782 uint8_t length = E1000_MNG_DHCP_COOKIE_LENGTH;
6782 6783
6783 length = (length >> 2); 6784 length = (length >> 2);
@@ -6796,7 +6797,7 @@ e1000_host_if_read_cookie(struct e1000_hw * hw, uint8_t *buffer)
6796 * and also checks whether the previous command is completed. 6797 * and also checks whether the previous command is completed.
6797 * It busy waits in case of previous command is not completed. 6798 * It busy waits in case of previous command is not completed.
6798 * 6799 *
6799 * returns: - E1000_ERR_HOST_INTERFACE_COMMAND in case if is not ready or 6800 * returns: - E1000_ERR_HOST_INTERFACE_COMMAND in case if is not ready or
6800 * timeout 6801 * timeout
6801 * - E1000_SUCCESS for success. 6802 * - E1000_SUCCESS for success.
6802 ****************************************************************************/ 6803 ****************************************************************************/
@@ -6820,7 +6821,7 @@ e1000_mng_enable_host_if(struct e1000_hw * hw)
6820 msec_delay_irq(1); 6821 msec_delay_irq(1);
6821 } 6822 }
6822 6823
6823 if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) { 6824 if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
6824 DEBUGOUT("Previous command timeout failed .\n"); 6825 DEBUGOUT("Previous command timeout failed .\n");
6825 return -E1000_ERR_HOST_INTERFACE_COMMAND; 6826 return -E1000_ERR_HOST_INTERFACE_COMMAND;
6826 } 6827 }