dpaa2-mac.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include <linux/of.h>
  6. #include <linux/of_mdio.h>
  7. #include <linux/of_net.h>
  8. #include <linux/phylink.h>
  9. #include "dpmac.h"
  10. #include "dpmac-cmd.h"
  11. struct dpaa2_mac {
  12. struct fsl_mc_device *mc_dev;
  13. struct dpmac_link_state state;
  14. struct net_device *net_dev;
  15. struct fsl_mc_io *mc_io;
  16. struct dpmac_attr attr;
  17. u16 ver_major, ver_minor;
  18. unsigned long features;
  19. struct phylink_config phylink_config;
  20. struct phylink *phylink;
  21. phy_interface_t if_mode;
  22. enum dpmac_link_type if_link_type;
  23. struct phylink_pcs *pcs;
  24. struct fwnode_handle *fw_node;
  25. struct phy *serdes_phy;
  26. };
  27. bool dpaa2_mac_is_type_fixed(struct fsl_mc_device *dpmac_dev,
  28. struct fsl_mc_io *mc_io);
  29. int dpaa2_mac_open(struct dpaa2_mac *mac);
  30. void dpaa2_mac_close(struct dpaa2_mac *mac);
  31. int dpaa2_mac_connect(struct dpaa2_mac *mac);
  32. void dpaa2_mac_disconnect(struct dpaa2_mac *mac);
  33. int dpaa2_mac_get_sset_count(void);
  34. void dpaa2_mac_get_strings(u8 *data);
  35. void dpaa2_mac_get_ethtool_stats(struct dpaa2_mac *mac, u64 *data);
  36. void dpaa2_mac_start(struct dpaa2_mac *mac);
  37. void dpaa2_mac_stop(struct dpaa2_mac *mac);
  38. #endif /* DPAA2_MAC_H */