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 EF4_SELFTEST_H
0009 #define EF4_SELFTEST_H
0010 
0011 #include "net_driver.h"
0012 
0013 /*
0014  * Self tests
0015  */
0016 
0017 struct ef4_loopback_self_tests {
0018     int tx_sent[EF4_TXQ_TYPES];
0019     int tx_done[EF4_TXQ_TYPES];
0020     int rx_good;
0021     int rx_bad;
0022 };
0023 
0024 #define EF4_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 ef4_self_tests {
0031     /* online tests */
0032     int phy_alive;
0033     int nvram;
0034     int interrupt;
0035     int eventq_dma[EF4_MAX_CHANNELS];
0036     int eventq_int[EF4_MAX_CHANNELS];
0037     /* offline tests */
0038     int memory;
0039     int registers;
0040     int phy_ext[EF4_MAX_PHY_TESTS];
0041     struct ef4_loopback_self_tests loopback[LOOPBACK_TEST_MAX + 1];
0042 };
0043 
0044 void ef4_loopback_rx_packet(struct ef4_nic *efx, const char *buf_ptr,
0045                 int pkt_len);
0046 int ef4_selftest(struct ef4_nic *efx, struct ef4_self_tests *tests,
0047          unsigned flags);
0048 void ef4_selftest_async_start(struct ef4_nic *efx);
0049 void ef4_selftest_async_cancel(struct ef4_nic *efx);
0050 void ef4_selftest_async_work(struct work_struct *data);
0051 
0052 #endif /* EF4_SELFTEST_H */