Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22361
b: refs/heads/master
c: d257924
h: refs/heads/master
i:
  22359: 3d21c91
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Mar 21, 2006
1 parent 15d7635 commit 6d2f984
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f24664da64f8db094cd9d379b16fc1d8776d1df
refs/heads/master: d257924e85a81561a956f1791fa5a226e3a32ce1
55 changes: 45 additions & 10 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2066,6 +2066,27 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port)
}
}

/* This should never happen it is a fatal situation */
static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port,
const char *rxtx, u32 mask)
{
struct net_device *dev = hw->dev[port];
struct sky2_port *sky2 = netdev_priv(dev);
u32 imask;

printk(KERN_ERR PFX "%s: %s descriptor error (hardware problem)\n",
dev ? dev->name : "<not registered>", rxtx);

imask = sky2_read32(hw, B0_IMSK);
imask &= ~mask;
sky2_write32(hw, B0_IMSK, imask);

if (dev) {
spin_lock(&sky2->phy_lock);
sky2_link_down(sky2);
spin_unlock(&sky2->phy_lock);
}
}

static int sky2_poll(struct net_device *dev0, int *budget)
{
Expand All @@ -2074,20 +2095,34 @@ static int sky2_poll(struct net_device *dev0, int *budget)
int work_done = 0;
u32 status = sky2_read32(hw, B0_Y2_SP_EISR);

if (status & Y2_IS_HW_ERR)
sky2_hw_intr(hw);
if (unlikely(status & ~Y2_IS_STAT_BMU)) {
if (status & Y2_IS_HW_ERR)
sky2_hw_intr(hw);

if (status & Y2_IS_IRQ_PHY1)
sky2_phy_intr(hw, 0);

if (status & Y2_IS_IRQ_PHY1)
sky2_phy_intr(hw, 0);
if (status & Y2_IS_IRQ_PHY2)
sky2_phy_intr(hw, 1);

if (status & Y2_IS_IRQ_PHY2)
sky2_phy_intr(hw, 1);
if (status & Y2_IS_IRQ_MAC1)
sky2_mac_intr(hw, 0);

if (status & Y2_IS_IRQ_MAC1)
sky2_mac_intr(hw, 0);
if (status & Y2_IS_IRQ_MAC2)
sky2_mac_intr(hw, 1);

if (status & Y2_IS_IRQ_MAC2)
sky2_mac_intr(hw, 1);
if (status & Y2_IS_CHK_RX1)
sky2_descriptor_error(hw, 0, "receive", Y2_IS_CHK_RX1);

if (status & Y2_IS_CHK_RX2)
sky2_descriptor_error(hw, 1, "receive", Y2_IS_CHK_RX2);

if (status & Y2_IS_CHK_TXA1)
sky2_descriptor_error(hw, 0, "transmit", Y2_IS_CHK_TXA1);

if (status & Y2_IS_CHK_TXA2)
sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2);
}

if (status & Y2_IS_STAT_BMU) {
work_done = sky2_status_intr(hw, work_limit);
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/sky2.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ enum {
Y2_IS_CHK_TXA1 = 1<<0, /* Descriptor error TXA 1 */

Y2_IS_BASE = Y2_IS_HW_ERR | Y2_IS_STAT_BMU,
Y2_IS_PORT_1 = Y2_IS_IRQ_PHY1 | Y2_IS_IRQ_MAC1,
Y2_IS_PORT_2 = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2,
Y2_IS_PORT_1 = Y2_IS_IRQ_PHY1 | Y2_IS_IRQ_MAC1
| Y2_IS_CHK_TXA1 | Y2_IS_CHK_RX1,
Y2_IS_PORT_2 = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2
| Y2_IS_CHK_TXA2 | Y2_IS_CHK_RX2,
};

/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */
Expand Down

0 comments on commit 6d2f984

Please sign in to comment.