| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/acorn/net/etherh.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * NS8390 I-cubed EtherH and ANT EtherM specific driver |
|---|
| 11 | 8 | * Thanks to I-Cubed for information on their cards. |
|---|
| .. | .. |
|---|
| 564 | 561 | sizeof(info->bus_info)); |
|---|
| 565 | 562 | } |
|---|
| 566 | 563 | |
|---|
| 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) |
|---|
| 568 | 566 | { |
|---|
| 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); |
|---|
| 575 | 574 | return 0; |
|---|
| 576 | 575 | } |
|---|
| 577 | 576 | |
|---|
| 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) |
|---|
| 579 | 579 | { |
|---|
| 580 | | - switch (cmd->autoneg) { |
|---|
| 580 | + switch (cmd->base.autoneg) { |
|---|
| 581 | 581 | case AUTONEG_ENABLE: |
|---|
| 582 | 582 | dev->flags |= IFF_AUTOMEDIA; |
|---|
| 583 | 583 | break; |
|---|
| 584 | 584 | |
|---|
| 585 | 585 | case AUTONEG_DISABLE: |
|---|
| 586 | | - switch (cmd->port) { |
|---|
| 586 | + switch (cmd->base.port) { |
|---|
| 587 | 587 | case PORT_TP: |
|---|
| 588 | 588 | dev->if_port = IF_PORT_10BASET; |
|---|
| 589 | 589 | break; |
|---|
| .. | .. |
|---|
| 622 | 622 | } |
|---|
| 623 | 623 | |
|---|
| 624 | 624 | 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, |
|---|
| 631 | 631 | }; |
|---|
| 632 | 632 | |
|---|
| 633 | 633 | static const struct net_device_ops etherh_netdev_ops = { |
|---|