Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
0002 /* Copyright 2019 NXP */
0003 #ifndef DPAA2_MAC_H
0004 #define DPAA2_MAC_H
0005 
0006 #include <linux/of.h>
0007 #include <linux/of_mdio.h>
0008 #include <linux/of_net.h>
0009 #include <linux/phylink.h>
0010 
0011 #include "dpmac.h"
0012 #include "dpmac-cmd.h"
0013 
0014 struct dpaa2_mac {
0015     struct fsl_mc_device *mc_dev;
0016     struct dpmac_link_state state;
0017     struct net_device *net_dev;
0018     struct fsl_mc_io *mc_io;
0019     struct dpmac_attr attr;
0020     u16 ver_major, ver_minor;
0021     unsigned long features;
0022 
0023     struct phylink_config phylink_config;
0024     struct phylink *phylink;
0025     phy_interface_t if_mode;
0026     enum dpmac_link_type if_link_type;
0027     struct phylink_pcs *pcs;
0028     struct fwnode_handle *fw_node;
0029 
0030     struct phy *serdes_phy;
0031 };
0032 
0033 bool dpaa2_mac_is_type_fixed(struct fsl_mc_device *dpmac_dev,
0034                  struct fsl_mc_io *mc_io);
0035 
0036 int dpaa2_mac_open(struct dpaa2_mac *mac);
0037 
0038 void dpaa2_mac_close(struct dpaa2_mac *mac);
0039 
0040 int dpaa2_mac_connect(struct dpaa2_mac *mac);
0041 
0042 void dpaa2_mac_disconnect(struct dpaa2_mac *mac);
0043 
0044 int dpaa2_mac_get_sset_count(void);
0045 
0046 void dpaa2_mac_get_strings(u8 *data);
0047 
0048 void dpaa2_mac_get_ethtool_stats(struct dpaa2_mac *mac, u64 *data);
0049 
0050 void dpaa2_mac_start(struct dpaa2_mac *mac);
0051 
0052 void dpaa2_mac_stop(struct dpaa2_mac *mac);
0053 
0054 #endif /* DPAA2_MAC_H */