nxp-c45-tja11xx.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* NXP C45 PHY driver header file
  3. * Copyright 2023 NXP
  4. * Author: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
  5. */
  6. #include <linux/ptp_clock_kernel.h>
  7. #define VEND1_PORT_FUNC_ENABLES 0x8048
  8. struct nxp_c45_macsec;
  9. struct nxp_c45_phy {
  10. const struct nxp_c45_phy_data *phy_data;
  11. struct phy_device *phydev;
  12. struct mii_timestamper mii_ts;
  13. struct ptp_clock *ptp_clock;
  14. struct ptp_clock_info caps;
  15. struct sk_buff_head tx_queue;
  16. struct sk_buff_head rx_queue;
  17. /* used to access the PTP registers atomic */
  18. struct mutex ptp_lock;
  19. int hwts_tx;
  20. int hwts_rx;
  21. u32 tx_delay;
  22. u32 rx_delay;
  23. struct timespec64 extts_ts;
  24. int extts_index;
  25. bool extts;
  26. struct nxp_c45_macsec *macsec;
  27. };
  28. #if IS_ENABLED(CONFIG_MACSEC)
  29. int nxp_c45_macsec_config_init(struct phy_device *phydev);
  30. int nxp_c45_macsec_probe(struct phy_device *phydev);
  31. void nxp_c45_macsec_remove(struct phy_device *phydev);
  32. void nxp_c45_handle_macsec_interrupt(struct phy_device *phydev,
  33. irqreturn_t *ret);
  34. #else
  35. static inline
  36. int nxp_c45_macsec_config_init(struct phy_device *phydev)
  37. {
  38. return 0;
  39. }
  40. static inline
  41. int nxp_c45_macsec_probe(struct phy_device *phydev)
  42. {
  43. return 0;
  44. }
  45. static inline
  46. void nxp_c45_macsec_remove(struct phy_device *phydev)
  47. {
  48. }
  49. static inline
  50. void nxp_c45_handle_macsec_interrupt(struct phy_device *phydev,
  51. irqreturn_t *ret)
  52. {
  53. }
  54. #endif