selftest.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /****************************************************************************
  2. * Driver for Solarflare Solarstorm network controllers and boards
  3. * Copyright 2005-2006 Fen Systems Ltd.
  4. * Copyright 2006-2008 Solarflare Communications Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation, incorporated herein by reference.
  9. */
  10. #ifndef EFX_SELFTEST_H
  11. #define EFX_SELFTEST_H
  12. #include "net_driver.h"
  13. /*
  14. * Self tests
  15. */
  16. struct efx_loopback_self_tests {
  17. int tx_sent[EFX_MAX_TX_QUEUES];
  18. int tx_done[EFX_MAX_TX_QUEUES];
  19. int rx_good;
  20. int rx_bad;
  21. };
  22. /* Efx self test results
  23. * For fields which are not counters, 1 indicates success and -1
  24. * indicates failure.
  25. */
  26. struct efx_self_tests {
  27. int interrupt;
  28. int eventq_dma[EFX_MAX_CHANNELS];
  29. int eventq_int[EFX_MAX_CHANNELS];
  30. int eventq_poll[EFX_MAX_CHANNELS];
  31. int phy_ok;
  32. int loopback_speed;
  33. int loopback_full_duplex;
  34. struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX];
  35. };
  36. extern void efx_loopback_rx_packet(struct efx_nic *efx,
  37. const char *buf_ptr, int pkt_len);
  38. extern int efx_online_test(struct efx_nic *efx,
  39. struct efx_self_tests *tests);
  40. extern int efx_offline_test(struct efx_nic *efx,
  41. struct efx_self_tests *tests,
  42. unsigned int loopback_modes);
  43. #endif /* EFX_SELFTEST_H */