summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-12-01 13:24:16 +0300
committerDavid S. Miller <davem@davemloft.net>2017-12-05 19:16:17 +0300
commit365c1e64ad4831f3d1806ff3d7771839ec5eeb6b (patch)
tree16d4b6f3d90513ac500ab720df3ecb25750e5bb7 /include/linux
parentb0e9fe1ba7f8305dc1c640fbeb1b8c5c609e604c (diff)
downloadlinux-365c1e64ad4831f3d1806ff3d7771839ec5eeb6b.tar.xz
phy: add phy_interface_mode_is_8023z() helper
Add and use phy_interface_mode_is_8023z() helper to identify the interface modes that use 802.3z negotiation. Use it in phylink's phylink_mac_an_restart(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 50030da01664..7570cb838410 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -762,6 +762,20 @@ static inline bool phy_interface_mode_is_rgmii(phy_interface_t mode)
};
/**
+ * phy_interface_mode_is_8023z() - does the phy interface mode use 802.3z
+ * negotiation
+ * @mode: one of &enum phy_interface_t
+ *
+ * Returns true if the phy interface mode uses the 16-bit negotiation
+ * word as defined in 802.3z. (See 802.3-2015 37.2.1 Config_Reg encoding)
+ */
+static inline bool phy_interface_mode_is_8023z(phy_interface_t mode)
+{
+ return mode == PHY_INTERFACE_MODE_1000BASEX ||
+ mode == PHY_INTERFACE_MODE_2500BASEX;
+}
+
+/**
* phy_interface_is_rgmii - Convenience function for testing if a PHY interface
* is RGMII (all variants)
* @phydev: the phy_device struct