Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /****************************************************************************
0003  * Driver for Solarflare network controllers and boards
0004  * Copyright 2005-2006 Fen Systems Ltd.
0005  * Copyright 2006-2012 Solarflare Communications Inc.
0006  */
0007 
0008 #ifndef EFX_SELFTEST_H
0009 #define EFX_SELFTEST_H
0010 
0011 #include "net_driver.h"
0012 
0013 /*
0014  * Self tests
0015  */
0016 
0017 struct efx_loopback_self_tests {
0018     int tx_sent[EFX_MAX_TXQ_PER_CHANNEL];
0019     int tx_done[EFX_MAX_TXQ_PER_CHANNEL];
0020     int rx_good;
0021     int rx_bad;
0022 };
0023 
0024 #define EFX_MAX_PHY_TESTS 20
0025 
0026 /* Efx self test results
0027  * For fields which are not counters, 1 indicates success and -1
0028  * indicates failure; 0 indicates test could not be run.
0029  */
0030 struct efx_self_tests {
0031     /* online tests */
0032     int phy_alive;
0033     int nvram;
0034     int interrupt;
0035     int eventq_dma[EFX_MAX_CHANNELS];
0036     int eventq_int[EFX_MAX_CHANNELS];
0037     /* offline tests */
0038     int memory;
0039     int registers;
0040     int phy_ext[EFX_MAX_PHY_TESTS];
0041     struct efx_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
0042 };
0043 
0044 void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
0045                 int pkt_len);
0046 int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
0047          unsigned flags);
0048 void efx_selftest_async_init(struct efx_nic *efx);
0049 void efx_selftest_async_start(struct efx_nic *efx);
0050 void efx_selftest_async_cancel(struct efx_nic *efx);
0051 
0052 #endif /* EFX_SELFTEST_H */