Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184600
b: refs/heads/master
c: b88aafd
h: refs/heads/master
v: v3
  • Loading branch information
Herton Ronaldo Krzesinski authored and David S. Miller committed Mar 2, 2010
1 parent 048bbe0 commit af486c4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 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: 4ab408dea0f0dba4dec0555f4f35b7ae703f5e91
refs/heads/master: b88aafd365bc6a2222e2d03ff320adea3a37f628
23 changes: 18 additions & 5 deletions trunk/drivers/net/sis190.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ struct sis190_private {
struct list_head first_phy;
u32 features;
u32 negotiated_lpa;
enum {
LNK_OFF,
LNK_ON,
LNK_AUTONEG,
} link_status;
};

struct sis190_phy {
Expand Down Expand Up @@ -750,6 +755,7 @@ static irqreturn_t sis190_interrupt(int irq, void *__dev)

if (status & LinkChange) {
netif_info(tp, intr, dev, "link change\n");
del_timer(&tp->timer);
schedule_work(&tp->phy_task);
}

Expand Down Expand Up @@ -922,12 +928,15 @@ static void sis190_phy_task(struct work_struct *work)
if (val & BMCR_RESET) {
// FIXME: needlessly high ? -- FR 02/07/2005
mod_timer(&tp->timer, jiffies + HZ/10);
} else if (!(mdio_read_latched(ioaddr, phy_id, MII_BMSR) &
BMSR_ANEGCOMPLETE)) {
goto out_unlock;
}

val = mdio_read_latched(ioaddr, phy_id, MII_BMSR);
if (!(val & BMSR_ANEGCOMPLETE) && tp->link_status != LNK_AUTONEG) {
netif_carrier_off(dev);
netif_warn(tp, link, dev, "auto-negotiating...\n");
mod_timer(&tp->timer, jiffies + SIS190_PHY_TIMEOUT);
} else {
tp->link_status = LNK_AUTONEG;
} else if ((val & BMSR_LSTATUS) && tp->link_status != LNK_ON) {
/* Rejoice ! */
struct {
int val;
Expand Down Expand Up @@ -1000,7 +1009,10 @@ static void sis190_phy_task(struct work_struct *work)

netif_info(tp, link, dev, "link on %s mode\n", p->msg);
netif_carrier_on(dev);
}
tp->link_status = LNK_ON;
} else if (!(val & BMSR_LSTATUS) && tp->link_status != LNK_AUTONEG)
tp->link_status = LNK_OFF;
mod_timer(&tp->timer, jiffies + SIS190_PHY_TIMEOUT);

out_unlock:
rtnl_unlock();
Expand Down Expand Up @@ -1513,6 +1525,7 @@ static struct net_device * __devinit sis190_init_board(struct pci_dev *pdev)

tp->pci_dev = pdev;
tp->mmio_addr = ioaddr;
tp->link_status = LNK_OFF;

sis190_irq_mask_and_ack(ioaddr);

Expand Down

0 comments on commit af486c4

Please sign in to comment.