summaryrefslogtreecommitdiff
path: root/src/shared/ethtool-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-21 05:32:17 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-23 11:40:15 +0900
commit4323046c5fa9fc235af65ad759540abcde62244a (patch)
tree2a3852d0720cce12161b65fd5de2a8569883e389 /src/shared/ethtool-util.c
parent4f5040313dd9ac737816c992e0d7e4e94dca36b4 (diff)
downloadsystemd-4323046c5fa9fc235af65ad759540abcde62244a.tar.gz
ethtool-util: move and rebreak comments
Diffstat (limited to 'src/shared/ethtool-util.c')
-rw-r--r--src/shared/ethtool-util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c
index da47aff720..11e6992981 100644
--- a/src/shared/ethtool-util.c
+++ b/src/shared/ethtool-util.c
@@ -805,12 +805,6 @@ static int set_sset(int fd, struct ifreq *ifr, const struct ethtool_link_usettin
return 0;
}
-/* If autonegotiation is disabled, the speed and duplex represent the fixed link
- * mode and are writable if the driver supports multiple link modes. If it is
- * enabled then they are read-only. If the link is up they represent the negotiated
- * link mode; if the link is down, the speed is 0, %SPEED_UNKNOWN or the highest
- * enabled speed and @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.
- */
int ethtool_set_glinksettings(
int *fd,
const char *ifname,
@@ -828,6 +822,12 @@ int ethtool_set_glinksettings(
assert(ifname);
assert(advertise);
+ /* If autonegotiation is disabled, the speed and duplex represent the fixed link mode and are
+ * writable if the driver supports multiple link modes. If it is enabled then they are
+ * read-only. If the link is up they represent the negotiated link mode; if the link is down,
+ * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and @duplex is %DUPLEX_UNKNOWN
+ * or the best enabled duplex mode. */
+
if (autonegotiation != AUTONEG_DISABLE && memeqzero(advertise, sizeof(uint32_t) * N_ADVERTISE)) {
log_debug("ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.");
return 0;