selftest.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2005-2006 Fen Systems Ltd.
  5. * Copyright 2006-2012 Solarflare Communications Inc.
  6. */
  7. #ifndef EFX_SELFTEST_H
  8. #define EFX_SELFTEST_H
  9. #include "net_driver.h"
  10. /*
  11. * Self tests
  12. */
  13. struct efx_loopback_self_tests {
  14. int tx_sent[EFX_MAX_TXQ_PER_CHANNEL];
  15. int tx_done[EFX_MAX_TXQ_PER_CHANNEL];
  16. int rx_good;
  17. int rx_bad;
  18. };
  19. #define EFX_MAX_PHY_TESTS 20
  20. /* Efx self test results
  21. * For fields which are not counters, 1 indicates success and -1
  22. * indicates failure; 0 indicates test could not be run.
  23. */
  24. struct efx_self_tests {
  25. /* online tests */
  26. int phy_alive;
  27. int nvram;
  28. int interrupt;
  29. int eventq_dma[EFX_MAX_CHANNELS];
  30. int eventq_int[EFX_MAX_CHANNELS];
  31. /* offline tests */
  32. int memory;
  33. int registers;
  34. int phy_ext[EFX_MAX_PHY_TESTS];
  35. struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
  36. };
  37. void efx_siena_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
  38. int pkt_len);
  39. int efx_siena_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
  40. unsigned int flags);
  41. void efx_siena_selftest_async_init(struct efx_nic *efx);
  42. void efx_siena_selftest_async_start(struct efx_nic *efx);
  43. void efx_siena_selftest_async_cancel(struct efx_nic *efx);
  44. #endif /* EFX_SELFTEST_H */