1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
2 /* Copyright 2019 NXP */
7 #include <linux/of_mdio.h>
8 #include <linux/of_net.h>
9 #include <linux/phylink.h>
12 #include "dpmac-cmd.h"
15 struct fsl_mc_device *mc_dev;
16 struct dpmac_link_state state;
17 struct net_device *net_dev;
18 struct fsl_mc_io *mc_io;
19 struct dpmac_attr attr;
20 u16 ver_major, ver_minor;
21 unsigned long features;
23 struct phylink_config phylink_config;
24 struct phylink *phylink;
25 phy_interface_t if_mode;
26 enum dpmac_link_type if_link_type;
27 struct phylink_pcs *pcs;
28 struct fwnode_handle *fw_node;
30 struct phy *serdes_phy;
33 static inline bool dpaa2_mac_is_type_phy(struct dpaa2_mac *mac)
38 return mac->attr.link_type == DPMAC_LINK_TYPE_PHY ||
39 mac->attr.link_type == DPMAC_LINK_TYPE_BACKPLANE;
42 int dpaa2_mac_open(struct dpaa2_mac *mac);
44 void dpaa2_mac_close(struct dpaa2_mac *mac);
46 int dpaa2_mac_connect(struct dpaa2_mac *mac);
48 void dpaa2_mac_disconnect(struct dpaa2_mac *mac);
50 int dpaa2_mac_get_sset_count(void);
52 void dpaa2_mac_get_strings(u8 **data);
54 void dpaa2_mac_get_ethtool_stats(struct dpaa2_mac *mac, u64 *data);
56 void dpaa2_mac_start(struct dpaa2_mac *mac);
58 void dpaa2_mac_stop(struct dpaa2_mac *mac);
60 #endif /* DPAA2_MAC_H */