1 /****************************************************************************
2 * Driver for Solarflare network controllers and boards
3 * Copyright 2005-2006 Fen Systems Ltd.
4 * Copyright 2006-2012 Solarflare Communications Inc.
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.
11 #ifndef EFX_SELFTEST_H
12 #define EFX_SELFTEST_H
14 #include "net_driver.h"
20 struct efx_loopback_self_tests {
21 int tx_sent[EFX_TXQ_TYPES];
22 int tx_done[EFX_TXQ_TYPES];
27 #define EFX_MAX_PHY_TESTS 20
29 /* Efx self test results
30 * For fields which are not counters, 1 indicates success and -1
33 struct efx_self_tests {
38 int eventq_dma[EFX_MAX_CHANNELS];
39 int eventq_int[EFX_MAX_CHANNELS];
42 int phy_ext[EFX_MAX_PHY_TESTS];
43 struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
46 extern void efx_loopback_rx_packet(struct efx_nic *efx,
47 const char *buf_ptr, int pkt_len);
48 extern int efx_selftest(struct efx_nic *efx,
49 struct efx_self_tests *tests,
51 extern void efx_selftest_async_start(struct efx_nic *efx);
52 extern void efx_selftest_async_cancel(struct efx_nic *efx);
53 extern void efx_selftest_async_work(struct work_struct *data);
55 #endif /* EFX_SELFTEST_H */