summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-23 23:24:17 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2020-04-16 23:03:43 +0100
commita5b81b3aa03ccce44df7a42272dbf3622bc2ca30 (patch)
tree30b879169afb33fe4bf09ae82fe7cf2de50318d9
parent1d2a5aaabf56b1b13fb0bccd9086f4fccf054c53 (diff)
net: phy: add supported_interfaces to phylib
Add a supported_interfaces member to phylib so we know which interfaces a PHY supports. Currently, set any unconverted driver to indicate all interfaces are supported. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--include/linux/phy.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 87bcd6e9c208..cda5c18bf24f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -110,6 +110,26 @@ typedef enum {
PHY_INTERFACE_MODE_MAX,
} phy_interface_t;
+/* PHY interface mode bitmap handling */
+#define DECLARE_PHY_INTERFACE_MASK(name) \
+ DECLARE_BITMAP(name, PHY_INTERFACE_MODE_MAX)
+
+static inline void phy_interface_zero(unsigned long *intf)
+{
+ bitmap_zero(intf, PHY_INTERFACE_MODE_MAX);
+}
+
+static inline bool phy_interface_empty(const unsigned long *intf)
+{
+ return bitmap_empty(intf, PHY_INTERFACE_MODE_MAX);
+}
+
+static inline void phy_interface_and(unsigned long *dst, const unsigned long *a,
+ const unsigned long *b)
+{
+ bitmap_and(dst, a, b, PHY_INTERFACE_MODE_MAX);
+}
+
/**
* phy_supported_speeds - return all speeds currently supported by a phy device
* @phy: The phy device to return supported speeds of.
@@ -444,6 +464,9 @@ struct phy_device {
/* used with phy_speed_down */
__ETHTOOL_DECLARE_LINK_MODE_MASK(adv_old);
+ /* bitmap of supported interfaces */
+ DECLARE_PHY_INTERFACE_MASK(supported_interfaces);
+
/* Energy efficient ethernet modes which should be prohibited */
u32 eee_broken_modes;