Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361445
b: refs/heads/master
c: d97e749
h: refs/heads/master
i:
  361443: 812fe74
v: v3
  • Loading branch information
Lucas Stach authored and David S. Miller committed Mar 15, 2013
1 parent 8c60339 commit fe91453
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 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: cca7af3889bfa343d33d5e657a38d876abd10e58
refs/heads/master: d97e74976982a35168c7f131cce0d93537337a26
26 changes: 15 additions & 11 deletions trunk/drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,24 +934,28 @@ static void fec_enet_adjust_link(struct net_device *ndev)
goto spin_unlock;
}

/* Duplex link change */
if (phy_dev->link) {
if (fep->full_duplex != phy_dev->duplex) {
fec_restart(ndev, phy_dev->duplex);
/* prevent unnecessary second fec_restart() below */
if (!fep->link) {
fep->link = phy_dev->link;
status_change = 1;
}
}

/* Link on or off change */
if (phy_dev->link != fep->link) {
fep->link = phy_dev->link;
if (phy_dev->link)
if (fep->full_duplex != phy_dev->duplex)
status_change = 1;

if (phy_dev->speed != fep->speed) {
fep->speed = phy_dev->speed;
status_change = 1;
}

/* if any of the above changed restart the FEC */
if (status_change)
fec_restart(ndev, phy_dev->duplex);
else
} else {
if (fep->link) {
fec_stop(ndev);
status_change = 1;
status_change = 1;
}
}

spin_unlock:
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/freescale/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ struct fec_enet_private {
phy_interface_t phy_interface;
int link;
int full_duplex;
int speed;
struct completion mdio_done;
int irq[FEC_IRQ_NUM];
int bufdesc_ex;
Expand Down

0 comments on commit fe91453

Please sign in to comment.