Lines Matching +full:max +full:- +full:speed

1 // SPDX-License-Identifier: GPL-2.0
10 #include <linux/pcs/pcs-xpcs.h>
151 return mdiobus_read(xpcs->bus, xpcs->addr, reg_addr); in xpcs_read()
158 return mdiobus_write(xpcs->bus, xpcs->addr, reg_addr, val); in xpcs_write()
193 } while (ret & MDIO_CTRL1_RESET && --retries); in xpcs_poll_reset()
195 return (ret & MDIO_CTRL1_RESET) ? -ETIMEDOUT : 0; in xpcs_poll_reset()
211 if ((__state)->link) \
212 dev_warn(&(__xpcs)->bus->dev, ##__args); \
226 return -EFAULT; in xpcs_read_fault()
244 return -EFAULT; in xpcs_read_fault()
260 return -EFAULT; in xpcs_read_fault()
292 int max = SPEED_UNKNOWN; in xpcs_get_max_usxgmii_speed() local
295 max = SPEED_1000; in xpcs_get_max_usxgmii_speed()
297 max = SPEED_2500; in xpcs_get_max_usxgmii_speed()
299 max = SPEED_10000; in xpcs_get_max_usxgmii_speed()
301 max = SPEED_10000; in xpcs_get_max_usxgmii_speed()
303 return max; in xpcs_get_max_usxgmii_speed()
306 static int xpcs_config_usxgmii(struct mdio_xpcs_args *xpcs, int speed) in xpcs_config_usxgmii() argument
310 switch (speed) { in xpcs_config_usxgmii()
331 return -EINVAL; in xpcs_config_usxgmii()
372 if (phylink_test(xpcs->supported, 2500baseX_Full)) in xpcs_config_aneg_c73()
383 if (phylink_test(xpcs->supported, 1000baseKX_Full)) in xpcs_config_aneg_c73()
385 if (phylink_test(xpcs->supported, 10000baseKX4_Full)) in xpcs_config_aneg_c73()
387 if (phylink_test(xpcs->supported, 10000baseKR_Full)) in xpcs_config_aneg_c73()
396 if (phylink_test(xpcs->supported, Pause)) in xpcs_config_aneg_c73()
398 if (phylink_test(xpcs->supported, Asym_Pause)) in xpcs_config_aneg_c73()
457 phylink_clear(state->lp_advertising, Autoneg); in xpcs_read_lpa()
461 phylink_set(state->lp_advertising, Autoneg); in xpcs_read_lpa()
469 phylink_set(state->lp_advertising, 2500baseX_Full); in xpcs_read_lpa()
476 phylink_set(state->lp_advertising, 1000baseKX_Full); in xpcs_read_lpa()
478 phylink_set(state->lp_advertising, 10000baseKX4_Full); in xpcs_read_lpa()
480 phylink_set(state->lp_advertising, 10000baseKR_Full); in xpcs_read_lpa()
487 phylink_set(state->lp_advertising, Pause); in xpcs_read_lpa()
489 phylink_set(state->lp_advertising, Asym_Pause); in xpcs_read_lpa()
491 linkmode_and(state->lp_advertising, state->lp_advertising, in xpcs_read_lpa()
492 state->advertising); in xpcs_read_lpa()
499 int max_speed = xpcs_get_max_usxgmii_speed(state->lp_advertising); in xpcs_resolve_lpa()
501 state->pause = MLO_PAUSE_TX | MLO_PAUSE_RX; in xpcs_resolve_lpa()
502 state->speed = max_speed; in xpcs_resolve_lpa()
503 state->duplex = DUPLEX_FULL; in xpcs_resolve_lpa()
509 unsigned long *adv = state->advertising; in xpcs_get_max_xlgmii_speed()
510 int speed = SPEED_UNKNOWN; in xpcs_get_max_xlgmii_speed() local
553 if (new_speed > speed) in xpcs_get_max_xlgmii_speed()
554 speed = new_speed; in xpcs_get_max_xlgmii_speed()
557 return speed; in xpcs_get_max_xlgmii_speed()
563 state->pause = MLO_PAUSE_TX | MLO_PAUSE_RX; in xpcs_resolve_pma()
564 state->duplex = DUPLEX_FULL; in xpcs_resolve_pma()
566 switch (state->interface) { in xpcs_resolve_pma()
568 state->speed = SPEED_10000; in xpcs_resolve_pma()
571 state->speed = xpcs_get_max_xlgmii_speed(xpcs, state); in xpcs_resolve_pma()
574 state->speed = SPEED_UNKNOWN; in xpcs_resolve_pma()
583 linkmode_and(supported, supported, xpcs->supported); in xpcs_validate()
584 linkmode_and(state->advertising, state->advertising, xpcs->supported); in xpcs_validate()
593 if (state->an_enabled) { in xpcs_config()
608 state->link = xpcs_read_link(xpcs, state->an_enabled) > 0 ? 1 : 0; in xpcs_get_state()
617 state->link = 0; in xpcs_get_state()
622 if (state->an_enabled && xpcs_aneg_done(xpcs, state)) { in xpcs_get_state()
623 state->an_complete = true; in xpcs_get_state()
626 } else if (state->an_enabled) { in xpcs_get_state()
627 state->link = 0; in xpcs_get_state()
628 } else if (state->link) { in xpcs_get_state()
635 static int xpcs_link_up(struct mdio_xpcs_args *xpcs, int speed, in xpcs_link_up() argument
639 return xpcs_config_usxgmii(xpcs, speed); in xpcs_link_up()
668 for (i = 0; match->interface[i] != PHY_INTERFACE_MODE_MAX; i++) { in xpcs_check_features()
669 if (match->interface[i] == interface) in xpcs_check_features()
673 if (match->interface[i] == PHY_INTERFACE_MODE_MAX) in xpcs_check_features()
676 for (i = 0; match->supported[i] != __ETHTOOL_LINK_MODE_MASK_NBITS; i++) in xpcs_check_features()
677 set_bit(match->supported[i], xpcs->supported); in xpcs_check_features()
691 if ((xpcs_id & entry->mask) == entry->id) { in xpcs_probe()
699 return -ENODEV; in xpcs_probe()