Jose Abreu | fcb26bd | 2020-03-09 09:36:26 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates. |
| 4 | * Synopsys DesignWare XPCS helpers |
| 5 | */ |
| 6 | |
| 7 | #ifndef __LINUX_MDIO_XPCS_H |
| 8 | #define __LINUX_MDIO_XPCS_H |
| 9 | |
| 10 | #include <linux/phy.h> |
| 11 | #include <linux/phylink.h> |
| 12 | |
| 13 | struct mdio_xpcs_args { |
| 14 | __ETHTOOL_DECLARE_LINK_MODE_MASK(supported); |
| 15 | struct mii_bus *bus; |
| 16 | int addr; |
| 17 | }; |
| 18 | |
| 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); |
| 30 | }; |
| 31 | |
| 32 | #if IS_ENABLED(CONFIG_MDIO_XPCS) |
| 33 | struct mdio_xpcs_ops *mdio_xpcs_get_ops(void); |
| 34 | #else |
| 35 | static inline struct mdio_xpcs_ops *mdio_xpcs_get_ops(void) |
| 36 | { |
| 37 | return NULL; |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 | #endif /* __LINUX_MDIO_XPCS_H */ |