Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150023
b: refs/heads/master
c: 29112f4
h: refs/heads/master
i:
  150021: 8e6b521
  150019: 8c6110e
  150015: 0aeba74
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Apr 27, 2009
1 parent dec7ed6 commit 2c6dc90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 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: 434e7b0d12f4e2de6686841a42bd344325b4d756
refs/heads/master: 29112f4e248ca6941f2233f6ed96a7283a67cced
26 changes: 12 additions & 14 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,18 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
if (bond->params.use_carrier)
return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;

/* Try to get link status using Ethtool first. */
if (slave_dev->ethtool_ops) {
if (slave_dev->ethtool_ops->get_link) {
u32 link;

link = slave_dev->ethtool_ops->get_link(slave_dev);

return link ? BMSR_LSTATUS : 0;
}
}

/* Ethtool can't be used, fallback to MII ioclts. */
ioctl = slave_ops->ndo_do_ioctl;
if (ioctl) {
/* TODO: set pointer to correct ioctl on a per team member */
Expand All @@ -720,20 +732,6 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
}
}

/*
* Some drivers cache ETHTOOL_GLINK for a period of time so we only
* attempt to get link status from it if the above MII ioctls fail.
*/
if (slave_dev->ethtool_ops) {
if (slave_dev->ethtool_ops->get_link) {
u32 link;

link = slave_dev->ethtool_ops->get_link(slave_dev);

return link ? BMSR_LSTATUS : 0;
}
}

/*
* If reporting, report that either there's no dev->do_ioctl,
* or both SIOCGMIIREG and get_link failed (meaning that we
Expand Down

0 comments on commit 2c6dc90

Please sign in to comment.