aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_ethtool.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-11-22 00:30:24 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-22 00:30:24 -0500
commitf5f4cf08467db10de061a1b90037a56a360d3554 (patch)
treef590f5a39dca1a57012f5eb62302ca56b7d3e27a /drivers/net/igb/igb_ethtool.c
parent21fc578dcaa66dd30bad3c2f2cd7578e2865e8f2 (diff)
igb: do not use phy ops in ethtool test cleanup for non-copper parts
Currently the igb driver is experiencing a panic due to a null function pointer being used during the cleanup of the ethtool looback test on fiber/serdes parts. This patch prevents that and adds a check prior to calling any phy function. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_ethtool.c')
-rw-r--r--drivers/net/igb/igb_ethtool.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index a661159a097b..8e9d295034ff 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1376,10 +1376,10 @@ static void igb_phy_disable_receiver(struct igb_adapter *adapter)
1376 struct e1000_hw *hw = &adapter->hw; 1376 struct e1000_hw *hw = &adapter->hw;
1377 1377
1378 /* Write out to PHY registers 29 and 30 to disable the Receiver. */ 1378 /* Write out to PHY registers 29 and 30 to disable the Receiver. */
1379 hw->phy.ops.write_phy_reg(hw, 29, 0x001F); 1379 igb_write_phy_reg(hw, 29, 0x001F);
1380 hw->phy.ops.write_phy_reg(hw, 30, 0x8FFC); 1380 igb_write_phy_reg(hw, 30, 0x8FFC);
1381 hw->phy.ops.write_phy_reg(hw, 29, 0x001A); 1381 igb_write_phy_reg(hw, 29, 0x001A);
1382 hw->phy.ops.write_phy_reg(hw, 30, 0x8FF0); 1382 igb_write_phy_reg(hw, 30, 0x8FF0);
1383} 1383}
1384 1384
1385static int igb_integrated_phy_loopback(struct igb_adapter *adapter) 1385static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
@@ -1392,17 +1392,17 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
1392 1392
1393 if (hw->phy.type == e1000_phy_m88) { 1393 if (hw->phy.type == e1000_phy_m88) {
1394 /* Auto-MDI/MDIX Off */ 1394 /* Auto-MDI/MDIX Off */
1395 hw->phy.ops.write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, 0x0808); 1395 igb_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
1396 /* reset to update Auto-MDI/MDIX */ 1396 /* reset to update Auto-MDI/MDIX */
1397 hw->phy.ops.write_phy_reg(hw, PHY_CONTROL, 0x9140); 1397 igb_write_phy_reg(hw, PHY_CONTROL, 0x9140);
1398 /* autoneg off */ 1398 /* autoneg off */
1399 hw->phy.ops.write_phy_reg(hw, PHY_CONTROL, 0x8140); 1399 igb_write_phy_reg(hw, PHY_CONTROL, 0x8140);
1400 } 1400 }
1401 1401
1402 ctrl_reg = rd32(E1000_CTRL); 1402 ctrl_reg = rd32(E1000_CTRL);
1403 1403
1404 /* force 1000, set loopback */ 1404 /* force 1000, set loopback */
1405 hw->phy.ops.write_phy_reg(hw, PHY_CONTROL, 0x4140); 1405 igb_write_phy_reg(hw, PHY_CONTROL, 0x4140);
1406 1406
1407 /* Now set up the MAC to the same speed/duplex as the PHY. */ 1407 /* Now set up the MAC to the same speed/duplex as the PHY. */
1408 ctrl_reg = rd32(E1000_CTRL); 1408 ctrl_reg = rd32(E1000_CTRL);
@@ -1496,10 +1496,10 @@ static void igb_loopback_cleanup(struct igb_adapter *adapter)
1496 wr32(E1000_RCTL, rctl); 1496 wr32(E1000_RCTL, rctl);
1497 1497
1498 hw->mac.autoneg = true; 1498 hw->mac.autoneg = true;
1499 hw->phy.ops.read_phy_reg(hw, PHY_CONTROL, &phy_reg); 1499 igb_read_phy_reg(hw, PHY_CONTROL, &phy_reg);
1500 if (phy_reg & MII_CR_LOOPBACK) { 1500 if (phy_reg & MII_CR_LOOPBACK) {
1501 phy_reg &= ~MII_CR_LOOPBACK; 1501 phy_reg &= ~MII_CR_LOOPBACK;
1502 hw->phy.ops.write_phy_reg(hw, PHY_CONTROL, phy_reg); 1502 igb_write_phy_reg(hw, PHY_CONTROL, phy_reg);
1503 igb_phy_sw_reset(hw); 1503 igb_phy_sw_reset(hw);
1504 } 1504 }
1505} 1505}