net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate
Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
1caaab63d3
commit
537fae0101
@@ -168,8 +168,8 @@ static int e1000_get_settings(struct net_device *netdev,
|
||||
else
|
||||
ecmd->duplex = DUPLEX_HALF;
|
||||
} else {
|
||||
ethtool_cmd_speed_set(ecmd, -1);
|
||||
ecmd->duplex = -1;
|
||||
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
}
|
||||
|
||||
ecmd->autoneg = ((hw->media_type == e1000_media_type_fiber) ||
|
||||
|
@@ -159,8 +159,8 @@ static int e1000_get_settings(struct net_device *netdev,
|
||||
ecmd->transceiver = XCVR_EXTERNAL;
|
||||
}
|
||||
|
||||
speed = -1;
|
||||
ecmd->duplex = -1;
|
||||
speed = SPEED_UNKNOWN;
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
|
||||
if (netif_running(netdev)) {
|
||||
if (netif_carrier_ok(netdev)) {
|
||||
|
@@ -229,8 +229,8 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
else
|
||||
ecmd->duplex = DUPLEX_HALF;
|
||||
} else {
|
||||
ecmd->speed = -1;
|
||||
ecmd->duplex = -1;
|
||||
ecmd->speed = SPEED_UNKNOWN;
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
}
|
||||
if ((hw->phy.media_type == e1000_media_type_fiber) ||
|
||||
hw->mac.autoneg)
|
||||
|
@@ -101,8 +101,8 @@ static int igbvf_get_settings(struct net_device *netdev,
|
||||
else
|
||||
ecmd->duplex = DUPLEX_HALF;
|
||||
} else {
|
||||
ethtool_cmd_speed_set(ecmd, -1);
|
||||
ecmd->duplex = -1;
|
||||
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
}
|
||||
|
||||
ecmd->autoneg = AUTONEG_DISABLE;
|
||||
|
@@ -107,8 +107,8 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
ethtool_cmd_speed_set(ecmd, SPEED_10000);
|
||||
ecmd->duplex = DUPLEX_FULL;
|
||||
} else {
|
||||
ethtool_cmd_speed_set(ecmd, -1);
|
||||
ecmd->duplex = -1;
|
||||
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
}
|
||||
|
||||
ecmd->autoneg = AUTONEG_DISABLE;
|
||||
|
@@ -296,8 +296,8 @@ static int ixgbe_get_settings(struct net_device *netdev,
|
||||
}
|
||||
ecmd->duplex = DUPLEX_FULL;
|
||||
} else {
|
||||
ethtool_cmd_speed_set(ecmd, -1);
|
||||
ecmd->duplex = -1;
|
||||
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@@ -135,8 +135,8 @@ static int ixgbevf_get_settings(struct net_device *netdev,
|
||||
ethtool_cmd_speed_set(ecmd, speed);
|
||||
ecmd->duplex = DUPLEX_FULL;
|
||||
} else {
|
||||
ethtool_cmd_speed_set(ecmd, -1);
|
||||
ecmd->duplex = -1;
|
||||
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
|
||||
ecmd->duplex = DUPLEX_UNKNOWN;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user