Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369343
b: refs/heads/master
c: bb5b052
h: refs/heads/master
i:
  369341: bf21036
  369339: 8e7afff
  369335: 7e1540a
  369327: 654f908
  369311: 929a7ef
  369279: 1341c71
v: v3
  • Loading branch information
Andy Gospodarek authored and David S. Miller committed Apr 19, 2013
1 parent d145a9d commit 9bc9783
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b457bdf1dbc961b62252034b05d47ec3e5b85d2
refs/heads/master: bb5b052f751b309b5181686741c724a66c5cb15a
32 changes: 32 additions & 0 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4226,6 +4226,37 @@ void bond_set_mode_ops(struct bonding *bond, int mode)
}
}

static int bond_ethtool_get_settings(struct net_device *bond_dev,
struct ethtool_cmd *ecmd)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave;
int i;
unsigned long speed = 0;

ecmd->duplex = DUPLEX_UNKNOWN;
ecmd->port = PORT_OTHER;

/* Since SLAVE_IS_OK returns false for all inactive or down slaves, we
* do not need to check mode. Though link speed might not represent
* the true receive or transmit bandwidth (not all modes are symmetric)
* this is an accurate maximum.
*/
read_lock(&bond->lock);
bond_for_each_slave(bond, slave, i) {
if (SLAVE_IS_OK(slave)) {
if (slave->speed != SPEED_UNKNOWN)
speed += slave->speed;
if (ecmd->duplex == DUPLEX_UNKNOWN &&
slave->duplex != DUPLEX_UNKNOWN)
ecmd->duplex = slave->duplex;
}
}
ethtool_cmd_speed_set(ecmd, speed ? : SPEED_UNKNOWN);
read_unlock(&bond->lock);
return 0;
}

static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
struct ethtool_drvinfo *drvinfo)
{
Expand All @@ -4237,6 +4268,7 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,

static const struct ethtool_ops bond_ethtool_ops = {
.get_drvinfo = bond_ethtool_get_drvinfo,
.get_settings = bond_ethtool_get_settings,
.get_link = ethtool_op_get_link,
};

Expand Down

0 comments on commit 9bc9783

Please sign in to comment.