Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24.4 /drivers/net/sky2.c

Filename:/drivers/net/sky2.c
Lines Added:9
Lines Deleted:5
Also changed in: (Previous) 2.6.24.2  2.6.24-git22  2.6.24-git21  2.6.24-git20  2.6.24.1  2.6.24-git19 
(Following) 2.6.24.5  2.6.24.6  2.6.24.7  2.6.25-rc7  2.6.25-rc8  2.6.25-rc8-git2 

Location
[  2.6.24.4
  [  drivers
    [  net
       o  sky2.c

Patch

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index bc15940..962e28b 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -621,6 +621,7 @@ static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff)
    static const u32 phy_power[] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
    static const u32 coma_mode[] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA };
 
+   sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
    reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
    /* Turn on/off phy power saving */
    if (onoff)
@@ -632,7 +633,8 @@ static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff)
       reg1 |= coma_mode[port];
 
    sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
-   reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+   sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+   sky2_pci_read32(hw, PCI_DEV_REG1);
 
    udelay(100);
 }
@@ -1412,6 +1414,7 @@ static int sky2_up(struct net_device *dev)
    imask |= portirq_msk[port];
    sky2_write32(hw, B0_IMSK, imask);
 
+   sky2_set_multicast(dev);
    return 0;
 
 err_out:
@@ -2426,6 +2429,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
    if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) {
       u16 pci_err;
 
+      sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
       pci_err = sky2_pci_read16(hw, PCI_STATUS);
       if (net_ratelimit())
          dev_err(&pdev->dev, "PCI hardware error (0x%x)\n",
@@ -2433,12 +2437,14 @@ static void sky2_hw_intr(struct sky2_hw *hw)
 
       sky2_pci_write16(hw, PCI_STATUS,
                   pci_err | PCI_STATUS_ERROR_BITS);
+      sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
    }
 
    if (status & Y2_IS_PCI_EXP) {
       /* PCI-Express uncorrectable Error occurred */
       u32 err;
 
+      sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
       err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
       sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
               0xfffffffful);
@@ -2446,6 +2452,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
          dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err);
 
       sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+      sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
    }
 
    if (status & Y2_HWE_L1_MASK)
@@ -2811,6 +2818,7 @@ static void sky2_reset(struct sky2_hw *hw)
    }
 
    sky2_power_on(hw);
+   sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
 
    for (i = 0; i < hw->ports; i++) {
       sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
@@ -3533,8 +3541,6 @@ static int sky2_set_ringparam(struct net_device *dev,
       err = sky2_up(dev);
       if (err)
          dev_close(dev);
-      else
-         sky2_set_multicast(dev);
    }
 
    return err;
@@ -4368,8 +4374,6 @@ static int sky2_resume(struct pci_dev *pdev)
             dev_close(dev);
             goto out;
          }
-
-         sky2_set_multicast(dev);
       }
    }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.