summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-23 23:24:17 +0000
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2021-06-07 11:26:50 +0100
commite683a056030e8a6ae40e2e8956ec5ab390b78c98 (patch)
tree3c0ac545f12893f2affb8f69a3887ea6b5731e31
parentb9c67fea389a3b27534ce03a820f43ccd04184c8 (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.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 19bdcf8bdce3..2db2fa58e93a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -151,6 +151,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
*/
@@ -614,6 +634,7 @@ struct phy_device {
/* supported PHY interface types */
DECLARE_PHY_INTERFACE_MASK(host_interfaces);
+ DECLARE_PHY_INTERFACE_MASK(supported_interfaces);
/* Energy efficient ethernet modes which should be prohibited */
u32 eee_broken_modes;