summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/phy.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 852743f07e3e..2e9b897d8872 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
*/