1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Stubs for the Network PHY library
6 #include <linux/rtnetlink.h>
8 struct kernel_hwtstamp_config;
9 struct netlink_ext_ack;
12 #if IS_ENABLED(CONFIG_PHYLIB)
14 extern const struct phylib_stubs *phylib_stubs;
17 int (*hwtstamp_get)(struct phy_device *phydev,
18 struct kernel_hwtstamp_config *config);
19 int (*hwtstamp_set)(struct phy_device *phydev,
20 struct kernel_hwtstamp_config *config,
21 struct netlink_ext_ack *extack);
24 static inline int phy_hwtstamp_get(struct phy_device *phydev,
25 struct kernel_hwtstamp_config *config)
27 /* phylib_register_stubs() and phylib_unregister_stubs()
28 * also run under rtnl_lock().
35 return phylib_stubs->hwtstamp_get(phydev, config);
38 static inline int phy_hwtstamp_set(struct phy_device *phydev,
39 struct kernel_hwtstamp_config *config,
40 struct netlink_ext_ack *extack)
42 /* phylib_register_stubs() and phylib_unregister_stubs()
43 * also run under rtnl_lock().
50 return phylib_stubs->hwtstamp_set(phydev, config, extack);
55 static inline int phy_hwtstamp_get(struct phy_device *phydev,
56 struct kernel_hwtstamp_config *config)
61 static inline int phy_hwtstamp_set(struct phy_device *phydev,
62 struct kernel_hwtstamp_config *config,
63 struct netlink_ext_ack *extack)