summaryrefslogtreecommitdiff
path: root/include/linux/dpll.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-09-13 23:49:39 +0300
committerDavid S. Miller <davem@davemloft.net>2023-09-17 13:50:20 +0300
commit5f18426928800c59fb0f9bc8fb0c182bb6f5ee24 (patch)
tree686549a480eaf87f4eae934ca2a2890163bd9cf4 /include/linux/dpll.h
parent9d71b54b65b1fb6c0d3a6c5c88ba9b915c783fbc (diff)
downloadlinux-5f18426928800c59fb0f9bc8fb0c182bb6f5ee24.tar.xz
netdev: expose DPLL pin handle for netdevice
In case netdevice represents a SyncE port, the user needs to understand the connection between netdevice and associated DPLL pin. There might me multiple netdevices pointing to the same pin, in case of VF/SF implementation. Add a IFLA Netlink attribute to nest the DPLL pin handle, similar to how it is implemented for devlink port. Add a struct dpll_pin pointer to netdev and protect access to it by RTNL. Expose netdev_dpll_pin_set() and netdev_dpll_pin_clear() helpers to the drivers so they can set/clear the DPLL pin relationship to netdev. Note that during the lifetime of struct dpll_pin the pin handle does not change. Therefore it is save to access it lockless. It is drivers responsibility to call netdev_dpll_pin_clear() before dpll_pin_put(). Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/dpll.h')
-rw-r--r--include/linux/dpll.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/dpll.h b/include/linux/dpll.h
index 2202310c10cd..bbc480cd2932 100644
--- a/include/linux/dpll.h
+++ b/include/linux/dpll.h
@@ -101,6 +101,21 @@ struct dpll_pin_properties {
struct dpll_pin_frequency *freq_supported;
};
+#if IS_ENABLED(CONFIG_DPLL)
+size_t dpll_msg_pin_handle_size(struct dpll_pin *pin);
+int dpll_msg_add_pin_handle(struct sk_buff *msg, struct dpll_pin *pin);
+#else
+static inline size_t dpll_msg_pin_handle_size(struct dpll_pin *pin)
+{
+ return 0;
+}
+
+static inline int dpll_msg_add_pin_handle(struct sk_buff *msg, struct dpll_pin *pin)
+{
+ return 0;
+}
+#endif
+
struct dpll_device *
dpll_device_get(u64 clock_id, u32 dev_driver_id, struct module *module);