Lines Matching refs:ecmd

321 static int prestera_port_type_set(const struct ethtool_link_ksettings *ecmd,  in prestera_port_type_set()  argument
328 if (port_types[type].eth_type == ecmd->base.port && in prestera_port_type_set()
330 ecmd->link_modes.supported)) { in prestera_port_type_set()
337 if (type != port->caps.type && ecmd->base.autoneg == AUTONEG_ENABLE) in prestera_port_type_set()
411 static void prestera_port_supp_types_get(struct ethtool_link_ksettings *ecmd, in prestera_port_supp_types_get() argument
424 ecmd->link_modes.supported); in prestera_port_supp_types_get()
428 static void prestera_port_remote_cap_get(struct ethtool_link_ksettings *ecmd, in prestera_port_remote_cap_get() argument
446 prestera_modes_to_eth(ecmd->link_modes.lp_advertising, in prestera_port_remote_cap_get()
449 if (!bitmap_empty(ecmd->link_modes.lp_advertising, in prestera_port_remote_cap_get()
451 ethtool_link_ksettings_add_link_mode(ecmd, in prestera_port_remote_cap_get()
460 ethtool_link_ksettings_add_link_mode(ecmd, in prestera_port_remote_cap_get()
464 ethtool_link_ksettings_add_link_mode(ecmd, in prestera_port_remote_cap_get()
469 static void prestera_port_link_mode_get(struct ethtool_link_ksettings *ecmd, in prestera_port_link_mode_get() argument
493 ecmd->base.speed = port->state_mac.speed; in prestera_port_link_mode_get()
494 ecmd->base.duplex = port->state_mac.duplex; in prestera_port_link_mode_get()
497 static void prestera_port_mdix_get(struct ethtool_link_ksettings *ecmd, in prestera_port_mdix_get() argument
508 ecmd->base.eth_tp_mdix = port->state_phy.mdix; in prestera_port_mdix_get()
509 ecmd->base.eth_tp_mdix_ctrl = port->cfg_phy.mdix; in prestera_port_mdix_get()
514 struct ethtool_link_ksettings *ecmd) in prestera_ethtool_get_link_ksettings() argument
518 ethtool_link_ksettings_zero_link_mode(ecmd, supported); in prestera_ethtool_get_link_ksettings()
519 ethtool_link_ksettings_zero_link_mode(ecmd, advertising); in prestera_ethtool_get_link_ksettings()
520 ethtool_link_ksettings_zero_link_mode(ecmd, lp_advertising); in prestera_ethtool_get_link_ksettings()
521 ecmd->base.speed = SPEED_UNKNOWN; in prestera_ethtool_get_link_ksettings()
522 ecmd->base.duplex = DUPLEX_UNKNOWN; in prestera_ethtool_get_link_ksettings()
525 return phylink_ethtool_ksettings_get(port->phy_link, ecmd); in prestera_ethtool_get_link_ksettings()
527 ecmd->base.autoneg = port->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE; in prestera_ethtool_get_link_ksettings()
530 ethtool_link_ksettings_add_link_mode(ecmd, supported, Autoneg); in prestera_ethtool_get_link_ksettings()
535 ethtool_link_ksettings_add_link_mode(ecmd, advertising, in prestera_ethtool_get_link_ksettings()
539 prestera_modes_to_eth(ecmd->link_modes.supported, in prestera_ethtool_get_link_ksettings()
544 prestera_port_supp_types_get(ecmd, port); in prestera_ethtool_get_link_ksettings()
547 prestera_port_link_mode_get(ecmd, port); in prestera_ethtool_get_link_ksettings()
549 ecmd->base.port = prestera_port_type_get(port); in prestera_ethtool_get_link_ksettings()
553 prestera_modes_to_eth(ecmd->link_modes.advertising, in prestera_ethtool_get_link_ksettings()
560 prestera_port_remote_cap_get(ecmd, port); in prestera_ethtool_get_link_ksettings()
565 prestera_port_mdix_get(ecmd, port); in prestera_ethtool_get_link_ksettings()
570 static int prestera_port_mdix_set(const struct ethtool_link_ksettings *ecmd, in prestera_port_mdix_set() argument
573 if (ecmd->base.eth_tp_mdix_ctrl != ETH_TP_MDI_INVALID && in prestera_port_mdix_set()
576 port->cfg_phy.mdix = ecmd->base.eth_tp_mdix_ctrl; in prestera_port_mdix_set()
632 prestera_port_speed_duplex_set(const struct ethtool_link_ksettings *ecmd, in prestera_port_speed_duplex_set() argument
637 if (ecmd->base.duplex != DUPLEX_UNKNOWN) in prestera_port_speed_duplex_set()
638 duplex = ecmd->base.duplex == DUPLEX_FULL ? in prestera_port_speed_duplex_set()
641 return prestera_port_link_mode_set(port, ecmd->base.speed, duplex, in prestera_port_speed_duplex_set()
647 const struct ethtool_link_ksettings *ecmd) in prestera_ethtool_set_link_ksettings() argument
655 return phylink_ethtool_ksettings_set(port->phy_link, ecmd); in prestera_ethtool_set_link_ksettings()
657 err = prestera_port_type_set(ecmd, port); in prestera_ethtool_set_link_ksettings()
662 err = prestera_port_mdix_set(ecmd, port); in prestera_ethtool_set_link_ksettings()
667 prestera_modes_from_eth(ecmd->link_modes.advertising, &adver_modes, in prestera_ethtool_set_link_ksettings()
670 if (ecmd->base.autoneg == AUTONEG_ENABLE) in prestera_ethtool_set_link_ksettings()
673 err = prestera_port_speed_duplex_set(ecmd, port); in prestera_ethtool_set_link_ksettings()