aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/bonding/bond_main.c4
-rw-r--r--drivers/net/bonding/bond_procfs.c4
-rw-r--r--include/linux/ethtool.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b2b9109b6712..b0c577256487 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -560,8 +560,8 @@ static int bond_update_speed_duplex(struct slave *slave)
560 u32 slave_speed; 560 u32 slave_speed;
561 int res; 561 int res;
562 562
563 slave->speed = -1; 563 slave->speed = SPEED_UNKNOWN;
564 slave->duplex = -1; 564 slave->duplex = DUPLEX_UNKNOWN;
565 565
566 res = __ethtool_get_settings(slave_dev, &ecmd); 566 res = __ethtool_get_settings(slave_dev, &ecmd);
567 if (res < 0) 567 if (res < 0)
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index d2ff52e63cbb..17206da2fab7 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -157,12 +157,12 @@ static void bond_info_show_slave(struct seq_file *seq,
157 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); 157 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
158 seq_printf(seq, "MII Status: %s\n", 158 seq_printf(seq, "MII Status: %s\n",
159 (slave->link == BOND_LINK_UP) ? "up" : "down"); 159 (slave->link == BOND_LINK_UP) ? "up" : "down");
160 if (slave->speed == -1) 160 if (slave->speed == SPEED_UNKNOWN)
161 seq_printf(seq, "Speed: %s\n", "Unknown"); 161 seq_printf(seq, "Speed: %s\n", "Unknown");
162 else 162 else
163 seq_printf(seq, "Speed: %d Mbps\n", slave->speed); 163 seq_printf(seq, "Speed: %d Mbps\n", slave->speed);
164 164
165 if (slave->duplex == -1) 165 if (slave->duplex == DUPLEX_UNKNOWN)
166 seq_printf(seq, "Duplex: %s\n", "Unknown"); 166 seq_printf(seq, "Duplex: %s\n", "Unknown");
167 else 167 else
168 seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half"); 168 seq_printf(seq, "Duplex: %s\n", slave->duplex ? "full" : "half");
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 45f00b61c096..de33de1e2052 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -1097,10 +1097,12 @@ struct ethtool_ops {
1097#define SPEED_1000 1000 1097#define SPEED_1000 1000
1098#define SPEED_2500 2500 1098#define SPEED_2500 2500
1099#define SPEED_10000 10000 1099#define SPEED_10000 10000
1100#define SPEED_UNKNOWN -1
1100 1101
1101/* Duplex, half or full. */ 1102/* Duplex, half or full. */
1102#define DUPLEX_HALF 0x00 1103#define DUPLEX_HALF 0x00
1103#define DUPLEX_FULL 0x01 1104#define DUPLEX_FULL 0x01
1105#define DUPLEX_UNKNOWN 0xff
1104 1106
1105/* Which connector port. */ 1107/* Which connector port. */
1106#define PORT_TP 0x00 1108#define PORT_TP 0x00