1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates.
4 * Synopsys DesignWare XPCS helpers
7 #ifndef __LINUX_PCS_XPCS_H
8 #define __LINUX_PCS_XPCS_H
10 #include <linux/phy.h>
11 #include <linux/phylink.h>
13 struct mdio_xpcs_args {
14 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
19 struct mdio_xpcs_ops {
20 int (*validate)(struct mdio_xpcs_args *xpcs,
21 unsigned long *supported,
22 struct phylink_link_state *state);
23 int (*config)(struct mdio_xpcs_args *xpcs,
24 const struct phylink_link_state *state);
25 int (*get_state)(struct mdio_xpcs_args *xpcs,
26 struct phylink_link_state *state);
27 int (*link_up)(struct mdio_xpcs_args *xpcs, int speed,
28 phy_interface_t interface);
29 int (*probe)(struct mdio_xpcs_args *xpcs, phy_interface_t interface);
32 #if IS_ENABLED(CONFIG_PCS_XPCS)
33 struct mdio_xpcs_ops *mdio_xpcs_get_ops(void);
35 static inline struct mdio_xpcs_ops *mdio_xpcs_get_ops(void)
41 #endif /* __LINUX_PCS_XPCS_H */