Lines Matching refs:link_ksettings
382 const struct ethtool_link_ksettings *link_ksettings) in convert_link_ksettings_to_legacy_settings() argument
395 link_ksettings->link_modes.supported); in convert_link_ksettings_to_legacy_settings()
398 link_ksettings->link_modes.advertising); in convert_link_ksettings_to_legacy_settings()
401 link_ksettings->link_modes.lp_advertising); in convert_link_ksettings_to_legacy_settings()
402 ethtool_cmd_speed_set(legacy_settings, link_ksettings->base.speed); in convert_link_ksettings_to_legacy_settings()
404 = link_ksettings->base.duplex; in convert_link_ksettings_to_legacy_settings()
406 = link_ksettings->base.port; in convert_link_ksettings_to_legacy_settings()
408 = link_ksettings->base.phy_address; in convert_link_ksettings_to_legacy_settings()
410 = link_ksettings->base.autoneg; in convert_link_ksettings_to_legacy_settings()
412 = link_ksettings->base.mdio_support; in convert_link_ksettings_to_legacy_settings()
414 = link_ksettings->base.eth_tp_mdix; in convert_link_ksettings_to_legacy_settings()
416 = link_ksettings->base.eth_tp_mdix_ctrl; in convert_link_ksettings_to_legacy_settings()
418 = link_ksettings->base.transceiver; in convert_link_ksettings_to_legacy_settings()
438 struct ethtool_link_ksettings *link_ksettings) in __ethtool_get_link_ksettings() argument
448 memset(link_ksettings, 0, sizeof(*link_ksettings)); in __ethtool_get_link_ksettings()
449 return dev->ethtool_ops->get_link_ksettings(dev, link_ksettings); in __ethtool_get_link_ksettings()
528 struct ethtool_link_ksettings link_ksettings; in ethtool_get_link_ksettings() local
535 if (copy_from_user(&link_ksettings.base, useraddr, in ethtool_get_link_ksettings()
536 sizeof(link_ksettings.base))) in ethtool_get_link_ksettings()
540 != link_ksettings.base.link_mode_masks_nwords) { in ethtool_get_link_ksettings()
542 memset(&link_ksettings, 0, sizeof(link_ksettings)); in ethtool_get_link_ksettings()
543 link_ksettings.base.cmd = ETHTOOL_GLINKSETTINGS; in ethtool_get_link_ksettings()
547 link_ksettings.base.link_mode_masks_nwords in ethtool_get_link_ksettings()
553 if (copy_to_user(useraddr, &link_ksettings.base, in ethtool_get_link_ksettings()
554 sizeof(link_ksettings.base))) in ethtool_get_link_ksettings()
564 memset(&link_ksettings, 0, sizeof(link_ksettings)); in ethtool_get_link_ksettings()
565 err = dev->ethtool_ops->get_link_ksettings(dev, &link_ksettings); in ethtool_get_link_ksettings()
570 link_ksettings.base.cmd = ETHTOOL_GLINKSETTINGS; in ethtool_get_link_ksettings()
571 link_ksettings.base.link_mode_masks_nwords in ethtool_get_link_ksettings()
573 link_ksettings.base.master_slave_cfg = MASTER_SLAVE_CFG_UNSUPPORTED; in ethtool_get_link_ksettings()
574 link_ksettings.base.master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED; in ethtool_get_link_ksettings()
575 link_ksettings.base.rate_matching = RATE_MATCH_NONE; in ethtool_get_link_ksettings()
577 return store_link_ksettings_for_user(useraddr, &link_ksettings); in ethtool_get_link_ksettings()
584 struct ethtool_link_ksettings link_ksettings = {}; in ethtool_set_link_ksettings() local
593 if (copy_from_user(&link_ksettings.base, useraddr, in ethtool_set_link_ksettings()
594 sizeof(link_ksettings.base))) in ethtool_set_link_ksettings()
598 != link_ksettings.base.link_mode_masks_nwords) in ethtool_set_link_ksettings()
604 err = load_link_ksettings_from_user(&link_ksettings, useraddr); in ethtool_set_link_ksettings()
610 != link_ksettings.base.link_mode_masks_nwords) in ethtool_set_link_ksettings()
613 if (link_ksettings.base.master_slave_cfg || in ethtool_set_link_ksettings()
614 link_ksettings.base.master_slave_state) in ethtool_set_link_ksettings()
617 err = dev->ethtool_ops->set_link_ksettings(dev, &link_ksettings); in ethtool_set_link_ksettings()
657 struct ethtool_link_ksettings link_ksettings; in ethtool_get_settings() local
668 memset(&link_ksettings, 0, sizeof(link_ksettings)); in ethtool_get_settings()
669 err = dev->ethtool_ops->get_link_ksettings(dev, &link_ksettings); in ethtool_get_settings()
672 convert_link_ksettings_to_legacy_settings(&cmd, &link_ksettings); in ethtool_get_settings()
693 struct ethtool_link_ksettings link_ksettings; in ethtool_set_settings() local
704 if (!convert_legacy_settings_to_link_ksettings(&link_ksettings, &cmd)) in ethtool_set_settings()
706 link_ksettings.base.link_mode_masks_nwords = in ethtool_set_settings()
708 ret = dev->ethtool_ops->set_link_ksettings(dev, &link_ksettings); in ethtool_set_settings()