History

net: phy: Add Synopsys DesignWare XPCS MDIO module

Synopsys DesignWare XPCS is an MMD that can manage link status, auto-negotiation, link training, ... In this commit we add basic support for XPCS using USXGMII interface and Clause 73 Auto-negotiation. This is highly tied with PHYLINK and can't be used without it. A given ethernet driver can use the provided callbacks to add the support for XPCS.

Jose Abreu committed 6 years ago

Commit fcb26bd1 parent 94148195 files · +667 −0Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/mdio-xpcs.h+41−0
@@ -0,0 +1,41 @@
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
13struct mdio_xpcs_args {
14 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
15 struct mii_bus *bus;
16 int addr;
17};
18
19struct 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)
33struct mdio_xpcs_ops *mdio_xpcs_get_ops(void);
34#else
35static inline struct mdio_xpcs_ops *mdio_xpcs_get_ops(void)
36{
37 return NULL;
38}
39#endif
40
41#endif /* __LINUX_MDIO_XPCS_H */