Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: cris: eth_v10: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Philippe Reynes and committed by
David S. Miller
bb370568 5dac9eaa

+20 -12
+20 -12
drivers/net/cris/eth_v10.c
··· 1412 1412 return rc; 1413 1413 } 1414 1414 1415 - static int e100_get_settings(struct net_device *dev, 1416 - struct ethtool_cmd *cmd) 1415 + static int e100_get_link_ksettings(struct net_device *dev, 1416 + struct ethtool_link_ksettings *cmd) 1417 1417 { 1418 1418 struct net_local *np = netdev_priv(dev); 1419 + u32 supported; 1419 1420 int err; 1420 1421 1421 1422 spin_lock_irq(&np->lock); 1422 - err = mii_ethtool_gset(&np->mii_if, cmd); 1423 + err = mii_ethtool_get_link_ksettings(&np->mii_if, cmd); 1423 1424 spin_unlock_irq(&np->lock); 1424 1425 1425 1426 /* The PHY may support 1000baseT, but the Etrax100 does not. */ 1426 - cmd->supported &= ~(SUPPORTED_1000baseT_Half 1427 - | SUPPORTED_1000baseT_Full); 1427 + ethtool_convert_link_mode_to_legacy_u32(&supported, 1428 + cmd->link_modes.supported); 1429 + 1430 + supported &= ~(SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full); 1431 + 1432 + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, 1433 + supported); 1434 + 1428 1435 return err; 1429 1436 } 1430 1437 1431 - static int e100_set_settings(struct net_device *dev, 1432 - struct ethtool_cmd *ecmd) 1438 + static int e100_set_link_ksettings(struct net_device *dev, 1439 + const struct ethtool_link_ksettings *ecmd) 1433 1440 { 1434 - if (ecmd->autoneg == AUTONEG_ENABLE) { 1441 + if (ecmd->base.autoneg == AUTONEG_ENABLE) { 1435 1442 e100_set_duplex(dev, autoneg); 1436 1443 e100_set_speed(dev, 0); 1437 1444 } else { 1438 - e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full); 1439 - e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100); 1445 + e100_set_duplex(dev, ecmd->base.duplex == DUPLEX_HALF ? 1446 + half : full); 1447 + e100_set_speed(dev, ecmd->base.speed == SPEED_10 ? 10 : 100); 1440 1448 } 1441 1449 1442 1450 return 0; ··· 1467 1459 } 1468 1460 1469 1461 static const struct ethtool_ops e100_ethtool_ops = { 1470 - .get_settings = e100_get_settings, 1471 - .set_settings = e100_set_settings, 1472 1462 .get_drvinfo = e100_get_drvinfo, 1473 1463 .nway_reset = e100_nway_reset, 1474 1464 .get_link = ethtool_op_get_link, 1465 + .get_link_ksettings = e100_get_link_ksettings, 1466 + .set_link_ksettings = e100_set_link_ksettings, 1475 1467 }; 1476 1468 1477 1469 static int