phylink.c (bf75213f2480b96f7f2d5dd10bdb463327f9a97a) | phylink.c (1953feb022154e19c5953988fd3dd65ebc769dc9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * phylink models the MAC to optional PHY connection, supporting 4 * technologies such as SFP cages where the PHY is hot-pluggable. 5 * 6 * Copyright (C) 2015 Russell King 7 */ 8#include <linux/acpi.h> --- 168 unchanged lines hidden (view full) --- 177 178 pl->link_config.speed = speed; 179 pl->link_config.duplex = DUPLEX_HALF; 180 181 if (fwnode_property_read_bool(fixed_node, "full-duplex")) 182 pl->link_config.duplex = DUPLEX_FULL; 183 184 /* We treat the "pause" and "asym-pause" terminology as | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * phylink models the MAC to optional PHY connection, supporting 4 * technologies such as SFP cages where the PHY is hot-pluggable. 5 * 6 * Copyright (C) 2015 Russell King 7 */ 8#include <linux/acpi.h> --- 168 unchanged lines hidden (view full) --- 177 178 pl->link_config.speed = speed; 179 pl->link_config.duplex = DUPLEX_HALF; 180 181 if (fwnode_property_read_bool(fixed_node, "full-duplex")) 182 pl->link_config.duplex = DUPLEX_FULL; 183 184 /* We treat the "pause" and "asym-pause" terminology as |
185 * defining the link partner's ability. */ | 185 * defining the link partner's ability. 186 */ |
186 if (fwnode_property_read_bool(fixed_node, "pause")) 187 __set_bit(ETHTOOL_LINK_MODE_Pause_BIT, 188 pl->link_config.lp_advertising); 189 if (fwnode_property_read_bool(fixed_node, "asym-pause")) 190 __set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, 191 pl->link_config.lp_advertising); 192 193 if (ret == 0) { --- 486 unchanged lines hidden (view full) --- 680 phylink_get_fixed_state(pl, &link_state); 681 mac_config = link_state.link; 682 break; 683 684 case MLO_AN_INBAND: 685 phylink_mac_pcs_get_state(pl, &link_state); 686 687 /* If we have a phy, the "up" state is the union of | 187 if (fwnode_property_read_bool(fixed_node, "pause")) 188 __set_bit(ETHTOOL_LINK_MODE_Pause_BIT, 189 pl->link_config.lp_advertising); 190 if (fwnode_property_read_bool(fixed_node, "asym-pause")) 191 __set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, 192 pl->link_config.lp_advertising); 193 194 if (ret == 0) { --- 486 unchanged lines hidden (view full) --- 681 phylink_get_fixed_state(pl, &link_state); 682 mac_config = link_state.link; 683 break; 684 685 case MLO_AN_INBAND: 686 phylink_mac_pcs_get_state(pl, &link_state); 687 688 /* If we have a phy, the "up" state is the union of |
688 * both the PHY and the MAC */ | 689 * both the PHY and the MAC 690 */ |
689 if (pl->phydev) 690 link_state.link &= pl->phy_state.link; 691 692 /* Only update if the PHY link is up */ 693 if (pl->phydev && pl->phy_state.link) { 694 link_state.interface = pl->phy_state.interface; 695 696 /* If we have a PHY, we need to update with | 691 if (pl->phydev) 692 link_state.link &= pl->phy_state.link; 693 694 /* Only update if the PHY link is up */ 695 if (pl->phydev && pl->phy_state.link) { 696 link_state.interface = pl->phy_state.interface; 697 698 /* If we have a PHY, we need to update with |
697 * the PHY flow control bits. */ | 699 * the PHY flow control bits. 700 */ |
698 link_state.pause = pl->phy_state.pause; 699 mac_config = true; 700 } 701 phylink_apply_manual_flow(pl, &link_state); 702 break; 703 } 704 } 705 --- 1905 unchanged lines hidden --- | 701 link_state.pause = pl->phy_state.pause; 702 mac_config = true; 703 } 704 phylink_apply_manual_flow(pl, &link_state); 705 break; 706 } 707 } 708 --- 1905 unchanged lines hidden --- |