Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327814
b: refs/heads/master
c: c6c1396
h: refs/heads/master
v: v3
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Sep 5, 2012
1 parent 854af79 commit 03e02cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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: f6fe569fe056388166575af1cfaed0bcbc688305
refs/heads/master: c6c13965f4ffca6163af0c9419095aedc103648c
18 changes: 15 additions & 3 deletions trunk/net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,21 @@ static ssize_t show_duplex(struct device *dev,

if (netif_running(netdev)) {
struct ethtool_cmd cmd;
if (!__ethtool_get_settings(netdev, &cmd))
ret = sprintf(buf, "%s\n",
cmd.duplex ? "full" : "half");
if (!__ethtool_get_settings(netdev, &cmd)) {
const char *duplex;
switch (cmd.duplex) {
case DUPLEX_HALF:
duplex = "half";
break;
case DUPLEX_FULL:
duplex = "full";
break;
default:
duplex = "unknown";
break;
}
ret = sprintf(buf, "%s\n", duplex);
}
}
rtnl_unlock();
return ret;
Expand Down

0 comments on commit 03e02cc

Please sign in to comment.