1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
2 /* Copyright 2019 NXP */
3 #ifndef DPAA2_MAC_H
4 #define DPAA2_MAC_H
5 
6 #include <linux/of.h>
7 #include <linux/of_mdio.h>
8 #include <linux/of_net.h>
9 #include <linux/phylink.h>
10 #include <linux/pcs-lynx.h>
11 
12 #include "dpmac.h"
13 #include "dpmac-cmd.h"
14 
15 struct dpaa2_mac {
16 	struct fsl_mc_device *mc_dev;
17 	struct dpmac_link_state state;
18 	struct net_device *net_dev;
19 	struct fsl_mc_io *mc_io;
20 	struct dpmac_attr attr;
21 
22 	struct phylink_config phylink_config;
23 	struct phylink *phylink;
24 	phy_interface_t if_mode;
25 	enum dpmac_link_type if_link_type;
26 	struct lynx_pcs *pcs;
27 	struct fwnode_handle *fw_node;
28 };
29 
30 bool dpaa2_mac_is_type_fixed(struct fsl_mc_device *dpmac_dev,
31 			     struct fsl_mc_io *mc_io);
32 
33 int dpaa2_mac_open(struct dpaa2_mac *mac);
34 
35 void dpaa2_mac_close(struct dpaa2_mac *mac);
36 
37 int dpaa2_mac_connect(struct dpaa2_mac *mac);
38 
39 void dpaa2_mac_disconnect(struct dpaa2_mac *mac);
40 
41 int dpaa2_mac_get_sset_count(void);
42 
43 void dpaa2_mac_get_strings(u8 *data);
44 
45 void dpaa2_mac_get_ethtool_stats(struct dpaa2_mac *mac, u64 *data);
46 
47 #endif /* DPAA2_MAC_H */
48