hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ethernet/8390/etherh.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/acorn/net/etherh.c
34 *
45 * Copyright (C) 2000-2002 Russell King
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 *
107 * NS8390 I-cubed EtherH and ANT EtherM specific driver
118 * Thanks to I-Cubed for information on their cards.
....@@ -564,26 +561,29 @@
564561 sizeof(info->bus_info));
565562 }
566563
567
-static int etherh_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
564
+static int etherh_get_link_ksettings(struct net_device *dev,
565
+ struct ethtool_link_ksettings *cmd)
568566 {
569
- cmd->supported = etherh_priv(dev)->supported;
570
- ethtool_cmd_speed_set(cmd, SPEED_10);
571
- cmd->duplex = DUPLEX_HALF;
572
- cmd->port = dev->if_port == IF_PORT_10BASET ? PORT_TP : PORT_BNC;
573
- cmd->autoneg = (dev->flags & IFF_AUTOMEDIA ?
574
- AUTONEG_ENABLE : AUTONEG_DISABLE);
567
+ ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
568
+ etherh_priv(dev)->supported);
569
+ cmd->base.speed = SPEED_10;
570
+ cmd->base.duplex = DUPLEX_HALF;
571
+ cmd->base.port = dev->if_port == IF_PORT_10BASET ? PORT_TP : PORT_BNC;
572
+ cmd->base.autoneg = (dev->flags & IFF_AUTOMEDIA ? AUTONEG_ENABLE :
573
+ AUTONEG_DISABLE);
575574 return 0;
576575 }
577576
578
-static int etherh_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
577
+static int etherh_set_link_ksettings(struct net_device *dev,
578
+ const struct ethtool_link_ksettings *cmd)
579579 {
580
- switch (cmd->autoneg) {
580
+ switch (cmd->base.autoneg) {
581581 case AUTONEG_ENABLE:
582582 dev->flags |= IFF_AUTOMEDIA;
583583 break;
584584
585585 case AUTONEG_DISABLE:
586
- switch (cmd->port) {
586
+ switch (cmd->base.port) {
587587 case PORT_TP:
588588 dev->if_port = IF_PORT_10BASET;
589589 break;
....@@ -622,12 +622,12 @@
622622 }
623623
624624 static const struct ethtool_ops etherh_ethtool_ops = {
625
- .get_settings = etherh_get_settings,
626
- .set_settings = etherh_set_settings,
627
- .get_drvinfo = etherh_get_drvinfo,
628
- .get_ts_info = ethtool_op_get_ts_info,
629
- .get_msglevel = etherh_get_msglevel,
630
- .set_msglevel = etherh_set_msglevel,
625
+ .get_drvinfo = etherh_get_drvinfo,
626
+ .get_ts_info = ethtool_op_get_ts_info,
627
+ .get_msglevel = etherh_get_msglevel,
628
+ .set_msglevel = etherh_set_msglevel,
629
+ .get_link_ksettings = etherh_get_link_ksettings,
630
+ .set_link_ksettings = etherh_set_link_ksettings,
631631 };
632632
633633 static const struct net_device_ops etherh_netdev_ops = {