ethtool_netlink.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef _LINUX_ETHTOOL_NETLINK_H_
  3. #define _LINUX_ETHTOOL_NETLINK_H_
  4. #include <uapi/linux/ethtool_netlink.h>
  5. #include <linux/ethtool.h>
  6. #include <linux/netdevice.h>
  7. #define __ETHTOOL_LINK_MODE_MASK_NWORDS \
  8. DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
  9. #define ETHTOOL_PAUSE_STAT_CNT (__ETHTOOL_A_PAUSE_STAT_CNT - \
  10. ETHTOOL_A_PAUSE_STAT_TX_FRAMES)
  11. enum ethtool_multicast_groups {
  12. ETHNL_MCGRP_MONITOR,
  13. };
  14. struct phy_device;
  15. #if IS_ENABLED(CONFIG_ETHTOOL_NETLINK)
  16. int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd);
  17. void ethnl_cable_test_free(struct phy_device *phydev);
  18. void ethnl_cable_test_finished(struct phy_device *phydev);
  19. int ethnl_cable_test_result(struct phy_device *phydev, u8 pair, u8 result);
  20. int ethnl_cable_test_fault_length(struct phy_device *phydev, u8 pair, u32 cm);
  21. int ethnl_cable_test_amplitude(struct phy_device *phydev, u8 pair, s16 mV);
  22. int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV);
  23. int ethnl_cable_test_step(struct phy_device *phydev, u32 first, u32 last,
  24. u32 step);
  25. #else
  26. static inline int ethnl_cable_test_alloc(struct phy_device *phydev, u8 cmd)
  27. {
  28. return -EOPNOTSUPP;
  29. }
  30. static inline void ethnl_cable_test_free(struct phy_device *phydev)
  31. {
  32. }
  33. static inline void ethnl_cable_test_finished(struct phy_device *phydev)
  34. {
  35. }
  36. static inline int ethnl_cable_test_result(struct phy_device *phydev, u8 pair,
  37. u8 result)
  38. {
  39. return -EOPNOTSUPP;
  40. }
  41. static inline int ethnl_cable_test_fault_length(struct phy_device *phydev,
  42. u8 pair, u32 cm)
  43. {
  44. return -EOPNOTSUPP;
  45. }
  46. static inline int ethnl_cable_test_amplitude(struct phy_device *phydev,
  47. u8 pair, s16 mV)
  48. {
  49. return -EOPNOTSUPP;
  50. }
  51. static inline int ethnl_cable_test_pulse(struct phy_device *phydev, u16 mV)
  52. {
  53. return -EOPNOTSUPP;
  54. }
  55. static inline int ethnl_cable_test_step(struct phy_device *phydev, u32 first,
  56. u32 last, u32 step)
  57. {
  58. return -EOPNOTSUPP;
  59. }
  60. #endif /* IS_ENABLED(CONFIG_ETHTOOL_NETLINK) */
  61. #endif /* _LINUX_ETHTOOL_NETLINK_H_ */