Lines Matching refs:interface

178 static unsigned int phylink_interface_signal_rate(phy_interface_t interface)
180 switch (interface) {
196 * phylink_interface_max_speed() - get the maximum speed of a phy interface
197 * @interface: phy interface mode defined by &typedef phy_interface_t
199 * Determine the maximum speed of a phy interface. This is intended to help
203 * Return: The maximum speed of @interface
205 static int phylink_interface_max_speed(phy_interface_t interface)
207 switch (interface) {
260 /* If we get here, someone forgot to add an interface mode above */
486 * @interface: phy interface mode defined by &typedef phy_interface_t
490 * Get the MAC capabilities that are supported by the @interface mode and
493 static unsigned long phylink_get_capabilities(phy_interface_t interface,
497 int max_speed = phylink_interface_max_speed(interface);
501 switch (interface) {
593 /* We can't adapt if the MAC doesn't support the interface's
609 /* The MAC must support half duplex at the interface's max
631 * aren't constant, such as if they vary depending on the interface.
642 caps = phylink_get_capabilities(state->interface, mac_capabilities,
658 /* Get the PCS for this interface mode */
660 pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
673 phylink_err(pl, "interface %s: uninitialised PCS\n",
674 phy_modes(state->interface));
696 state->interface);
708 phy_interface_t interface,
718 tmp_state.interface = interface;
721 tmp_state.rate_matching = phy_get_rate_matching(phy, interface);
724 phylink_dbg(pl, " interface %u (%s) rate match %s supports %*pbl\n",
725 interface, phy_modes(interface),
742 int interface;
744 for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX)
745 phylink_validate_one(pl, phy, supported, state, interface,
759 if (state->interface == PHY_INTERFACE_MODE_NA)
763 if (!test_bit(state->interface, interfaces))
909 switch (pl->link_config.interface) {
928 caps = phylink_get_capabilities(pl->link_config.interface, caps,
936 phy_modes(pl->link_config.interface));
981 phy_interface_t interface)
984 pcs->ops->pcs_pre_config(pcs, interface);
988 phy_interface_t interface)
993 err = pcs->ops->pcs_post_config(pcs, interface);
1021 return pcs->ops->pcs_config(pcs, neg_mode, state->interface,
1026 phy_interface_t interface, int speed,
1030 pcs->ops->pcs_link_up(pcs, neg_mode, interface, speed, duplex);
1075 phy_modes(st.interface),
1087 phy_interface_mode_is_8023z(pl->link_config.interface) &&
1095 * @interface: interface mode to be used
1101 * - %PHYLINK_PCS_NEG_NONE: interface mode does not support inband
1112 phy_interface_t interface,
1117 switch (interface) {
1167 phylink_dbg(pl, "major config %s\n", phy_modes(state->interface));
1170 state->interface,
1174 pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface);
1189 state->interface);
1212 phylink_pcs_pre_config(pl->pcs, state->interface);
1217 phylink_pcs_post_config(pl->pcs, state->interface);
1239 state->interface);
1246 rate_kbd = phylink_interface_signal_rate(state->interface);
1270 phy_modes(pl->link_config.interface),
1276 pl->link_config.interface,
1303 state->interface = pl->link_config.interface;
1355 if (link_state.interface == PHY_INTERFACE_MODE_SGMII)
1398 * the link_state) to the interface speed, and will send
1401 speed = phylink_interface_max_speed(link_state.interface);
1408 * the link_state) to the interface speed, and will cause
1411 speed = phylink_interface_max_speed(link_state.interface);
1416 pl->cur_interface = link_state.interface;
1508 /* If the interface has changed, force a
1512 if (link_state.interface !=
1513 pl->phy_state.interface) {
1517 link_state.interface = pl->phy_state.interface;
1542 if (link_state.interface != pl->link_config.interface) {
1543 /* The interface has changed, force the link down and
1551 pl->link_config.interface = link_state.interface;
1630 * interface
1682 pl->phy_state.interface = iface;
1688 pl->link_config.interface = iface;
1760 phy_interface_mode_is_8023z(pl->link_config.interface)))
1782 pl->phy_state.interface = phydev->interface;
1789 phy_modes(phydev->interface),
1844 /* Check whether we would use rate matching for the proposed interface
1847 state->rate_matching = phy_get_rate_matching(phy, state->interface);
1851 * For some interface modes (e.g. RXAUI, XAUI and USXGMII) switching
1854 * For these which switch interface modes, we really need to know which
1855 * interface modes the PHY supports to properly work out which ethtool
1857 * against all interface modes, which may lead to more ethtool link
1861 state->interface != PHY_INTERFACE_MODE_RXAUI &&
1862 state->interface != PHY_INTERFACE_MODE_XAUI &&
1863 state->interface != PHY_INTERFACE_MODE_USXGMII)
1864 state->interface = PHY_INTERFACE_MODE_NA;
1870 phy_interface_t interface)
1889 config.interface = interface;
1894 phy_modes(config.interface),
1913 pl->phy_state.interface = interface;
1928 phy_modes(interface),
1942 phy_interface_t interface)
1948 phy_interface_mode_is_8023z(interface) && !pl->sfp_bus)))
1957 return phy_attach_direct(pl->netdev, phy, flags, interface);
1979 /* Use PHY device/driver interface */
1981 pl->link_interface = phy->interface;
1982 pl->link_config.interface = pl->link_interface;
1989 ret = phylink_bringup_phy(pl, phy, pl->link_config.interface);
2054 /* Use PHY device/driver interface */
2056 pl->link_interface = phy_dev->interface;
2057 pl->link_config.interface = pl->link_interface;
2069 ret = phylink_bringup_phy(pl, phy_dev, pl->link_config.interface);
2171 phy_modes(pl->link_config.interface));
2485 * - link_config.interface will be updated by the PHY calling
2559 * also cause the associated interface to be selected such that the
2563 config.interface = sfp_select_interface(pl->sfp_bus,
2565 if (config.interface == PHY_INTERFACE_MODE_NA) {
2567 "selection of interface failed, advertisement %*pb\n",
2573 /* Revalidate with the selected interface */
2578 phy_modes(config.interface),
2599 if (pl->link_config.interface != config.interface) {
2600 /* The interface changed, e.g. 1000base-X <-> 2500base-X */
2601 /* We need to force the link down, then change the interface */
2609 pl->link_config.interface = config.interface;
2981 * phylink_mii_ioctl() - generic mii ioctl interface
3123 phy_interface_t interface;
3126 interface = PHY_INTERFACE_MODE_NA;
3129 interface = phylink_sfp_interface_preference[i];
3133 return interface;
3143 phylink_an_mode_str(mode), phy_modes(state->interface),
3157 pl->link_config.interface != state->interface) {
3159 pl->link_config.interface = state->interface;
3165 phy_modes(state->interface));
3186 config.interface = PHY_INTERFACE_MODE_NA;
3203 "selection of interface failed, advertisement %*pb\n",
3208 config.interface = iface;
3215 phy_modes(config.interface),
3233 phy_interface_t interface;
3248 phylink_err(pl, "unsupported SFP module: no common interface modes\n");
3270 interface = phylink_choose_sfp_interface(pl, interfaces);
3271 if (interface == PHY_INTERFACE_MODE_NA) {
3272 phylink_err(pl, "failed to select SFP interface\n");
3276 phylink_dbg(pl, "optical SFP: chosen %s interface\n",
3277 phy_modes(interface));
3279 config.interface = interface;
3375 phy_interface_t interface;
3402 interface = pl->link_config.interface;
3403 ret = phylink_attach_phy(pl, phy, interface);
3407 ret = phylink_bringup_phy(pl, phy, interface);
3628 switch (state->interface) {
3685 * @interface: the PHY interface mode being configured
3691 * Encode the clause 37 PCS advertisement as specified by @interface and
3696 int phylink_mii_c22_pcs_encode_advertisement(phy_interface_t interface,
3701 switch (interface) {
3725 * @interface: the PHY interface mode being configured
3730 * parameters for the @mode, @interface and @advertising parameters.
3735 phy_interface_t interface,
3743 adv = phylink_mii_c22_pcs_encode_advertisement(interface, advertising);
3806 switch (state->interface) {